Java 类org.junit.Test.None 实例源码

项目: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   
@Test(expected = None.class)
public void testConstructorNameRequires() {
    assertNotNull(Argument.create("thisName", Requires.FALSE));
    assertNotNull(Argument.create("a", Requires.OPTIONAL));
    assertNotNull(Argument.create("JustANormalLongExtendedNoSpacedArgument", Requires.TRUE));
}
项目: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", Requires.FALSE, "Desc", new String[]{"Valid", "Values"}, "Values"));
}
项目:tracer    文件:ConfiguredStackedTracerTest.java   
@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);
}