use of org.apache.archiva.repository.content.ItemSelector in project archiva by apache.
the class AbstractBaseRepositoryContentLayoutTest method testGetArtifactOnEmptyPath.
@Test
public void testGetArtifactOnEmptyPath() throws LayoutException {
ItemSelector selector = ArchivaItemSelector.builder().build();
try {
getManaged().getLayout(BaseRepositoryContentLayout.class).getArtifact(selector);
fail("getArtifact(ItemSelector) with empty selector should throw IllegalArgumentException");
} catch (IllegalArgumentException e) {
// Good
}
}
use of org.apache.archiva.repository.content.ItemSelector in project archiva by apache.
the class ManagedDefaultRepositoryContentTest method testArtifactListWithArtifactSelectorWithClassifier.
@Test
public void testArtifactListWithArtifactSelectorWithClassifier() {
ItemSelector selector = ArchivaItemSelector.builder().withNamespace("org.apache.maven").withProjectId("test").withVersion("1.0-SNAPSHOT").withArtifactId("test").withClassifier("javadoc").withArtifactVersion("1.0-20050611.112233-1").build();
List<? extends Artifact> results = repoContent.getArtifacts(selector);
assertNotNull(results);
assertEquals(1, results.size());
Artifact artifact = results.stream().filter(a -> a.getFileName().equalsIgnoreCase("test-1.0-20050611.112233-1-javadoc.jar")).findFirst().get();
assertNotNull(artifact);
assertEquals("javadoc", artifact.getClassifier());
assertEquals("javadoc", artifact.getType());
}
use of org.apache.archiva.repository.content.ItemSelector in project archiva by apache.
the class ManagedDefaultRepositoryContentTest method testArtifactStreamWithProjectSelector.
@Test
public void testArtifactStreamWithProjectSelector() {
ItemSelector selector = ArchivaItemSelector.builder().withNamespace("org.apache.maven.shared").withProjectId("maven-downloader").build();
Stream<? extends Artifact> results = repoContent.newArtifactStream(selector);
checkArtifactListWithProjectSelector(results.collect(Collectors.toList()));
}
use of org.apache.archiva.repository.content.ItemSelector in project archiva by apache.
the class ManagedDefaultRepositoryContentTest method testHasContent.
@Test
public void testHasContent() throws LayoutException {
ItemSelector selector = ArchivaItemSelector.builder().withNamespace("org.apache.maven.shared").withProjectId("maven-downloader").withVersion("1.1").withArtifactId("maven-downloader").withExtension("jar").build();
assertTrue(repoContent.hasContent(selector));
selector = ArchivaItemSelector.builder().withNamespace("org.apache.maven.shared").withProjectId("maven-downloader").withVersion("1.1").withArtifactId("maven-downloader").withExtension("zip").build();
assertFalse(repoContent.hasContent(selector));
}
use of org.apache.archiva.repository.content.ItemSelector in project archiva by apache.
the class ManagedDefaultRepositoryContentTest method testGetArtifactListWithVersionSelector.
@Test
public void testGetArtifactListWithVersionSelector() {
ItemSelector selector = ArchivaItemSelector.builder().withNamespace("javax.sql").withProjectId("jdbc").withVersion("2.0").build();
List<? extends Artifact> results = repoContent.getArtifacts(selector);
checkArtifactListWithVersionSelector1(results);
}
Aggregations