incubator-ivy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xav...@apache.org
Subject svn commit: r534012 - in /incubator/ivy/core/trunk: src/java/org/apache/ivy/ant/IvyInstall.java test/java/org/apache/ivy/ant/IvyInstallTest.java
Date Tue, 01 May 2007 11:30:07 GMT
Author: xavier
Date: Tue May  1 04:30:06 2007
New Revision: 534012

URL: http://svn.apache.org/viewvc?view=rev&rev=534012
Log:
FIX: ivy:install ant task does not fail on error (IVY-475)
use haltonfailure instead of haltonunresolved, and halt in case of any failure

Modified:
    incubator/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyInstall.java
    incubator/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyInstallTest.java

Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyInstall.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyInstall.java?view=diff&rev=534012&r1=534011&r2=534012
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyInstall.java (original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyInstall.java Tue May  1 04:30:06
2007
@@ -46,7 +46,7 @@
     private boolean _transitive;
     private String _type;
     private String _matcher = PatternMatcher.EXACT;
-    private boolean _haltOnUnresolved = true;
+    private boolean _haltOnFailure = true;
     
     public void execute() throws BuildException {
         Ivy ivy = getIvyInstance();
@@ -81,17 +81,16 @@
             throw new BuildException("impossible to install "+ mrid +": "+e, e);
         }
         
-        if (report.getUnresolvedDependencies().length > 0 && isHaltonunresolved())
{
-            throw new BuildException(report.getUnresolvedDependencies().length
-            		+" unresolved dependencies - see output for details");
+        if (report.hasError() && isHaltonfailure()) {
+            throw new BuildException("Problem happened while installing modules - see output
for details");
         }
     }
     
-    public boolean isHaltonunresolved() {
-        return _haltOnUnresolved;
+    public boolean isHaltonfailure() {
+        return _haltOnFailure;
     }
-    public void setHaltonunresolved(boolean haltOnUnresolved) {
-        _haltOnUnresolved = haltOnUnresolved;
+    public void setHaltonfailure(boolean haltOnFailure) {
+        _haltOnFailure = haltOnFailure;
     }
     
     public File getCache() {

Modified: incubator/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyInstallTest.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyInstallTest.java?view=diff&rev=534012&r1=534011&r2=534012
==============================================================================
--- incubator/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyInstallTest.java (original)
+++ incubator/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyInstallTest.java Tue May  1 04:30:06
2007
@@ -78,9 +78,6 @@
             fail("unknown dependency, failure expected (haltunresolved=true)");
         } catch (BuildException be) {
             // success
-            assertTrue("invalid exception message, it should contain '1 unresolved',"
-            		+" but it's: '"+be.getMessage()+"'", 
-            		be.getMessage().indexOf("1 unresolved") != -1);
         }  
     }
 
@@ -90,7 +87,7 @@
         _install.setRevision("zzz");
         _install.setFrom("test");
         _install.setTo("1");
-        _install.setHaltonunresolved(false);
+        _install.setHaltonfailure(false);
         
         try {
             _install.execute();



Mime
View raw message