本文整理汇总了Java中org.eclipse.jdt.internal.junit.model.ITestRunListener2类的典型用法代码示例。如果您正苦于以下问题:Java ITestRunListener2类的具体用法?Java ITestRunListener2怎么用?Java ITestRunListener2使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ITestRunListener2类属于org.eclipse.jdt.internal.junit.model包,在下文中一共展示了ITestRunListener2类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testFailed
import org.eclipse.jdt.internal.junit.model.ITestRunListener2; //导入依赖的package包/类
public synchronized void testFailed(int status, String testId, String testName, String trace, String expected,
String actual) {
String statusMessage = String.valueOf(status);
if (status == ITestRunListener2.STATUS_OK) {
numberOfTestsPassed++;
statusMessage = "OK";
} else if (status == ITestRunListener2.STATUS_FAILURE) {
numberOfTestsFailed++;
statusMessage = "FAILED";
} else if (status == ITestRunListener2.STATUS_ERROR) {
numberOfTestsWithError++;
statusMessage = "ERROR";
}
System.out.println(" Test Failed - " + count() + " - " + testName + " - status: " + statusMessage
+ ", trace: " + trace + ", expected: " + expected + ", actual: " + actual);
}
示例2: testFailed
import org.eclipse.jdt.internal.junit.model.ITestRunListener2; //导入依赖的package包/类
@Override
public synchronized void testFailed(int status, String testId, String testName, String trace, String expected, String actual) {
String statusMessage = String.valueOf(status);
if (status == ITestRunListener2.STATUS_OK) {
numberOfTestsPassed++;
statusMessage = "OK";
} else if (status == ITestRunListener2.STATUS_FAILURE) {
numberOfTestsFailed++;
statusMessage = "FAILED";
getXMLJUnitResultFormatter().addFailure(currentTest, new AssertionFailedError(trace));
} else if (status == ITestRunListener2.STATUS_ERROR) {
numberOfTestsWithError++;
statusMessage = "ERROR";
getXMLJUnitResultFormatter().addError(currentTest, new Exception(trace));
}
System.out.println(" Test Failed - " + count() + " - " + testName + " - status: " + statusMessage
+ ", trace: " + trace + ", expected: " + expected + ", actual: " + actual);
}
示例3: testReran
import org.eclipse.jdt.internal.junit.model.ITestRunListener2; //导入依赖的package包/类
public synchronized void testReran(String testId, String testClass, String testName, int status, String trace,
String expected, String actual) {
String statusMessage = String.valueOf(status);
if (status == ITestRunListener2.STATUS_OK) {
statusMessage = "OK";
} else if (status == ITestRunListener2.STATUS_FAILURE) {
statusMessage = "FAILED";
} else if (status == ITestRunListener2.STATUS_ERROR) {
statusMessage = "ERROR";
}
System.out.println(" Test ReRan - " + testName + " - test class: " + testClass + ", status: " + statusMessage
+ ", trace: " + trace + ", expected: " + expected + ", actual: " + actual);
}
示例4: run
import org.eclipse.jdt.internal.junit.model.ITestRunListener2; //导入依赖的package包/类
public void run(int port) throws InterruptedException {
pdeTestListener = new PDETestListener(this, suiteName);
new RemoteTestRunnerClient().startListening(new ITestRunListener2[] { pdeTestListener }, port);
System.out.println("Listening on port " + port + " for test suite " + suiteName + " results ...");
synchronized (this) {
wait();
}
}
示例5: testReran
import org.eclipse.jdt.internal.junit.model.ITestRunListener2; //导入依赖的package包/类
@Override
public synchronized void testReran(String testId, String testClass, String testName, int status, String trace, String expected, String actual) {
String statusMessage = String.valueOf(status);
if (status == ITestRunListener2.STATUS_OK) {
statusMessage = "OK";
} else if (status == ITestRunListener2.STATUS_FAILURE) {
statusMessage = "FAILED";
} else if (status == ITestRunListener2.STATUS_ERROR) {
statusMessage = "ERROR";
}
System.out.println(" Test ReRan - " + testName + " - test class: " + testClass + ", status: " + statusMessage
+ ", trace: " + trace + ", expected: " + expected + ", actual: " + actual);
}
示例6: run
import org.eclipse.jdt.internal.junit.model.ITestRunListener2; //导入依赖的package包/类
private void run(int port) throws InterruptedException {
pdeTestListener = new PDETestListener(this, suiteName);
new RemoteTestRunnerClient().startListening(new ITestRunListener2[] {pdeTestListener}, port);
System.out.println("Listening on port " + port + " for test suite " + suiteName + " results ...");
synchronized (this) {
wait();
}
}