1
2
3
4
5
6
7
8
9
10
11
12
13
14
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 }