Java 类org.junit.runners.model.RunnerBuilder 实例源码

项目:aaf-junit    文件:ConcurrentDependsOnClasspathSuite.java   
public ConcurrentDependsOnClasspathSuite(Class<?> suiteClass, RunnerBuilder builder) throws InitializationError {
    super(suiteClass, builder);
    methodFilter = newMethodFilter(suiteClass.getAnnotation(MethodFilters.class));
    int maximumPoolSize = isAnnotationPresent(suiteClass) && !runSerial() ? maximumPoolSize(suiteClass) : 1;
    if (maximumPoolSize < 1) {
        throw new IllegalArgumentException("maximumPoolSize < 1");
    }
    scheduler = new ConcurrentDependsOnSuiteScheduler(maximumPoolSize, listener);
    setScheduler(scheduler);
    getChildren().stream().forEach(r -> shouldRun.add(getClassName(r)));
    getChildren().stream().forEach(r -> nameToRunner.put(getClassName(r), r));
    verifyDependecyGraph();
    getChildren().stream().filter(r -> r instanceof IgnoredClassRunner).forEach(r -> {
        failed.add(getClassName(r));
    });
    if (methodFilter != null) {
        applyMethodFilter();
    }
}
项目:aws-encryption-sdk-java    文件:FastTestsOnlySuite.java   
public CustomRunner(Class<?> klass, RunnerBuilder builder) throws InitializationError {
    super(
            klass,
            new RunnerBuilder() {
                @Override public Runner runnerForClass(Class<?> testClass) throws Throwable {
                    Boolean oldValue = IS_FAST_TEST_SUITE_ACTIVE.get();

                    try {
                        IS_FAST_TEST_SUITE_ACTIVE.set(true);
                        Runner r = builder.runnerForClass(testClass);
                        return r;
                    } finally {
                        IS_FAST_TEST_SUITE_ACTIVE.set(oldValue);
                    }
                }
            }
    );
}
项目:parameterized-suite    文件:ParameterizedSuite.java   
public ParameterizedSuite(Class<?> suiteTestClass, RunnerBuilder runnerBuilder) throws Throwable {
    super(suiteTestClass);
    Class<?>[] childTestClasses = SuiteUtil.getSuiteClasses(suiteTestClass);
    mode = determineRuntimeMode();

    if (Mode.ROOT.equals(mode)) {
        // Forking for each parameter is necessary.
        Iterable<Object> parametersOfSuiteClass = ParameterizedUtil.getParameters(getTestClass());
        String parametersNamePattern = ParameterizedUtil.getNamePatternForParameters(getTestClass());
        currentlyActiveParameter = null;

        this.runners = createSuiteRunnersPerParameter(suiteTestClass, runnerBuilder, childTestClasses, parametersOfSuiteClass, parametersNamePattern);
    } else {
        // Forking has already been done by a ParameterizedSuite that is superior in the test
        // hierarchy. Create Runners for children like a normal Suite would do.
        currentlyActiveParameter = ParameterContext.getParameterAsArray();

        this.runners = createRunnersForChildTestClasses(suiteTestClass, runnerBuilder, childTestClasses);
    }
}
项目:xtf    文件:XTFTestSuite.java   
@Synchronized
private static List<Runner> getRunners(@NonNull Class<?> suiteClass, @NonNull RunnerBuilder builder)
        throws InitializationError {

    List<Runner> runners = RUNNERS_CACHE.get(suiteClass);
    if (runners == null) {
        final List<Class<?>> testClasses = resolveTestClasses(suiteClass);
        runners = Collections.unmodifiableList(builder.runners(suiteClass, testClasses));
        RUNNERS_CACHE.put(suiteClass, runners);
        TEST_CLASSES_CACHE.put(suiteClass, testClasses);
    }
    return runners;
}
项目:xtf    文件:XTFTestSuiteTest.java   
private void createSuite(Class<?> suiteClass) throws Exception {
    suite = new XTFTestSuite(suiteClass, new RunnerBuilder() {
        @Override
        public Runner runnerForClass(Class<?> testClass) throws Throwable {
            return new BlockJUnit4ClassRunner(testClass);
        }
    });
}
项目:parameterized-suite    文件:SuiteForSingleParameter.java   
public SuiteForSingleParameter(RunnerBuilder runnerBuilder, Class<?> forkingSuiteClass, Class<?>[] classes,
        String suiteName, Object[] parameter) throws InitializationError {
    /*
     * By passing "forkingSuiteClass" (which is the forking
     * ParameterizedSuite), the JUnit framework will build the internal
     * testClass attribute from the ParameterizedSuite and not from this
     * virtual, forked Suite. This way @Before/After/Class can be evaluated.
     */
    super(runnerBuilder, forkingSuiteClass, classes);

    this.suiteName = suiteName;
    this.singleParameter = parameter;
}
项目:parameterized-suite    文件:ParameterizedSuite.java   
private SuiteForSingleParameter setContextAndBuildSuiteForSingleParameter(Class<?> suiteTestClass, RunnerBuilder runnerBuilder,
        Class<?>[] suiteChildClasses, Parameter parameter, String suiteName) throws InitializationError {
    try {
        ParameterContext.setParameter(parameter);
        return new SuiteForSingleParameter(runnerBuilder, suiteTestClass, suiteChildClasses, suiteName, parameter.asNormalized());
    } finally {
        ParameterContext.removeParameter();
    }
}
项目:hgraphdb    文件:CustomSuite.java   
@SuppressWarnings("deprecation")
public CustomSuite(final Class<?> klass, final RunnerBuilder builder) throws InitializationError {
    super(klass, builder,
            new Class<?>[]{
                    CustomTest.class,
            },
            null,
            false,
            TraversalEngine.Type.STANDARD);
}
项目:LiteGraph    文件:AbstractGremlinSuite.java   
/**
 * Constructs a Gremlin Test Suite implementation.
 *
 * @param klass               Required for JUnit Suite construction
 * @param builder             Required for JUnit Suite construction
 * @param testsToExecute      The list of tests to execute
 * @param testsToEnforce      The list of tests to "enforce" such that a check is made to ensure that in this list,
 *                            there exists an implementation in the testsToExecute (use {@code null} for no
 *                            enforcement).
 * @param gremlinFlavorSuite  Ignore validation of {@link org.apache.tinkerpop.gremlin.structure.Graph.OptIn}
 *                            annotations which is typically reserved for structure tests
 * @param traversalEngineType The {@link org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine.Type} to
 *                            enforce on this suite
 */
public AbstractGremlinSuite(final Class<?> klass, final RunnerBuilder builder, final Class<?>[] testsToExecute,
                            final Class<?>[] testsToEnforce, final boolean gremlinFlavorSuite,
                            final TraversalEngine.Type traversalEngineType) throws InitializationError {
    super(builder, klass, enforce(testsToExecute, testsToEnforce));

    this.gremlinFlavorSuite = gremlinFlavorSuite;

    // figures out what the implementer assigned as the GraphProvider class and make it available to tests.
    // the klass is the Suite that implements this suite (e.g. GroovyTinkerGraphProcessStandardTest).
    // this class should be annotated with GraphProviderClass.  Failure to do so will toss an InitializationError
    final Pair<Class<? extends GraphProvider>, Class<? extends Graph>> pair = getGraphProviderClass(klass);

    // the GraphProvider.Descriptor is only needed right now if the test if for a computer engine - an
    // exception is thrown if it isn't present.
    final Optional<GraphProvider.Descriptor> graphProviderDescriptor = getGraphProviderDescriptor(traversalEngineType, pair.getValue0());

    // validate public acknowledgement of the test suite and filter out tests ignored by the implementation
    validateOptInToSuite(pair.getValue1());
    validateOptInAndOutAnnotationsOnGraph(pair.getValue1());

    registerOptOuts(pair.getValue1(), graphProviderDescriptor, traversalEngineType);

    try {
        final GraphProvider graphProvider = pair.getValue0().newInstance();
        GraphManager.setGraphProvider(graphProvider);
        GraphManager.setTraversalEngineType(traversalEngineType);
    } catch (Exception ex) {
        throw new InitializationError(ex);
    }
}
项目:LiteGraph    文件:TinkerGraphStrategySuite.java   
public TinkerGraphStrategySuite(final Class<?> klass, final RunnerBuilder builder) throws InitializationError {

        super(klass, builder,
                new Class<?>[]{
                        TinkerGraphStepStrategyTest.class
                }, new Class<?>[]{
                        TinkerGraphStepStrategyTest.class
                },
                false,
                TraversalEngine.Type.STANDARD);
    }
项目:LiteGraph    文件:Neo4jStrategySuite.java   
public Neo4jStrategySuite(final Class<?> klass, final RunnerBuilder builder) throws InitializationError {

        super(klass, builder,
                new Class<?>[]{
                        Neo4jGraphStepStrategyTest.class
                }, new Class<?>[]{
                        Neo4jGraphStepStrategyTest.class
                },
                false,
                TraversalEngine.Type.STANDARD);
    }
项目:LiteGraph    文件:NativeNeo4jSuite.java   
public NativeNeo4jSuite(final Class<?> klass, final RunnerBuilder builder) throws InitializationError {
    super(klass, builder,
            new Class<?>[]{
                    NativeNeo4jStructureCheck.class,
                    NativeNeo4jIndexCheck.class,
                    NativeNeo4jCypherCheck.class,
            }, new Class<?>[]{
                    NativeNeo4jStructureCheck.class,
                    NativeNeo4jIndexCheck.class,
                    NativeNeo4jCypherCheck.class
            },
            false,
            TraversalEngine.Type.STANDARD);
}
项目:incubator-netbeans    文件:TestsInPkgSuite.java   
public TestsInPkgSuite(Class<?> klass, RunnerBuilder builder) throws InitializationError {
    super(builder, klass, getPkgTestClasses(klass));
}
项目:marathonv5    文件:ParallelComputer.java   
@Override public Runner getSuite(RunnerBuilder builder, java.lang.Class<?>[] classes) throws InitializationError {
    Runner suite = super.getSuite(builder, classes);
    return fClasses ? parallelize(suite) : suite;
}
项目:marathonv5    文件:ParallelComputer.java   
@Override protected Runner getRunner(RunnerBuilder builder, Class<?> testClass) throws Throwable {
    Runner runner = super.getRunner(builder, testClass);
    return fMethods ? parallelize(runner) : runner;
}
项目:Java-Testing-Toolbox    文件:EnclosedParallel.java   
public EnclosedParallel(Class<?> klass, RunnerBuilder builder) throws Throwable {
    super(klass, builder);

    this.setScheduler(new ParallelScheduler());
}
项目:Java-Testing-Toolbox    文件:ParallelCategories.java   
public ParallelCategories(Class<?> klass, RunnerBuilder builder) throws InitializationError {
    super(klass, builder);

    this.setScheduler(new ParallelScheduler());
}
项目:Java-Testing-Toolbox    文件:ParallelSuite.java   
public ParallelSuite(Class<?> klass, RunnerBuilder builder) throws InitializationError {
    super(klass, builder);

    this.setScheduler(new ParallelScheduler());
}
项目:Java-Testing-Toolbox    文件:ParallelSuite.java   
public ParallelSuite(RunnerBuilder builder, Class<?> klass, Class<?>[] suiteClasses) throws InitializationError {
    super(builder, klass, suiteClasses);

    this.setScheduler(new ParallelScheduler());
}
项目:Java-Testing-Toolbox    文件:ParallelSuite.java   
public ParallelSuite(RunnerBuilder builder, Class<?>[] classes) throws InitializationError {
    super(builder, classes);

    this.setScheduler(new ParallelScheduler());
}
项目:xtf    文件:XTFTestSuite.java   
public XTFTestSuite(final Class<?> suiteClass, final RunnerBuilder builder) throws InitializationError {
    super(suiteClass);
    XTFTestSuite.suiteClass = suiteClass;
    testRunners = getRunners(suiteClass, builder);
}
项目:bitsy    文件:BitsyGraphStructureTestSuite.java   
public BitsyGraphStructureTestSuite(final Class<?> klass, final RunnerBuilder builder) throws InitializationError {
    super(klass, builder, allTests, null, false, TraversalEngine.Type.STANDARD);
}
项目:monarch    文件:SuiteRunner.java   
public SuiteRunner(final Class<?> klass, final RunnerBuilder builder) throws InitializationError {
  super(klass, getRunners(klass));
}
项目:sweet-junit-runner    文件:SuiteRunner.java   
public SuiteRunner(Class<?> klass, RunnerBuilder builder) throws InitializationError {
  super(builder, klass, loadClasses(klass));
}
项目:google-options    文件:ClasspathSuite.java   
/**
 * Only called reflectively. Do not use programmatically.
 */
public ClasspathSuite(Class<?> klass, RunnerBuilder builder) throws Throwable {
  super(builder, klass, getClasses(klass));
}
项目:google-options    文件:CustomSuite.java   
/**
 * Only called reflectively. Do not use programmatically.
 */
public CustomSuite(Class<?> klass, RunnerBuilder builder) throws Throwable {
  super(builder, klass, getClasses(klass));
}
项目:january    文件:TestUtils.java   
public VerboseSuite(Class<?> klass, RunnerBuilder builder) throws InitializationError {
    super(klass, builder);
}
项目:oma-riista-web    文件:BaseClassFilteringTestSuite.java   
public BaseClassFilteringTestSuite(final Class<?> clazz, final RunnerBuilder builder) throws InitializationError {
    super(builder, clazz, getSuiteClasses(clazz));
}
项目:photon-model    文件:ProvisionComputeTaskServiceTest.java   
public ProvisionComputeTaskServiceTest(Class<?> klass, RunnerBuilder builder)
        throws InitializationError {
    super(klass, builder);
}
项目:photon-model    文件:ResourcePoolQueryHelperTest.java   
public ResourcePoolQueryHelperTest(Class<?> klass, RunnerBuilder builder)
        throws InitializationError {
    super(klass, builder);
}
项目:photon-model    文件:AuthTranslationServiceTest.java   
public AuthTranslationServiceTest(Class<?> klass, RunnerBuilder builder)
        throws InitializationError {
    super(klass, builder);
}
项目:photon-model    文件:ScheduledTaskServiceTest.java   
public ScheduledTaskServiceTest(Class<?> klass, RunnerBuilder builder)
        throws InitializationError {
    super(klass, builder);
}
项目:photon-model    文件:IPAddressReleaseTaskServiceTest.java   
public IPAddressReleaseTaskServiceTest(Class<?> klass,
                                       RunnerBuilder builder) throws InitializationError {
    super(klass, builder);
}
项目:photon-model    文件:SshCommandTaskServiceTest.java   
public SshCommandTaskServiceTest(Class<?> klass, RunnerBuilder builder)
        throws InitializationError {
    super(klass, builder);
}
项目:photon-model    文件:ProvisionSubnetTaskServiceTest.java   
public ProvisionSubnetTaskServiceTest(Class<?> klass, RunnerBuilder builder)
        throws InitializationError {
    super(klass, builder);
}
项目:photon-model    文件:NicSecurityGroupsTaskServiceTest.java   
public NicSecurityGroupsTaskServiceTest(Class<?> klass, RunnerBuilder builder)
        throws InitializationError {
    super(klass, builder);
}
项目:photon-model    文件:EndpointAllocationTaskServiceTest.java   
public EndpointAllocationTaskServiceTest(Class<?> klass,
        RunnerBuilder builder) throws InitializationError {
    super(klass, builder);
}
项目:photon-model    文件:ImageEnumerationTaskServiceTest.java   
public ImageEnumerationTaskServiceTest(Class<?> klass, RunnerBuilder builder) throws Throwable {
    super(klass, builder);
}
项目:photon-model    文件:ProvisionLoadBalancerTaskServiceTest.java   
public ProvisionLoadBalancerTaskServiceTest(Class<?> klass, RunnerBuilder builder)
        throws InitializationError {
    super(klass, builder);
}
项目:photon-model    文件:ResourceEnumerationTaskServiceTest.java   
public ResourceEnumerationTaskServiceTest(Class<?> klass,
        RunnerBuilder builder) throws InitializationError {
    super(klass, builder);
}