use of org.apache.archiva.configuration.model.FileType in project archiva by apache.
the class MavenRepositoryRequestInfoTest method setUp.
@Before
public void setUp() throws Exception {
Path repoDir = getRepositoryPath("default-repository");
MavenManagedRepository repository = createRepository("testRepo", "Unit Test Repo", repoDir);
FileType fileType = archivaConfiguration.getConfiguration().getRepositoryScanning().getFileTypes().get(0);
fileType.addPattern("**/*.xml");
assertEquals(FileTypes.ARTIFACTS, fileType.getId());
fileTypes.afterConfigurationChange(null, "fileType", null);
ManagedDefaultRepositoryContent repoContent = new ManagedDefaultRepositoryContent(repository, fileTypes, fileLockManager);
// repoContent = (ManagedRepositoryContent) lookup( ManagedRepositoryContent.class, "default" );
repository.setContent(repoContent);
repoContent.setMavenContentHelper(mavenContentHelper);
repoContent.setArtifactMappingProviders(artifactMappingProviders);
repoContent.setPathTranslator(pathTranslator);
repoRequest = new MavenRepositoryRequestInfo(repository);
}
use of org.apache.archiva.configuration.model.FileType in project archiva by apache.
the class ManagedDefaultRepositoryContentTest method setUp.
@Before
public void setUp() throws Exception {
Path repoDir = getRepositoryPath("default-repository");
MavenManagedRepository repository = createRepository("testRepo", "Unit Test Repo", repoDir);
FileType fileType = archivaConfiguration.getConfiguration().getRepositoryScanning().getFileTypes().get(0);
fileType.addPattern("**/*.xml");
assertEquals(FileTypes.ARTIFACTS, fileType.getId());
fileTypes.afterConfigurationChange(null, "fileType", null);
repoContent = new ManagedDefaultRepositoryContent(repository, fileTypes, fileLockManager);
repoContent.setMavenContentHelper(contentHelper);
repoContent.setMetadataReader(metadataReader);
repoContent.setPathTranslator(pathTranslator);
repoContent.setArtifactMappingProviders(artifactMappingProviders);
// repoContent = (ManagedRepositoryContent) lookup( ManagedRepositoryContent.class, "default" );
}
use of org.apache.archiva.configuration.model.FileType in project archiva by apache.
the class ManagedDefaultRepositoryContentTest method setupRepoCopy.
private Path setupRepoCopy(String source, String target) throws IOException {
Path defaultRepo = getRepositoryPath(source);
Path newRepo = defaultRepo.getParent().resolve(target);
FileUtils.copyDirectory(defaultRepo.toFile(), newRepo.toFile());
MavenManagedRepository repository = createRepository("testRepo", "Unit Test Repo", newRepo);
FileType fileType = archivaConfiguration.getConfiguration().getRepositoryScanning().getFileTypes().get(0);
fileType.addPattern("**/*.xml");
assertEquals(FileTypes.ARTIFACTS, fileType.getId());
fileTypes.afterConfigurationChange(null, "fileType", null);
repoContent = new ManagedDefaultRepositoryContent(repository, fileTypes, fileLockManager);
return newRepo;
}
Aggregations