db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bpendle...@apache.org
Subject svn commit: r911999 - in /db/derby/code/trunk: build.xml java/build/org/apache/derbyBuild/MessageBundleTest.java
Date Fri, 19 Feb 2010 21:52:31 GMT
Author: bpendleton
Date: Fri Feb 19 21:52:31 2010
New Revision: 911999

URL: http://svn.apache.org/viewvc?rev=911999&view=rev
Log:
DERBY-4341: Building with a different CLASSPATH causes runmessagecheck to fail.

This change was contributed by John Storta Jr. (js at storta dot net)

The problem was that running the MessageBundleTest as an Ant task made
it hard for us to control the exact CLASSPATH that was used, because
Ant tasks always are affected by the overall CLASSPATH that is being
used for the Ant process.

The change converts MessageBundleTest from an Ant task to a standalone Java
program, and changes the runmessagecheck target in the top-level build.xml
to run MessageBundleTest in a separate JVM with fork=true so that the
CLASSPATH setting can be exactly controlled.

Modified:
    db/derby/code/trunk/build.xml
    db/derby/code/trunk/java/build/org/apache/derbyBuild/MessageBundleTest.java

Modified: db/derby/code/trunk/build.xml
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/build.xml?rev=911999&r1=911998&r2=911999&view=diff
==============================================================================
--- db/derby/code/trunk/build.xml (original)
+++ db/derby/code/trunk/build.xml Fri Feb 19 21:52:31 2010
@@ -507,12 +507,11 @@
 
   <!-- Run the MessageBundleTest -->
   <target name="runmessagecheck">
-    <taskdef 
-      name="runMessageBundleTest"
-      classname="org.apache.derbyBuild.MessageBundleTest"
-      classpath="${out.dir}"
-    />
-    <runMessageBundleTest/>
+    <java   fork="true" 
+       classname="org.apache.derbyBuild.MessageBundleTest"
+     failonerror="true"
+       classpath="${out.dir}"
+     />
   </target>
 
 <!-- ==================================================================== -->

Modified: db/derby/code/trunk/java/build/org/apache/derbyBuild/MessageBundleTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/build/org/apache/derbyBuild/MessageBundleTest.java?rev=911999&r1=911998&r2=911999&view=diff
==============================================================================
--- db/derby/code/trunk/java/build/org/apache/derbyBuild/MessageBundleTest.java (original)
+++ db/derby/code/trunk/java/build/org/apache/derbyBuild/MessageBundleTest.java Fri Feb 19
21:52:31 2010
@@ -30,8 +30,7 @@
 import java.util.Locale;
 import java.util.Iterator;
 
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Task;
+import java.lang.Exception;
 
 
 /**
@@ -42,7 +41,7 @@
  * that don't have matching ids in the SQLState and MessageId files.   The
  * first is a bug, the second is something to be aware of.
  */
-public class MessageBundleTest extends Task {
+public class MessageBundleTest {
 
     static boolean failbuild = false;
 
@@ -54,7 +53,7 @@
     public MessageBundleTest()
     {}
     
-    public void execute() throws BuildException
+    public static void main(String [] args) throws Exception
     {
         MessageBundleTest t = new MessageBundleTest();
         try {
@@ -66,7 +65,7 @@
             e.printStackTrace();
         }
         if (failbuild) 
-            throw new BuildException("Message check failed. \n" +
+            throw new Exception("Message check failed. \n" +
                 "See error in build output or call ant runmessagecheck.");
     }    
     



Mime
View raw message