Author: jsong
Date: Wed Apr 27 16:23:13 2005
New Revision: 165066

URL: http://svn.apache.org/viewcvs?rev=165066&view=rev
Log:
Fix for BEEHIVE-575

Contributed by Joe Pemberton


Modified:
    incubator/beehive/trunk/controls/test/build.xml
    incubator/beehive/trunk/controls/test/infra/mantis/mantis.jar
    
incubator/beehive/trunk/controls/test/tools/mantis/src/org/apache/beehive/test/tools/mantis/MantisTask.java

Modified: incubator/beehive/trunk/controls/test/build.xml
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/test/build.xml?rev=165066&r1=165065&r2=165066&view=diff
==============================================================================
--- incubator/beehive/trunk/controls/test/build.xml (original)
+++ incubator/beehive/trunk/controls/test/build.xml Wed Apr 27 16:23:13 2005
@@ -424,7 +424,7 @@
             classpathref="tch.run.classpath"
             failureproperty="run.failed"
             dir="${controls.test.root}"
-       inheritall="true">
+         inheritall="true">
 
              <arg value="-emacs"/>
              <property name="tch.replication.entry-point" value="ant -f 
${controls.test.root}/build.xml run"/>
@@ -469,7 +469,8 @@
                logdir="${mantis.tch.log.dir}"
                config="${mantis.config}"
                timeout="10000"
-               aptcommand="${os.JAVA_HOME}/bin/apt">
+               aptcommand="${os.JAVA_HOME}/bin/apt"
+        failonerror="true">
        <include 
name="${mantis.milton.control.test.accessers.relative}/**/*.java"/>
        <include name="src/units/**/*.java"/>
        </mantis>
@@ -489,7 +490,8 @@
                timeout="10000"
                
processor="org.apache.beehive.test.tools.milton.mantis.MiltonProcessor"
                
processorArgs="webapp.name=${controls.test.webapp.name},accesser.src.gendir=${milton.accesser.src.gendir},webapp.gen.dir=${controls.webapp.dir.name}"
-               aptcommand="${os.JAVA_HOME}/bin/apt"/>
+               aptcommand="${os.JAVA_HOME}/bin/apt"
+        failonerror="true"/>
   </target>
 
 </project>

Modified: incubator/beehive/trunk/controls/test/infra/mantis/mantis.jar
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/test/infra/mantis/mantis.jar?rev=165066&r1=165065&r2=165066&view=diff
==============================================================================
Binary files - no diff available.

Modified: 
incubator/beehive/trunk/controls/test/tools/mantis/src/org/apache/beehive/test/tools/mantis/MantisTask.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/test/tools/mantis/src/org/apache/beehive/test/tools/mantis/MantisTask.java?rev=165066&r1=165065&r2=165066&view=diff
==============================================================================
--- 
incubator/beehive/trunk/controls/test/tools/mantis/src/org/apache/beehive/test/tools/mantis/MantisTask.java
 (original)
+++ 
incubator/beehive/trunk/controls/test/tools/mantis/src/org/apache/beehive/test/tools/mantis/MantisTask.java
 Wed Apr 27 16:23:13 2005
@@ -31,6 +31,9 @@
   // use _srcgen if not provided
   private String _logdir = null;
 
+  // Default value for failonerror
+  private boolean _failonerror = true;
+
   // setters for attributes
   public void setSrcdir(String p_srcdir)
   {
@@ -70,8 +73,7 @@
 
   public void setProcessor(String p_processor)
   {
-    _processor = p_processor;
-  }
+    _processor = p_processor; }
   
   public void setProcessorArgs(String p_procargs)
   {
@@ -88,6 +90,11 @@
     _timeout = p_timeout;
   }
 
+  public void setFailonerror(boolean p_failonerror)
+  {
+    _failonerror = p_failonerror;
+  }
+
   public void execute() throws BuildException
   {
     // create the file of all files to process
@@ -98,6 +105,7 @@
     DirectoryScanner scanner = getDirectoryScanner(new File(_srcdir));
     String[] files = scanner.getIncludedFiles();
     String filename = _srcgen+P+"files.txt";
+    int returnCode = 0;
     try
     {
       FileWriter writer = new FileWriter(new File(filename));
@@ -157,7 +165,8 @@
     {
       Process p = Runtime.getRuntime().exec(cmd.toString());
       logStreams(p);
-      System.out.println("RETURN: "+p.waitFor());
+      returnCode = p.waitFor();
+      System.out.println("RETURN: "+returnCode);
     }
     catch(IOException ioe)
     {
@@ -169,6 +178,8 @@
       ie.printStackTrace();
       System.out.println("ERROR: InterruptedException during apt execution");
     }
+    if (_failonerror && returnCode != 0)
+      throw new BuildException("Mantis returned exit code: " + returnCode);
   }
 
   private void logStreams(Process p_proc) throws 
IOException,InterruptedException


Reply via email to