]> source.dussan.org Git - archiva.git/commitdiff
Making unit tests more resilient on windows.
authorJoakim Erdfelt <joakime@apache.org>
Thu, 26 Apr 2007 15:12:49 +0000 (15:12 +0000)
committerJoakim Erdfelt <joakime@apache.org>
Thu, 26 Apr 2007 15:12:49 +0000 (15:12 +0000)
git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/branches/archiva-jpox-database-refactor@532776 13f79535-47bb-0310-9956-ffa450edef68

archiva-base/archiva-xml-tools/src/test/java/org/apache/maven/archiva/xml/XMLWriterTest.java

index a3d59d9b998ce838e4588f3d5e6b938c7f7ca58b..7841418a6ff9cca2247b3476a1abcfb4f0d251ab 100644 (file)
@@ -19,7 +19,6 @@ package org.apache.maven.archiva.xml;
  * under the License.
  */
 
-import org.codehaus.plexus.util.FileUtils;
 import org.dom4j.Document;
 import org.dom4j.DocumentHelper;
 import org.dom4j.Element;
@@ -38,7 +37,16 @@ public class XMLWriterTest
     public void testWrite()
         throws Exception
     {
-        String expectedResults = FileUtils.fileRead( getExampleXml( "prolog-with-utf8.xml" ) );
+        StringBuffer expected = new StringBuffer();
+
+        expected.append( "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" );
+        expected.append( "\n" );
+        expected.append( "<basic>\n" );
+        expected.append( "  <names>\n" );
+        expected.append( "    <name>" ).append( TRYGVIS ).append( "</name>\n" );
+        expected.append( "    <name>" ).append( INFINITE_ARCHIVA ).append( "</name>\n" );
+        expected.append( "  </names>\n" );
+        expected.append( "</basic>\n" );
 
         Element basic = DocumentHelper.createElement( "basic" );
         Document doc = DocumentHelper.createDocument( basic );
@@ -50,6 +58,6 @@ public class XMLWriterTest
         StringWriter actual = new StringWriter();
         XMLWriter.write( doc, actual );
 
-        assertEquals( "Comparision of contents:", expectedResults, actual.toString() );
+        assertEquals( "Comparision of contents:", expected.toString(), actual.toString() );
     }
 }