View Javadoc

1   /*
2    * Copyright  2000-2002,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  
18  package org.woopi.ant.taskdefs.junit;
19  import java.io.File;
20  import java.util.Vector;
21  
22  /***
23   * Baseclass for BatchTest and JUnitTest.
24   *
25   */
26  public abstract class BaseTest {
27      protected boolean haltOnError = false;
28      protected boolean haltOnFail = false;
29      protected boolean filtertrace = true;
30      protected boolean fork = false;
31      protected String ifProperty = null;
32      protected String unlessProperty = null;
33      protected Vector formatters = new Vector();
34      /*** destination directory */
35      protected File destDir = null;
36  
37      protected String failureProperty;
38      protected String errorProperty;
39  
40      public void setFiltertrace(boolean value) {
41          filtertrace = value;
42      }
43  
44      public boolean getFiltertrace() {
45          return filtertrace;
46      }
47  
48      public void setFork(boolean value) {
49          fork = value;
50      }
51  
52      public boolean getFork() {
53          return fork;
54      }
55  
56      public void setHaltonerror(boolean value) {
57          haltOnError = value;
58      }
59  
60      public void setHaltonfailure(boolean value) {
61          haltOnFail = value;
62      }
63  
64      public boolean getHaltonerror() {
65          return haltOnError;
66      }
67  
68      public boolean getHaltonfailure() {
69          return haltOnFail;
70      }
71  
72      public void setIf(String propertyName) {
73          ifProperty = propertyName;
74      }
75  
76      public void setUnless(String propertyName) {
77          unlessProperty = propertyName;
78      }
79  
80      public void addFormatter(FormatterElement elem) {
81          formatters.addElement(elem);
82      }
83  
84      /***
85       * Sets the destination directory.
86       */
87      public void setTodir(File destDir) {
88          this.destDir = destDir;
89      }
90  
91      /***
92       * @return the destination directory as an absolute path if it exists
93       *         otherwise return <tt>null</tt>
94       */
95      public String getTodir() {
96          if (destDir != null) {
97              return destDir.getAbsolutePath();
98          }
99          return null;
100     }
101 
102     public java.lang.String getFailureProperty() {
103         return failureProperty;
104     }
105 
106     public void setFailureProperty(String failureProperty) {
107         this.failureProperty = failureProperty;
108     }
109 
110     public java.lang.String getErrorProperty() {
111         return errorProperty;
112     }
113 
114     public void setErrorProperty(String errorProperty) {
115         this.errorProperty = errorProperty;
116     }
117 }