use of org.apache.archiva.configuration.FileType in project archiva by apache.
the class RepositoryPurgeConsumerTest method cleanupFileTypes.
private void cleanupFileTypes() {
ArchivaConfiguration archivaConfiguration = applicationContext.getBean("archivaConfiguration#default", ArchivaConfiguration.class);
FileType fileType = archivaConfiguration.getConfiguration().getRepositoryScanning().getFileTypes().get(0);
fileType.removePattern("**/*.xml");
}
use of org.apache.archiva.configuration.FileType in project archiva by apache.
the class FiletypeToMapClosure method execute.
@Override
public void execute(Object input) {
if (input instanceof FileType) {
FileType filetype = (FileType) input;
map.put(filetype.getId(), filetype);
}
}
use of org.apache.archiva.configuration.FileType in project archiva by apache.
the class AbstractArtifactConsumerTest method setUp.
@Before
public void setUp() throws Exception {
FileType fileType = (FileType) archivaConfiguration.getConfiguration().getRepositoryScanning().getFileTypes().get(0);
assertEquals(FileTypes.ARTIFACTS, fileType.getId());
fileType.addPattern("**/*.xml");
repoLocation = Paths.get("target/test-" + getName() + "/test-repo");
}
use of org.apache.archiva.configuration.FileType in project archiva by apache.
the class RepositoryPurgeConsumerTest method assertNotConsumed.
@SuppressWarnings("deprecation")
private void assertNotConsumed(String path) throws Exception {
ArchivaConfiguration archivaConfiguration = applicationContext.getBean("archivaConfiguration#default", ArchivaConfiguration.class);
FileType fileType = archivaConfiguration.getConfiguration().getRepositoryScanning().getFileTypes().get(0);
assertEquals(FileTypes.ARTIFACTS, fileType.getId());
fileType.addPattern("**/*.xml");
// FileTypes fileTypes = applicationContext.getBean( FileTypes.class );
for (FileTypes fileTypes : applicationContext.getBeansOfType(FileTypes.class).values()) {
fileTypes.afterConfigurationChange(null, "repositoryScanning.fileTypes", null);
}
KnownRepositoryContentConsumer repoPurgeConsumer = applicationContext.getBean("knownRepositoryContentConsumer#repository-purge", KnownRepositoryContentConsumer.class);
Path repoLocation = Paths.get("target/test-" + getName() + "/test-repo");
Path localFile = repoLocation.resolve(path);
ConsumerWantsFilePredicate predicate = new ConsumerWantsFilePredicate();
BaseFile baseFile = new BaseFile(repoLocation.toFile(), localFile.toFile());
predicate.setBasefile(baseFile);
assertFalse(predicate.evaluate(repoPurgeConsumer));
}
use of org.apache.archiva.configuration.FileType in project archiva by apache.
the class ManagedDefaultRepositoryContentTest method setUp.
@Before
public void setUp() throws Exception {
Path repoDir = Paths.get("src/test/repositories/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(artifactMappingProviders, fileTypes);
// repoContent = (ManagedRepositoryContent) lookup( ManagedRepositoryContent.class, "default" );
repoContent.setRepository(repository);
}
Aggregations