use of org.pentaho.di.trans.steps.loadsave.LoadSaveTester in project pentaho-kettle by pentaho.
the class StringCutMetaTest method setUpLoadSave.
@Before
public void setUpLoadSave() throws Exception {
KettleEnvironment.init();
PluginRegistry.init(false);
List<String> attributes = Arrays.asList("fieldInStream", "fieldOutStream", "cutFrom", "cutTo");
Map<String, String> getterMap = new HashMap<String, String>() {
{
put("fieldInStream", "getFieldInStream");
put("fieldOutStream", "getFieldOutStream");
put("cutFrom", "getCutFrom");
put("cutTo", "getCutTo");
}
};
Map<String, String> setterMap = new HashMap<String, String>() {
{
put("fieldInStream", "setFieldInStream");
put("fieldOutStream", "setFieldOutStream");
put("cutFrom", "setCutFrom");
put("cutTo", "setCutTo");
}
};
FieldLoadSaveValidator<String[]> stringArrayLoadSaveValidator = new ArrayLoadSaveValidator<String>(new StringLoadSaveValidator(), 5);
Map<String, FieldLoadSaveValidator<?>> attrValidatorMap = new HashMap<String, FieldLoadSaveValidator<?>>();
attrValidatorMap.put("fieldInStream", stringArrayLoadSaveValidator);
attrValidatorMap.put("fieldOutStream", stringArrayLoadSaveValidator);
attrValidatorMap.put("cutFrom", stringArrayLoadSaveValidator);
attrValidatorMap.put("cutTo", stringArrayLoadSaveValidator);
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 SystemDataMetaTest method setUpLoadSave.
@Before
public void setUpLoadSave() throws Exception {
KettleEnvironment.init();
PluginRegistry.init(false);
List<String> attributes = Arrays.asList("fieldName", "fieldType");
Map<String, String> getterMap = new HashMap<String, String>() {
{
put("fieldName", "getFieldName");
put("fieldType", "getFieldType");
}
};
Map<String, String> setterMap = new HashMap<String, String>() {
{
put("fieldName", "setFieldName");
put("fieldType", "setFieldType");
}
};
FieldLoadSaveValidator<String[]> stringArrayLoadSaveValidator = new ArrayLoadSaveValidator<String>(new StringLoadSaveValidator(), 5);
FieldLoadSaveValidator<SystemDataTypes[]> sdtArrayLoadSaveValidator = new ArrayLoadSaveValidator<SystemDataTypes>(new SystemDataTypesLoadSaveValidator(), 5);
Map<String, FieldLoadSaveValidator<?>> attrValidatorMap = new HashMap<String, FieldLoadSaveValidator<?>>();
attrValidatorMap.put("fieldName", stringArrayLoadSaveValidator);
attrValidatorMap.put("fieldType", sdtArrayLoadSaveValidator);
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 TableCompareMetaTest method setUpLoadSave.
@Before
public void setUpLoadSave() throws Exception {
KettleEnvironment.init();
PluginRegistry.init(false);
List<String> attributes = Arrays.asList("referenceConnection", "referenceSchemaField", "referenceTableField", "compareConnection", "compareSchemaField", "compareTableField", "keyFieldsField", "excludeFieldsField", "nrErrorsField", "nrRecordsReferenceField", "nrRecordsCompareField", "nrErrorsLeftJoinField", "nrErrorsInnerJoinField", "nrErrorsRightJoinField", "keyDescriptionField", "valueReferenceField", "valueCompareField");
Map<String, String> getterMap = new HashMap<String, String>();
Map<String, String> setterMap = new HashMap<String, String>();
Map<String, FieldLoadSaveValidator<?>> attrValidatorMap = new HashMap<String, FieldLoadSaveValidator<?>>();
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 TableExistsMetaTest method testLoadSave.
@Test
public void testLoadSave() throws KettleException {
List<String> attributes = Arrays.asList("Database", "DynamicTablenameField", "ResultFieldName", "Schemaname");
LoadSaveTester loadSaveTester = new LoadSaveTester(TableExistsMeta.class, attributes);
loadSaveTester.testSerialization();
}
use of org.pentaho.di.trans.steps.loadsave.LoadSaveTester in project pentaho-kettle by pentaho.
the class TableInputMetaTest method setUpLoadSave.
@Before
public void setUpLoadSave() throws Exception {
KettleEnvironment.init();
PluginRegistry.init(false);
List<String> attributes = Arrays.asList("databaseMeta", "sQL", "rowLimit", "executeEachInputRow", "variableReplacementActive", "lazyConversionActive");
Map<String, String> getterMap = new HashMap<String, String>();
Map<String, String> setterMap = new HashMap<String, String>();
Map<String, FieldLoadSaveValidator<?>> attrValidatorMap = new HashMap<String, FieldLoadSaveValidator<?>>();
Map<String, FieldLoadSaveValidator<?>> typeValidatorMap = new HashMap<String, FieldLoadSaveValidator<?>>();
loadSaveTester = new LoadSaveTester(testMetaClass, attributes, getterMap, setterMap, attrValidatorMap, typeValidatorMap);
}
Aggregations