本文整理汇总了Java中junit.framework.Protectable类的典型用法代码示例。如果您正苦于以下问题:Java Protectable类的具体用法?Java Protectable怎么用?Java Protectable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Protectable类属于junit.framework包,在下文中一共展示了Protectable类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: run
import junit.framework.Protectable; //导入依赖的package包/类
/**
* {@inheritDoc}
* <p/>
* <p/> Replacement run method. Gets a hold of the TestRunner used for running this test so it can populate it with
* the results retrieved from OSGi.
*/
public final void run(TestResult result) {
// get a hold of the test result
originalResult = result;
result.startTest(osgiJUnitTest);
result.runProtected(osgiJUnitTest, new Protectable() {
public void protect() throws Throwable {
AbstractOsgiTests.this.runBare();
}
});
result.endTest(osgiJUnitTest);
// super.run(result);
}
开发者ID:eclipse,项目名称:gemini.blueprint,代码行数:23,代码来源:AbstractOsgiTests.java
示例2: run
import junit.framework.Protectable; //导入依赖的package包/类
/**
* {@inheritDoc}
*
* <p/> Replacement run method. Gets a hold of the TestRunner used for
* running this test so it can populate it with the results retrieved from
* OSGi.
*/
public final void run(TestResult result) {
// get a hold of the test result
originalResult = result;
result.startTest(osgiJUnitTest);
result.runProtected(osgiJUnitTest, new Protectable() {
public void protect() throws Throwable {
AbstractOsgiTests.this.runBare();
}
});
result.endTest(osgiJUnitTest);
// super.run(result);
}
开发者ID:BeamFoundry,项目名称:spring-osgi,代码行数:24,代码来源:AbstractOsgiTests.java
示例3: run
import junit.framework.Protectable; //导入依赖的package包/类
@Override
public void run(final TestResult result) {
Protectable p= new Protectable() {
public void protect() throws Exception {
try {
// run suite (first test run will setup the suite)
superRun(result);
} finally {
// tear down the suite
if (Suite.this.currentTestCase != null) { // protect against empty test suite
Suite.this.currentTestCase.tearDownSuite();
}
}
}
};
result.runProtected(this, p);
}
开发者ID:jwloka,项目名称:reflectify,代码行数:18,代码来源:SuiteOfTestCases.java
示例4: run
import junit.framework.Protectable; //导入依赖的package包/类
@Override
public void run(final TestResult result) {
result.runProtected(this, new Protectable() {
public @Override void protect() throws Throwable {
ClassLoader before = Thread.currentThread().getContextClassLoader();
try {
runInRuntimeContainer(result);
} finally {
Thread.currentThread().setContextClassLoader(before);
}
}
});
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:NbModuleSuite.java
示例5: runTest
import junit.framework.Protectable; //导入依赖的package包/类
/**
* Run fixture setup, test from the given test case and fixture teardown.
*
* @param osgiTestExtensions
* @param testName
*/
protected TestResult runTest(final OsgiJUnitTest osgiTestExtensions, String testName) {
if (log.isDebugEnabled()) {
log.debug("Running test [" + testName + "] on testCase " + osgiTestExtensions);
}
final TestResult result = new TestResult();
TestCase rawTest = osgiTestExtensions.getTestCase();
rawTest.setName(testName);
try {
osgiTestExtensions.osgiSetUp();
try {
// use TestResult method to bypass the setUp/tearDown methods
result.runProtected(rawTest, new Protectable() {
public void protect() throws Throwable {
osgiTestExtensions.osgiRunTest();
}
});
} finally {
osgiTestExtensions.osgiTearDown();
}
}
// exceptions thrown by osgiSetUp/osgiTearDown
catch (Exception ex) {
log.error("test exception threw exception ", ex);
result.addError(rawTest, ex);
}
return result;
}
开发者ID:eclipse,项目名称:gemini.blueprint,代码行数:39,代码来源:OsgiJUnitService.java
示例6: run
import junit.framework.Protectable; //导入依赖的package包/类
public void run(TestResult result) {
result.startTest(this);
Protectable p= new Protectable() {
public void protect() throws Throwable {
fTestCase.runBare();
fTestCase.runBare();
}
};
result.runProtected(this, p);
result.endTest(this);
}
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:12,代码来源:TestImplementorTest.java
示例7: CoreTestRunnable
import junit.framework.Protectable; //导入依赖的package包/类
/**
* Creates a new CoreTestRunnable for the given parameters.
*/
public CoreTestRunnable(TestCase test, TestResult result,
Protectable protectable, boolean invert, boolean isolate) {
this.fTest = test;
this.fProtectable = protectable;
this.fResult = result;
this.fInvert = invert;
this.fIsolate = isolate;
}
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:13,代码来源:CoreTestRunnable.java
示例8: run
import junit.framework.Protectable; //导入依赖的package包/类
@Override
public void run(final TestResult result) {
Protectable p = new Protectable() {
public void protect() throws Exception {
setUp();
basicRun(result);
tearDown();
}
};
result.runProtected(this, p);
}
开发者ID:DIVERSIFY-project,项目名称:sosiefier,代码行数:12,代码来源:TestSetup.java
示例9: run
import junit.framework.Protectable; //导入依赖的package包/类
public void run(TestResult result) {
result.startTest(this);
Protectable p = new Protectable() {
public void protect() throws Throwable {
fTestCase.runBare();
fTestCase.runBare();
}
};
result.runProtected(this, p);
result.endTest(this);
}
开发者ID:DIVERSIFY-project,项目名称:sosiefier,代码行数:12,代码来源:TestImplementorTest.java
示例10: runTest
import junit.framework.Protectable; //导入依赖的package包/类
/**
* Run fixture setup, test from the given test case and fixture teardown.
*
* @param osgiTestExtensions
* @param testName
*/
protected TestResult runTest(final OsgiJUnitTest osgiTestExtensions, String testName) {
if (log.isDebugEnabled())
log.debug("Running test [" + testName + "] on testCase " + osgiTestExtensions);
final TestResult result = new TestResult();
TestCase rawTest = osgiTestExtensions.getTestCase();
rawTest.setName(testName);
try {
osgiTestExtensions.osgiSetUp();
try {
// use TestResult method to bypass the setUp/tearDown methods
result.runProtected(rawTest, new Protectable() {
public void protect() throws Throwable {
osgiTestExtensions.osgiRunTest();
}
});
}
finally {
osgiTestExtensions.osgiTearDown();
}
}
// exceptions thrown by osgiSetUp/osgiTearDown
catch (Exception ex) {
log.error("test exception threw exception ", ex);
result.addError((Test) rawTest, ex);
}
return result;
}
开发者ID:BeamFoundry,项目名称:spring-osgi,代码行数:40,代码来源:OsgiJUnitService.java
示例11: run
import junit.framework.Protectable; //导入依赖的package包/类
protected void run(final TestResult result, final Method testMethod) {
final Test test = createTest(testMethod);
result.startTest(test);
final Protectable p = new Protectable() {
public void protect() throws Throwable {
runTestMethod(testMethod);
}
};
//System.out.println(">>" + NumberedTestCase.class.getName() + "> started: " + testMethod.toGenericString());
result.runProtected(test, p);
result.endTest(test);
//System.out.println(">>" + NumberedTestCase.class.getName() + "> done: " + testMethod.toGenericString());
}
开发者ID:apache,项目名称:tomee,代码行数:14,代码来源:NumberedTestCase.java
注:本文中的junit.framework.Protectable类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论