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;
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
}
public void testGenerateBasicTree()
- throws IOException, ConsumerException
+ throws IOException, ConsumerException, ParserConfigurationException, SAXException
{
consumer.beginScan( repository, null );
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();
}
public void testProfiles()
- throws IOException, ConsumerException
+ throws IOException, ConsumerException, ParserConfigurationException, SAXException
{
PlexusContainerAdapter container = new PlexusContainerAdapter();
container.setApplicationContext( getApplicationContext() );
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();