Search in sources :

Example 1 with ArchivaRepositoryRegistry

use of org.apache.archiva.repository.base.ArchivaRepositoryRegistry in project archiva by apache.

the class SimpleArtifactConsumerTest method setUpMockRepository.

private void setUpMockRepository() throws IOException, RepositoryException {
    ((ArchivaRepositoryRegistry) repositoryRegistry).setIgnoreIndexing(true);
    Path repoDir = Paths.get("target/test-consumer-repo");
    Files.createDirectories(repoDir);
    repoDir.toFile().deleteOnExit();
    testRepository = BasicManagedRepository.newFilesystemInstance("test-consumer-repository", "Test-Consumer-Repository", Paths.get("target/repositories"));
    testRepository.setLocation(repoDir.toAbsolutePath().toUri());
    repositoryRegistry.putRepository(testRepository);
// when( repositoryRegistry.getManagedRepository( testRepository.getId() ) ).thenReturn( testRepository );
}
Also used : Path(java.nio.file.Path) ArchivaRepositoryRegistry(org.apache.archiva.repository.base.ArchivaRepositoryRegistry)

Aggregations

Path (java.nio.file.Path)1 ArchivaRepositoryRegistry (org.apache.archiva.repository.base.ArchivaRepositoryRegistry)1