Search in sources :

Example 6 with DataItem

use of org.apache.archiva.repository.content.DataItem in project archiva by apache.

the class ManagedDefaultRepositoryContentTest method testNewItemStreamWithNamespace2.

@Test
public void testNewItemStreamWithNamespace2() {
    ItemSelector selector = ArchivaItemSelector.builder().withNamespace("org.apache.maven").recurse().build();
    Stream<? extends ContentItem> stream = repoContent.newItemStream(selector, false);
    List<? extends ContentItem> result = stream.collect(Collectors.toList());
    assertEquals(170, result.size());
    assertEquals(92, result.stream().filter(a -> a instanceof DataItem).count());
}
Also used : ArchivaItemSelector(org.apache.archiva.repository.content.base.ArchivaItemSelector) ItemSelector(org.apache.archiva.repository.content.ItemSelector) DataItem(org.apache.archiva.repository.content.DataItem) Test(org.junit.Test)

Example 7 with DataItem

use of org.apache.archiva.repository.content.DataItem in project archiva by apache.

the class ManagedDefaultRepositoryContentTest method getExistingMetadataItem.

@Test
public void getExistingMetadataItem() {
    // org/apache/maven/some-ejb/1.0
    ArchivaItemSelector versionSelector = ArchivaItemSelector.builder().withNamespace("org.apache.maven").withProjectId("some-ejb").withVersion("1.0").build();
    Version version = repoContent.getVersion(versionSelector);
    DataItem metaData = repoContent.getMetadataItem(version);
    assertTrue(metaData.exists());
    assertEquals("/org/apache/maven/some-ejb/1.0/maven-metadata.xml", metaData.getAsset().getPath());
}
Also used : ArchivaItemSelector(org.apache.archiva.repository.content.base.ArchivaItemSelector) Version(org.apache.archiva.repository.content.Version) DataItem(org.apache.archiva.repository.content.DataItem) Test(org.junit.Test)

Aggregations

DataItem (org.apache.archiva.repository.content.DataItem)7 Test (org.junit.Test)5 ContentItem (org.apache.archiva.repository.content.ContentItem)4 Version (org.apache.archiva.repository.content.Version)3 ArchivaContentItem (org.apache.archiva.repository.content.base.ArchivaContentItem)3 ArchivaItemSelector (org.apache.archiva.repository.content.base.ArchivaItemSelector)3 StorageAsset (org.apache.archiva.repository.storage.StorageAsset)3 Path (java.nio.file.Path)1 SnapshotVersion (org.apache.archiva.model.SnapshotVersion)1 Artifact (org.apache.archiva.repository.content.Artifact)1 BaseRepositoryContentLayout (org.apache.archiva.repository.content.BaseRepositoryContentLayout)1 ItemSelector (org.apache.archiva.repository.content.ItemSelector)1 LayoutException (org.apache.archiva.repository.content.LayoutException)1