summaryrefslogtreecommitdiffstats
path: root/archiva-modules
diff options
context:
space:
mode:
authorEmmanuel Venisse <evenisse@apache.org>2008-06-24 11:56:58 +0000
committerEmmanuel Venisse <evenisse@apache.org>2008-06-24 11:56:58 +0000
commit4537213235c856494ba09865a6a53bc099c719e5 (patch)
tree87f76f8533cea0749586ece990c33550f6d9aa34 /archiva-modules
parent4fe4dc198e8ba22e532fcb17412d1bd9e8999872 (diff)
downloadarchiva-4537213235c856494ba09865a6a53bc099c719e5.tar.gz
archiva-4537213235c856494ba09865a6a53bc099c719e5.zip
[MRM-847] Fix build on windows by using xmlunit to test xml output
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@671144 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules')
-rw-r--r--archiva-modules/archiva-base/archiva-consumers/archiva-dependency-tree-consumer/pom.xml5
-rw-r--r--archiva-modules/archiva-base/archiva-consumers/archiva-dependency-tree-consumer/src/test/java/org/apache/archiva/consumers/dependencytree/DependencyTreeGeneratorConsumerTest.java12
2 files changed, 13 insertions, 4 deletions
diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-dependency-tree-consumer/pom.xml b/archiva-modules/archiva-base/archiva-consumers/archiva-dependency-tree-consumer/pom.xml
index 3ef60354e..6bc87a5d7 100644
--- a/archiva-modules/archiva-base/archiva-consumers/archiva-dependency-tree-consumer/pom.xml
+++ b/archiva-modules/archiva-base/archiva-consumers/archiva-dependency-tree-consumer/pom.xml
@@ -39,5 +39,10 @@
<version>${wagon.version}</version>
<scope>runtime</scope>
</dependency>
+ <dependency>
+ <groupId>xmlunit</groupId>
+ <artifactId>xmlunit</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
</project>
diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-dependency-tree-consumer/src/test/java/org/apache/archiva/consumers/dependencytree/DependencyTreeGeneratorConsumerTest.java b/archiva-modules/archiva-base/archiva-consumers/archiva-dependency-tree-consumer/src/test/java/org/apache/archiva/consumers/dependencytree/DependencyTreeGeneratorConsumerTest.java
index c17d9ea2a..07a9d7ab8 100644
--- a/archiva-modules/archiva-base/archiva-consumers/archiva-dependency-tree-consumer/src/test/java/org/apache/archiva/consumers/dependencytree/DependencyTreeGeneratorConsumerTest.java
+++ b/archiva-modules/archiva-base/archiva-consumers/archiva-dependency-tree-consumer/src/test/java/org/apache/archiva/consumers/dependencytree/DependencyTreeGeneratorConsumerTest.java
@@ -22,6 +22,8 @@ package org.apache.archiva.consumers.dependencytree;
import java.io.File;
import java.io.IOException;
+import javax.xml.parsers.ParserConfigurationException;
+
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
@@ -30,6 +32,8 @@ import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer;
import org.apache.maven.profiles.DefaultProfileManager;
import org.codehaus.plexus.spring.PlexusContainerAdapter;
import org.codehaus.plexus.spring.PlexusInSpringTestCase;
+import org.custommonkey.xmlunit.XMLAssert;
+import org.xml.sax.SAXException;
public class DependencyTreeGeneratorConsumerTest
extends PlexusInSpringTestCase
@@ -65,7 +69,7 @@ public class DependencyTreeGeneratorConsumerTest
}
public void testGenerateBasicTree()
- throws IOException, ConsumerException
+ throws IOException, ConsumerException, ParserConfigurationException, SAXException
{
consumer.beginScan( repository, null );
@@ -73,7 +77,7 @@ public class DependencyTreeGeneratorConsumerTest
consumer.processFile( path );
File generatedFile = new File( generatedRepositoryLocation, path + ".xml" );
- assertEquals( IOUtils.toString( getClass().getResourceAsStream( "/test-data/maven-core-2.0-tree.xml" ) ),
+ XMLAssert.assertXMLEqual( IOUtils.toString( getClass().getResourceAsStream( "/test-data/maven-core-2.0-tree.xml" ) ),
FileUtils.readFileToString( generatedFile ) );
consumer.completeScan();
@@ -101,7 +105,7 @@ public class DependencyTreeGeneratorConsumerTest
}
public void testProfiles()
- throws IOException, ConsumerException
+ throws IOException, ConsumerException, ParserConfigurationException, SAXException
{
PlexusContainerAdapter container = new PlexusContainerAdapter();
container.setApplicationContext( getApplicationContext() );
@@ -114,7 +118,7 @@ public class DependencyTreeGeneratorConsumerTest
consumer.processFile( path );
File generatedFile = new File( generatedRepositoryLocation, path + ".xml" );
- assertEquals( IOUtils.toString( getClass().getResourceAsStream( "/test-data/surefire-testng-2.0-tree.xml" ) ),
+ XMLAssert.assertXMLEqual( IOUtils.toString( getClass().getResourceAsStream( "/test-data/surefire-testng-2.0-tree.xml" ) ),
FileUtils.readFileToString( generatedFile ) );
consumer.completeScan();