Home » geronimo-2.2-source-release » org.apache.geronimo.axis » [javadoc | source]

    1   /*
    2    * Copyright 2001-2004 The Apache Software Foundation.
    3    * 
    4    * Licensed under the Apache License, Version 2.0 (the "License");
    5    * you may not use this file except in compliance with the License.
    6    * You may obtain a copy of the License at
    7    * 
    8    *      http://www.apache.org/licenses/LICENSE-2.0
    9    * 
   10    * Unless required by applicable law or agreed to in writing, software
   11    * distributed under the License is distributed on an "AS IS" BASIS,
   12    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   13    * See the License for the specific language governing permissions and
   14    * limitations under the License.
   15    */
   16   
   17   package org.apache.geronimo.axis;
   18   
   19   import java.io.File;
   20   
   21   import junit.framework.TestCase;
   22   
   23   /**
   24    * Abstract base class for test cases.
   25    * @version $Rev: 111239 $ $Date: 2004-12-08 01:29:11 -0800 (Wed, 08 Dec 2004) $
   26    */
   27   public abstract class AbstractTestCase
   28           extends TestCase {
   29       protected String testDir = "src/test/";
   30       protected String sampleDir = "src/samples/";
   31       protected String outDir = "target/generated/samples/";
   32       protected String tempDir = "target/generated/temp";
   33       /**
   34        * Basedir for all file I/O. Important when running tests from
   35        * the reactor.
   36        */
   37       public String basedir = System.getProperty("basedir");
   38   
   39       /**
   40        * Constructor.
   41        */
   42       public AbstractTestCase(String testName) {
   43           super(testName);
   44           if (basedir == null) {
   45               basedir = new File(".").getAbsolutePath();
   46               if (!(basedir.endsWith("axis")
   47                       || basedir.endsWith("axis\\")
   48                       || basedir.endsWith("axis/"))) {
   49                   basedir = new File("./modules/axis/").getAbsolutePath();
   50               }
   51           }
   52           testDir = new File(basedir, testDir).getAbsolutePath();
   53           sampleDir = new File(basedir, sampleDir).getAbsolutePath();
   54           outDir = new File(basedir, outDir).getAbsolutePath();
   55           tempDir = new File(basedir, tempDir).getAbsolutePath();
   56       }
   57   
   58       /**
   59        * Get test input file.
   60        *
   61        * @param path Path to test input file.
   62        */
   63       public String getTestFile(String path) {
   64           return new File(basedir, path).getAbsolutePath();
   65       }
   66   
   67       public void testDummy() throws Exception {
   68           //to allow commenting out all tests in a test case
   69       }
   70   }
   71   

Home » geronimo-2.2-source-release » org.apache.geronimo.axis » [javadoc | source]