aslom       2002/12/03 22:50:08

  Modified:    java     build.xml
               java/test/util WSIFTestRunner.java
  Log:
  fixed  WSIFTestRunner to remove dependancy on ShoppingCart test
  that will fail of EJB is not available (fixed by using Class.forName())
  
  Revision  Changes    Path
  1.14      +1 -1      xml-axis-wsif/java/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/xml-axis-wsif/java/build.xml,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- build.xml 4 Dec 2002 06:00:15 -0000       1.13
  +++ build.xml 4 Dec 2002 06:50:07 -0000       1.14
  @@ -190,6 +190,7 @@
   
     <patternset id="test.source.files">
       <include name="**/*.java"/>
  +    <exclude name="shop/**/*.java" unless="ejb.present"/>
     </patternset>
   
     <patternset id="j2c.source.files">
  @@ -310,7 +311,6 @@
       <javac srcdir="test" destdir="${build.tests}" 
              classpath="${dynamic.dest}:${build.samples}" debug="${debug}">
         <patternset refid="test.source.files"/>
  -      <exclude name="shop/**.java" unless="ejb.present"/>
       </javac>
   
       <copy todir="${build.samples}">
  
  
  
  1.22      +21 -11    xml-axis-wsif/java/test/util/WSIFTestRunner.java
  
  Index: WSIFTestRunner.java
  ===================================================================
  RCS file: /home/cvs/xml-axis-wsif/java/test/util/WSIFTestRunner.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- WSIFTestRunner.java       15 Nov 2002 16:47:24 -0000      1.21
  +++ WSIFTestRunner.java       4 Dec 2002 06:50:07 -0000       1.22
  @@ -2,7 +2,7 @@
    * The Apache Software License, Version 1.1
    *
    *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights 
  + * Copyright (c) 2002 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -10,7 +10,7 @@
    * are met:
    *
    * 1. Redistributions of source code must retain the above copyright
  - *    notice, this list of conditions and the following disclaimer. 
  + *    notice, this list of conditions and the following disclaimer.
    *
    * 2. Redistributions in binary form must reproduce the above copyright
    *    notice, this list of conditions and the following disclaimer in
  @@ -18,7 +18,7 @@
    *    distribution.
    *
    * 3. The end-user documentation included with the redistribution,
  - *    if any, must include the following acknowledgment:  
  + *    if any, must include the following acknowledgment:
    *       "This product includes software developed by the
    *        Apache Software Foundation (http://www.apache.org/)."
    *    Alternately, this acknowledgment may appear in the software itself,
  @@ -26,7 +26,7 @@
    *
    * 4. The names "WSIF" and "Apache Software Foundation" must
    *    not be used to endorse or promote products derived from this
  - *    software without prior written permission. For written 
  + *    software without prior written permission. For written
    *    permission, please contact [EMAIL PROTECTED]
    *
    * 5. Products derived from this software may not be called "Apache",
  @@ -71,7 +71,7 @@
   import mime.MimeTest;
   import providers.PlugableProvidersTest;
   import providers.ProvidersInitialisationTest;
  -import shop.ShoppingCartTest;
  +//import shop.ShoppingCartTest;
   import soap.InputPartsTest;
   import soap.OutputPartsTest;
   import soapinterop.InteropTest;
  @@ -88,21 +88,21 @@
    * Run JUnit tests on WSIF code.
    * Add new tests to the suite() method.
    * Comment out lines for tests not required.
  - *   
  + *
    * @author Owen Burroughs
    */
   
   public class WSIFTestRunner {
   
       public static void main(String[] args) {
  -         TestUtilities.startListeners();     
  +         TestUtilities.startListeners();
           junit.textui.TestRunner.run(suite());
  -        TestUtilities.stopListeners();       
  +        TestUtilities.stopListeners();
       }
   
       public static Test suite() {
           TestSuite suite = new TestSuite("All WSIF Tests");
  -             
  +
                // Check all files for the dreaded ^M character! If you set
                // fix=on in the wsif.test.properties file, this test will
                // not only check the files but also fix them.
  @@ -112,8 +112,9 @@
           // the FIRST of the functional tests as after this, WSIF will already
           // have been initialised.
           suite.addTest(new TestSuite(ProvidersInitialisationTest.class));
  -        
  -        suite.addTest(new TestSuite(ShoppingCartTest.class));
  +
  +        //suite.addTest(new TestSuite(ShoppingCartTest.class));
  +        addIfAvaliable(suite, "ShoppingCartTest");
           suite.addTest(new TestSuite(AsyncTests.class));
           suite.addTest(new TestSuite(HeadersTest.class));
           suite.addTest(new TestSuite(FaultMsgTest.class));
  @@ -141,5 +142,14 @@
           }
   
           return suite;
  +    }
  +
  +    public static void addIfAvaliable(TestSuite suite, String className) {
  +     try {
  +         Class klass = Class.forName("ShoppingCartTest");
  +         suite.addTest(new TestSuite(klass));
  +     } catch(Exception ex) {
  +     }
  +
       }
   }
  
  
  


Reply via email to