public static <T extends Performable> T instrumented(Class<T> stepClass, Object... parameters) { return stepFactory.getUniqueStepLibraryFor(stepClass, parameters); } }
private void initStepFactory() { stepFactory = new StepFactory(); }
/** * Create a new instance of a class containing test steps using custom interceptors. */ public <T> T instantiateNewStepLibraryFor(Class<T> scenarioStepsClass, MethodInterceptor interceptor) { T steps = createProxyStepLibrary(scenarioStepsClass, interceptor); indexStepLibrary(scenarioStepsClass, steps); instantiateAnyNestedStepLibrariesIn(steps, scenarioStepsClass); injectOtherDependenciesInto(steps); return steps; }
public <T> T getNewStepLibraryFor(final Class<T> scenarioStepsClass) { if (isStepLibraryInstantiatedFor(scenarioStepsClass)) { return getManagedStepLibraryFor(scenarioStepsClass); } else { return instantiateNewStepLibraryFor(scenarioStepsClass); } }
private <T> T instantiateUniqueStepLibraryFor(Class<T> scenarioStepsClass, Object... parameters) { StepInterceptor stepInterceptor = new StepInterceptor(scenarioStepsClass); T steps = createProxyStepLibrary(scenarioStepsClass, stepInterceptor, parameters); instantiateAnyNestedStepLibrariesIn(steps, scenarioStepsClass); injectOtherDependenciesInto(steps); return steps; }
AmazonElasticMapReduceClient emr = new AmazonElasticMapReduceClient(credentials); StepFactory stepFactory = new StepFactory(); .withHadoopJarStep(stepFactory.newEnableDebuggingStep()); .withHadoopJarStep(stepFactory.newInstallHiveStep()); .withHadoopJarStep(stepFactory.newRunHiveScriptStep("s3://dummy/dummy.hive"));
public Object newDataDrivenSteps(final Class<?> scenarioStepsClass, final List<?> instantiatedSteps) { DataDrivenStepInterceptor stepInterceptor = new DataDrivenStepInterceptor(instantiatedSteps); return factory.instantiateNewStepLibraryFor(scenarioStepsClass, stepInterceptor); } }
AmazonElasticMapReduceClient emr = new AmazonElasticMapReduceClient(credentials); StepFactory stepFactory = new StepFactory(); .withActionOnFailure("TERMINATE_JOB_FLOW").withHadoopJarStep(stepFactory.newEnableDebuggingStep()); .withHadoopJarStep(stepFactory.newInstallHiveStep()); List<String> setMappersArgs = new ArrayList<String>(); setMappersArgs.add("-s");
private <T> T webEnabledStepLibrary(final Class<T> scenarioStepsClass, final Enhancer e) { if (hasAPagesConstructor(scenarioStepsClass)) { Object[] arguments = new Object[1]; arguments[0] = pages; return (T) e.create(CONSTRUCTOR_ARG_TYPES, arguments); } else { T newStepLibrary = (T) e.create(); return injectPagesInto(scenarioStepsClass, newStepLibrary); } }
StepFactory stepFactory = new StepFactory(); stepFactory.newRunHiveScriptStep(rb.getString("scriptClienteS3"), "-d", "s3DataToProcess=s3://"+rb.getString("bucketPropio")+"/"+rb.getString("ruta_input_c1")+folderS3.getNameKey(), "-d", "s3DataToProcessOut=s3://"+rb.getString("bucketPropioOUT")+"/"+rb.getString("ruta_output_c1")+folderS3.getOutputFolder(),
public <T> T getUniqueStepLibraryFor(final Class<T> scenarioStepsClass) { return instantiateUniqueStepLibraryFor(scenarioStepsClass); }
private <T> void injectOtherDependenciesInto(T steps) { List<DependencyInjector> dependencyInjectors = dependencyInjectorService.findDependencyInjectors(); dependencyInjectors.addAll(getDefaultDependencyInjectors()); for(DependencyInjector dependencyInjector : dependencyInjectors) { dependencyInjector.injectDependenciesInto(steps); } }
private <T> T stepLibraryWithPages(final Class<T> scenarioStepsClass, final Enhancer e) { T newStepLibrary = (T) e.create(); return injectPagesInto(scenarioStepsClass, newStepLibrary); }
/** * Returns a new ScenarioSteps instance, of the specified type. * This is actually a proxy that allows reporting and screenshots to * be performed at each step. */ public <T> T getStepLibraryFor(final Class<T> scenarioStepsClass) { if (isStepLibraryInstantiatedFor(scenarioStepsClass)) { return getManagedStepLibraryFor(scenarioStepsClass); } else { return instantiateNewStepLibraryFor(scenarioStepsClass); } }
private <T> T instantiateUniqueStepLibraryFor(Class<T> scenarioStepsClass) { StepInterceptor stepInterceptor = new StepInterceptor(scenarioStepsClass); T steps = createProxyStepLibrary(scenarioStepsClass, stepInterceptor); instantiateAnyNestedStepLibrariesIn(steps, scenarioStepsClass); injectOtherDependenciesInto(steps); return steps; }
/** * Create a new instance of a class containing test steps. * This method will instrument the class appropriately and inject any nested step libraries or * other dependencies. */ public <T> T instantiateNewStepLibraryFor(Class<T> scenarioStepsClass) { StepInterceptor stepInterceptor = new StepInterceptor(scenarioStepsClass); return instantiateNewStepLibraryFor(scenarioStepsClass, stepInterceptor); }
private <T> T webEnabledStepLibrary(final Class<T> scenarioStepsClass, final Enhancer e) { if (hasAPagesConstructor(scenarioStepsClass)) { Object[] arguments = new Object[1]; arguments[0] = pages; return (T) e.create(CONSTRUCTOR_ARG_TYPES, arguments); } else { T newStepLibrary = (T) e.create(); return injectPagesInto(scenarioStepsClass, newStepLibrary); } }
public <T> T getUniqueStepLibraryFor(final Class<T> scenarioStepsClass) { return instantiateUniqueStepLibraryFor(scenarioStepsClass); }
private <T> void injectOtherDependenciesInto(T steps) { List<DependencyInjector> dependencyInjectors = dependencyInjectorService.findDependencyInjectors(); dependencyInjectors.addAll(getDefaultDependencyInjectors()); for (DependencyInjector dependencyInjector : dependencyInjectors) { dependencyInjector.injectDependenciesInto(steps); } }
private <T> T webEnabledStepLibrary(final Class<T> scenarioStepsClass, final Enhancer e) { if (StepLibraryType.ofClass(scenarioStepsClass).hasAPagesConstructor()) { Object[] arguments = new Object[1]; arguments[0] = pages; return (T) e.create(CONSTRUCTOR_ARG_TYPES, arguments); } else { T newStepLibrary = (T) e.create(); return injectPagesInto(scenarioStepsClass, newStepLibrary); } }