aboutsummaryrefslogtreecommitdiffstats
path: root/archiva-modules
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2012-09-13 08:40:26 +0000
committerOlivier Lamy <olamy@apache.org>2012-09-13 08:40:26 +0000
commit5c9657b348c29dfb797c68130fa278eca19ef384 (patch)
tree503e8a4176e94b1ebfbd3c1a2750856471da838b /archiva-modules
parent67f7fee51c8580dccff2f8566e3dce79aa392f19 (diff)
downloadarchiva-5c9657b348c29dfb797c68130fa278eca19ef384.tar.gz
archiva-5c9657b348c29dfb797c68130fa278eca19ef384.zip
move those tests to webapp-js as there will be still valid even if we remove the legacy UI :)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1384233 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules')
-rw-r--r--archiva-modules/archiva-web/archiva-webapp-js/pom.xml23
-rw-r--r--archiva-modules/archiva-web/archiva-webapp-js/src/test/java/org/apache/archiva/webapp/ui/services/api/RuntimeInfoServiceTest.java2
-rw-r--r--archiva-modules/archiva-web/archiva-webapp-js/src/test/junit-4.9.jarbin0 -> 248994 bytes
-rw-r--r--archiva-modules/archiva-web/archiva-webapp-js/src/test/repositories/test-repo/org/apache/archiva/archiva-search/1.0/archiva-search-1.0-patch1.jarbin0 -> 2518 bytes
-rw-r--r--archiva-modules/archiva-web/archiva-webapp-js/src/test/repositories/test-repo/org/apache/archiva/archiva-search/1.0/archiva-search-1.0-sources.jarbin0 -> 2518 bytes
-rw-r--r--archiva-modules/archiva-web/archiva-webapp-js/src/test/repositories/test-repo/org/apache/archiva/archiva-search/1.0/archiva-search-1.0.jarbin0 -> 2518 bytes
-rw-r--r--archiva-modules/archiva-web/archiva-webapp-js/src/test/repositories/test-repo/org/apache/archiva/archiva-search/1.0/archiva-search-1.0.pom28
-rw-r--r--archiva-modules/archiva-web/archiva-webapp-js/src/test/repositories/test-repo/org/apache/archiva/archiva-test/1.0/archiva-test-1.0.jarbin0 -> 2471 bytes
-rw-r--r--archiva-modules/archiva-web/archiva-webapp-js/src/test/repositories/test-repo/org/apache/archiva/archiva-test/1.0/archiva-test-1.0.pom23
-rw-r--r--archiva-modules/archiva-web/archiva-webapp-js/src/test/repositories/test-repo/org/apache/archiva/archiva-test/2.0/archiva-test-2.0.jarbin0 -> 2494 bytes
-rw-r--r--archiva-modules/archiva-web/archiva-webapp-js/src/test/repositories/test-repo/org/apache/archiva/archiva-test/2.0/archiva-test-2.0.pom28
-rw-r--r--archiva-modules/archiva-web/archiva-webapp-js/src/test/repositories/test-repo/org/apache/archiva/archiva-webapp/1.0/archiva-webapp-1.0.pom23
-rw-r--r--archiva-modules/archiva-web/archiva-webapp-js/src/test/repositories/test-repo/org/apache/archiva/archiva-webapp/1.0/archiva-webapp-1.0.war0
-rw-r--r--archiva-modules/archiva-web/archiva-webapp-js/src/test/repositories/test-repo/org/apache/archiva/test-webapp/1.0-SNAPSHOT/test-webapp-1.0-SNAPSHOT.warbin0 -> 4169 bytes
-rw-r--r--archiva-modules/archiva-web/archiva-webapp-js/src/test/repositories/test-repo/org/apache/felix/org.apache.felix.bundlerepository/1.6.6/org.apache.felix.bundlerepository-1.6.6.jarbin0 -> 168279 bytes
-rw-r--r--archiva-modules/archiva-web/archiva-webapp-js/src/test/repositories/test-repo/org/apache/felix/org.apache.felix.bundlerepository/1.6.6/org.apache.felix.bundlerepository-1.6.6.pom138
-rw-r--r--archiva-modules/archiva-web/archiva-webapp-js/src/test/resources/META-INF/spring-context.xml (renamed from archiva-modules/archiva-web/archiva-webapp-js/src/test/resources/META-INF/spring-context-test.xml)0
-rw-r--r--archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/archiva/AbstractDownloadTest.java278
-rw-r--r--archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/archiva/DownloadArtifactsTest.java240
-rw-r--r--archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/archiva/DownloadMergedIndexTest.java183
-rw-r--r--archiva-modules/archiva-web/archiva-webapp/src/test/resources/spring-context-artifacts-download.xml55
-rw-r--r--archiva-modules/archiva-web/archiva-webapp/src/test/resources/spring-context-merge-index-download.xml56
22 files changed, 263 insertions, 814 deletions
diff --git a/archiva-modules/archiva-web/archiva-webapp-js/pom.xml b/archiva-modules/archiva-web/archiva-webapp-js/pom.xml
index 2a1f1aa84..23d091491 100644
--- a/archiva-modules/archiva-web/archiva-webapp-js/pom.xml
+++ b/archiva-modules/archiva-web/archiva-webapp-js/pom.xml
@@ -795,7 +795,27 @@
<artifactId>slf4j-simple</artifactId>
</exclusion>
</exclusions>
- </dependency>
+ </dependency>
+
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-server</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-plus</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.archiva</groupId>
+ <artifactId>archiva-web-common</artifactId>
+ <classifier>tests</classifier>
+ <scope>test</scope>
+ <version>${project.version}</version>
+ </dependency>
+
</dependencies>
<build>
@@ -817,6 +837,7 @@
<exclude>src/main/webapp/js/*.js</exclude>
<exclude>src/site/resources/css/*.css</exclude>
<exclude>src/site/resources/js/*.js</exclude>
+ <exclude>src/test/repositories/test-repo/**</exclude>
</excludes>
</configuration>
</plugin>
diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/test/java/org/apache/archiva/webapp/ui/services/api/RuntimeInfoServiceTest.java b/archiva-modules/archiva-web/archiva-webapp-js/src/test/java/org/apache/archiva/webapp/ui/services/api/RuntimeInfoServiceTest.java
index 3daf26598..d9992d9ca 100644
--- a/archiva-modules/archiva-web/archiva-webapp-js/src/test/java/org/apache/archiva/webapp/ui/services/api/RuntimeInfoServiceTest.java
+++ b/archiva-modules/archiva-web/archiva-webapp-js/src/test/java/org/apache/archiva/webapp/ui/services/api/RuntimeInfoServiceTest.java
@@ -59,7 +59,7 @@ public class RuntimeInfoServiceTest
@Override
protected String getSpringConfigLocation()
{
- return "classpath*:META-INF/spring-context.xml,classpath*:META-INF/spring-context-test.xml";
+ return "classpath*:META-INF/spring-context.xml";
}
protected String getRestServicesPath()
diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/test/junit-4.9.jar b/archiva-modules/archiva-web/archiva-webapp-js/src/test/junit-4.9.jar
new file mode 100644
index 000000000..142081561
--- /dev/null
+++ b/archiva-modules/archiva-web/archiva-webapp-js/src/test/junit-4.9.jar
Binary files differ
diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/test/repositories/test-repo/org/apache/archiva/archiva-search/1.0/archiva-search-1.0-patch1.jar b/archiva-modules/archiva-web/archiva-webapp-js/src/test/repositories/test-repo/org/apache/archiva/archiva-search/1.0/archiva-search-1.0-patch1.jar
new file mode 100644
index 000000000..9c16c3ced
--- /dev/null
+++ b/archiva-modules/archiva-web/archiva-webapp-js/src/test/repositories/test-repo/org/apache/archiva/archiva-search/1.0/archiva-search-1.0-patch1.jar
Binary files differ
diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/test/repositories/test-repo/org/apache/archiva/archiva-search/1.0/archiva-search-1.0-sources.jar b/archiva-modules/archiva-web/archiva-webapp-js/src/test/repositories/test-repo/org/apache/archiva/archiva-search/1.0/archiva-search-1.0-sources.jar
new file mode 100644
index 000000000..9c16c3ced
--- /dev/null
+++ b/archiva-modules/archiva-web/archiva-webapp-js/src/test/repositories/test-repo/org/apache/archiva/archiva-search/1.0/archiva-search-1.0-sources.jar
Binary files differ
diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/test/repositories/test-repo/org/apache/archiva/archiva-search/1.0/archiva-search-1.0.jar b/archiva-modules/archiva-web/archiva-webapp-js/src/test/repositories/test-repo/org/apache/archiva/archiva-search/1.0/archiva-search-1.0.jar
new file mode 100644
index 000000000..9c16c3ced
--- /dev/null
+++ b/archiva-modules/archiva-web/archiva-webapp-js/src/test/repositories/test-repo/org/apache/archiva/archiva-search/1.0/archiva-search-1.0.jar
Binary files differ
diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/test/repositories/test-repo/org/apache/archiva/archiva-search/1.0/archiva-search-1.0.pom b/archiva-modules/archiva-web/archiva-webapp-js/src/test/repositories/test-repo/org/apache/archiva/archiva-search/1.0/archiva-search-1.0.pom
new file mode 100644
index 000000000..b0d983fde
--- /dev/null
+++ b/archiva-modules/archiva-web/archiva-webapp-js/src/test/repositories/test-repo/org/apache/archiva/archiva-search/1.0/archiva-search-1.0.pom
@@ -0,0 +1,28 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.archiva</groupId>
+ <artifactId>archiva-search</artifactId>
+ <packaging>jar</packaging>
+ <version>1.0</version>
+ <name>Archiva Search</name>
+ <url>http://archiva.apache.org</url>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ <version>2.3</version>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.8</version>
+ </dependency>
+ </dependencies>
+</project>
diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/test/repositories/test-repo/org/apache/archiva/archiva-test/1.0/archiva-test-1.0.jar b/archiva-modules/archiva-web/archiva-webapp-js/src/test/repositories/test-repo/org/apache/archiva/archiva-test/1.0/archiva-test-1.0.jar
new file mode 100644
index 000000000..843ee45bc
--- /dev/null
+++ b/archiva-modules/archiva-web/archiva-webapp-js/src/test/repositories/test-repo/org/apache/archiva/archiva-test/1.0/archiva-test-1.0.jar
Binary files differ
diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/test/repositories/test-repo/org/apache/archiva/archiva-test/1.0/archiva-test-1.0.pom b/archiva-modules/archiva-web/archiva-webapp-js/src/test/repositories/test-repo/org/apache/archiva/archiva-test/1.0/archiva-test-1.0.pom
new file mode 100644
index 000000000..0b037a3a5
--- /dev/null
+++ b/archiva-modules/archiva-web/archiva-webapp-js/src/test/repositories/test-repo/org/apache/archiva/archiva-test/1.0/archiva-test-1.0.pom
@@ -0,0 +1,23 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.archiva</groupId>
+ <artifactId>archiva-test</artifactId>
+ <packaging>jar</packaging>
+ <version>1.0</version>
+ <name>archiva-test</name>
+ <url>http://maven.apache.org</url>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ <version>2.3</version>
+ </dependency>
+ </dependencies>
+</project>
diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/test/repositories/test-repo/org/apache/archiva/archiva-test/2.0/archiva-test-2.0.jar b/archiva-modules/archiva-web/archiva-webapp-js/src/test/repositories/test-repo/org/apache/archiva/archiva-test/2.0/archiva-test-2.0.jar
new file mode 100644
index 000000000..e904a17c4
--- /dev/null
+++ b/archiva-modules/archiva-web/archiva-webapp-js/src/test/repositories/test-repo/org/apache/archiva/archiva-test/2.0/archiva-test-2.0.jar
Binary files differ
diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/test/repositories/test-repo/org/apache/archiva/archiva-test/2.0/archiva-test-2.0.pom b/archiva-modules/archiva-web/archiva-webapp-js/src/test/repositories/test-repo/org/apache/archiva/archiva-test/2.0/archiva-test-2.0.pom
new file mode 100644
index 000000000..04fdb4859
--- /dev/null
+++ b/archiva-modules/archiva-web/archiva-webapp-js/src/test/repositories/test-repo/org/apache/archiva/archiva-test/2.0/archiva-test-2.0.pom
@@ -0,0 +1,28 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.archiva</groupId>
+ <artifactId>archiva-test</artifactId>
+ <packaging>jar</packaging>
+ <version>2.0</version>
+ <name>Archiva Test</name>
+ <url>http://archiva.apache.org</url>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ <version>2.3</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>1.4</version>
+ </dependency>
+ </dependencies>
+</project>
diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/test/repositories/test-repo/org/apache/archiva/archiva-webapp/1.0/archiva-webapp-1.0.pom b/archiva-modules/archiva-web/archiva-webapp-js/src/test/repositories/test-repo/org/apache/archiva/archiva-webapp/1.0/archiva-webapp-1.0.pom
new file mode 100644
index 000000000..ca28dc132
--- /dev/null
+++ b/archiva-modules/archiva-web/archiva-webapp-js/src/test/repositories/test-repo/org/apache/archiva/archiva-webapp/1.0/archiva-webapp-1.0.pom
@@ -0,0 +1,23 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.archiva</groupId>
+ <artifactId>archiva-webapp</artifactId>
+ <packaging>war</packaging>
+ <version>1.0</version>
+ <name>Archiva Webapp</name>
+ <url>http://archiva.apache.org</url>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.8</version>
+ </dependency>
+ </dependencies>
+</project>
diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/test/repositories/test-repo/org/apache/archiva/archiva-webapp/1.0/archiva-webapp-1.0.war b/archiva-modules/archiva-web/archiva-webapp-js/src/test/repositories/test-repo/org/apache/archiva/archiva-webapp/1.0/archiva-webapp-1.0.war
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/archiva-modules/archiva-web/archiva-webapp-js/src/test/repositories/test-repo/org/apache/archiva/archiva-webapp/1.0/archiva-webapp-1.0.war
diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/test/repositories/test-repo/org/apache/archiva/test-webapp/1.0-SNAPSHOT/test-webapp-1.0-SNAPSHOT.war b/archiva-modules/archiva-web/archiva-webapp-js/src/test/repositories/test-repo/org/apache/archiva/test-webapp/1.0-SNAPSHOT/test-webapp-1.0-SNAPSHOT.war
new file mode 100644
index 000000000..5559103fd
--- /dev/null
+++ b/archiva-modules/archiva-web/archiva-webapp-js/src/test/repositories/test-repo/org/apache/archiva/test-webapp/1.0-SNAPSHOT/test-webapp-1.0-SNAPSHOT.war
Binary files differ
diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/test/repositories/test-repo/org/apache/felix/org.apache.felix.bundlerepository/1.6.6/org.apache.felix.bundlerepository-1.6.6.jar b/archiva-modules/archiva-web/archiva-webapp-js/src/test/repositories/test-repo/org/apache/felix/org.apache.felix.bundlerepository/1.6.6/org.apache.felix.bundlerepository-1.6.6.jar
new file mode 100644
index 000000000..218330e3f
--- /dev/null
+++ b/archiva-modules/archiva-web/archiva-webapp-js/src/test/repositories/test-repo/org/apache/felix/org.apache.felix.bundlerepository/1.6.6/org.apache.felix.bundlerepository-1.6.6.jar
Binary files differ
diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/test/repositories/test-repo/org/apache/felix/org.apache.felix.bundlerepository/1.6.6/org.apache.felix.bundlerepository-1.6.6.pom b/archiva-modules/archiva-web/archiva-webapp-js/src/test/repositories/test-repo/org/apache/felix/org.apache.felix.bundlerepository/1.6.6/org.apache.felix.bundlerepository-1.6.6.pom
new file mode 100644
index 000000000..19831eefa
--- /dev/null
+++ b/archiva-modules/archiva-web/archiva-webapp-js/src/test/repositories/test-repo/org/apache/felix/org.apache.felix.bundlerepository/1.6.6/org.apache.felix.bundlerepository-1.6.6.pom
@@ -0,0 +1,138 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>felix-parent</artifactId>
+ <version>2.1</version>
+ <relativePath>../pom/pom.xml</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <packaging>bundle</packaging>
+ <name>Apache Felix Bundle Repository</name>
+ <description>Bundle repository service.</description>
+ <artifactId>org.apache.felix.bundlerepository</artifactId>
+ <version>1.6.6</version>
+ <scm>
+ <connection>scm:svn:http://svn.apache.org/repos/asf/felix/releases/org.apache.felix.bundlerepository-1.6.6</connection>
+ <developerConnection>scm:svn:https://svn.apache.org/repos/asf/felix/releases/org.apache.felix.bundlerepository-1.6.6</developerConnection>
+ <url>http://svn.apache.org/repos/asf/felix/releases/org.apache.felix.bundlerepository-1.6.6</url>
+ </scm>
+ <dependencies>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>org.apache.felix.utils</artifactId>
+ <version>1.1.0</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>org.osgi.service.obr</artifactId>
+ <version>1.0.2</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>org.apache.felix.shell</artifactId>
+ <version>1.4.1</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>net.sf.kxml</groupId>
+ <artifactId>kxml2</artifactId>
+ <version>2.3.0</version>
+ <optional>true</optional>
+ <exclusions>
+ <exclusion>
+ <groupId>xmlpull</groupId>
+ <artifactId>xmlpull</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.compendium</artifactId>
+ <version>4.0.0</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.core</artifactId>
+ <version>4.1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.woodstox</groupId>
+ <artifactId>woodstox-core-asl</artifactId>
+ <version>4.0.7</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>org.easymock</groupId>
+ <artifactId>easymock</artifactId>
+ <version>2.4</version>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <version>2.3.4</version>
+ <extensions>true</extensions>
+ <configuration>
+ <instructions>
+ <Export-Package>org.apache.felix.bundlerepository;version="2.0"</Export-Package>
+ <Private-Package>
+ org.kxml2.io,
+ org.xmlpull.v1,
+ org.apache.felix.bundlerepository.impl.*,
+ org.apache.felix.utils.*
+ </Private-Package>
+ <Import-Package>!javax.xml.parsers,!org.xml.sax,org.osgi.service.log;resolution:=optional,org.osgi.service.obr;resolution:=optional,javax.xml.stream;resolution:=optional,*</Import-Package>
+ <DynamicImport-Package>org.apache.felix.shell</DynamicImport-Package>
+ <Bundle-Activator>${project.artifactId}.impl.Activator</Bundle-Activator>
+ <Bundle-DocURL>http://felix.apache.org/site/apache-felix-osgi-bundle-repository.html</Bundle-DocURL>
+ <Bundle-Url>http://felix.apache.org/site/downloads.cgi</Bundle-Url>
+ <Bundle-Source>http://felix.apache.org/site/downloads.cgi</Bundle-Source>
+ <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
+ <Bundle-Vendor>The Apache Software Foundation</Bundle-Vendor>
+ <Export-Service>org.apache.felix.bundlerepository.RepositoryAdmin,org.osgi.service.obr.RepositoryAdmin</Export-Service>
+ <_versionpolicy>[$(version;==;$(@)),$(version;+;$(@)))</_versionpolicy>
+ <Include-Resource>META-INF/LICENSE=LICENSE,META-INF/LICENSE.kxml2=LICENSE.kxml2,META-INF/NOTICE=NOTICE,META-INF/DEPENDENCIES=DEPENDENCIES</Include-Resource>
+ </instructions>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.rat</groupId>
+ <artifactId>apache-rat-plugin</artifactId>
+ <configuration>
+ <excludeSubProjects>false</excludeSubProjects>
+ <useEclipseDefaultExcludes>true</useEclipseDefaultExcludes>
+ <useMavenDefaultExcludes>true</useMavenDefaultExcludes>
+ <excludes>
+ <param>doc/*</param>
+ <param>maven-eclipse.xml</param>
+ <param>.checkstyle</param>
+ <param>.externalToolBuilders/*</param>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/test/resources/META-INF/spring-context-test.xml b/archiva-modules/archiva-web/archiva-webapp-js/src/test/resources/META-INF/spring-context.xml
index 4478e93dc..4478e93dc 100644
--- a/archiva-modules/archiva-web/archiva-webapp-js/src/test/resources/META-INF/spring-context-test.xml
+++ b/archiva-modules/archiva-web/archiva-webapp-js/src/test/resources/META-INF/spring-context.xml
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/archiva/AbstractDownloadTest.java b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/archiva/AbstractDownloadTest.java
deleted file mode 100644
index fdf51e81b..000000000
--- a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/archiva/AbstractDownloadTest.java
+++ /dev/null
@@ -1,278 +0,0 @@
-package org.apache.archiva;
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import junit.framework.TestCase;
-import org.apache.archiva.rest.api.services.ManagedRepositoriesService;
-import org.apache.archiva.rest.api.services.ProxyConnectorService;
-import org.apache.archiva.rest.api.services.RemoteRepositoriesService;
-import org.apache.archiva.rest.api.services.RepositoriesService;
-import org.apache.archiva.rest.api.services.RepositoryGroupService;
-import org.apache.archiva.rest.api.services.SearchService;
-import org.apache.archiva.webdav.RepositoryServlet;
-import org.apache.commons.lang.StringUtils;
-import org.apache.cxf.common.util.Base64Utility;
-import org.apache.cxf.jaxrs.client.JAXRSClientFactory;
-import org.apache.cxf.jaxrs.client.WebClient;
-import org.apache.cxf.transport.servlet.CXFServlet;
-import org.codehaus.jackson.jaxrs.JacksonJaxbJsonProvider;
-import org.apache.archiva.redback.integration.security.role.RedbackRoleConstants;
-import org.apache.archiva.redback.rest.api.model.User;
-import org.apache.archiva.redback.rest.api.services.RoleManagementService;
-import org.apache.archiva.redback.rest.api.services.UserService;
-import org.apache.archiva.redback.rest.services.FakeCreateAdminService;
-import org.eclipse.jetty.server.Connector;
-import org.eclipse.jetty.server.Server;
-import org.eclipse.jetty.server.session.SessionHandler;
-import org.eclipse.jetty.servlet.ServletContextHandler;
-import org.eclipse.jetty.servlet.ServletHolder;
-import org.junit.After;
-import org.junit.Before;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.web.context.ContextLoaderListener;
-
-import java.util.Collections;
-import org.apache.archiva.test.utils.ArchivaBlockJUnit4ClassRunner;
-import org.junit.runner.RunWith;
-
-/**
- * @author Olivier Lamy
- */
-@RunWith( ArchivaBlockJUnit4ClassRunner.class )
-public abstract class AbstractDownloadTest
- extends TestCase
-{
-
- protected Logger log = LoggerFactory.getLogger( getClass() );
-
- static String previousAppServerBase;
-
- public String authorizationHeader = getAdminAuthzHeader();
-
- public Server server = null;
-
- public int port;
-
- public static String encode( String uid, String password )
- {
- return "Basic " + Base64Utility.encode( ( uid + ":" + password ).getBytes() );
- }
-
- public static String getAdminAuthzHeader()
- {
- String adminPwdSysProps = System.getProperty( "rest.admin.pwd" );
- if ( StringUtils.isBlank( adminPwdSysProps ) )
- {
- return encode( RedbackRoleConstants.ADMINISTRATOR_ACCOUNT_NAME, FakeCreateAdminService.ADMIN_TEST_PWD );
- }
- return encode( RedbackRoleConstants.ADMINISTRATOR_ACCOUNT_NAME, adminPwdSysProps );
- }
-
-
- protected abstract String getSpringConfigLocation();
-
-
- protected String getRestServicesPath()
- {
- return "restServices";
- }
-
-
- @Before
- public void startServer()
- throws Exception
- {
-
- System.setProperty( "redback.admin.creation.file", "target/auto-admin-creation.properties" );
- this.server = new Server( 0 );
-
- ServletContextHandler context = new ServletContextHandler();
-
- context.setContextPath( "/" );
-
- context.setInitParameter( "contextConfigLocation", getSpringConfigLocation() );
-
- ContextLoaderListener contextLoaderListener = new ContextLoaderListener();
-
- context.addEventListener( contextLoaderListener );
-
- ServletHolder sh = new ServletHolder( CXFServlet.class );
-
- SessionHandler sessionHandler = new SessionHandler();
-
- context.setSessionHandler( sessionHandler );
-
- context.addServlet( sh, "/" + getRestServicesPath() + "/*" );
-
- ServletHolder repoSh = new ServletHolder( RepositoryServlet.class );
- context.addServlet( repoSh, "/repository/*" );
-
- server.setHandler( context );
- this.server.start();
- Connector connector = this.server.getConnectors()[0];
- this.port = connector.getLocalPort();
- log.info( "start server on port " + this.port );
-
- User user = new User();
- user.setEmail( "toto@toto.fr" );
- user.setFullName( "the root user" );
- user.setUsername( RedbackRoleConstants.ADMINISTRATOR_ACCOUNT_NAME );
- user.setPassword( FakeCreateAdminService.ADMIN_TEST_PWD );
-
- getUserService( null ).createAdminUser( user );
-
-
- }
-
-
- @After
- public void tearDown()
- throws Exception
- {
- System.clearProperty( "redback.admin.creation.file" );
- super.tearDown();
- if ( this.server != null )
- {
- this.server.stop();
- }
- }
-
-
- protected ProxyConnectorService getProxyConnectorService()
- {
- ProxyConnectorService service =
- JAXRSClientFactory.create( getBaseUrl() + "/" + getRestServicesPath() + "/archivaServices/",
- ProxyConnectorService.class,
- Collections.singletonList( new JacksonJaxbJsonProvider() ) );
-
- WebClient.client( service ).header( "Authorization", authorizationHeader );
- WebClient.getConfig( service ).getHttpConduit().getClient().setReceiveTimeout( 300000L );
- return service;
- }
-
- protected RemoteRepositoriesService getRemoteRepositoriesService()
- {
- RemoteRepositoriesService service =
- JAXRSClientFactory.create( getBaseUrl() + "/" + getRestServicesPath() + "/archivaServices/",
- RemoteRepositoriesService.class,
- Collections.singletonList( new JacksonJaxbJsonProvider() ) );
-
- WebClient.client( service ).header( "Authorization", authorizationHeader );
- WebClient.getConfig( service ).getHttpConduit().getClient().setReceiveTimeout( 300000L );
- return service;
- }
-
- protected ManagedRepositoriesService getManagedRepositoriesService()
- {
- ManagedRepositoriesService service =
- JAXRSClientFactory.create( getBaseUrl() + "/" + getRestServicesPath() + "/archivaServices/",
- ManagedRepositoriesService.class,
- Collections.singletonList( new JacksonJaxbJsonProvider() ) );
-
- WebClient.client( service ).header( "Authorization", authorizationHeader );
- WebClient.getConfig( service ).getHttpConduit().getClient().setReceiveTimeout( 300000L );
- return service;
- }
-
-
- protected RepositoryGroupService getRepositoryGroupService()
- {
- RepositoryGroupService service =
- JAXRSClientFactory.create( getBaseUrl() + "/" + getRestServicesPath() + "/archivaServices/",
- RepositoryGroupService.class,
- Collections.singletonList( new JacksonJaxbJsonProvider() ) );
-
- WebClient.client( service ).header( "Authorization", authorizationHeader );
- WebClient.getConfig( service ).getHttpConduit().getClient().setReceiveTimeout( 300000L );
- return service;
- }
-
- protected RepositoriesService getRepositoriesService()
- {
- RepositoriesService service =
- JAXRSClientFactory.create( getBaseUrl() + "/" + getRestServicesPath() + "/archivaServices/",
- RepositoriesService.class,
- Collections.singletonList( new JacksonJaxbJsonProvider() ) );
-
- WebClient.client( service ).header( "Authorization", authorizationHeader );
- WebClient.getConfig( service ).getHttpConduit().getClient().setReceiveTimeout( 300000L );
- return service;
- }
-
- protected SearchService getSearchService()
- {
- SearchService service =
- JAXRSClientFactory.create( getBaseUrl() + "/" + getRestServicesPath() + "/archivaServices/",
- SearchService.class,
- Collections.singletonList( new JacksonJaxbJsonProvider() ) );
-
- WebClient.client( service ).header( "Authorization", authorizationHeader );
- WebClient.getConfig( service ).getHttpConduit().getClient().setReceiveTimeout( 300000L );
- return service;
- }
-
- protected String getBaseUrl()
- {
- String baseUrlSysProps = System.getProperty( "archiva.baseRestUrl" );
- return StringUtils.isBlank( baseUrlSysProps ) ? "http://localhost:" + port : baseUrlSysProps;
- }
-
-
- protected RoleManagementService getRoleManagementService( String authzHeader )
- {
- RoleManagementService service =
- JAXRSClientFactory.create( "http://localhost:" + port + "/" + getRestServicesPath() + "/redbackServices/",
- RoleManagementService.class,
- Collections.singletonList( new JacksonJaxbJsonProvider() ) );
-
- // for debuging purpose
- WebClient.getConfig( service ).getHttpConduit().getClient().setReceiveTimeout( 3000000L );
-
- if ( authzHeader != null )
- {
- WebClient.client( service ).header( "Authorization", authzHeader );
- }
- return service;
- }
-
- protected UserService getUserService( String authzHeader )
- {
- UserService service =
- JAXRSClientFactory.create( "http://localhost:" + port + "/" + getRestServicesPath() + "/redbackServices/",
- UserService.class, Collections.singletonList( new JacksonJaxbJsonProvider() ) );
-
- // for debuging purpose
- WebClient.getConfig( service ).getHttpConduit().getClient().setReceiveTimeout( 3000000L );
-
- if ( authzHeader != null )
- {
- WebClient.client( service ).header( "Authorization", authzHeader );
- }
- return service;
- }
-
- protected FakeCreateAdminService getFakeCreateAdminService()
- {
- return JAXRSClientFactory.create(
- "http://localhost:" + port + "/" + getRestServicesPath() + "/fakeCreateAdminService/",
- FakeCreateAdminService.class );
- }
-
-}
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/archiva/DownloadArtifactsTest.java b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/archiva/DownloadArtifactsTest.java
deleted file mode 100644
index ff1c7322e..000000000
--- a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/archiva/DownloadArtifactsTest.java
+++ /dev/null
@@ -1,240 +0,0 @@
-package org.apache.archiva;
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import org.apache.archiva.admin.model.beans.RemoteRepository;
-import org.apache.archiva.redback.rest.api.services.RoleManagementService;
-import org.apache.archiva.security.common.ArchivaRoleConstants;
-import org.apache.commons.compress.utils.IOUtils;
-import org.apache.commons.io.FileUtils;
-import org.apache.maven.wagon.providers.http.HttpWagon;
-import org.apache.maven.wagon.repository.Repository;
-import org.eclipse.jetty.server.Server;
-import org.eclipse.jetty.servlet.ServletContextHandler;
-import org.eclipse.jetty.servlet.ServletHolder;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.List;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
-import org.apache.archiva.test.utils.ArchivaBlockJUnit4ClassRunner;
-
-/**
- * @author Olivier Lamy
- */
-@RunWith( ArchivaBlockJUnit4ClassRunner.class )
-public class DownloadArtifactsTest
- extends AbstractDownloadTest
-{
-
- protected Logger log = LoggerFactory.getLogger( DownloadArtifactsTest.class );
-
- public Server redirectServer = null;
-
- public int redirectPort;
-
- public Server repoServer = null;
-
- public int repoServerPort;
-
- @BeforeClass
- public static void setAppServerBase()
- {
- previousAppServerBase = System.getProperty( "appserver.base" );
- System.setProperty( "appserver.base", "target/" + DownloadArtifactsTest.class.getName() );
- }
-
-
- @AfterClass
- public static void resetAppServerBase()
- {
- System.setProperty( "appserver.base", previousAppServerBase );
- }
-
- protected String getSpringConfigLocation()
- {
- return "classpath*:META-INF/spring-context.xml classpath*:spring-context-artifacts-download.xml";
- }
-
- @Before
- public void startServer()
- throws Exception
- {
- super.startServer();
-
- // repo handler
-
- this.repoServer = new Server( 0 );
-
- ServletHolder shRepo = new ServletHolder( RepoServlet.class );
- ServletContextHandler contextRepo = new ServletContextHandler();
-
- contextRepo.setContextPath( "/" );
- contextRepo.addServlet( shRepo, "/*" );
-
- repoServer.setHandler( contextRepo );
- repoServer.start();
- this.repoServerPort = repoServer.getConnectors()[0].getLocalPort();
-
- //redirect handler
-
- this.redirectServer = new Server( 0 );
- ServletHolder shRedirect = new ServletHolder( RedirectServlet.class );
- ServletContextHandler contextRedirect = new ServletContextHandler();
- contextRedirect.setAttribute( "redirectToPort", Integer.toString( this.repoServerPort ) );
-
- contextRedirect.setContextPath( "/" );
- contextRedirect.addServlet( shRedirect, "/*" );
-
- redirectServer.setHandler( contextRedirect );
- redirectServer.start();
- this.redirectPort = redirectServer.getConnectors()[0].getLocalPort();
- log.info( "redirect server port {}", redirectPort );
-
-
-
- }
-
- @After
- public void tearDown()
- throws Exception
- {
- super.tearDown();
- if ( this.redirectServer != null )
- {
- this.redirectServer.stop();
- }
- }
-
- @Test
- public void downloadWithRemoteRedirect()
- throws Exception
- {
- RemoteRepository remoteRepository = getRemoteRepositoriesService().getRemoteRepository( "central" );
- remoteRepository.setUrl( "http://localhost:" + redirectPort );
- getRemoteRepositoriesService().updateRemoteRepository( remoteRepository );
-
- RoleManagementService roleManagementService = getRoleManagementService( authorizationHeader );
-
- if ( !roleManagementService.templatedRoleExists( ArchivaRoleConstants.TEMPLATE_REPOSITORY_OBSERVER,
- "internal" ) )
- {
- roleManagementService.createTemplatedRole( ArchivaRoleConstants.TEMPLATE_REPOSITORY_OBSERVER, "internal" );
- }
-
- getUserService( authorizationHeader ).createGuestUser();
- roleManagementService.assignRole( ArchivaRoleConstants.TEMPLATE_GUEST, "guest" );
-
- roleManagementService.assignTemplatedRole( ArchivaRoleConstants.TEMPLATE_REPOSITORY_OBSERVER, "internal",
- "guest" );
-
- getUserService( authorizationHeader ).removeFromCache( "guest" );
-
- File file = new File( "target/junit-4.9.jar" );
- if ( file.exists() )
- {
- file.delete();
- }
-
- HttpWagon httpWagon = new HttpWagon();
- httpWagon.connect( new Repository( "foo", "http://localhost:" + port ) );
-
- httpWagon.get( "/repository/internal/junit/junit/4.9/junit-4.9.jar", file );
-
- ZipFile zipFile = new ZipFile( file );
- List<String> entries = getZipEntriesNames( zipFile );
- ZipEntry zipEntry = zipFile.getEntry( "org/junit/runners/JUnit4.class" );
- assertNotNull( "cannot find zipEntry org/junit/runners/JUnit4.class, entries: " + entries + ", content is: "
- + FileUtils.readFileToString( file ), zipEntry );
- zipFile.close();
- file.deleteOnExit();
- }
-
- private List<String> getZipEntriesNames( ZipFile zipFile )
- {
- try
- {
- List<String> entriesNames = new ArrayList<String>();
- Enumeration<? extends ZipEntry> entries = zipFile.entries();
- while ( entries.hasMoreElements() )
- {
- entriesNames.add( entries.nextElement().getName() );
- }
- return entriesNames;
- }
- catch ( Throwable e )
- {
- log.info( "fail to get zipEntries " + e.getMessage(), e );
- }
- return Collections.emptyList();
- }
-
-
- public static class RedirectServlet
- extends HttpServlet
- {
- @Override
- protected void doGet( HttpServletRequest req, HttpServletResponse resp )
- throws ServletException, IOException
- {
-
- LoggerFactory.getLogger( getClass() ).info( "redirect servlet receive: {}", req.getRequestURI() );
- resp.setStatus( 302 );
- resp.getWriter().write( "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n" + "<html><head>\n"
- + "<title>302 Found</title>\n" + "</head><body>\n" + "<h1>Found</h1>\n"
- + "<p>The document has moved <a href=\"http://repo.maven.apache.org/maven2/junit/junit/4.9/junit-4.9.jar\">here</a>.</p>\n"
- + "</body></html>\n" + "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n"
- + "<html><head>\n" );
- resp.sendRedirect( "http://localhost:" + getServletContext().getAttribute( "redirectToPort" ) + "/maven2/"
- + req.getRequestURI() );
- }
- }
-
- public static class RepoServlet
- extends HttpServlet
- {
- @Override
- protected void doGet( HttpServletRequest req, HttpServletResponse resp )
- throws ServletException, IOException
- {
- File jar = new File( System.getProperty( "basedir" ), "src/test/junit-4.9.jar" );
- IOUtils.copy( new FileInputStream( jar ), resp.getOutputStream() );
-
- }
- }
-
-
-}
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/archiva/DownloadMergedIndexTest.java b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/archiva/DownloadMergedIndexTest.java
deleted file mode 100644
index 118ff0dc8..000000000
--- a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/archiva/DownloadMergedIndexTest.java
+++ /dev/null
@@ -1,183 +0,0 @@
-package org.apache.archiva;
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import org.apache.archiva.admin.model.beans.ManagedRepository;
-import org.apache.archiva.admin.model.beans.ProxyConnector;
-import org.apache.archiva.admin.model.beans.RemoteRepository;
-import org.apache.archiva.admin.model.beans.RepositoryGroup;
-import org.apache.archiva.maven2.model.Artifact;
-import org.apache.archiva.rest.api.model.SearchRequest;
-import org.apache.archiva.rest.api.services.ManagedRepositoriesService;
-import org.apache.archiva.rest.api.services.ProxyConnectorService;
-import org.apache.archiva.rest.api.services.RepositoriesService;
-import org.apache.archiva.rest.api.services.RepositoryGroupService;
-import org.apache.archiva.rest.api.services.SearchService;
-import org.apache.commons.io.FileUtils;
-import org.apache.archiva.redback.integration.security.role.RedbackRoleConstants;
-import org.apache.archiva.redback.rest.services.FakeCreateAdminService;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import java.io.File;
-import java.util.Arrays;
-import java.util.List;
-import org.apache.archiva.test.utils.ArchivaBlockJUnit4ClassRunner;
-
-/**
- * @author Olivier Lamy
- */
-@RunWith( ArchivaBlockJUnit4ClassRunner.class )
-public class DownloadMergedIndexTest
- extends AbstractDownloadTest
-{
-
- @BeforeClass
- public static void setAppServerBase()
- {
- previousAppServerBase = System.getProperty( "appserver.base" );
- System.setProperty( "appserver.base", "target/" + DownloadMergedIndexTest.class.getName() );
- }
-
- @AfterClass
- public static void resetAppServerBase()
- {
- System.setProperty( "appserver.base", previousAppServerBase );
- }
-
- protected String getSpringConfigLocation()
- {
- return "classpath*:META-INF/spring-context.xml classpath*:spring-context-merge-index-download.xml";
- }
-
- @After
- public void cleanup()
- throws Exception
- {
- super.tearDown();
- File tmpIndexDir = new File( System.getProperty( "java.io.tmpdir" ) + "/tmpIndex" );
- if ( tmpIndexDir.exists() )
- {
- FileUtils.deleteDirectory( tmpIndexDir );
- }
- }
-
-
- @Test
- public void downloadMergedIndex()
- throws Exception
- {
- File tmpIndexDir = new File( System.getProperty( "java.io.tmpdir" ) + "/tmpIndex" );
- if ( tmpIndexDir.exists() )
- {
- FileUtils.deleteDirectory( tmpIndexDir );
- }
- String id = Long.toString( System.currentTimeMillis() );
- ManagedRepository managedRepository = new ManagedRepository();
- managedRepository.setId( id );
- managedRepository.setName( "name of " + id );
- managedRepository.setLocation( "src/test/repositories/test-repo" );
- managedRepository.setIndexDirectory( System.getProperty( "java.io.tmpdir" ) + "/tmpIndex/" + id );
-
- ManagedRepositoriesService managedRepositoriesService = getManagedRepositoriesService();
-
- if ( managedRepositoriesService.getManagedRepository( id ) != null )
- {
- managedRepositoriesService.deleteManagedRepository( id, false );
- }
-
- getManagedRepositoriesService().addManagedRepository( managedRepository );
-
- RepositoriesService repositoriesService = getRepositoriesService();
-
- repositoriesService.scanRepositoryNow( id, true );
-
- // wait a bit to ensure index is finished
- int timeout = 20000;
- while ( timeout > 0 && repositoriesService.alreadyScanning( id ) )
- {
- Thread.sleep( 500 );
- timeout -= 500;
- }
-
- RepositoryGroupService repositoryGroupService = getRepositoryGroupService();
-
- RepositoryGroup repositoryGroup = new RepositoryGroup();
- repositoryGroup.setId( "test-group" );
- repositoryGroup.setRepositories( Arrays.asList( id ) );
-
- repositoryGroupService.addRepositoryGroup( repositoryGroup );
-
- // create a repo with a remote on the one with index
- id = Long.toString( System.currentTimeMillis() );
- managedRepository = new ManagedRepository();
- managedRepository.setId( id );
- managedRepository.setName( "name of " + id );
- managedRepository.setLocation( "src/test/repositories/test-repo" );
- managedRepository.setIndexDirectory( System.getProperty( "java.io.tmpdir" ) + "/tmpIndex/" + id );
-
- if ( managedRepositoriesService.getManagedRepository( id ) != null )
- {
- managedRepositoriesService.deleteManagedRepository( id, false );
- }
-
- getManagedRepositoriesService().addManagedRepository( managedRepository );
-
- RemoteRepository remoteRepository = new RemoteRepository();
- remoteRepository.setId( "all-merged" );
- remoteRepository.setName( "all-merged" );
- remoteRepository.setDownloadRemoteIndex( true );
- remoteRepository.setUrl( "http://localhost:" + port + "/repository/test-group" );
- remoteRepository.setRemoteIndexUrl( "http://localhost:" + port + "/repository/test-group/.indexer" );
- remoteRepository.setUserName( RedbackRoleConstants.ADMINISTRATOR_ACCOUNT_NAME );
- remoteRepository.setPassword( FakeCreateAdminService.ADMIN_TEST_PWD );
-
- getRemoteRepositoriesService().addRemoteRepository( remoteRepository );
-
- ProxyConnectorService proxyConnectorService = getProxyConnectorService();
- ProxyConnector proxyConnector = new ProxyConnector();
- proxyConnector.setProxyId( "foo-bar" );
- proxyConnector.setSourceRepoId( id );
- proxyConnector.setTargetRepoId( "all-merged" );
- proxyConnectorService.addProxyConnector( proxyConnector );
-
- repositoriesService.scheduleDownloadRemoteIndex( "all-merged", true, true );
-
- // wait a bit
- timeout = 20000;
- while ( timeout > 0 )
- {
- Thread.sleep( 500 );
- timeout -= 500;
- }
-
- SearchService searchService = getSearchService();
-
- SearchRequest request = new SearchRequest();
- request.setRepositories( Arrays.asList( id ) );
- request.setGroupId( "org.apache.felix" );
-
- List<Artifact> artifacts = searchService.searchArtifacts( request );
- assertFalse( artifacts.isEmpty() );
- assertEquals( 1, artifacts.size() );
- }
-}
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/test/resources/spring-context-artifacts-download.xml b/archiva-modules/archiva-web/archiva-webapp/src/test/resources/spring-context-artifacts-download.xml
deleted file mode 100644
index 2ade48455..000000000
--- a/archiva-modules/archiva-web/archiva-webapp/src/test/resources/spring-context-artifacts-download.xml
+++ /dev/null
@@ -1,55 +0,0 @@
-<?xml version="1.0"?>
-
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one
- ~ or more contributor license agreements. See the NOTICE file
- ~ distributed with this work for additional information
- ~ regarding copyright ownership. The ASF licenses this file
- ~ to you under the Apache License, Version 2.0 (the
- ~ "License"); you may not use this file except in compliance
- ~ with the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing,
- ~ software distributed under the License is distributed on an
- ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- ~ KIND, either express or implied. See the License for the
- ~ specific language governing permissions and limitations
- ~ under the License.
- -->
-
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:context="http://www.springframework.org/schema/context"
- xsi:schemaLocation="http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
- http://www.springframework.org/schema/context
- http://www.springframework.org/schema/context/spring-context-3.0.xsd"
- default-lazy-init="true">
-
- <context:property-placeholder system-properties-mode="OVERRIDE"/>
-
-
- <bean name="commons-configuration" class="org.apache.archiva.redback.components.registry.commons.CommonsConfigurationRegistry">
- <property name="properties">
- <value>
- <![CDATA[
- <configuration>
- <system/>
-
- <xml fileName="${appserver.base}/conf/archiva-test-download-artifacts.xml" config-optional="true"
- config-name="org.apache.archiva.base"
- config-at="org.apache.archiva"/>
-
- <properties fileName="${appserver.base}/conf/security.properties" config-optional="true"
- config-at="org.apache.archiva.redback"/>
- <properties fileName="org/apache/archiva/security.properties" config-at="org.apache.archiva.redback"/>
- </configuration>
- ]]>
- </value>
- </property>
- </bean>
- <bean name="repositorySessionFactory" class="org.apache.archiva.webtest.memory.TestRepositorySessionFactory"/>
-
-</beans>
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/test/resources/spring-context-merge-index-download.xml b/archiva-modules/archiva-web/archiva-webapp/src/test/resources/spring-context-merge-index-download.xml
deleted file mode 100644
index 16b37542d..000000000
--- a/archiva-modules/archiva-web/archiva-webapp/src/test/resources/spring-context-merge-index-download.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-<?xml version="1.0"?>
-
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one
- ~ or more contributor license agreements. See the NOTICE file
- ~ distributed with this work for additional information
- ~ regarding copyright ownership. The ASF licenses this file
- ~ to you under the Apache License, Version 2.0 (the
- ~ "License"); you may not use this file except in compliance
- ~ with the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing,
- ~ software distributed under the License is distributed on an
- ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- ~ KIND, either express or implied. See the License for the
- ~ specific language governing permissions and limitations
- ~ under the License.
- -->
-
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:context="http://www.springframework.org/schema/context"
- xsi:schemaLocation="http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
- http://www.springframework.org/schema/context
- http://www.springframework.org/schema/context/spring-context-3.0.xsd"
- default-lazy-init="true">
-
- <context:property-placeholder system-properties-mode="OVERRIDE"/>
-
-
- <bean name="commons-configuration" class="org.apache.archiva.redback.components.registry.commons.CommonsConfigurationRegistry">
- <property name="properties">
- <value>
- <![CDATA[
- <configuration>
- <system/>
-
- <xml fileName="${appserver.base}/conf/archiva-test-merge-index-download.xml" config-optional="true"
- config-name="org.apache.archiva.base"
- config-at="org.apache.archiva"/>
-
- <properties fileName="${appserver.base}/conf/security.properties" config-optional="true"
- config-at="org.apache.archiva.redback"/>
- <properties fileName="org/apache/archiva/security.properties" config-at="org.apache.archiva.redback"/>
- </configuration>
- ]]>
- </value>
- </property>
- </bean>
-
- <bean name="repositorySessionFactory" class="org.apache.archiva.webtest.memory.TestRepositorySessionFactory"/>
-
-</beans>