aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrett Porter <brett@apache.org>2014-07-30 14:34:42 +1000
committerBrett Porter <brett@apache.org>2014-07-30 14:34:42 +1000
commit54f97d54cb262f628041b042adb31cc2add21533 (patch)
treeba1b5e0df3fa1ed7850529ac7687f741e91ab99d
parentc329113c529d8cd87cba757d41ae60ba3c4302a2 (diff)
downloadarchiva-54f97d54cb262f628041b042adb31cc2add21533.tar.gz
archiva-54f97d54cb262f628041b042adb31cc2add21533.zip
fix merge of converters
The test files in artifact converter had been adjusted, and need to merge the spring context. Also make the artifactConverter injection more specific to avoid picking up those defined for tests
-rw-r--r--archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/archiva/converter/legacy/LegacyConverterArtifactConsumer.java2
-rw-r--r--archiva-modules/archiva-base/archiva-converter/src/test/expected-files/converted-v3-snapshot.pom3
-rw-r--r--archiva-modules/archiva-base/archiva-converter/src/test/expected-files/converted-v3-timestamped-snapshot.pom3
-rw-r--r--archiva-modules/archiva-base/archiva-converter/src/test/expected-files/converted-v3-warnings.pom3
-rw-r--r--archiva-modules/archiva-base/archiva-converter/src/test/expected-files/converted-v3.pom3
-rw-r--r--archiva-modules/archiva-base/archiva-converter/src/test/expected-files/relocated-test/relocated-v3artifact/1.0.0/relocated-v3artifact-1.0.0.pom3
-rw-r--r--archiva-modules/archiva-base/archiva-converter/src/test/expected-files/test/relocated-v3artifact/1.0.0/relocated-v3artifact-1.0.0.pom3
-rw-r--r--archiva-modules/archiva-base/archiva-converter/src/test/resources/spring-context.xml16
8 files changed, 25 insertions, 11 deletions
diff --git a/archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/archiva/converter/legacy/LegacyConverterArtifactConsumer.java b/archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/archiva/converter/legacy/LegacyConverterArtifactConsumer.java
index ff15d3b1f..dc1b08126 100644
--- a/archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/archiva/converter/legacy/LegacyConverterArtifactConsumer.java
+++ b/archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/archiva/converter/legacy/LegacyConverterArtifactConsumer.java
@@ -40,6 +40,7 @@ import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;
import javax.inject.Inject;
+import javax.inject.Named;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@@ -59,6 +60,7 @@ public class LegacyConverterArtifactConsumer
private Logger log = LoggerFactory.getLogger( LegacyConverterArtifactConsumer.class );
@Inject
+ @Named("artifactConverter#legacy-to-default")
private ArtifactConverter artifactConverter;
private ArtifactFactory artifactFactory;
diff --git a/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/converted-v3-snapshot.pom b/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/converted-v3-snapshot.pom
index 1615b6663..f03b5a53f 100644
--- a/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/converted-v3-snapshot.pom
+++ b/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/converted-v3-snapshot.pom
@@ -1,4 +1,5 @@
-<project>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>test</groupId>
<artifactId>v3artifact</artifactId>
diff --git a/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/converted-v3-timestamped-snapshot.pom b/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/converted-v3-timestamped-snapshot.pom
index 94307d863..1c56340b0 100644
--- a/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/converted-v3-timestamped-snapshot.pom
+++ b/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/converted-v3-timestamped-snapshot.pom
@@ -1,4 +1,5 @@
-<project>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>test</groupId>
<artifactId>v3artifact</artifactId>
diff --git a/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/converted-v3-warnings.pom b/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/converted-v3-warnings.pom
index 25f4e76d0..bdd22765f 100644
--- a/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/converted-v3-warnings.pom
+++ b/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/converted-v3-warnings.pom
@@ -1,4 +1,5 @@
-<project>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>test</groupId>
<artifactId>v3-warnings-artifact</artifactId>
diff --git a/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/converted-v3.pom b/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/converted-v3.pom
index 9f8b63e16..df4700c04 100644
--- a/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/converted-v3.pom
+++ b/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/converted-v3.pom
@@ -1,4 +1,5 @@
-<project>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>test</groupId>
<artifactId>v3artifact</artifactId>
diff --git a/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/relocated-test/relocated-v3artifact/1.0.0/relocated-v3artifact-1.0.0.pom b/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/relocated-test/relocated-v3artifact/1.0.0/relocated-v3artifact-1.0.0.pom
index 0180549f0..3f5df2267 100644
--- a/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/relocated-test/relocated-v3artifact/1.0.0/relocated-v3artifact-1.0.0.pom
+++ b/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/relocated-test/relocated-v3artifact/1.0.0/relocated-v3artifact-1.0.0.pom
@@ -1,4 +1,5 @@
-<project>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>relocated-test</groupId>
<artifactId>relocated-v3artifact</artifactId>
diff --git a/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/test/relocated-v3artifact/1.0.0/relocated-v3artifact-1.0.0.pom b/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/test/relocated-v3artifact/1.0.0/relocated-v3artifact-1.0.0.pom
index b20f62f9e..4efefb741 100644
--- a/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/test/relocated-v3artifact/1.0.0/relocated-v3artifact-1.0.0.pom
+++ b/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/test/relocated-v3artifact/1.0.0/relocated-v3artifact-1.0.0.pom
@@ -1,4 +1,5 @@
-<project>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<groupId>test</groupId>
<artifactId>relocated-v3artifact</artifactId>
<version>1.0.0</version>
diff --git a/archiva-modules/archiva-base/archiva-converter/src/test/resources/spring-context.xml b/archiva-modules/archiva-base/archiva-converter/src/test/resources/spring-context.xml
index b679284d8..69187cb7c 100644
--- a/archiva-modules/archiva-base/archiva-converter/src/test/resources/spring-context.xml
+++ b/archiva-modules/archiva-base/archiva-converter/src/test/resources/spring-context.xml
@@ -20,12 +20,18 @@
-->
<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">
+ http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
+
+ <bean name="artifactConverter#force-repository-converter" class="org.apache.archiva.converter.artifact.LegacyToDefaultConverter">
+ <property name="force" value="true"/>
+ <property name="dryrun" value="false"/>
+ </bean>
+
+ <bean name="artifactConverter#dryrun-repository-converter" class="org.apache.archiva.converter.artifact.LegacyToDefaultConverter">
+ <property name="force" value="false"/>
+ <property name="dryrun" value="true"/>
+ </bean>
<bean name="mockArchivaAdministration" class="org.apache.archiva.converter.mock.MockArchivaAdministration"/>