/** * Truncates jobflow input. * @param description the target importer description * @throws IOException if failed to truncate the input */ public void truncate(ImporterDescription description) throws IOException { LOG.info(MessageFormat.format( Messages.getString("BatchTestTool.infoCleaningInput"), //$NON-NLS-1$ description.getClass().getName())); TestModerator moderator = new TestModerator(getTestTools(), this); moderator.truncate(description); }
/** * Truncates jobflow output. * @param description the target exporter description * @throws IOException if failed to truncate the output */ public void truncate(ExporterDescription description) throws IOException { LOG.info(MessageFormat.format( Messages.getString("BatchTestTool.infoCleaningOutput"), //$NON-NLS-1$ description.getClass().getName())); TestModerator moderator = new TestModerator(getTestTools(), this); moderator.truncate(description); }
private void validateTestCondition() throws IOException { TestModerator moderator = new TestModerator(driverContext.getRepository(), driverContext); for (Map.Entry<? extends ImporterDescription, ? extends DataModelSourceFactory> entry : getExternalResources().entrySet()) { ImporterDescription description = entry.getKey(); String label = String.format("Resource(%s)", description); //$NON-NLS-1$ DataModelSourceFactory source = entry.getValue(); moderator.validate(entry.getKey().getModelType(), label, source); } for (Map.Entry<String, JobFlowTester> entry : jobflowMap.entrySet()) { validateTestCondition(entry.getValue(), entry.getKey()); } }
/** * Collects jobflow output. * @param description the exporter description * @param sink the output sink * @throws IOException if failed to collect the output * @since 0.9.1 */ public void collect(ExporterDescription description, DataModelSinkFactory sink) throws IOException { TestModerator moderator = new TestModerator(getTestTools(), this); moderator.save(description.getModelType(), description, sink); }
/** * Prepares jobflow input. * @param description the importer description * @param source the data model source * @throws IOException if failed to prepare the input */ public void prepare(ImporterDescription description, DataModelSourceFactory source) throws IOException { TestModerator moderator = new TestModerator(getTestTools(), this); moderator.prepare(description.getModelType(), description, source); }
/** * Creates a new instance. * @param context submission context * @throws IllegalArgumentException if some parameters were {@code null} */ JobflowExecutor(TestDriverContext context) { if (context == null) { throw new IllegalArgumentException("context must not be null"); //$NON-NLS-1$ } this.driverContext = context; this.moderator = new TestModerator(context.getRepository(), context); this.taskExecutors = new ArrayList<>(); taskExecutors.addAll(TaskExecutors.loadDefaults(context.getClassLoader())); taskExecutors.add(new DefaultHadoopTaskExecutor()); taskExecutors.add(new DefaultCommandTaskExecutor()); taskExecutors.add(new DefaultDeleteTaskExecutor()); this.configurations = ConfigurationFactory.getDefault(); }
/** * Verifies jobflow output. * @param description the exporter description * @param verifier the verifier * @return verify differences * @throws IOException if failed to verify the output */ public List<Difference> verify(ExporterDescription description, VerifierFactory verifier) throws IOException { TestModerator moderator = new TestModerator(getTestTools(), this); return moderator.inspect( description.getModelType(), description, new VerifyContext(this), verifier); }
private void validateTestCondition() throws IOException { TestModerator moderator = new TestModerator(driverContext.getRepository(), driverContext); for (Map.Entry<? extends ImporterDescription, ? extends DataModelSourceFactory> entry : getExternalResources().entrySet()) { ImporterDescription description = entry.getKey(); String label = String.format("Resource(%s)", description); //$NON-NLS-1$ DataModelSourceFactory source = entry.getValue(); moderator.validate(entry.getKey().getModelType(), label, source); } for (DriverInputBase<?> port : inputs) { String label = String.format("Input(%s)", port.getName()); //$NON-NLS-1$ Class<?> type = port.getModelType(); DataModelSourceFactory source = port.getSource(); if (source != null) { moderator.validate(type, label, source); } } for (DriverOutputBase<?> port : outputs) { String label = String.format("Output(%s)", port.getName()); //$NON-NLS-1$ Class<?> type = port.getModelType(); DataModelSourceFactory source = port.getSource(); if (source != null) { moderator.validate(type, label, source); } VerifierFactory verifier = port.getVerifier(); if (verifier != null) { moderator.validate(type, label, verifier); } } }
private void validateTestCondition() throws IOException { TestModerator moderator = new TestModerator(driverContext.getRepository(), driverContext); for (Map.Entry<? extends ImporterDescription, ? extends DataModelSourceFactory> entry : getExternalResources().entrySet()) {
private void validateTestCondition(JobFlowTester flow, String id) throws IOException { TestModerator moderator = new TestModerator(driverContext.getRepository(), driverContext); for (DriverInputBase<?> port : flow.inputs) { String label = String.format("Input(flow=%s, name=%s)", id, port.getName()); //$NON-NLS-1$ Class<?> type = port.getModelType(); DataModelSourceFactory source = port.getSource(); if (source != null) { moderator.validate(type, label, source); } } for (DriverOutputBase<?> port : flow.outputs) { String label = String.format("Output(flow=%s, name=%s)", id, port.getName()); //$NON-NLS-1$ Class<?> type = port.getModelType(); DataModelSourceFactory source = port.getSource(); if (source != null) { moderator.validate(type, label, source); } VerifierFactory verifier = port.getVerifier(); if (verifier != null) { moderator.validate(type, label, verifier); } } } }