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


Java JUnitCore.runClasses方法代码示例

本文整理汇总了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 );
}
 
开发者ID:evandrocoan,项目名称:ComputerScienceGraduation,代码行数:25,代码来源:Principal.java

示例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);
}
 
开发者ID:Morgan-Stanley,项目名称:SilverKing,代码行数:19,代码来源:SkfsRenameGlenn.java

示例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);
}
 
开发者ID:Morgan-Stanley,项目名称:SilverKing,代码行数:19,代码来源:SkfsCopyGlenn.java

示例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);
		}
	}
 
开发者ID:UCL-INGI,项目名称:Informatique-1,代码行数:17,代码来源:EXQ6Vide.java

示例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();
	}
}
 
开发者ID:EvoSuite,项目名称:evosuite,代码行数:27,代码来源:JUnitTestSuite.java

示例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);
        }
	}
 
开发者ID:UCL-INGI,项目名称:Informatique-1,代码行数:17,代码来源:M11Q7Corr.java

示例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);

	}
}
 
开发者ID:UCL-INGI,项目名称:Informatique-1,代码行数:17,代码来源:M3Q4.java

示例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());
}
 
开发者ID:ampool,项目名称:monarch,代码行数:9,代码来源:MTableCheckAndPutDUnitTest.java

示例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);
}
 
开发者ID:arquillian,项目名称:smart-testing,代码行数:10,代码来源:ProjectPersistUsingPropertyTest.java

示例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();
}
 
开发者ID:arquillian,项目名称:smart-testing,代码行数:8,代码来源:ProjectPersistTest.java

示例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...");
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:10,代码来源:Bug_for_Next.java

示例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());
}
 
开发者ID:arjunnayak0705,项目名称:java-indian-bank-api-wrapper,代码行数:9,代码来源:TestRunner.java

示例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());
}
 
开发者ID:asms,项目名称:360w17g1,代码行数:13,代码来源:FullTestRunner.java

示例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());
}
 
开发者ID:ampool,项目名称:monarch,代码行数:9,代码来源:MTableCheckAndDeleteDUnitTest.java

示例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());
    }
}
 
开发者ID:ricomaster9000,项目名称:sageOneApiLibrary-GLOBAL,代码行数:10,代码来源:TestRunner.java


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