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


Java BaseTestRunner类代码示例

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


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

示例1: displayProblems

import junit.runner.BaseTestRunner; //导入依赖的package包/类
private void displayProblems( PrintWriter writer, String kind, int count, Enumeration enumeration ) {
    if (count != 0) {
        displayProblemTitle( writer, getFormatted( count, kind ) );
        Enumeration e = enumeration;
        for (int i = 1; e.hasMoreElements(); i++) {
            TestFailure failure = (TestFailure) e.nextElement();
            displayProblemDetailHeader( writer, i, failure.failedTest().toString() );
            if (failure.thrownException() instanceof AssertionFailedError) {
                displayProblemDetail( writer, failure.thrownException().getMessage() );
            } else {
                displayProblemDetail( writer, BaseTestRunner.getFilteredTrace( failure.thrownException() ) );
            }
            displayProblemDetailFooter( writer );
        }
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:17,代码来源:JUnitServlet.java

示例2: displayResults

import junit.runner.BaseTestRunner; //导入依赖的package包/类
private void displayResults( PrintWriter writer, String failureNodeName, Enumeration resultsEnumeration ) {
    for (Enumeration e = resultsEnumeration; e.hasMoreElements();) {
        TestFailure failure = (TestFailure) e.nextElement();
        writer.println( "  <testcase name=" + asAttribute( failure.failedTest().toString() ) + ">" );
        writer.print( "    <" + failureNodeName + " type=" + asAttribute( failure.thrownException().getClass().getName() ) +
                                              " message=" + asAttribute( failure.exceptionMessage() ) );
        if (!displayException( failure )) {
            writer.println( "/>" );
        } else {
            writer.println( ">" );
            writer.print( sgmlEscape( BaseTestRunner.getFilteredTrace( failure.thrownException() ) ) );
            writer.println( "    </" + failureNodeName + ">" );
        }
        writer.println( "  </testcase>" );
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:17,代码来源:JUnitServlet.java

示例3: SLDTestRunner

import junit.runner.BaseTestRunner; //导入依赖的package包/类
/**
 * Instantiates a new SLD test runner.
 */
public SLDTestRunner() {
    BaseTestRunner.setPreference("maxmessage", "-1");

    System.out.println("Operating system is : " + OSValidator.getOS());
    // Populate the list of fields that are colours
    colourFieldsList.add(FieldIdEnum.FILL_COLOUR);
    colourFieldsList.add(FieldIdEnum.STROKE_FILL_COLOUR);
    colourFieldsList.add(FieldIdEnum.STROKE_STROKE_COLOUR);
    colourFieldsList.add(FieldIdEnum.HALO_COLOUR);

    filenameList.add(FieldIdEnum.SYMBOL_TYPE);
    filenameList.add(FieldIdEnum.EXTERNAL_GRAPHIC);
    filenameList.add(FieldIdEnum.TTF_SYMBOL);

    try {
        sldEditor = SLDEditor.createAndShowGUI(null, null, true, null);
    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:24,代码来源:SLDTestRunner.java

示例4: printFailure

import junit.runner.BaseTestRunner; //导入依赖的package包/类
void printFailure(KXmlSerializer serializer, String type, Throwable t)
        throws IOException {
    serializer.startTag(ns, TESTCASE);
    printAttributes(serializer);

    serializer.startTag(ns, type);
    String message = t.getMessage();
    if (message != null && message.length() > 0) {
        serializer.attribute(ns, ATTR_MESSAGE, t.getMessage());
    }
    serializer.attribute(ns, ATTR_TYPE, t.getClass().getName());
    serializer.text(sanitize(BaseTestRunner.getFilteredTrace(t)));
    serializer.endTag(ns, type);

    serializer.endTag(ns, TESTCASE);
}
 
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:17,代码来源:XmlReportPrinter.java

示例5: run

import junit.runner.BaseTestRunner; //导入依赖的package包/类
private void run(Class... tests) {
    runs = new ArrayList<Integer>();
    BaseTestRunner runner = new TestRunner();
    for (Class test : tests) {
        TestResult result = new TestResult();
        //result.addListener(new ResultPrinter(System.err));
        runner.getTest(test.getName()).run(result);
        assertEquals("failures in " + test, Collections.emptyList(), Collections.list((Enumeration<?>) result.failures()));
        assertEquals("errors in " + test, Collections.emptyList(), Collections.list((Enumeration<?>) result.errors()));
    }
    Collections.sort(runs);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:RandomlyFailsTest.java

示例6: addError

import junit.runner.BaseTestRunner; //导入依赖的package包/类
@Override
public void addError(Test test, Throwable t) {
	mTestResult.putString(REPORT_KEY_STACK, BaseTestRunner.getFilteredTrace(t));
	mTestResultCode = REPORT_VALUE_RESULT_ERROR;
	// pretty printing
	mTestResult.putString(Instrumentation.REPORT_KEY_STREAMRESULT, String.format("\nError in %s:\n%s", ((TestCase) test).getName(), BaseTestRunner.getFilteredTrace(t)));

	mPrinter.addError(test, t);
}
 
开发者ID:MagicHry,项目名称:EnhancedPUMA,代码行数:10,代码来源:MyUiAutomatorTestRunner.java

示例7: addFailure

import junit.runner.BaseTestRunner; //导入依赖的package包/类
@Override
public void addFailure(Test test, AssertionFailedError t) {
	mTestResult.putString(REPORT_KEY_STACK, BaseTestRunner.getFilteredTrace(t));
	mTestResultCode = REPORT_VALUE_RESULT_FAILURE;
	// pretty printing
	mTestResult.putString(Instrumentation.REPORT_KEY_STREAMRESULT, String.format("\nFailure in %s:\n%s", ((TestCase) test).getName(), BaseTestRunner.getFilteredTrace(t)));

	mPrinter.addFailure(test, t);
}
 
开发者ID:MagicHry,项目名称:EnhancedPUMA,代码行数:10,代码来源:MyUiAutomatorTestRunner.java

示例8: testInvokeNonStaticSuite

import junit.runner.BaseTestRunner; //导入依赖的package包/类
public void testInvokeNonStaticSuite() {
	BaseTestRunner runner= new MockRunner();
	runner.getTest("junit.tests.runner.BaseTestRunnerTest$NonStatic"); // Used to throw NullPointerException
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:5,代码来源:BaseTestRunnerTest.java

示例9: testFilter

import junit.runner.BaseTestRunner; //导入依赖的package包/类
public void testFilter() {
	assertEquals(fFiltered, BaseTestRunner.getFilteredTrace(fUnfiltered));
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:4,代码来源:StackFilterTest.java

示例10: printDefectTrace

import junit.runner.BaseTestRunner; //导入依赖的package包/类
protected void printDefectTrace(TestFailure booBoo) {
    getWriter().print(BaseTestRunner.getFilteredTrace(booBoo.trace()));
}
 
开发者ID:OSBI,项目名称:mondrian,代码行数:4,代码来源:MondrianResultPrinter.java

示例11: testInvokeNonStaticSuite

import junit.runner.BaseTestRunner; //导入依赖的package包/类
public void testInvokeNonStaticSuite() {
    BaseTestRunner runner = new MockRunner();
    runner.getTest("junit.tests.runner.BaseTestRunnerTest$NonStatic"); // Used to throw NullPointerException
}
 
开发者ID:DIVERSIFY-project,项目名称:sosiefier,代码行数:5,代码来源:BaseTestRunnerTest.java

示例12: testFilter

import junit.runner.BaseTestRunner; //导入依赖的package包/类
public void testFilter() {
    assertEquals(fFiltered, BaseTestRunner.getFilteredTrace(fUnfiltered));
}
 
开发者ID:DIVERSIFY-project,项目名称:sosiefier,代码行数:4,代码来源:StackFilterTest.java

示例13: addError

import junit.runner.BaseTestRunner; //导入依赖的package包/类
@Override
public void addError(final Test test, final Throwable e) {
	pLogger.logDebug(this, "addError", "Error in test [%s]!\n%s", test
			.getClass().getName(), BaseTestRunner.getFilteredTrace(e));
}
 
开发者ID:isandlaTech,项目名称:cohorte-utilities,代码行数:6,代码来源:CCpntLoggerTestListener.java

示例14: addFailure

import junit.runner.BaseTestRunner; //导入依赖的package包/类
@Override
public void addFailure(final Test test, final AssertionFailedError e) {
	pLogger.logDebug(this, "addFailure", "Test [%s] failed!\n%s", test
			.getClass().getName(), BaseTestRunner.getFilteredTrace(e));
}
 
开发者ID:isandlaTech,项目名称:cohorte-utilities,代码行数:6,代码来源:CCpntLoggerTestListener.java


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