return System.getProperty( "basedir" );
}
+ @Test
+ public void readArtifactContentEntriesRootPathNull()
+ throws Exception
+ {
+
+ File file = new File( getBasedir(),
+ "src/test/repo-with-osgi/commons-logging/commons-logging/1.1/commons-logging-1.1.jar" );
+
+ List<ArtifactContentEntry> artifactContentEntries = browseService.readFileEntries( file, null );
+
+ log.info( "artifactContentEntries: {}", artifactContentEntries );
+
+ assertThat( artifactContentEntries ).isNotNull().isNotEmpty().hasSize( 2 ).contains(
+ new ArtifactContentEntry( "org", false, 0, true ), new ArtifactContentEntry( "META-INF", false, 0, true ) );
+
+ }
+
+ @Test
+ public void readArtifactContentEntriesRootPathEmpty()
+ throws Exception
+ {
+
+ File file = new File( getBasedir(),
+ "src/test/repo-with-osgi/commons-logging/commons-logging/1.1/commons-logging-1.1.jar" );
+
+ List<ArtifactContentEntry> artifactContentEntries = browseService.readFileEntries( file, "" );
+
+ log.info( "artifactContentEntries: {}", artifactContentEntries );
+
+ assertThat( artifactContentEntries ).isNotNull().isNotEmpty().hasSize( 2 ).contains(
+ new ArtifactContentEntry( "org", false, 0, true ), new ArtifactContentEntry( "META-INF", false, 0, true ) );
+
+ }
+
+ @Test
+ public void readArtifactContentEntriesRootSlash()
+ throws Exception
+ {
+
+ File file = new File( getBasedir(),
+ "src/test/repo-with-osgi/commons-logging/commons-logging/1.1/commons-logging-1.1.jar" );
+
+ List<ArtifactContentEntry> artifactContentEntries = browseService.readFileEntries( file, "/" );
+
+ log.info( "artifactContentEntries: {}", artifactContentEntries );
+
+ assertThat( artifactContentEntries ).isNotNull().isNotEmpty().hasSize( 2 ).contains(
+ new ArtifactContentEntry( "org", false, 0, true ), new ArtifactContentEntry( "META-INF", false, 0, true ) );
+
+ }
+
@Test
public void readArtifactContentEntriesSecondDepthOnlyOneDirectory()
throws Exception
log.info( "artifactContentEntries: {}", artifactContentEntries );
assertThat( artifactContentEntries ).isNotNull().isNotEmpty().hasSize( 1 ).contains(
- new ArtifactContentEntry( "org/apache", false, 1 ) );
+ new ArtifactContentEntry( "org/apache", false, 1, true ) );
}
log.info( "artifactContentEntries: {}", artifactContentEntries );
assertThat( artifactContentEntries ).isNotNull().isNotEmpty().hasSize( 16 ).contains(
- new ArtifactContentEntry( "org/apache/commons/logging/impl/AvalonLogger.class", true, 5 ) );
+ new ArtifactContentEntry( "org/apache/commons/logging/impl/AvalonLogger.class", true, 5, true ) );
}
log.info( "artifactContentEntries: {}", artifactContentEntries );
assertThat( artifactContentEntries ).isNotNull().isNotEmpty().hasSize( 10 ).contains(
- new ArtifactContentEntry( "org/apache/commons/logging/impl", false, 4 ),
- new ArtifactContentEntry( "org/apache/commons/logging/LogSource.class", true, 4 ) );
+ new ArtifactContentEntry( "org/apache/commons/logging/impl", false, 4, true ),
+ new ArtifactContentEntry( "org/apache/commons/logging/LogSource.class", true, 4, true ) );
}
log.info( "artifactContentEntries: {}", artifactContentEntries );
assertThat( artifactContentEntries ).isNotNull().isNotEmpty().hasSize( 2 ).contains(
- new ArtifactContentEntry( "org", false, 0 ), new ArtifactContentEntry( "META-INF", false, 0 ) );
+ new ArtifactContentEntry( "org", false, 0,true ), new ArtifactContentEntry( "META-INF", false, 0, true ) );
deleteTestRepo( testRepoId );
}
log.info( "artifactContentEntries: {}", artifactContentEntries );
assertThat( artifactContentEntries ).isNotNull().isNotEmpty().hasSize( 1 ).contains(
- new ArtifactContentEntry( "org/apache", false, 1 ) );
+ new ArtifactContentEntry( "org/apache", false, 1, true ) );
deleteTestRepo( testRepoId );
}
log.info( "artifactContentEntries: {}", artifactContentEntries );
assertThat( artifactContentEntries ).isNotNull().isNotEmpty().hasSize( 10 ).contains(
- new ArtifactContentEntry( "org/apache/commons/logging/impl", false, 4 ),
- new ArtifactContentEntry( "org/apache/commons/logging/LogSource.class", true, 4 ) );
+ new ArtifactContentEntry( "org/apache/commons/logging/impl", false, 4, true ),
+ new ArtifactContentEntry( "org/apache/commons/logging/LogSource.class", true, 4, true ) );
deleteTestRepo( testRepoId );
}