@Test
- public void testArtifactListWithProjectSelector1() {
+ public void testArtifactListWithProjectSelector() {
ItemSelector selector = ArchivaItemSelector.builder( )
.withNamespace( "org.apache.maven.shared" )
.withProjectId( "maven-downloader" )
.build( );
List<? extends Artifact> results = repoContent.getArtifacts( selector );
- checkArtifactListWithProjectSelector1( results );
+ checkArtifactListWithProjectSelector( results );
}
@Test
- public void testArtifactStreamWithProjectSelector1() {
+ public void testArtifactStreamWithProjectSelector() {
ItemSelector selector = ArchivaItemSelector.builder( )
.withNamespace( "org.apache.maven.shared" )
.withProjectId( "maven-downloader" )
.build( );
Stream<? extends Artifact> results = repoContent.newArtifactStream( selector );
- checkArtifactListWithProjectSelector1( results.collect( Collectors.toList()) );
+ checkArtifactListWithProjectSelector( results.collect( Collectors.toList()) );
}
- private void checkArtifactListWithProjectSelector1( List<? extends Artifact> results )
+ private void checkArtifactListWithProjectSelector( List<? extends Artifact> results )
{
assertNotNull( results );
assertEquals( 27, results.size( ) );
assertEquals( ".jar.sha1", artifact.getRemainder( ) );
}
+ @Test
+ public void testArtifactListWithNamespaceSelector() {
+ ItemSelector selector = ArchivaItemSelector.builder( )
+ .withNamespace( "org.multilevel" )
+ .build( );
+ List<? extends Artifact> results = repoContent.getArtifacts( selector );
+ assertNotNull( results );
+ assertEquals( 3, results.size( ) );
+ assertTrue( results.get( 0 ).getFileName( ).startsWith( "testproj1" ) );
+ }
+
+ @Test
+ public void testArtifactListWithNamespaceSelectorRecursive() {
+ ItemSelector selector = ArchivaItemSelector.builder( )
+ .withNamespace( "org.multilevel" )
+ .recurse()
+ .build( );
+ List<? extends Artifact> results = repoContent.getArtifacts( selector );
+ assertNotNull( results );
+ assertEquals( 6, results.size( ) );
+
+ Artifact artifact = results.stream( ).filter( a -> a.getFileName( ).equalsIgnoreCase( "testproj2-1.0.pom" ) )
+ .findFirst( ).get( );
+ assertNotNull( artifact );
+ assertEquals( 6, artifact.getAsset( ).getParent( ).getPath( ).split( "/" ).length );
+
+ artifact = results.stream( ).filter( a -> a.getFileName( ).equalsIgnoreCase( "testproj1-1.0.pom" ) )
+ .findFirst( ).get( );
+ assertNotNull( artifact );
+ assertEquals( 5, artifact.getAsset( ).getParent( ).getPath( ).split( "/" ).length );
+
+ }
+
}
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<project>
- <modelVersion>4.0.0</modelVersion>
-
- <groupId>org</groupId>
- <artifactId>multilevel</artifactId>
- <name>Multilevel Test</name>
- <version>1.0</version>
- <packaging>pom</packaging>
-
- <organization>
- <name>Company</name>
- <url>http://www.company.com/</url>
- </organization>
- <inceptionYear>2002</inceptionYear>
-
- <modules>
- <module>api</module>
- <module>common</module>
- <module>broker</module>
- <module>endpoint</module>
- </modules>
-
- <dependencies>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>3.8.1</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
- <dependencyManagement>
- <dependencies>
- <!-- common version strategy -->
- <dependency>
- <groupId>javax.activation</groupId>
- <artifactId>activation</artifactId>
- <version>1.0.2</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.jms</groupId>
- <artifactId>jms</artifactId>
- <version>1.0.2</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.ejb</groupId>
- <artifactId>ejb</artifactId>
- <version>2.0</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.4</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.mail</groupId>
- <artifactId>mail</artifactId>
- <version>1.4</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>xml-apis</groupId>
- <artifactId>xml-apis</artifactId>
- <version>2.0.2</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- <version>1.0.4</version>
- </dependency>
- <dependency>
- <groupId>commons-lang</groupId>
- <artifactId>commons-lang</artifactId>
- <version>2.1</version>
- </dependency>
- <dependency>
- <groupId>commons-collections</groupId>
- <artifactId>commons-collections</artifactId>
- <version>3.2</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring</artifactId>
- <version>2.0.7</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-mock</artifactId>
- <version>2.0.7</version>
- <scope>test</scope>
- <exclusions>
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring-jdbc</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring-web</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <version>1.2.8</version>
- </dependency>
- <dependency>
- <groupId>commons-discovery</groupId>
- <artifactId>commons-discovery</artifactId>
- <version>0.2</version>
- </dependency>
- <dependency>
- <groupId>commons-id</groupId>
- <artifactId>commons-id</artifactId>
- <version>0.1-dev</version>
- </dependency>
- <dependency>
- <groupId>org.codehaus.castor</groupId>
- <artifactId>castor</artifactId>
- <version>1.0.5-xml</version>
- </dependency>
- <dependency>
- <groupId>xerces</groupId>
- <artifactId>xerces</artifactId>
- <version>2.4.0</version>
- </dependency>
- <dependency>
- <groupId>commons-httpclient</groupId>
- <artifactId>commons-httpclient</artifactId>
- <version>3.1</version>
- </dependency>
- <dependency>
- <groupId>stax</groupId>
- <artifactId>stax-api</artifactId>
- <version>1.0.1</version>
- </dependency>
- <dependency>
- <groupId>org.codehaus.woodstox</groupId>
- <artifactId>wstx-asl</artifactId>
- <version>3.2.1</version>
- </dependency>
- <dependency>
- <groupId>com.thoughtworks.xstream</groupId>
- <artifactId>xstream</artifactId>
- <version>1.2.2</version>
- </dependency>
- <dependency>
- <groupId>javax.management</groupId>
- <artifactId>jmxri</artifactId>
- <version>1.2.1</version>
- <scope>provided</scope>
- </dependency>
- </dependencies>
- </dependencyManagement>
-
-</project>
+++ /dev/null
-f47d2f7fe7abf0939aca96197ca21a13 mulitlevel-1.0.pom
+++ /dev/null
-de1d43c63ea17a7aad03c6edc8477a8e196ad406a6c7e18c23db057f9e030a13 mulitlevel-1.0.pom
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<project>
- <modelVersion>4.0.0</modelVersion>
-
- <groupId>org.multilevel</groupId>
- <artifactId>test</artifactId>
- <name>Multilevel Test Sub 1</name>
- <version>1.0</version>
- <packaging>pom</packaging>
-
- <organization>
- <name>Company</name>
- <url>http://www.company.com/</url>
- </organization>
- <inceptionYear>2002</inceptionYear>
-
- <modules>
- <module>api</module>
- <module>common</module>
- <module>broker</module>
- <module>endpoint</module>
- </modules>
-
- <dependencies>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>3.8.1</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
- <dependencyManagement>
- <dependencies>
- <!-- common version strategy -->
- <dependency>
- <groupId>javax.activation</groupId>
- <artifactId>activation</artifactId>
- <version>1.0.2</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.jms</groupId>
- <artifactId>jms</artifactId>
- <version>1.0.2</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.ejb</groupId>
- <artifactId>ejb</artifactId>
- <version>2.0</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.4</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.mail</groupId>
- <artifactId>mail</artifactId>
- <version>1.4</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>xml-apis</groupId>
- <artifactId>xml-apis</artifactId>
- <version>2.0.2</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- <version>1.0.4</version>
- </dependency>
- <dependency>
- <groupId>commons-lang</groupId>
- <artifactId>commons-lang</artifactId>
- <version>2.1</version>
- </dependency>
- <dependency>
- <groupId>commons-collections</groupId>
- <artifactId>commons-collections</artifactId>
- <version>3.2</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring</artifactId>
- <version>2.0.7</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-mock</artifactId>
- <version>2.0.7</version>
- <scope>test</scope>
- <exclusions>
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring-jdbc</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring-web</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <version>1.2.8</version>
- </dependency>
- <dependency>
- <groupId>commons-discovery</groupId>
- <artifactId>commons-discovery</artifactId>
- <version>0.2</version>
- </dependency>
- <dependency>
- <groupId>commons-id</groupId>
- <artifactId>commons-id</artifactId>
- <version>0.1-dev</version>
- </dependency>
- <dependency>
- <groupId>org.codehaus.castor</groupId>
- <artifactId>castor</artifactId>
- <version>1.0.5-xml</version>
- </dependency>
- <dependency>
- <groupId>xerces</groupId>
- <artifactId>xerces</artifactId>
- <version>2.4.0</version>
- </dependency>
- <dependency>
- <groupId>commons-httpclient</groupId>
- <artifactId>commons-httpclient</artifactId>
- <version>3.1</version>
- </dependency>
- <dependency>
- <groupId>stax</groupId>
- <artifactId>stax-api</artifactId>
- <version>1.0.1</version>
- </dependency>
- <dependency>
- <groupId>org.codehaus.woodstox</groupId>
- <artifactId>wstx-asl</artifactId>
- <version>3.2.1</version>
- </dependency>
- <dependency>
- <groupId>com.thoughtworks.xstream</groupId>
- <artifactId>xstream</artifactId>
- <version>1.2.2</version>
- </dependency>
- <dependency>
- <groupId>javax.management</groupId>
- <artifactId>jmxri</artifactId>
- <version>1.2.1</version>
- <scope>provided</scope>
- </dependency>
- </dependencies>
- </dependencyManagement>
-
-</project>
+++ /dev/null
-ef3e226769f6e4ef6ba17a39d1ae7832 test-1.0.pom
+++ /dev/null
-340253fb0649f043044a96857c5a6ec4b74992e25d58071b46de1ef99f046cf0 test-1.0.pom
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.multilevel</groupId>
+ <artifactId>testproj1</artifactId>
+ <name>Multilevel Test 1</name>
+ <version>1.0</version>
+ <packaging>pom</packaging>
+
+ <organization>
+ <name>Company</name>
+ <url>http://www.company.com/</url>
+ </organization>
+ <inceptionYear>2002</inceptionYear>
+
+ <modules>
+ <module>api</module>
+ <module>common</module>
+ <module>broker</module>
+ <module>endpoint</module>
+ </modules>
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <dependencyManagement>
+ <dependencies>
+ <!-- common version strategy -->
+ <dependency>
+ <groupId>javax.activation</groupId>
+ <artifactId>activation</artifactId>
+ <version>1.0.2</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.jms</groupId>
+ <artifactId>jms</artifactId>
+ <version>1.0.2</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.ejb</groupId>
+ <artifactId>ejb</artifactId>
+ <version>2.0</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.4</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.mail</groupId>
+ <artifactId>mail</artifactId>
+ <version>1.4</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>xml-apis</groupId>
+ <artifactId>xml-apis</artifactId>
+ <version>2.0.2</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>1.0.4</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ <version>2.1</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-collections</groupId>
+ <artifactId>commons-collections</artifactId>
+ <version>3.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring</artifactId>
+ <version>2.0.7</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-mock</artifactId>
+ <version>2.0.7</version>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-jdbc</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-web</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.8</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-discovery</groupId>
+ <artifactId>commons-discovery</artifactId>
+ <version>0.2</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-id</groupId>
+ <artifactId>commons-id</artifactId>
+ <version>0.1-dev</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.castor</groupId>
+ <artifactId>castor</artifactId>
+ <version>1.0.5-xml</version>
+ </dependency>
+ <dependency>
+ <groupId>xerces</groupId>
+ <artifactId>xerces</artifactId>
+ <version>2.4.0</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-httpclient</groupId>
+ <artifactId>commons-httpclient</artifactId>
+ <version>3.1</version>
+ </dependency>
+ <dependency>
+ <groupId>stax</groupId>
+ <artifactId>stax-api</artifactId>
+ <version>1.0.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.woodstox</groupId>
+ <artifactId>wstx-asl</artifactId>
+ <version>3.2.1</version>
+ </dependency>
+ <dependency>
+ <groupId>com.thoughtworks.xstream</groupId>
+ <artifactId>xstream</artifactId>
+ <version>1.2.2</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.management</groupId>
+ <artifactId>jmxri</artifactId>
+ <version>1.2.1</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+</project>
--- /dev/null
+f47d2f7fe7abf0939aca96197ca21a13 mulitlevel-1.0.pom
--- /dev/null
+de1d43c63ea17a7aad03c6edc8477a8e196ad406a6c7e18c23db057f9e030a13 mulitlevel-1.0.pom
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.multilevel.testproj1</groupId>
+ <artifactId>testproj2</artifactId>
+ <name>Multilevel Test Sub 2</name>
+ <version>1.0</version>
+ <packaging>pom</packaging>
+
+ <organization>
+ <name>Company</name>
+ <url>http://www.company.com/</url>
+ </organization>
+ <inceptionYear>2002</inceptionYear>
+
+ <modules>
+ <module>api</module>
+ <module>common</module>
+ <module>broker</module>
+ <module>endpoint</module>
+ </modules>
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <dependencyManagement>
+ <dependencies>
+ <!-- common version strategy -->
+ <dependency>
+ <groupId>javax.activation</groupId>
+ <artifactId>activation</artifactId>
+ <version>1.0.2</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.jms</groupId>
+ <artifactId>jms</artifactId>
+ <version>1.0.2</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.ejb</groupId>
+ <artifactId>ejb</artifactId>
+ <version>2.0</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.4</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.mail</groupId>
+ <artifactId>mail</artifactId>
+ <version>1.4</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>xml-apis</groupId>
+ <artifactId>xml-apis</artifactId>
+ <version>2.0.2</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>1.0.4</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ <version>2.1</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-collections</groupId>
+ <artifactId>commons-collections</artifactId>
+ <version>3.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring</artifactId>
+ <version>2.0.7</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-mock</artifactId>
+ <version>2.0.7</version>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-jdbc</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-web</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.8</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-discovery</groupId>
+ <artifactId>commons-discovery</artifactId>
+ <version>0.2</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-id</groupId>
+ <artifactId>commons-id</artifactId>
+ <version>0.1-dev</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.castor</groupId>
+ <artifactId>castor</artifactId>
+ <version>1.0.5-xml</version>
+ </dependency>
+ <dependency>
+ <groupId>xerces</groupId>
+ <artifactId>xerces</artifactId>
+ <version>2.4.0</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-httpclient</groupId>
+ <artifactId>commons-httpclient</artifactId>
+ <version>3.1</version>
+ </dependency>
+ <dependency>
+ <groupId>stax</groupId>
+ <artifactId>stax-api</artifactId>
+ <version>1.0.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.woodstox</groupId>
+ <artifactId>wstx-asl</artifactId>
+ <version>3.2.1</version>
+ </dependency>
+ <dependency>
+ <groupId>com.thoughtworks.xstream</groupId>
+ <artifactId>xstream</artifactId>
+ <version>1.2.2</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.management</groupId>
+ <artifactId>jmxri</artifactId>
+ <version>1.2.1</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+</project>
--- /dev/null
+ef3e226769f6e4ef6ba17a39d1ae7832 test-1.0.pom
--- /dev/null
+340253fb0649f043044a96857c5a6ec4b74992e25d58071b46de1ef99f046cf0 test-1.0.pom