use of org.apache.archiva.common.filelock.DefaultFileLockManager in project archiva by apache.
the class ArtifactContentEntriesTests method readArtifactContentEntriesRootPathNull.
@Test
public void readArtifactContentEntriesRootPathNull() throws Exception {
FilesystemStorage filesystemStorage = new FilesystemStorage(Paths.get(getBasedir()), new DefaultFileLockManager());
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(new FilesystemAsset(filesystemStorage, file.toString(), file), null, "foo");
log.info("artifactContentEntries: {}", artifactContentEntries);
assertThat(artifactContentEntries).isNotNull().isNotEmpty().hasSize(2).contains(new ArtifactContentEntry("org", false, 0, "foo"), new ArtifactContentEntry("META-INF", false, 0, "foo"));
}
use of org.apache.archiva.common.filelock.DefaultFileLockManager in project archiva by apache.
the class ArtifactContentEntriesTests method readArtifactContentEntriesSecondDepthOnlyOneDirectory.
@Test
public void readArtifactContentEntriesSecondDepthOnlyOneDirectory() throws Exception {
FilesystemStorage filesystemStorage = new FilesystemStorage(Paths.get(getBasedir()), new DefaultFileLockManager());
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(new FilesystemAsset(filesystemStorage, file.toString(), file), "org", "foo");
log.info("artifactContentEntries: {}", artifactContentEntries);
assertThat(artifactContentEntries).isNotNull().isNotEmpty().hasSize(1).contains(new ArtifactContentEntry("org/apache", false, 1, "foo"));
}
use of org.apache.archiva.common.filelock.DefaultFileLockManager in project archiva by apache.
the class ArtifactContentEntriesTests method readArtifactContentEntriesDirectoryAndFiles.
@Test
public void readArtifactContentEntriesDirectoryAndFiles() throws Exception {
FilesystemStorage filesystemStorage = new FilesystemStorage(Paths.get(getBasedir()), new DefaultFileLockManager());
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(new FilesystemAsset(filesystemStorage, file.toString(), 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"));
}
use of org.apache.archiva.common.filelock.DefaultFileLockManager in project archiva by apache.
the class ArtifactContentEntriesTests method readArtifactContentEntriesOnlyFiles.
@Test
public void readArtifactContentEntriesOnlyFiles() throws Exception {
FilesystemStorage filesystemStorage = new FilesystemStorage(Paths.get(getBasedir()), new DefaultFileLockManager());
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(new FilesystemAsset(filesystemStorage, file.toString(), file), "org/apache/commons/logging/impl/", "foo");
log.info("artifactContentEntries: {}", artifactContentEntries);
assertThat(artifactContentEntries).isNotNull().isNotEmpty().hasSize(16).contains(new ArtifactContentEntry("org/apache/commons/logging/impl/AvalonLogger.class", true, 5, "foo"));
}
use of org.apache.archiva.common.filelock.DefaultFileLockManager in project archiva by apache.
the class ArtifactContentEntriesTests method readArtifactContentEntriesRootPathEmpty.
@Test
public void readArtifactContentEntriesRootPathEmpty() throws Exception {
FilesystemStorage filesystemStorage = new FilesystemStorage(Paths.get(getBasedir()), new DefaultFileLockManager());
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(new FilesystemAsset(filesystemStorage, file.toString(), file), "", "foo");
log.info("artifactContentEntries: {}", artifactContentEntries);
assertThat(artifactContentEntries).isNotNull().isNotEmpty().hasSize(2).contains(new ArtifactContentEntry("org", false, 0, "foo"), new ArtifactContentEntry("META-INF", false, 0, "foo"));
}
Aggregations