use of org.apache.archiva.common.filelock.DefaultFileLockManager in project archiva by apache.
the class NewVersionsOfArtifactRssFeedProcessorTest method setUp.
@Before
@Override
public void setUp() throws Exception {
super.setUp();
newVersionsProcessor = new NewVersionsOfArtifactRssFeedProcessor();
newVersionsProcessor.setGenerator(new RssFeedGenerator());
metadataRepository = mock(MetadataRepository.class);
sessionFactory = mock(RepositorySessionFactory.class);
session = mock(RepositorySession.class);
when(sessionFactory.createSession()).thenReturn(session);
when(session.getRepository()).thenReturn(metadataRepository);
repositoryRegistry = mock(ArchivaRepositoryRegistry.class);
List<Repository> reg = new ArrayList<>();
reg.add(new BasicManagedRepository(TEST_REPO, TEST_REPO, new FilesystemStorage(Paths.get("target/test-storage"), new DefaultFileLockManager())));
when(repositoryRegistry.getRepositories()).thenReturn(reg);
newVersionsProcessor.setRepositorySessionFactory(sessionFactory);
newVersionsProcessor.setRepositoryRegistry(repositoryRegistry);
}
use of org.apache.archiva.common.filelock.DefaultFileLockManager in project archiva by apache.
the class ArtifactBuilderTest method getFile.
StorageAsset getFile(String path) throws IOException {
Path filePath = Paths.get(path);
FilesystemStorage filesystemStorage = new FilesystemStorage(filePath.getParent(), new DefaultFileLockManager());
return new FilesystemAsset(filesystemStorage, filePath.getFileName().toString(), filePath);
}
Aggregations