1 16 package org.apache.commons.lang.exception; 17 18 import java.io.EOFException ; 19 20 import junit.framework.Test; 21 import junit.framework.TestSuite; 22 import junit.textui.TestRunner; 23 24 30 public class NestableErrorTestCase extends AbstractNestableTestCase { 31 32 38 public NestableErrorTestCase(String name) 39 { 40 super(name); 41 } 42 43 46 public void setUp() 47 { 48 } 49 50 55 public static Test suite() 56 { 57 return new TestSuite(NestableErrorTestCase.class); 58 } 59 60 63 public void tearDown() 64 { 65 } 66 67 72 public static void main(String args[]) 73 { 74 TestRunner.run(suite()); 75 } 76 77 80 public Nestable getNestable() 81 { 82 return new NestableError(); 83 } 84 85 88 public Nestable getNestable(Nestable n) 89 { 90 return new NestableError((Throwable ) n); 91 } 92 93 96 public Nestable getNestable(String msg) 97 { 98 return new NestableError(msg); 99 } 100 101 104 public Nestable getNestable(Throwable t) 105 { 106 return new NestableError(t); 107 } 108 109 112 public Nestable getNestable(String msg, Throwable t) 113 { 114 return new NestableError(msg, t); 115 } 116 117 120 public Nestable getNestable(String msg, Nestable n) 121 { 122 return new NestableError(msg, (Throwable ) n); 123 } 124 125 128 public Nestable getTester1(Throwable t) 129 { 130 return new NestableErrorTester1(t); 131 } 132 133 136 public Nestable getTester1(Nestable n) 137 { 138 return new NestableErrorTester1((Throwable ) n); 139 } 140 141 144 public Nestable getTester1(String msg, Throwable t) 145 { 146 return new NestableErrorTester1(msg, t); 147 } 148 149 152 public Nestable getTester1(String msg, Nestable n) 153 { 154 return new NestableErrorTester1(msg, (Throwable ) n); 155 } 156 157 160 public Class getTester1Class() 161 { 162 return NestableErrorTester1.class; 163 } 164 165 168 public Nestable getTester2(String msg, Throwable t) 169 { 170 return new NestableErrorTester2(msg, t); 171 } 172 173 176 public Nestable getTester2(String msg, Nestable n) 177 { 178 return new NestableErrorTester2(msg, (Throwable ) n); 179 } 180 181 184 public Class getTester2Class() 185 { 186 return NestableErrorTester2.class; 187 } 188 189 192 public Throwable getThrowable(String msg) 193 { 194 return new EOFException (msg); 195 } 196 197 200 public Class getThrowableClass() 201 { 202 return EOFException .class; 203 } 204 205 208 public Class getBaseThrowableClass() 209 { 210 return Error .class; 211 } 212 213 } 214 215 218 class NestableErrorTester1 extends NestableError 219 { 220 public NestableErrorTester1() 221 { 222 super(); 223 } 224 225 public NestableErrorTester1(String reason, Throwable cause) 226 { 227 super(reason, cause); 228 } 229 230 public NestableErrorTester1(String reason) 231 { 232 super(reason); 233 } 234 235 public NestableErrorTester1(Throwable cause) 236 { 237 super(cause); 238 } 239 240 } 241 242 245 class NestableErrorTester2 extends NestableError 246 { 247 public NestableErrorTester2() 248 { 249 super(); 250 } 251 252 public NestableErrorTester2(String reason, Throwable cause) 253 { 254 super(reason, cause); 255 } 256 257 public NestableErrorTester2(String reason) 258 { 259 super(reason); 260 } 261 262 public NestableErrorTester2(Throwable cause) 263 { 264 super(cause); 265 } 266 267 } 268 | Popular Tags |