Search in sources :

Example 1 with ArchivaContentItem

use of org.apache.archiva.repository.content.base.ArchivaContentItem in project archiva by apache.

the class ManagedDefaultRepositoryContentTest method testToItemFromPath.

@Test
public void testToItemFromPath() throws LayoutException {
    String path = "/org/apache/maven/shared";
    ContentItem item = repoContent.toItem(path);
    assertNotNull(item);
    assertTrue(item instanceof ArchivaContentItem);
    path = "/org/apache/maven/shared/maven-downloader";
    item = repoContent.toItem(path);
    assertNotNull(item);
    assertTrue(item instanceof ArchivaContentItem);
    path = "/org/apache/maven/shared/maven-downloader/1.1";
    item = repoContent.toItem(path);
    assertNotNull(item);
    assertTrue(item instanceof ArchivaContentItem);
    path = "/org/apache/maven/shared/maven-downloader/1.1/maven-downloader-1.1.jar";
    item = repoContent.toItem(path);
    assertNotNull(item);
    assertTrue(item instanceof DataItem);
}
Also used : ArchivaContentItem(org.apache.archiva.repository.content.base.ArchivaContentItem) DataItem(org.apache.archiva.repository.content.DataItem) ContentItem(org.apache.archiva.repository.content.ContentItem) ArchivaContentItem(org.apache.archiva.repository.content.base.ArchivaContentItem) Test(org.junit.Test)

Example 2 with ArchivaContentItem

use of org.apache.archiva.repository.content.base.ArchivaContentItem in project archiva by apache.

the class ManagedDefaultRepositoryContentTest method testToItemFromAssetPath.

@Test
public void testToItemFromAssetPath() throws LayoutException {
    StorageAsset path = repoContent.getRepository().getAsset("/org/apache/maven/shared");
    ContentItem item = repoContent.toItem(path);
    assertNotNull(item);
    assertTrue(item instanceof ArchivaContentItem);
    path = repoContent.getRepository().getAsset("/org/apache/maven/shared/maven-downloader");
    item = repoContent.toItem(path);
    assertNotNull(item);
    assertTrue(item instanceof ArchivaContentItem);
    path = repoContent.getRepository().getAsset("/org/apache/maven/shared/maven-downloader/1.1");
    item = repoContent.toItem(path);
    assertNotNull(item);
    assertTrue(item instanceof ArchivaContentItem);
    path = repoContent.getRepository().getAsset("/org/apache/maven/shared/maven-downloader/1.1/maven-downloader-1.1.jar");
    item = repoContent.toItem(path);
    assertNotNull(item);
    assertTrue(item instanceof DataItem);
}
Also used : ArchivaContentItem(org.apache.archiva.repository.content.base.ArchivaContentItem) DataItem(org.apache.archiva.repository.content.DataItem) StorageAsset(org.apache.archiva.repository.storage.StorageAsset) ContentItem(org.apache.archiva.repository.content.ContentItem) ArchivaContentItem(org.apache.archiva.repository.content.base.ArchivaContentItem) Test(org.junit.Test)

Aggregations

ContentItem (org.apache.archiva.repository.content.ContentItem)2 DataItem (org.apache.archiva.repository.content.DataItem)2 ArchivaContentItem (org.apache.archiva.repository.content.base.ArchivaContentItem)2 Test (org.junit.Test)2 StorageAsset (org.apache.archiva.repository.storage.StorageAsset)1