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


Java JavaStringCompiler.getTestResult方法代码示例

本文整理汇总了Java中vk.core.api.JavaStringCompiler.getTestResult方法的典型用法代码示例。如果您正苦于以下问题:Java JavaStringCompiler.getTestResult方法的具体用法?Java JavaStringCompiler.getTestResult怎么用?Java JavaStringCompiler.getTestResult使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在vk.core.api.JavaStringCompiler的用法示例。


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

示例1: handleTests

import vk.core.api.JavaStringCompiler; //导入方法依赖的package包/类
private String handleTests(JavaStringCompiler myCompileObject) {
	String testResults = "";
	TestResult happyEndChecker = myCompileObject.getTestResult();
	if(happyEndChecker.getNumberOfFailedTests() == 0) {
		testResults += "All tests succeeded!\n";
		testSuccess = true;
	}
	else {
		testSuccess = false;
		testResults += "Successful Tests: " + happyEndChecker.getNumberOfSuccessfulTests() + "\n";
		testResults += "Failed Tests: " + happyEndChecker.getNumberOfFailedTests() + "\n\n";
		Collection<TestFailure> fails = happyEndChecker.getTestFailures();
		Iterator<TestFailure> fail = fails.iterator();
		while(fail.hasNext()) {
			TestFailure found = fail.next();
			testResults += "Class: " + found.getTestClassName() + "\n" 
			+ "Method: " + found.getMethodName() + "\n" 
			+ "Message: " + found.getMessage();
		}		
	}
	return testResults;
}
 
开发者ID:ProPra16,项目名称:programmierpraktikum-abschlussprojekt-stack-overflow,代码行数:23,代码来源:CompileHandler.java

示例2: handleAcceptanceTests

import vk.core.api.JavaStringCompiler; //导入方法依赖的package包/类
private String handleAcceptanceTests(JavaStringCompiler myCompileObject) {
	String testResults = "";
	TestResult happyEndChecker = myCompileObject.getTestResult();
	
	if(happyEndChecker.getNumberOfFailedTests() == 0) {
		testResults += "All tests succeeded!";
		acceptance = true;
	}
	else {
		acceptance = false;
		testResults += "Acceptance Test Failed\n";
		testResults += "Successful Tests: " + happyEndChecker.getNumberOfSuccessfulTests() + "\n";
		testResults += "Failed Tests: " + happyEndChecker.getNumberOfFailedTests() + "\n\n";
		Collection<TestFailure> fails = happyEndChecker.getTestFailures();
		Iterator<TestFailure> fail = fails.iterator();
		while(fail.hasNext()) {
			TestFailure found = fail.next();
			testResults += "Class: " + found.getTestClassName() + "\n" 
			+ "Method: " + found.getMethodName() + "\n" 
			+ "Message: " + found.getMessage();
		}		
	}
	return testResults;
}
 
开发者ID:ProPra16,项目名称:programmierpraktikum-abschlussprojekt-stack-overflow,代码行数:25,代码来源:CompileHandler.java

示例3: test

import vk.core.api.JavaStringCompiler; //导入方法依赖的package包/类
/**
 * Gibt Testergebnisse auf die (programminterne) Konsole aus.
 * 
 * Wandelt übergebene Compilationunits mit {@link #getJSC(CompilationUnit[])} in JavaStringCompiler um,
 * bestimmt Anzahl der erfolgreichen und fehlgeschlagenen Tests und gibt dies, sowie genauere Fehlermendungen
 * auf der programminternen Konsole aus.
 */
public static void test(CompilationUnit[] comp_uns){ //gibt testergebnisse auf console aus
	JavaStringCompiler comp = getJSC(comp_uns);
	TestResult test_res = comp.getTestResult();
	int tests_ok = test_res.getNumberOfSuccessfulTests();
	int tests_fail = test_res.getNumberOfFailedTests();
	console.set_textln("Testresult:");
	Collection<TestFailure> fails = test_res.getTestFailures();
	console.set_textln("OK: "+tests_ok+" FAIL: "+tests_fail);
	for(TestFailure fail: fails){
		console.set_textln("Testname: "+fail.getTestClassName());
		console.set_textln("Methodname: "+fail.getMethodName());
		console.set_textln(fail.getMessage());
		console.set_textln("");
	}
	console.set_textln("");

}
 
开发者ID:ProPra16,项目名称:programmierpraktikum-abschlussprojekt-team-1,代码行数:25,代码来源:Testing.java

示例4: compileAndRunTests

import vk.core.api.JavaStringCompiler; //导入方法依赖的package包/类
/**
 * Compiles and runs the passed test and sets info to any error that may have occured.
 * @param code Code of code to be compiled
 * @param codeClassName Classname of the code
 * @param test Code of tests to be compiled
 * @param testClassName Classname of the test
 * @return True if the test is compile- and runnable. Otherwise false.
 */
public boolean compileAndRunTests(String code, String codeClassName, String test, String testClassName) {
	CompilationUnit cuCode = new CompilationUnit(codeClassName, code, false);
	CompilationUnit cuTest = new CompilationUnit(testClassName, test, true);
	JavaStringCompiler jsc = CompilerFactory.getCompiler(cuCode, cuTest);
	jsc.compileAndRunTests();
	CompilerResult cr = jsc.getCompilerResult();

	if (cr.hasCompileErrors()) {
		info = formatCompileErrors(cr, cuCode);
		info += formatCompileErrors(cr, cuTest);
		return false;
	}

	TestResult tr = jsc.getTestResult();

	if (tr.getNumberOfFailedTests() != 0) {
		info = formatFailingTests(tr);
		return false;
	}

	return true;
}
 
开发者ID:ProPra16,项目名称:programmierpraktikum-abschlussprojekt-nimmdochirgendeinennamen,代码行数:31,代码来源:TDDTCompiler.java

示例5: tests_passed

import vk.core.api.JavaStringCompiler; //导入方法依赖的package包/类
/**
 * Prüft ob alle Tests bestanden werden.
 * 
 * Prüft ob die Compilationunits fehlerlos compilieren und prüft anschließend ob alle enthaltenen Tests erfolgreich sind.
 */
public static boolean tests_passed(CompilationUnit[] comp_uns){ //fuer next-button
	if(!hasCompileErrors(comp_uns)){
		JavaStringCompiler comp = getJSC(comp_uns);
		TestResult test_res = comp.getTestResult();
		test(comp_uns);
		return(test_res.getNumberOfFailedTests() == 0);
	} else return false;
}
 
开发者ID:ProPra16,项目名称:programmierpraktikum-abschlussprojekt-team-1,代码行数:14,代码来源:Testing.java

示例6: GreenValidator

import vk.core.api.JavaStringCompiler; //导入方法依赖的package包/类
public GreenValidator(JavaStringCompiler compiler) {
    this.compiler = compiler;
    this.Tests=compiler.getTestResult();
    checkifReady();
    if (Compiled) {
        BadTest();
    }
}
 
开发者ID:ProPra16,项目名称:programmierpraktikum-abschlussprojekt-halt-doch-einfach-mal-dein-maul,代码行数:9,代码来源:GreenValidator.java


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