Author: maartenc
Date: Thu Mar 20 13:26:32 2008
New Revision: 639439

URL: http://svn.apache.org/viewvc?rev=639439&view=rev
Log:
JUnit tests didn't compile anymore on JDK1.4

Modified:
    
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/AbstractModuleDescriptorParserTester.java
    
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java
    
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParserTest.java

Modified: 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/AbstractModuleDescriptorParserTester.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/AbstractModuleDescriptorParserTester.java?rev=639439&r1=639438&r2=639439&view=diff
==============================================================================
--- 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/AbstractModuleDescriptorParserTester.java
 (original)
+++ 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/AbstractModuleDescriptorParserTester.java
 Thu Mar 20 13:26:32 2008
@@ -57,6 +57,30 @@
             assertTrue("artifact not found: " + artifactsNames[i], found);
         }
     }
+    
+    
+    protected static String convertEOL(String str) {
+        StringBuffer buffer = new StringBuffer();
+
+        char[] chars = str.toCharArray();
+        char last = ' ';
+        for (int i = 0; i < chars.length; i++) {
+            if ((chars[i] == '\r') && (last == '\n')) {
+                last = '\r';
+                continue; 
+            }
+            if (chars[i] == '\r') {
+                buffer.append('\n');
+            } else {
+                buffer.append(chars[i]);
+            }
+            last = chars[i];
+        }
+        
+        return buffer.toString();
+    }
+
+
 
     protected void assertDependencyArtifacts(DependencyDescriptor dd, String[] 
confs,
             String[] artifactsNames) {

Modified: 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java?rev=639439&r1=639438&r2=639439&view=diff
==============================================================================
--- 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java
 (original)
+++ 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java
 Thu Mar 20 13:26:32 2008
@@ -478,9 +478,8 @@
                        + "framework. It is designed\n        as a 
light-weight, event-driven component " 
                        + "technology that handles communication with disparate 
systems\n        " 
                        + "transparently providing a simple component 
interface.", 
-                       md.getDescription().replace("\n\r", "\n").replace("\r", 
"\n"));
+                       convertEOL(md.getDescription()));
     }
-
     
     public void testDependencyManagment() throws ParseException, IOException {
         ModuleDescriptor md = 
PomModuleDescriptorParser.getInstance().parseDescriptor(

Modified: 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParserTest.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParserTest.java?rev=639439&r1=639438&r2=639439&view=diff
==============================================================================
--- 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParserTest.java
 (original)
+++ 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParserTest.java
 Thu Mar 20 13:26:32 2008
@@ -207,7 +207,7 @@
         assertEquals("This module is <b>great</b> !<br/>\n\t"
                        + "You can use it especially with myconf1 and myconf2, "
                        + "and myconf4 is not too bad too.", 
-                       md.getDescription().replace("\n\r", "\n").replace("\r", 
"\n"));
+                       convertEOL(md.getDescription()));
         
         assertEquals(1, md.getExtraInfo().size());
         assertEquals("56576", md.getExtraInfo().get("e:someExtra"));


Reply via email to