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(); } }
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); } } } ); }
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); } }
@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; }
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); } }); }
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; }
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(); } }
@SuppressWarnings("deprecation") public CustomSuite(final Class<?> klass, final RunnerBuilder builder) throws InitializationError { super(klass, builder, new Class<?>[]{ CustomTest.class, }, null, false, TraversalEngine.Type.STANDARD); }
/** * 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); } }
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); }
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); }
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); }
public TestsInPkgSuite(Class<?> klass, RunnerBuilder builder) throws InitializationError { super(builder, klass, getPkgTestClasses(klass)); }
@Override public Runner getSuite(RunnerBuilder builder, java.lang.Class<?>[] classes) throws InitializationError { Runner suite = super.getSuite(builder, classes); return fClasses ? parallelize(suite) : suite; }
@Override protected Runner getRunner(RunnerBuilder builder, Class<?> testClass) throws Throwable { Runner runner = super.getRunner(builder, testClass); return fMethods ? parallelize(runner) : runner; }
public EnclosedParallel(Class<?> klass, RunnerBuilder builder) throws Throwable { super(klass, builder); this.setScheduler(new ParallelScheduler()); }
public ParallelCategories(Class<?> klass, RunnerBuilder builder) throws InitializationError { super(klass, builder); this.setScheduler(new ParallelScheduler()); }
public ParallelSuite(Class<?> klass, RunnerBuilder builder) throws InitializationError { super(klass, builder); this.setScheduler(new ParallelScheduler()); }
public ParallelSuite(RunnerBuilder builder, Class<?> klass, Class<?>[] suiteClasses) throws InitializationError { super(builder, klass, suiteClasses); this.setScheduler(new ParallelScheduler()); }
public ParallelSuite(RunnerBuilder builder, Class<?>[] classes) throws InitializationError { super(builder, classes); this.setScheduler(new ParallelScheduler()); }
public XTFTestSuite(final Class<?> suiteClass, final RunnerBuilder builder) throws InitializationError { super(suiteClass); XTFTestSuite.suiteClass = suiteClass; testRunners = getRunners(suiteClass, builder); }
public BitsyGraphStructureTestSuite(final Class<?> klass, final RunnerBuilder builder) throws InitializationError { super(klass, builder, allTests, null, false, TraversalEngine.Type.STANDARD); }
public SuiteRunner(final Class<?> klass, final RunnerBuilder builder) throws InitializationError { super(klass, getRunners(klass)); }
public SuiteRunner(Class<?> klass, RunnerBuilder builder) throws InitializationError { super(builder, klass, loadClasses(klass)); }
/** * Only called reflectively. Do not use programmatically. */ public ClasspathSuite(Class<?> klass, RunnerBuilder builder) throws Throwable { super(builder, klass, getClasses(klass)); }
/** * Only called reflectively. Do not use programmatically. */ public CustomSuite(Class<?> klass, RunnerBuilder builder) throws Throwable { super(builder, klass, getClasses(klass)); }
public VerboseSuite(Class<?> klass, RunnerBuilder builder) throws InitializationError { super(klass, builder); }
public BaseClassFilteringTestSuite(final Class<?> clazz, final RunnerBuilder builder) throws InitializationError { super(builder, clazz, getSuiteClasses(clazz)); }
public ProvisionComputeTaskServiceTest(Class<?> klass, RunnerBuilder builder) throws InitializationError { super(klass, builder); }
public ResourcePoolQueryHelperTest(Class<?> klass, RunnerBuilder builder) throws InitializationError { super(klass, builder); }
public AuthTranslationServiceTest(Class<?> klass, RunnerBuilder builder) throws InitializationError { super(klass, builder); }
public ScheduledTaskServiceTest(Class<?> klass, RunnerBuilder builder) throws InitializationError { super(klass, builder); }
public IPAddressReleaseTaskServiceTest(Class<?> klass, RunnerBuilder builder) throws InitializationError { super(klass, builder); }
public SshCommandTaskServiceTest(Class<?> klass, RunnerBuilder builder) throws InitializationError { super(klass, builder); }
public ProvisionSubnetTaskServiceTest(Class<?> klass, RunnerBuilder builder) throws InitializationError { super(klass, builder); }
public NicSecurityGroupsTaskServiceTest(Class<?> klass, RunnerBuilder builder) throws InitializationError { super(klass, builder); }
public EndpointAllocationTaskServiceTest(Class<?> klass, RunnerBuilder builder) throws InitializationError { super(klass, builder); }
public ImageEnumerationTaskServiceTest(Class<?> klass, RunnerBuilder builder) throws Throwable { super(klass, builder); }
public ProvisionLoadBalancerTaskServiceTest(Class<?> klass, RunnerBuilder builder) throws InitializationError { super(klass, builder); }
public ResourceEnumerationTaskServiceTest(Class<?> klass, RunnerBuilder builder) throws InitializationError { super(klass, builder); }