use of org.pentaho.di.trans.steps.loadsave.LoadSaveTester in project pentaho-kettle by pentaho.
the class OlapInputMetaTest method testRoundTrip.
@Test
public void testRoundTrip() throws KettleException {
List<String> attributes = Arrays.asList("url", "username", "password", "mdx", "catalog", "variables_active");
Map<String, String> getterMap = new HashMap<String, String>();
getterMap.put("url", "getOlap4jUrl");
getterMap.put("username", "getUsername");
getterMap.put("password", "getPassword");
getterMap.put("mdx", "getMdx");
getterMap.put("catalog", "getCatalog");
getterMap.put("variables_active", "isVariableReplacementActive");
Map<String, String> setterMap = new HashMap<String, String>();
setterMap.put("url", "setOlap4jUrl");
setterMap.put("username", "setUsername");
setterMap.put("password", "setPassword");
setterMap.put("mdx", "setMdx");
setterMap.put("catalog", "setCatalog");
setterMap.put("variables_active", "setVariableReplacementActive");
LoadSaveTester loadSaveTester = new LoadSaveTester(OlapInputMeta.class, attributes, getterMap, setterMap);
loadSaveTester.testSerialization();
}
use of org.pentaho.di.trans.steps.loadsave.LoadSaveTester in project pentaho-kettle by pentaho.
the class ParGzipCsvInputMetaTest method setUpLoadSave.
@Before
public void setUpLoadSave() throws Exception {
KettleEnvironment.init();
PluginRegistry.init(false);
List<String> attributes = Arrays.asList("filename", "filenameField", "includingFilename", "rowNumField", "headerPresent", "delimiter", "enclosure", "bufferSize", "lazyConversionActive", "addResultFile", "runningInParallel", "encoding", "inputFields");
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("inputFields", new ArrayLoadSaveValidator<TextFileInputField>(new TextFileInputFieldValidator(), 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 PentahoReportingOutputMetaLoadSaveTest method setUpLoadSave.
@Before
public void setUpLoadSave() throws Exception {
KettleEnvironment.init();
PluginRegistry.init(false);
List<String> attributes = Arrays.asList("inputFileField", "outputFileField", "parameterFieldMap", "outputProcessorType", "createParentfolder");
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("parameterFieldMap", new MapLoadSaveValidator<String, String>(new StringLoadSaveValidator(), new StringLoadSaveValidator(), 5));
attrValidatorMap.put("outputProcessorType", new ProcessorTypeLoadSaveValidator());
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 PGBulkLoaderMetaTest method setUpLoadSave.
@Before
public void setUpLoadSave() throws Exception {
KettleEnvironment.init();
PluginRegistry.init(false);
List<String> attributes = Arrays.asList("schemaName", "tableName", "loadAction", "dbNameOverride", "delimiter", "enclosure", "stopOnError", "fieldTable", "fieldStream", "dateMask", "databaseMeta");
Map<String, String> getterMap = new HashMap<String, String>() {
{
put("schemaName", "getSchemaName");
put("tableName", "getTableName");
put("loadAction", "getLoadAction");
put("dbNameOverride", "getDbNameOverride");
put("delimiter", "getDelimiter");
put("enclosure", "getEnclosure");
put("stopOnError", "isStopOnError");
put("fieldTable", "getFieldTable");
put("fieldStream", "getFieldStream");
put("dateMask", "getDateMask");
put("databaseMeta", "getDatabaseMeta");
}
};
Map<String, String> setterMap = new HashMap<String, String>() {
{
put("schemaName", "setSchemaName");
put("tableName", "setTableName");
put("loadAction", "setLoadAction");
put("dbNameOverride", "setDbNameOverride");
put("delimiter", "setDelimiter");
put("enclosure", "setEnclosure");
put("stopOnError", "setStopOnError");
put("fieldTable", "setFieldTable");
put("fieldStream", "setFieldStream");
put("dateMask", "setDateMask");
put("databaseMeta", "setDatabaseMeta");
}
};
FieldLoadSaveValidator<String[]> stringArrayLoadSaveValidator = new ArrayLoadSaveValidator<String>(new StringLoadSaveValidator(), 5);
FieldLoadSaveValidator<String[]> datemaskArrayLoadSaveValidator = new ArrayLoadSaveValidator<String>(new DateMaskLoadSaveValidator(), 5);
Map<String, FieldLoadSaveValidator<?>> attrValidatorMap = new HashMap<String, FieldLoadSaveValidator<?>>();
attrValidatorMap.put("fieldTable", stringArrayLoadSaveValidator);
attrValidatorMap.put("fieldStream", stringArrayLoadSaveValidator);
attrValidatorMap.put("dateMask", datemaskArrayLoadSaveValidator);
attrValidatorMap.put("databaseMeta", new DatabaseMetaLoadSaveValidator());
Map<String, FieldLoadSaveValidator<?>> typeValidatorMap = new HashMap<String, FieldLoadSaveValidator<?>>();
// typeValidatorMap.put( int[].class.getCanonicalName(), new PrimitiveIntArrayLoadSaveValidator( new IntLoadSaveValidator(), 1 ) );
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 PGPEncryptStreamMetaTest method setUpLoadSave.
@Before
public void setUpLoadSave() throws Exception {
KettleEnvironment.init();
PluginRegistry.init(false);
List<String> attributes = Arrays.asList("gPGLocation", "keynameFieldName", "streamField", "resultFieldName", "keynameInField", "keynameFieldName");
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