Author: xavier
Date: Thu Apr  3 10:14:44 2008
New Revision: 644410

URL: http://svn.apache.org/viewvc?rev=644410&view=rev
Log:
FIX: Ivy silently fails XML errors in ivyrep (IVY-579)

Added:
    ant/ivy/core/trunk/test/repositories/badfile/ivys/ivy-badmodule.xml   
(contents, props changed)
      - copied, changed from r644224, 
ant/ivy/core/trunk/test/repositories/badfile/ivys/ ivy-badmodule.xml
    ant/ivy/core/trunk/test/repositories/badfile/ivys/ivy-badxml.xml   (with 
props)
    ant/ivy/core/trunk/test/repositories/badfile/myorg/mymodule/ivy-badxml.xml  
 (with props)
Removed:
    ant/ivy/core/trunk/test/repositories/badfile/ivys/ ivy-badmodule.xml
Modified:
    ant/ivy/core/trunk/CHANGES.txt
    ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ResolveTest.java
    ant/ivy/core/trunk/test/repositories/badfile/ivys/ivy-badorg.xml
    ant/ivy/core/trunk/test/repositories/badfile/ivys/ivy-badrevision.xml
    
ant/ivy/core/trunk/test/repositories/badfile/myorg/mymodule/ivy-badmodule.xml
    ant/ivy/core/trunk/test/repositories/badfile/myorg/mymodule/ivy-badorg.xml
    
ant/ivy/core/trunk/test/repositories/badfile/myorg/mymodule/ivy-badrevision.xml

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=644410&r1=644409&r2=644410&view=diff
==============================================================================
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Thu Apr  3 10:14:44 2008
@@ -76,6 +76,7 @@
 - IMPROVEMENT: Change allownomd and skipbuildwithoutivy into a more 
semantically correct name (IVY-297)
 - IMPROVEMENT: Smarter determination if an expression is exact or not for 
RegexpPatternMatcher and GlobPatternMatcher
 
+- FIX: Ivy silently fails XML errors in ivyrep (IVY-579)
 - FIX: Extra Attributes are not available to resolver after resolve if cache 
was empty (IVY-773)
 - FIX: NullPointerException during ResovleEngine.downloadArtifacts. (IVY-592)
 - FIX: setting m2compatible on ibiblio resolver overwrite root and pattern 
settings (IVY-437) (thanks to Jing Xue)

Modified: 
ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ResolveTest.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ResolveTest.java?rev=644410&r1=644409&r2=644410&view=diff
==============================================================================
--- ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ResolveTest.java 
(original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ResolveTest.java 
Thu Apr  3 10:14:44 2008
@@ -58,6 +58,7 @@
 import org.apache.ivy.plugins.resolver.FileSystemResolver;
 import org.apache.ivy.util.CacheCleaner;
 import org.apache.ivy.util.FileUtil;
+import org.apache.ivy.util.StringUtils;
 import org.xml.sax.SAXException;
 import org.xml.sax.helpers.DefaultHandler;
 
@@ -2863,27 +2864,26 @@
         Ivy ivy = new Ivy();
         ivy.configure(new File("test/repositories/badfile/ivysettings.xml"));
 
-        try {
-            ivy.resolve(new 
File("test/repositories/badfile/ivys/ivy-badorg.xml").toURL(),
-                getResolveOptions(new String[] {"*"}));
-            fail("bad org should have raised an exception !");
-        } catch (Exception ex) {
-            // OK, it raised an exception
-        }
-        try {
-            ivy.resolve(new 
File("test/repositories/badfile/ivys/ivy-badmodule.xml").toURL(),
-                getResolveOptions(new String[] {"*"}));
-            fail("bad module should have raised an exception !");
-        } catch (Exception ex) {
-            // OK, it raised an exception
-        }
-        try {
-            ivy.resolve(new 
File("test/repositories/badfile/ivys/ivy-badrevision.xml").toURL(),
-                getResolveOptions(new String[] {"*"}));
-            fail("bad revision should have raised an exception !");
-        } catch (Exception ex) {
-            // OK, it raised an exception
-        }
+        ResolveReport report = ivy.resolve(
+            new File("test/repositories/badfile/ivys/ivy-badorg.xml").toURL(),
+            getResolveOptions(new String[] {"*"}));
+        assertTrue("bad org should have raised an error in report", 
report.hasError());
+        assertTrue(StringUtils.join(report.getAllProblemMessages().toArray(), 
"\n").indexOf("'badorg'") != -1);
+        
+        report = ivy.resolve(new 
File("test/repositories/badfile/ivys/ivy-badmodule.xml").toURL(),
+            getResolveOptions(new String[] {"*"}));
+        assertTrue("bad module should have raised an error in report", 
report.hasError());
+        assertTrue(StringUtils.join(report.getAllProblemMessages().toArray(), 
"\n").indexOf("'badmodule'") != -1);
+
+        report = ivy.resolve(new 
File("test/repositories/badfile/ivys/ivy-badrevision.xml").toURL(),
+            getResolveOptions(new String[] {"*"}));
+        assertTrue("bad revision should have raised an error in report", 
report.hasError());
+        assertTrue(StringUtils.join(report.getAllProblemMessages().toArray(), 
"\n").indexOf("'badrevision'") != -1);
+        
+        report = ivy.resolve(new 
File("test/repositories/badfile/ivys/ivy-badxml.xml").toURL(),
+            getResolveOptions(new String[] {"*"}));
+        assertTrue("bad xml should have raised an error in report", 
report.hasError());
+        assertTrue(StringUtils.join(report.getAllProblemMessages().toArray(), 
"\n").indexOf("badatt") != -1);
     }
 
     public void testTransitiveSetting() throws Exception {

Copied: ant/ivy/core/trunk/test/repositories/badfile/ivys/ivy-badmodule.xml 
(from r644224, ant/ivy/core/trunk/test/repositories/badfile/ivys/ 
ivy-badmodule.xml)
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/badfile/ivys/ivy-badmodule.xml?p2=ant/ivy/core/trunk/test/repositories/badfile/ivys/ivy-badmodule.xml&p1=ant/ivy/core/trunk/test/repositories/badfile/ivys/%20ivy-badmodule.xml&r1=644224&r2=644410&rev=644410&view=diff
==============================================================================
--- ant/ivy/core/trunk/test/repositories/badfile/ivys/ ivy-badmodule.xml 
(original)
+++ ant/ivy/core/trunk/test/repositories/badfile/ivys/ivy-badmodule.xml Thu Apr 
 3 10:14:44 2008
@@ -17,8 +17,8 @@
    under the License.    
 -->
 <ivy-module version="1.0">
-    <info organisation="apache" name="test-badorg"/>
+    <info organisation="apache" module="test-badmodule"/>
     <dependencies>
-               <dependency org="myorg" name="mymodule" rev="badorg"/>
+               <dependency org="myorg" name="mymodule" rev="badmodule"/>
     </dependencies>
 </ivy-module>

Propchange: ant/ivy/core/trunk/test/repositories/badfile/ivys/ivy-badmodule.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: ant/ivy/core/trunk/test/repositories/badfile/ivys/ivy-badorg.xml
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/badfile/ivys/ivy-badorg.xml?rev=644410&r1=644409&r2=644410&view=diff
==============================================================================
--- ant/ivy/core/trunk/test/repositories/badfile/ivys/ivy-badorg.xml (original)
+++ ant/ivy/core/trunk/test/repositories/badfile/ivys/ivy-badorg.xml Thu Apr  3 
10:14:44 2008
@@ -17,7 +17,7 @@
    under the License.    
 -->
 <ivy-module version="1.0">
-    <info organisation="apache" name="test-badorg"/>
+    <info organisation="apache" module="test-badorg"/>
     <dependencies>
                <dependency org="myorg" name="mymodule" rev="badorg"/>
     </dependencies>

Modified: ant/ivy/core/trunk/test/repositories/badfile/ivys/ivy-badrevision.xml
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/badfile/ivys/ivy-badrevision.xml?rev=644410&r1=644409&r2=644410&view=diff
==============================================================================
--- ant/ivy/core/trunk/test/repositories/badfile/ivys/ivy-badrevision.xml 
(original)
+++ ant/ivy/core/trunk/test/repositories/badfile/ivys/ivy-badrevision.xml Thu 
Apr  3 10:14:44 2008
@@ -17,8 +17,8 @@
    under the License.    
 -->
 <ivy-module version="1.0">
-    <info organisation="apache" name="test-badorg"/>
+    <info organisation="apache" module="test-badrevision"/>
     <dependencies>
-               <dependency org="myorg" name="mymodule" rev="badorg"/>
+               <dependency org="myorg" name="mymodule" rev="badrevision"/>
     </dependencies>
 </ivy-module>

Added: ant/ivy/core/trunk/test/repositories/badfile/ivys/ivy-badxml.xml
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/badfile/ivys/ivy-badxml.xml?rev=644410&view=auto
==============================================================================
--- ant/ivy/core/trunk/test/repositories/badfile/ivys/ivy-badxml.xml (added)
+++ ant/ivy/core/trunk/test/repositories/badfile/ivys/ivy-badxml.xml Thu Apr  3 
10:14:44 2008
@@ -0,0 +1,24 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.    
+-->
+<ivy-module version="1.0">
+    <info organisation="apache" module="test-badxml"/>
+    <dependencies>
+               <dependency org="myorg" name="mymodule" rev="badxml"/>
+    </dependencies>
+</ivy-module>

Propchange: ant/ivy/core/trunk/test/repositories/badfile/ivys/ivy-badxml.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ant/ivy/core/trunk/test/repositories/badfile/ivys/ivy-badxml.xml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: 
ant/ivy/core/trunk/test/repositories/badfile/myorg/mymodule/ivy-badmodule.xml
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/badfile/myorg/mymodule/ivy-badmodule.xml?rev=644410&r1=644409&r2=644410&view=diff
==============================================================================
--- 
ant/ivy/core/trunk/test/repositories/badfile/myorg/mymodule/ivy-badmodule.xml 
(original)
+++ 
ant/ivy/core/trunk/test/repositories/badfile/myorg/mymodule/ivy-badmodule.xml 
Thu Apr  3 10:14:44 2008
@@ -17,5 +17,5 @@
    under the License.    
 -->
 <ivy-module version="1.1">
-       <info organisation="myorg" name="badmodule" revision="badmodule"/>
+       <info organisation="myorg" module="badmodule" revision="badmodule"/>
 </ivy-module>

Modified: 
ant/ivy/core/trunk/test/repositories/badfile/myorg/mymodule/ivy-badorg.xml
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/badfile/myorg/mymodule/ivy-badorg.xml?rev=644410&r1=644409&r2=644410&view=diff
==============================================================================
--- ant/ivy/core/trunk/test/repositories/badfile/myorg/mymodule/ivy-badorg.xml 
(original)
+++ ant/ivy/core/trunk/test/repositories/badfile/myorg/mymodule/ivy-badorg.xml 
Thu Apr  3 10:14:44 2008
@@ -17,5 +17,5 @@
    under the License.    
 -->
 <ivy-module version="1.1">
-       <info organisation="badorg" name="mymodule" revision="badorg"/>
+       <info organisation="badorg" module="mymodule" revision="badorg"/>
 </ivy-module>

Modified: 
ant/ivy/core/trunk/test/repositories/badfile/myorg/mymodule/ivy-badrevision.xml
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/badfile/myorg/mymodule/ivy-badrevision.xml?rev=644410&r1=644409&r2=644410&view=diff
==============================================================================
--- 
ant/ivy/core/trunk/test/repositories/badfile/myorg/mymodule/ivy-badrevision.xml 
(original)
+++ 
ant/ivy/core/trunk/test/repositories/badfile/myorg/mymodule/ivy-badrevision.xml 
Thu Apr  3 10:14:44 2008
@@ -17,5 +17,5 @@
    under the License.    
 -->
 <ivy-module version="1.1">
-       <info organisation="myorg" name="mymodule" revision="1.0"/>
+       <info organisation="myorg" module="mymodule" revision="1.0"/>
 </ivy-module>

Added: 
ant/ivy/core/trunk/test/repositories/badfile/myorg/mymodule/ivy-badxml.xml
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/badfile/myorg/mymodule/ivy-badxml.xml?rev=644410&view=auto
==============================================================================
--- ant/ivy/core/trunk/test/repositories/badfile/myorg/mymodule/ivy-badxml.xml 
(added)
+++ ant/ivy/core/trunk/test/repositories/badfile/myorg/mymodule/ivy-badxml.xml 
Thu Apr  3 10:14:44 2008
@@ -0,0 +1,21 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.    
+-->
+<ivy-module version="1.1">
+       <info organisation="myorg" name="mymodule" revision="badxml" 
badatt="invalid"/>
+</ivy-module>

Propchange: 
ant/ivy/core/trunk/test/repositories/badfile/myorg/mymodule/ivy-badxml.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
ant/ivy/core/trunk/test/repositories/badfile/myorg/mymodule/ivy-badxml.xml
------------------------------------------------------------------------------
    svn:mime-type = text/plain


Reply via email to