Exemplo n.º 1
0
 private TestsToRun scanClasspath() {
   TestsToRun scannedClasses =
       parameters
           .getScanResult()
           .applyFilter(new TestPlanScannerFilter(launcher), parameters.getTestClassLoader());
   return parameters.getRunOrderCalculator().orderTestClasses(scannedClasses);
 }
 @Override
 public Iterable<Class<?>> getSuites() {
   return Arrays.asList(
       providerParameters
           .getScanResult()
           .applyFilter(
               clazz ->
                   Arrays.stream(clazz.getAnnotations())
                       .anyMatch(annotation -> Test.class.equals(annotation.annotationType())),
               providerParameters.getTestClassLoader())
           .getLocatedClasses());
 }
 public IsolatedJUnitProvider(ProviderParameters booterParameters) {
   this.providerParameters = booterParameters;
   this.testClassLoader = booterParameters.getTestClassLoader();
   this.scanResult = booterParameters.getScanResult();
   this.runOrderCalculator = booterParameters.getRunOrderCalculator();
   String mode = providerParameters.getProviderProperties().getProperty("compatMode");
   if (!"junit4".equals(mode) && !"junit3".equals(mode)) mode = "junit4";
   this.isJunit4 = "junit4".equals(mode);
   if (isJunit4) {
     junit4TestChecker = new JUnit4TestChecker(testClassLoader);
   } else {
     jUnit3TestChecker = new JUnit3TestChecker(testClassLoader);
     this.v3testChecker = new PojoAndJUnit3Checker(jUnit3TestChecker);
   }
   customRunListeners =
       JUnit4RunListenerFactory.createCustomListeners(
           providerParameters.getProviderProperties().getProperty("listener"));
 }