本文整理匯總了Java中junit.extensions.TestSetup.run方法的典型用法代碼示例。如果您正苦於以下問題:Java TestSetup.run方法的具體用法?Java TestSetup.run怎麽用?Java TestSetup.run使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類junit.extensions.TestSetup
的用法示例。
在下文中一共展示了TestSetup.run方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: testRunningErrorsInTestSetup
import junit.extensions.TestSetup; //導入方法依賴的package包/類
public void testRunningErrorsInTestSetup() {
TestCase failure= new TestCase("failure") {
public void runTest() {
fail();
}
};
TestCase error= new TestCase("error") {
public void runTest() {
throw new Error();
}
};
TestSuite suite= new TestSuite();
suite.addTest(failure);
suite.addTest(error);
TestSetup wrapper= new TestSetup(suite);
TestResult result= new TestResult();
wrapper.run(result);
assertEquals(1, result.failureCount());
assertEquals(1, result.errorCount());
}
示例2: testSetupErrorInTestSetup
import junit.extensions.TestSetup; //導入方法依賴的package包/類
public void testSetupErrorInTestSetup() {
WasRun test = new WasRun();
TestSetup wrapper = new TestSetup(test) {
@Override
public void setUp() {
fail();
}
};
TestResult result = new TestResult();
wrapper.run(result);
assertTrue(!test.fWasRun);
assertTrue(!result.wasSuccessful());
}
示例3: testRunningErrorInTestSetup
import junit.extensions.TestSetup; //導入方法依賴的package包/類
public void testRunningErrorInTestSetup() {
TestCase test= new TestCase("failure") {
public void runTest() {
fail();
}
};
TestSetup wrapper= new TestSetup(test);
TestResult result= new TestResult();
wrapper.run(result);
assertTrue(!result.wasSuccessful());
}
示例4: testSetupErrorInTestSetup
import junit.extensions.TestSetup; //導入方法依賴的package包/類
public void testSetupErrorInTestSetup() {
WasRun test= new WasRun();
TestSetup wrapper= new TestSetup(test) {
public void setUp() {
fail();
}
};
TestResult result= new TestResult();
wrapper.run(result);
assertTrue(!test.fWasRun);
assertTrue(!result.wasSuccessful());
}
示例5: testRunningErrorInTestSetup
import junit.extensions.TestSetup; //導入方法依賴的package包/類
public void testRunningErrorInTestSetup() {
TestCase test = new TestCase("failure") {
@Override
public void runTest() {
fail();
}
};
TestSetup wrapper = new TestSetup(test);
TestResult result = new TestResult();
wrapper.run(result);
assertTrue(!result.wasSuccessful());
}
示例6: testRunningErrorsInTestSetup
import junit.extensions.TestSetup; //導入方法依賴的package包/類
public void testRunningErrorsInTestSetup() {
TestCase failure = new TestCase("failure") {
@Override
public void runTest() {
fail();
}
};
TestCase error = new TestCase("error") {
@Override
public void runTest() {
throw new Error();
}
};
TestSuite suite = new TestSuite();
suite.addTest(failure);
suite.addTest(error);
TestSetup wrapper = new TestSetup(suite);
TestResult result = new TestResult();
wrapper.run(result);
assertEquals(1, result.failureCount());
assertEquals(1, result.errorCount());
}