项目:powermock
文件:PowerMockJUnit4LegacyTestIntrospector.java
@SuppressWarnings("all")
public Class<? extends Throwable> expectedException(Method method) {
Test annotation = method.getAnnotation(Test.class);
if (annotation == null || annotation.expected() == None.class)
return null;
else
return annotation.expected();
}
项目:sosiefier
文件:BlockJUnit4ClassRunner.java
private Class<? extends Throwable> getExpectedException(Test annotation) {
if (annotation == null || annotation.expected() == None.class) {
return null;
} else {
return annotation.expected();
}
}
项目:lcm
文件:TestMethod.java
protected Class<? extends Throwable> getExpectedException() {
Test annotation = fMethod.getAnnotation(Test.class);
if (annotation == null || annotation.expected() == None.class) {
return null;
} else {
return annotation.expected();
}
}
项目:lcm
文件:BlockJUnit4ClassRunner.java
private Class<? extends Throwable> getExpectedException(Test annotation) {
if (annotation == null || annotation.expected() == None.class) {
return null;
} else {
return annotation.expected();
}
}
项目:apache-jmeter-2.10
文件:JUnitSampler.java
@Override
protected void runtest() throws Throwable {
try {
long start = System.currentTimeMillis();
method.invoke(testObject,(Object[])null);
if (expectedException != None.class) {
throw new AssertionFailedError(
"No error was generated for a test case which specifies an error.");
}
if (timeout > 0){
long elapsed = System.currentTimeMillis() - start;
if (elapsed > timeout) {
throw new AssertionFailedError("Test took longer than the specified timeout.");
}
}
} catch (InvocationTargetException e) {
Throwable thrown = e.getCause();
if (thrown == null) { // probably should not happen
throw e;
}
if (expectedException == None.class){
// Convert JUnit4 AssertionError failures to JUnit3 style so
// will be treated as failure rather than error.
if (thrown instanceof AssertionError && !(thrown instanceof AssertionFailedError)){
AssertionFailedError afe = new AssertionFailedError(thrown.toString());
// copy the original stack trace
afe.setStackTrace(thrown.getStackTrace());
throw afe;
}
throw thrown;
}
if (!expectedException.isAssignableFrom(thrown.getClass())){
throw new AssertionFailedError("The wrong exception was thrown from the test case");
}
}
}
项目:junit
文件:TestMethod.java
protected Class<? extends Throwable> getExpectedException() {
Test annotation = fMethod.getAnnotation(Test.class);
if (annotation == null || annotation.expected() == None.class) {
return null;
} else {
return annotation.expected();
}
}
项目:junit
文件:BlockJUnit4ClassRunner.java
private Class<? extends Throwable> getExpectedException(Test annotation) {
if (annotation == null || annotation.expected() == None.class) {
return null;
} else {
return annotation.expected();
}
}
项目:org.openntf.domino
文件:TestMethod.java
protected Class<? extends Throwable> getExpectedException() {
Test annotation = fMethod.getAnnotation(Test.class);
if (annotation == null || annotation.expected() == None.class) {
return null;
} else {
return annotation.expected();
}
}
项目:org.openntf.domino
文件:BlockJUnit4ClassRunner.java
private Class<? extends Throwable> getExpectedException(Test annotation) {
if (annotation == null || annotation.expected() == None.class) {
return null;
} else {
return annotation.expected();
}
}
项目:ExtendedCLI
文件:ArgumentTest.java
项目:ExtendedCLI
文件:ArgumentTest.java
@Test(expected = None.class)
public void testConstructorNameRequiresDescription() {
assertNotNull(Argument.create("name",Requires.FALSE,"Desc"));
}
项目:ExtendedCLI
文件:ArgumentTest.java
@Test(expected = None.class)
public void testConstructorNameRequiresValidValuesDefaultValue() {
assertNotNull(Argument.create("Name",Requires.OPTIONAL,new String[]{"default"},"default"));
}
项目:ExtendedCLI
文件:ArgumentTest.java
@Test(expected = None.class)
public void testConstructorNameRequiresDescriptionValidValuesDefaultValue() {
assertNotNull(Argument.create("Name","Desc",new String[]{"Valid","Values"},"Values"));
}
@Test(expected = None.class)
public void shouldBeStacked() {
tracer.start();
tracer.get("X-Trace-ID");
tracer.start();
}
项目:sosiefier
文件:ObjectContractTest.java
@Theory
@Test(expected = None.class)
public void equalsThrowsNoException(Object a,Object b) {
assumeNotNull(a);
a.equals(b);
}
项目:junit
文件:ObjectContractTest.java
@Theory
@Test(expected = None.class)
public void equalsThrowsNoException(Object a,Object b) {
assumeNotNull(a);
a.equals(b);
}
项目:health-and-care-developer-network
文件:ObjectContractTest.java
@Theory
@Test(expected = None.class)
public void equalsThrowsNoException(Object a,Object b) {
assumeNotNull(a);
a.equals(b);
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。