Search in sources :

Example 11 with ArtifactContentEntry

use of org.apache.archiva.rest.api.model.ArtifactContentEntry in project archiva by apache.

the class ArtifactContentEntriesTests method readArtifactContentEntriesDirectoryAndFiles.

@Test
public void readArtifactContentEntriesDirectoryAndFiles() throws Exception {
    Path file = Paths.get(getBasedir(), "src/test/repo-with-osgi/commons-logging/commons-logging/1.1/commons-logging-1.1.jar");
    List<ArtifactContentEntry> artifactContentEntries = browseService.readFileEntries(file, "org/apache/commons/logging/", "foo");
    log.info("artifactContentEntries: {}", artifactContentEntries);
    assertThat(artifactContentEntries).isNotNull().isNotEmpty().hasSize(10).contains(new ArtifactContentEntry("org/apache/commons/logging/impl", false, 4, "foo"), new ArtifactContentEntry("org/apache/commons/logging/LogSource.class", true, 4, "foo"));
}
Also used : Path(java.nio.file.Path) ArtifactContentEntry(org.apache.archiva.rest.api.model.ArtifactContentEntry) Test(org.junit.Test)

Aggregations

ArtifactContentEntry (org.apache.archiva.rest.api.model.ArtifactContentEntry)11 Test (org.junit.Test)9 Path (java.nio.file.Path)6 BrowseService (org.apache.archiva.rest.api.services.BrowseService)3 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 Map (java.util.Map)2 List (java.util.List)1 JarEntry (java.util.jar.JarEntry)1 JarFile (java.util.jar.JarFile)1 VersionsList (org.apache.archiva.rest.api.model.VersionsList)1