ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject cvs commit: jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs/optional TraXLiaisonTest.java
Date Fri, 08 Mar 2002 11:16:14 GMT
bodewig     02/03/08 03:16:14

  Modified:    .        build.xml
               src/main/org/apache/tools/ant AntClassLoader.java
               src/main/org/apache/tools/ant/taskdefs/optional
                        TraXLiaison.java
               src/main/org/apache/tools/ant/taskdefs/optional/junit
                        JUnitTask.java
               src/testcases/org/apache/tools/ant/taskdefs/optional
                        TraXLiaisonTest.java
  Log:
  give conext classloaders in <junit> another try, catch Xalan errors in
  TraxLiaisonTest.
  
  Revision  Changes    Path
  1.262     +1 -1      jakarta-ant/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/build.xml,v
  retrieving revision 1.261
  retrieving revision 1.262
  diff -u -r1.261 -r1.262
  --- build.xml	8 Mar 2002 08:34:19 -0000	1.261
  +++ build.xml	8 Mar 2002 11:16:13 -0000	1.262
  @@ -131,7 +131,7 @@
                unless="jdk1.2+" />
       <!-- uses the context classloader -->
       <exclude name="${optional.package}/junit/JUnitClassLoaderTest.java"
  -             />
  +             unless="jdk1.2+" />
     </patternset>
     <patternset id="needs.jdk1.3+">
       <exclude name="${ant.package}/taskdefs/TestProcess.java"
  
  
  
  1.44      +6 -1      jakarta-ant/src/main/org/apache/tools/ant/AntClassLoader.java
  
  Index: AntClassLoader.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/AntClassLoader.java,v
  retrieving revision 1.43
  retrieving revision 1.44
  diff -u -r1.43 -r1.44
  --- AntClassLoader.java	25 Feb 2002 15:04:23 -0000	1.43
  +++ AntClassLoader.java	8 Mar 2002 11:16:14 -0000	1.44
  @@ -402,7 +402,12 @@
               try {
                   savedContextLoader
                       = (ClassLoader)getContextClassLoader.invoke(Thread.currentThread(),
new Object[0]);
  -                Object[] args = new Object[] {this};
  +                Object[] args = null;
  +                if ("only".equals(project.getProperty("build.sysclasspath"))) {
  +                    args = new Object[] {this.getClass().getClassLoader()};
  +                } else {
  +                    args = new Object[] {this};
  +                }
                   setContextClassLoader.invoke(Thread.currentThread(), args);
                   isContextLoaderSaved = true;
               }
  
  
  
  1.14      +4 -0      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/TraXLiaison.java
  
  Index: TraXLiaison.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/TraXLiaison.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- TraXLiaison.java	5 Mar 2002 13:49:46 -0000	1.13
  +++ TraXLiaison.java	8 Mar 2002 11:16:14 -0000	1.14
  @@ -226,6 +226,10 @@
       }
       
       private void logError(TransformerException e, String type) {
  +        if (logger == null) {
  +            return;
  +        }
  +        
           StringBuffer msg = new StringBuffer();
           if(e.getLocator() != null) {
               if(e.getLocator().getSystemId() != null) {
  
  
  
  1.38      +3 -3      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java
  
  Index: JUnitTask.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -u -r1.37 -r1.38
  --- JUnitTask.java	26 Feb 2002 10:11:19 -0000	1.37
  +++ JUnitTask.java	8 Mar 2002 11:16:14 -0000	1.38
  @@ -141,7 +141,7 @@
    * @author <a href="mailto:Gerrit.Riessen@web.de">Gerrit Riessen</a>
    * @author <a href="mailto:ehatcher@apache.org">Erik Hatcher</a>
    *
  - * @version $Revision: 1.37 $
  + * @version $Revision: 1.38 $
    *
    * @see JUnitTest
    * @see BatchTest
  @@ -642,7 +642,7 @@
                   cl.addSystemPackageRoot("junit");
                   // will cause trouble in JDK 1.1 if omitted
                   cl.addSystemPackageRoot("org.apache.tools.ant");
  -                //cl.setThreadContextLoader();
  +                cl.setThreadContextLoader();
               }
               runner = new JUnitTestRunner(test, test.getHaltonerror(), test.getFiltertrace(),
test.getHaltonfailure(), cl);
               if (summary) {
  @@ -673,7 +673,7 @@
               if (sysProperties != null) {
                   sysProperties.restoreSystem();
               }
  -            //cl.resetThreadContextLoader();
  +            cl.resetThreadContextLoader();
           }
       }
   
  
  
  
  1.8       +13 -2     jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs/optional/TraXLiaisonTest.java
  
  Index: TraXLiaisonTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs/optional/TraXLiaisonTest.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- TraXLiaisonTest.java	15 Feb 2002 17:08:18 -0000	1.7
  +++ TraXLiaisonTest.java	8 Mar 2002 11:16:14 -0000	1.8
  @@ -1,11 +1,14 @@
   package org.apache.tools.ant.taskdefs.optional;
   
   import org.apache.tools.ant.taskdefs.XSLTLiaison;
  +import org.apache.tools.ant.taskdefs.XSLTLogger;
   import org.apache.tools.ant.taskdefs.condition.Os;
   import org.apache.tools.ant.BuildException;
   
   import java.io.File;
   
  +import junit.framework.AssertionFailedError;
  +
   /* 
    * The Apache Software License, Version 1.1
    *
  @@ -65,7 +68,9 @@
    * TraX XSLTLiaison testcase
    * @author <a href="mailto:sbailliez@apache.org">Stephane Bailliez</a>
    */
  -public class TraXLiaisonTest extends AbstractXSLTLiaisonTest {
  +public class TraXLiaisonTest extends AbstractXSLTLiaisonTest 
  +    implements XSLTLogger {
  +
       public TraXLiaisonTest(String name){
           super(name);
       }
  @@ -78,7 +83,9 @@
       }
   
       public XSLTLiaison createLiaison() throws Exception {
  -        return new TraXLiaison();
  +        TraXLiaison l = new TraXLiaison();
  +        l.setLogger(this);
  +        return l;
       }
   
       public void testXalan2Redirect() throws Exception {
  @@ -122,6 +129,10 @@
           String systemid = ((TraXLiaison)liaison).getSystemId(file);
           assertTrue("SystemIDs should start by file:///", systemid.startsWith("file:///"));
           assertTrue("SystemIDs should not start with file:////", !systemid.startsWith("file:////"));
  +    }
  +
  +    public void log(String message) {
  +        throw new AssertionFailedError("Liaison sent message: "+message);
       }
   
   }
  
  
  

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message