本文整理汇总了Java中org.junit.runner.JUnitCore.runClasses方法的典型用法代码示例。如果您正苦于以下问题:Java JUnitCore.runClasses方法的具体用法?Java JUnitCore.runClasses怎么用?Java JUnitCore.runClasses使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.junit.runner.JUnitCore
的用法示例。
在下文中一共展示了JUnitCore.runClasses方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: executarTodosOs50Testes
import org.junit.runner.JUnitCore; //导入方法依赖的package包/类
/**
* Chama o motor de testes JUnit.
*/
private static void executarTodosOs50Testes()
{
final Result result = JUnitCore.runClasses( GrafoTest.class );
final StringBuilder mensagem = new StringBuilder();
if( result.getFailureCount() > 0 )
{
mensagem.append( "############## OS SEGUINTES TESTES FALHARAM!! "
+ "#####################################\n" );
} else
{
mensagem.append( "############## TODOS OS TESTES FORAM EXECUTADOS "
+ "COM SUCESSO!! #######################\n" );
}
for( final Failure failure: result.getFailures() )
{
mensagem.append( failure.getDescription() ).append( '\n' );
mensagem.append( failure.getMessage() ).append( '\n' );
}
System.out.println( mensagem );
}
示例2: main
import org.junit.runner.JUnitCore; //导入方法依赖的package包/类
public static void main(String[] args) {
if (args.length != 1) {
System.out.println("Need an argument for target directory: i.e. /var/tmp/silverking_holstben/skfs/skfs_mnt/skfs");
return;
}
targetDirPath = args[0];
absTestsDir = targetDirPath + sep + testsDirName;
targetDir = new File(targetDirPath);
testsDir = new File(targetDirPath, testsDirName);
parentFile = new File(absTestsDir, parentFileName);
parentFileRename = new File(absTestsDir, parentFileName+"Rename");
Result result = JUnitCore.runClasses(SkfsRenameGlenn.class);
printSummary(result);
}
示例3: main
import org.junit.runner.JUnitCore; //导入方法依赖的package包/类
public static void main(String[] args) {
if (args.length != 1) {
System.out.println("Need an argument for target directory: i.e. /var/tmp/silverking_holstben/skfs/skfs_mnt/skfs");
return;
}
targetDirPath = args[0];
absTestsDir = targetDirPath + sep + testsDirName;
targetDir = new File(targetDirPath);
testsDir = new File(targetDirPath, testsDirName);
parentDir = new File(absTestsDir, parentDirName);
Result result = JUnitCore.runClasses(SkfsCopyGlenn.class);
printSummary(result);
System.out.println("exists: " + exists);
}
示例4: main
import org.junit.runner.JUnitCore; //导入方法依赖的package包/类
public static void main(String[] args) {
Result result = JUnitCore.runClasses(EXQ6Tests.class);
Iterator<Failure> failures = result.getFailures().iterator();
Failure f;
while(failures.hasNext()){
f = failures.next();
System.err.println(f.getMessage());
//System.err.println(f.getTrace());
}
if(result.wasSuccessful() == true){
//System.out.println(true);
/**127 : nombre magique afin de signaler que tout les tests sont passés */
System.exit(127);
}
}
示例5: runSuite
import org.junit.runner.JUnitCore; //导入方法依赖的package包/类
/**
* <p>runSuite</p>
*
* @param name a {@link java.lang.String} object.
*/
public void runSuite(String name) {
try {
Class<?> forName = null;
forName = Class.forName(name);
logger.info("Running against JUnit test suite " + name);
JUnitCore.runClasses(forName);
ExecutionTrace trace = ExecutionTracer.getExecutionTracer().getTrace();
coveredMethods = new HashSet<String>();
coveredBranchesTrue = trace.getCoveredTrueBranches();
coveredBranchesFalse = trace.getCoveredFalseBranches();
for (String methodName : trace.getCoveredMethods()) {
if (!methodName.contains("$"))
coveredMethods.add(methodName);
}
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
}
示例6: main
import org.junit.runner.JUnitCore; //导入方法依赖的package包/类
public static void main(String[] args) {
Result result = JUnitCore.runClasses(DListTest.class);
Iterator<Failure> failures = result.getFailures().iterator();
Failure f;
while(failures.hasNext()){
f = failures.next();
System.err.println(f.getMessage());
//System.err.println(f.getTrace());
}
if(result.wasSuccessful() == true){
System.out.println(true);
/**127 : nombre magique afin de signaler que tout les tests sont passés */
System.exit(127);
}
}
示例7: main
import org.junit.runner.JUnitCore; //导入方法依赖的package包/类
public static void main(String[] args) {
Result result = JUnitCore.runClasses(M3Q4Tests.class);
Iterator<Failure> failures = result.getFailures().iterator();
Failure f;
while(failures.hasNext()){
f = failures.next();
System.err.println(f.getMessage());
}
if(result.wasSuccessful() == true){
/**127 : nombre magique afin de signaler
* que tout les tests sont passés **/
System.exit(127);
}
}
示例8: testCheckAndPutSuite
import org.junit.runner.JUnitCore; //导入方法依赖的package包/类
@Test
public void testCheckAndPutSuite() {
final Result result = JUnitCore.runClasses(MTableCheckAndPutInternal.class);
for (final Failure failure : result.getFailures()) {
System.out.println("Test failed: " + failure.toString());
}
assertTrue(result.wasSuccessful());
}
示例9: should_store_project_under_test_directory_when_test_is_passing_but_property_is_set
import org.junit.runner.JUnitCore; //导入方法依赖的package包/类
@Test
public void should_store_project_under_test_directory_when_test_is_passing_but_property_is_set() throws IOException {
System.setProperty("test.bed.project.persist", "true");
final Result result = JUnitCore.runClasses(ProjectPersistAnotherPass.class);
assertThat(result.wasSuccessful()).isTrue();
assertThat(findPersistedProjects("repo.bundle", "ProjectPersistAnotherPass_should_pass")).hasSize(1);
}
示例10: should_not_store_project_under_test_directory_when_test_is_passing
import org.junit.runner.JUnitCore; //导入方法依赖的package包/类
@Test
public void should_not_store_project_under_test_directory_when_test_is_passing() throws IOException {
final Result result = JUnitCore.runClasses(ProjectPersistPass.class);
assertThat(result.wasSuccessful()).isTrue();
assertThat(findPersistedProjects("repo.bundle", "ProjectPersistPass_should_pass")).isEmpty();
}
示例11: main
import org.junit.runner.JUnitCore; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
Result result = JUnitCore.runClasses(Bug_for_Next.class);
for (Failure fail : result.getFailures()) {
System.out.println(fail.toString());
}
if (result.wasSuccessful()) {
System.out.println("All tests finished successfully...");
}
}
示例12: main
import org.junit.runner.JUnitCore; //导入方法依赖的package包/类
public static void main(String[] args) {
Result result = JUnitCore.runClasses(BankDetailsJunitTest.class);
for (Failure failure : result.getFailures()) {
System.out.println(failure.toString());
}
System.out.println("==========================================================================");
System.out.println(result.wasSuccessful());
}
示例13: main
import org.junit.runner.JUnitCore; //导入方法依赖的package包/类
public static void main(String[] args) {
Result result = JUnitCore.runClasses(TestSuite.class);
for (Failure failure : result.getFailures()) {
System.out.println(failure.toString());
}
if(result.wasSuccessful()){
System.out.println("The tests all passed: " + result.wasSuccessful());
}
else System.err.println("The tests all passed: " + result.wasSuccessful());
}
示例14: testCheckAndDeleteSuite
import org.junit.runner.JUnitCore; //导入方法依赖的package包/类
@Test
public void testCheckAndDeleteSuite() {
final Result result = JUnitCore.runClasses(MTableCheckAndDeleteInternal.class);
for (final Failure failure : result.getFailures()) {
System.out.println("Test failed: " + failure.toString());
}
assertTrue(result.wasSuccessful());
}
示例15: main
import org.junit.runner.JUnitCore; //导入方法依赖的package包/类
public static void main(String[] args) {
Result result = JUnitCore.runClasses(TestVersion2.class);
System.out.println(result.getFailureCount() + " tests failed out a total of " + result.getRunCount());
for(Failure failure : result.getFailures()) {
System.out.println(failure.toString());
}
}