当前位置: 首页>>代码示例>>Java>>正文


Java None类代码示例

本文整理汇总了Java中org.junit.Test.None的典型用法代码示例。如果您正苦于以下问题:Java None类的具体用法?Java None怎么用?Java None使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


None类属于org.junit.Test包,在下文中一共展示了None类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: expectedException

import org.junit.Test.None; //导入依赖的package包/类
@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();
}
 
开发者ID:awenblue,项目名称:powermock,代码行数:9,代码来源:PowerMockJUnit4LegacyTestIntrospector.java

示例2: getExpectedException

import org.junit.Test.None; //导入依赖的package包/类
private Class<? extends Throwable> getExpectedException(Test annotation) {
    if (annotation == null || annotation.expected() == None.class) {
        return null;
    } else {
        return annotation.expected();
    }
}
 
开发者ID:DIVERSIFY-project,项目名称:sosiefier,代码行数:8,代码来源:BlockJUnit4ClassRunner.java

示例3: getExpectedException

import org.junit.Test.None; //导入依赖的package包/类
protected Class<? extends Throwable> getExpectedException() {
    Test annotation = fMethod.getAnnotation(Test.class);
    if (annotation == null || annotation.expected() == None.class) {
        return null;
    } else {
        return annotation.expected();
    }
}
 
开发者ID:lcm-proj,项目名称:lcm,代码行数:9,代码来源:TestMethod.java

示例4: runTest

import org.junit.Test.None; //导入依赖的package包/类
@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");
        }
    }
}
 
开发者ID:botelhojp,项目名称:apache-jmeter-2.10,代码行数:37,代码来源:JUnitSampler.java

示例5: testConstructorNameRequires

import org.junit.Test.None; //导入依赖的package包/类
@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));
}
 
开发者ID:JPDSousa,项目名称:ExtendedCLI,代码行数:7,代码来源:ArgumentTest.java

示例6: testConstructorNameRequiresDescription

import org.junit.Test.None; //导入依赖的package包/类
@Test(expected = None.class)
public void testConstructorNameRequiresDescription() {
	assertNotNull(Argument.create("name", Requires.FALSE, "Desc"));
}
 
开发者ID:JPDSousa,项目名称:ExtendedCLI,代码行数:5,代码来源:ArgumentTest.java

示例7: testConstructorNameRequiresValidValuesDefaultValue

import org.junit.Test.None; //导入依赖的package包/类
@Test(expected = None.class)
public void testConstructorNameRequiresValidValuesDefaultValue() {
	assertNotNull(Argument.create("Name", Requires.OPTIONAL, new String[]{"default"}, "default"));
}
 
开发者ID:JPDSousa,项目名称:ExtendedCLI,代码行数:5,代码来源:ArgumentTest.java

示例8: testConstructorNameRequiresDescriptionValidValuesDefaultValue

import org.junit.Test.None; //导入依赖的package包/类
@Test(expected = None.class)
public void testConstructorNameRequiresDescriptionValidValuesDefaultValue() {
	assertNotNull(Argument.create("Name", Requires.FALSE, "Desc", new String[]{"Valid", "Values"}, "Values"));
}
 
开发者ID:JPDSousa,项目名称:ExtendedCLI,代码行数:5,代码来源:ArgumentTest.java

示例9: shouldBeStacked

import org.junit.Test.None; //导入依赖的package包/类
@Test(expected = None.class)
public void shouldBeStacked() {
    tracer.start();
    tracer.get("X-Trace-ID");
    tracer.start();
}
 
开发者ID:zalando,项目名称:tracer,代码行数:7,代码来源:ConfiguredStackedTracerTest.java

示例10: equalsThrowsNoException

import org.junit.Test.None; //导入依赖的package包/类
@Theory
@Test(expected = None.class)
public void equalsThrowsNoException(Object a, Object b) {
    assumeNotNull(a);
    a.equals(b);
}
 
开发者ID:DIVERSIFY-project,项目名称:sosiefier,代码行数:7,代码来源:ObjectContractTest.java


注:本文中的org.junit.Test.None类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。