use of org.pentaho.di.trans.steps.loadsave.LoadSaveTester in project pentaho-kettle by pentaho.
the class SelectValuesMetaTest method loadSaveTest.
@Test
public void loadSaveTest() throws KettleException {
List<String> attributes = Arrays.asList("selectFields", "deleteName");
SelectField selectField = new SelectField();
selectField.setName("TEST_NAME");
selectField.setRename("TEST_RENAME");
selectField.setLength(2);
selectField.setPrecision(2);
Map<String, FieldLoadSaveValidator<?>> fieldLoadSaveValidatorTypeMap = new HashMap<String, FieldLoadSaveValidator<?>>();
fieldLoadSaveValidatorTypeMap.put(SelectField[].class.getCanonicalName(), new ArrayLoadSaveValidator<SelectField>(new SelectFieldLoadSaveValidator(selectField), 2));
LoadSaveTester tester = new LoadSaveTester(SelectValuesMeta.class, attributes, new HashMap<String, String>(), new HashMap<String, String>(), new HashMap<String, FieldLoadSaveValidator<?>>(), fieldLoadSaveValidatorTypeMap);
tester.testSerialization();
}
use of org.pentaho.di.trans.steps.loadsave.LoadSaveTester in project pentaho-kettle by pentaho.
the class SetValueConstantMetaTest method setUpLoadSave.
@Before
public void setUpLoadSave() throws Exception {
KettleEnvironment.init();
PluginRegistry.init(false);
List<String> attributes = Arrays.asList("fieldName", "replaceValue", "replaceMask", "setEmptyString", "usevar");
Map<String, String> getterMap = new HashMap<String, String>() {
{
put("fieldName", "getFieldName");
put("replaceValue", "getReplaceValue");
put("replaceMask", "getReplaceMask");
put("setEmptyString", "isSetEmptyString");
put("usevar", "isUseVars");
}
};
Map<String, String> setterMap = new HashMap<String, String>() {
{
put("fieldName", "setFieldName");
put("replaceValue", "setReplaceValue");
put("replaceMask", "setReplaceMask");
put("setEmptyString", "setEmptyString");
put("usevar", "setUseVars");
}
};
FieldLoadSaveValidator<String[]> stringArrayLoadSaveValidator = new ArrayLoadSaveValidator<String>(new StringLoadSaveValidator(), 5);
Map<String, FieldLoadSaveValidator<?>> attrValidatorMap = new HashMap<String, FieldLoadSaveValidator<?>>();
attrValidatorMap.put("fieldName", stringArrayLoadSaveValidator);
attrValidatorMap.put("replaceValue", stringArrayLoadSaveValidator);
attrValidatorMap.put("replaceMask", stringArrayLoadSaveValidator);
attrValidatorMap.put("setEmptyString", new PrimitiveBooleanArrayLoadSaveValidator(new BooleanLoadSaveValidator(), 5));
Map<String, FieldLoadSaveValidator<?>> typeValidatorMap = new HashMap<String, FieldLoadSaveValidator<?>>();
loadSaveTester = new LoadSaveTester(testMetaClass, attributes, new ArrayList<String>(), new ArrayList<String>(), getterMap, setterMap, attrValidatorMap, typeValidatorMap, this);
}
use of org.pentaho.di.trans.steps.loadsave.LoadSaveTester in project pentaho-kettle by pentaho.
the class SFTPPutMetaTest method setUpLoadSave.
@Before
public void setUpLoadSave() throws Exception {
KettleEnvironment.init();
PluginRegistry.init(false);
List<String> attributes = Arrays.asList("serverName", "serverPort", "userName", "password", "sourceFileFieldName", "remoteDirectoryFieldName", "addFilenameResut", "inputStream", "useKeyFile", "keyFilename", "keyPassPhrase", "compression", "createRemoteFolder", "proxyType", "proxyHost", "proxyPort", "proxyUsername", "proxyPassword", "destinationFolderFieldName", "createDestinationFolder", "afterFTPS", "remoteFilenameFieldName");
Map<String, String> getterMap = new HashMap<String, String>();
Map<String, String> setterMap = new HashMap<String, String>();
Map<String, FieldLoadSaveValidator<?>> attrValidatorMap = new HashMap<String, FieldLoadSaveValidator<?>>();
// See JobEntrySFTPPUT for the boundary ... chose not to create a test dependency between the Step and the JobEntry.
attrValidatorMap.put("afterFTPS", new IntLoadSaveValidator(3));
Map<String, FieldLoadSaveValidator<?>> typeValidatorMap = new HashMap<String, FieldLoadSaveValidator<?>>();
loadSaveTester = new LoadSaveTester(testMetaClass, attributes, getterMap, setterMap, attrValidatorMap, typeValidatorMap);
}
use of org.pentaho.di.trans.steps.loadsave.LoadSaveTester in project pentaho-kettle by pentaho.
the class SimpleMappingMetaTest method setUpLoadSave.
@Before
public void setUpLoadSave() throws Exception {
KettleEnvironment.init();
PluginRegistry.init(false);
List<String> attributes = Arrays.asList("transName", "fileName", "directoryPath", "transObjectId", "specificationMethod", "inputMapping", "outputMapping", "mappingParameters");
Map<String, String> getterMap = new HashMap<String, String>();
Map<String, String> setterMap = new HashMap<String, String>();
Map<String, FieldLoadSaveValidator<?>> attrValidatorMap = new HashMap<String, FieldLoadSaveValidator<?>>();
attrValidatorMap.put("transObjectId", new ObjectIdLoadSaveValidator());
attrValidatorMap.put("specificationMethod", new ObjectLocationSpecificationMethodLoadSaveValidator());
attrValidatorMap.put("inputMapping", new MappingIODefinitionLoadSaveValidator());
attrValidatorMap.put("outputMapping", new MappingIODefinitionLoadSaveValidator());
attrValidatorMap.put("mappingParameters", new MappingParametersLoadSaveValidator());
Map<String, FieldLoadSaveValidator<?>> typeValidatorMap = new HashMap<String, FieldLoadSaveValidator<?>>();
loadSaveTester = new LoadSaveTester(testMetaClass, attributes, getterMap, setterMap, attrValidatorMap, typeValidatorMap);
}
use of org.pentaho.di.trans.steps.loadsave.LoadSaveTester in project pentaho-kettle by pentaho.
the class SingleThreaderMetaTest method setUpLoadSave.
@Before
public void setUpLoadSave() throws Exception {
KettleEnvironment.init();
PluginRegistry.init(false);
List<String> attributes = Arrays.asList("transName", "fileName", "directoryPath", "batchSize", "batchTime", "injectStep", "retrieveStep", "passingAllParameters", "specificationMethod", "transObjectId", "parameters", "parameterValues");
Map<String, String> getterMap = new HashMap<String, String>();
Map<String, String> setterMap = new HashMap<String, String>();
FieldLoadSaveValidator<String[]> stringArrayLoadSaveValidator = new ArrayLoadSaveValidator<String>(new StringLoadSaveValidator(), 5);
Map<String, FieldLoadSaveValidator<?>> attrValidatorMap = new HashMap<String, FieldLoadSaveValidator<?>>();
attrValidatorMap.put("parameters", stringArrayLoadSaveValidator);
attrValidatorMap.put("parameterValues", stringArrayLoadSaveValidator);
attrValidatorMap.put("specificationMethod", new ObjectLocationSpecificationMethodLoadSaveValidator());
attrValidatorMap.put("transObjectId", new ObjectIdLoadSaveValidator());
Map<String, FieldLoadSaveValidator<?>> typeValidatorMap = new HashMap<String, FieldLoadSaveValidator<?>>();
loadSaveTester = new LoadSaveTester(testMetaClass, attributes, new ArrayList<String>(), new ArrayList<String>(), getterMap, setterMap, attrValidatorMap, typeValidatorMap, this);
}
Aggregations