01: package test.expectedexceptions;
02:
03: import test.BaseTest;
04:
05: import java.lang.reflect.Method;
06:
07: import java.util.logging.*;
08:
09: import java.util.ArrayList;
10: import java.util.Collection;
11: import java.util.Iterator;
12: import java.util.List;
13: import java.util.HashMap;
14: import java.util.Map;
15: import java.util.Properties;
16:
17: import org.testng.ITestListener;
18: import org.testng.ITestResult;
19:
20: public class ExpectedExceptionsTest extends BaseTest {
21:
22: /**
23: * @testng.test
24: */
25: public void expectedExceptionsDeprecated() {
26: addClass("test.expectedexceptions.SampleExceptions");
27: run();
28: String[] passed = { "shouldPass", };
29: String[] failed = { "shouldFail1", "shouldFail2" };
30: String[] skipped = {};
31: verifyTests("Passed", passed, getPassedTests());
32: verifyTests("Failed", failed, getFailedTests());
33: verifyTests("Skipped", skipped, getSkippedTests());
34: }
35:
36: /**
37: * @testng.test
38: */
39: public void expectedExceptions() {
40: addClass("test.expectedexceptions.SampleExceptions2");
41: run();
42: String[] passed = { "shouldPass", };
43: String[] failed = { "shouldFail1", "shouldFail2" };
44: String[] skipped = {};
45: verifyTests("Passed", passed, getPassedTests());
46: verifyTests("Failed", failed, getFailedTests());
47: verifyTests("Skipped", skipped, getSkippedTests());
48: }
49:
50: }
|