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


Java Version类代码示例

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


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

示例1: newRunListener

import junit.runner.Version; //导入依赖的package包/类
/**
 * Returns a new {@link RunListener} instance for the given {@param outputFormat}.
 */
public RunListener newRunListener(OutputFormat outputFormat) {
    switch (outputFormat) {
        case JUNIT:
            out.println("JUnit version " + Version.id());
            return new TextListener(out);
        case GTM_UNIT_TESTING:
            return new GtmUnitTestingTextListener();
        default:
            throw new IllegalArgumentException("outputFormat");
    }
}
 
开发者ID:doppllib,项目名称:core-doppl,代码行数:15,代码来源:DopplJunitTestHelper.java

示例2: newRunListener

import junit.runner.Version; //导入依赖的package包/类
/**
 * Returns a new {@link RunListener} instance for the given {@param outputFormat}.
 */
public RunListener newRunListener(OutputFormat outputFormat) {
  switch (outputFormat) {
    case JUNIT:
      out.println("JUnit version " + Version.id());
      return new TextListener(out);
    case GTM_UNIT_TESTING:
      return new GtmUnitTestingTextListener();
    default:
      throw new IllegalArgumentException("outputFormat");
  }
}
 
开发者ID:Sellegit,项目名称:j2objc,代码行数:15,代码来源:JUnitTestRunner.java

示例3: start

import junit.runner.Version; //导入依赖的package包/类
/**
 * Starts a test run. Analyzes the command line arguments
 * and runs the given test suite.
 */
@Override
public TestResult start(String args[]) throws Exception {
	String testCase= "";
	boolean wait= false;
	
	for (int i= 0; i < args.length; i++) {
		if (args[i].equals("-wait"))
			wait= true;
		else if (args[i].equals("-c")) 
			testCase= extractClassName(args[++i]);
		else if (args[i].equals("-v"))
			System.err.println("JUnit "+Version.id()+" by Kent Beck and Erich Gamma");
		else
			testCase= args[i];
	}
	
	if (testCase.equals("")) 
		throw new Exception("Usage: TestName[#testCaseName] [-wait], where TestName is the name of the TestCase class, testCaseName that of a test method");

	try {
		Test suite= getTest(testCase);
		return doRun(suite, wait);
	}
	catch(Exception e) {
		throw new Exception("Could not create and run test suite: "+e);
	}
}
 
开发者ID:mpgerstl,项目名称:tEFMA,代码行数:32,代码来源:TestRunner.java

示例4: start

import junit.runner.Version; //导入依赖的package包/类
/**
 * Starts a test run. Analyzes the command line arguments and runs the given
 * test suite.
 */
public TestResult start(String args[]) throws Exception {
    String testCase = "";
    String method = "";
    boolean wait = false;

    for (int i = 0; i < args.length; i++) {
        if (args[i].equals("-wait")) {
            wait = true;
        } else if (args[i].equals("-c")) {
            testCase = extractClassName(args[++i]);
        } else if (args[i].equals("-m")) {
            String arg = args[++i];
            int lastIndex = arg.lastIndexOf('.');
            testCase = arg.substring(0, lastIndex);
            method = arg.substring(lastIndex + 1);
        } else if (args[i].equals("-v")) {
            System.err.println("JUnit " + Version.id() + " by Kent Beck and Erich Gamma");
        } else {
            testCase = args[i];
        }
    }

    if (testCase.equals("")) {
        throw new Exception("Usage: TestRunner [-wait] testCaseName, where name is the name of the TestCase class");
    }

    try {
        if (!method.equals("")) {
            return runSingleMethod(testCase, method, wait);
        }
        Test suite = getTest(testCase);
        return doRun(suite, wait);
    } catch (Exception e) {
        throw new Exception("Could not create and run test suite: " + e);
    }
}
 
开发者ID:DIVERSIFY-project,项目名称:sosiefier,代码行数:41,代码来源:TestRunner.java

示例5: runMain

import junit.runner.Version; //导入依赖的package包/类
/**
 * @param system
 * @param args from main()
 */
Result runMain(JUnitSystem system, String... args) {
    system.out().println("JUnit version " + Version.id());

    JUnitCommandLineParseResult jUnitCommandLineParseResult = JUnitCommandLineParseResult.parse(args);

    RunListener listener = new TextListener(system);
    addListener(listener);

    return run(jUnitCommandLineParseResult.createRequest(defaultComputer()));
}
 
开发者ID:DIVERSIFY-project,项目名称:sosiefier,代码行数:15,代码来源:JUnitCore.java

示例6: getVersion

import junit.runner.Version; //导入依赖的package包/类
/**
 * @return the version number of this release
 */
public String getVersion() {
    return Version.id();
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:7,代码来源:MarathonTestRunner.java

示例7: testVersion

import junit.runner.Version; //导入依赖的package包/类
@Test(timeout = 20L, expected = Test.None.class)
public void testVersion() {
    org.junit.Assert.assertEquals("4.12", Version.id());
}
 
开发者ID:BruceZu,项目名称:KeepTry,代码行数:5,代码来源:MyLinkedListTest.java

示例8: getJUnitVersion

import junit.runner.Version; //导入依赖的package包/类
public static String getJUnitVersion() {
    return Version.id();
}
 
开发者ID:awenblue,项目名称:powermock,代码行数:4,代码来源:JUnitVersion.java

示例9: start

import junit.runner.Version; //导入依赖的package包/类
/**
 * Starts a test run. Analyzes the command line arguments
 * and runs the given test suite.
 *
 * @param args The command line arguments.
 *
 * @return The test results.
 *
 * @throws Exception Any exceptions falling through the tests are wrapped in Exception and rethrown.
 */
public TestResult start(String[] args) throws Exception
{
    String testCase = "";
    boolean wait = false;

    for (int i = 0; i < args.length; i++)
    {
        if (args[i].equals("-wait"))
        {
            wait = true;
        }
        else if (args[i].equals("-c"))
        {
            testCase = extractClassName(args[++i]);
        }
        else if (args[i].equals("-v"))
        {
            System.err.println("JUnit " + Version.id() + " by Kent Beck and Erich Gamma");
        }
        else
        {
            testCase = args[i];
        }
    }

    if (testCase.equals(""))
    {
        throw new Exception("Usage: TestRunner [-wait] testCaseName, where name is the name of the TestCase class");
    }

    try
    {
        Test suite = getTest(testCase);

        return doRun(suite, wait);
    }
    catch (Exception e)
    {
        log.warn("Got exception whilst creating and running test suite.", e);
        throw new Exception("Could not create and run the test suite.", e);
    }
}
 
开发者ID:wso2,项目名称:andes,代码行数:53,代码来源:TestRunnerImprovedErrorHandling.java


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