use of org.pentaho.di.trans.steps.loadsave.LoadSaveTester in project pentaho-kettle by pentaho.
the class PGPDecryptStreamMetaTest method setUpLoadSave.
@Before
public void setUpLoadSave() throws Exception {
KettleEnvironment.init();
PluginRegistry.init(false);
List<String> attributes = Arrays.asList("gPGLocation", "passphrase", "passphraseFieldName", "passphraseFieldName", "streamField", "resultFieldName");
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 ProcessFilesMetaTest method testSerialization.
@Test
public void testSerialization() throws KettleException {
List<String> attributes = Arrays.asList("DynamicSourceFileNameField", "DynamicTargetFileNameField", "OperationType", "AddTargetFileNameToResult", "OverwriteTargetFile", "CreateParentFolder", "Simulate");
Map<String, String> getterMap = new HashMap<String, String>();
Map<String, String> setterMap = new HashMap<String, String>();
Map<String, FieldLoadSaveValidator<?>> attributeMap = new HashMap<String, FieldLoadSaveValidator<?>>();
attributeMap.put("OperationType", new IntLoadSaveValidator(ProcessFilesMeta.operationTypeCode.length));
Map<String, FieldLoadSaveValidator<?>> typeMap = new HashMap<String, FieldLoadSaveValidator<?>>();
LoadSaveTester<ProcessFilesMeta> tester = new LoadSaveTester<ProcessFilesMeta>(ProcessFilesMeta.class, attributes, getterMap, setterMap, attributeMap, typeMap);
tester.testSerialization();
}
use of org.pentaho.di.trans.steps.loadsave.LoadSaveTester in project pentaho-kettle by pentaho.
the class ReservoirSamplingMetaTest method testLoadSaveMeta.
@Test
public void testLoadSaveMeta() throws KettleException {
List<String> attributes = Arrays.asList("sample_size", "seed");
Map<String, String> getterMap = new HashMap<String, String>();
getterMap.put("sample_size", "getSampleSize");
getterMap.put("seed", "getSeed");
Map<String, String> setterMap = new HashMap<String, String>();
setterMap.put("sample_size", "setSampleSize");
setterMap.put("seed", "setSeed");
LoadSaveTester tester = new LoadSaveTester(ReservoirSamplingMeta.class, attributes, getterMap, setterMap);
tester.testSerialization();
}
use of org.pentaho.di.trans.steps.loadsave.LoadSaveTester in project pentaho-kettle by pentaho.
the class RowGeneratorMetaTest method setUpLoadSave.
@Before
public void setUpLoadSave() throws Exception {
KettleEnvironment.init();
PluginRegistry.init(false);
List<String> attributes = Arrays.asList("neverEnding", "intervalInMs", "rowTimeField", "lastTimeField", "rowLimit", "currency", "decimal", "group", "value", "fieldName", "fieldType", "fieldFormat", "fieldLength", "fieldPrecision");
Map<String, String> getterMap = new HashMap<String, String>() {
{
put("neverEnding", "isNeverEnding");
put("intervalInMs", "getIntervalInMs");
put("rowTimeField", "getRowTimeField");
put("lastTimeField", "getLastTimeField");
put("rowLimit", "getRowLimit");
put("currency", "getCurrency");
put("decimal", "getDecimal");
put("group", "getGroup");
put("value", "getValue");
put("fieldName", "getFieldName");
put("fieldType", "getFieldType");
put("fieldFormat", "getFieldFormat");
put("fieldLength", "getFieldLength");
put("fieldPrecision", "getFieldPrecision");
}
};
Map<String, String> setterMap = new HashMap<String, String>() {
{
put("neverEnding", "setNeverEnding");
put("intervalInMs", "setIntervalInMs");
put("rowTimeField", "setRowTimeField");
put("lastTimeField", "setLastTimeField");
put("rowLimit", "setRowLimit");
put("currency", "setCurrency");
put("decimal", "setDecimal");
put("group", "setGroup");
put("value", "setValue");
put("fieldName", "setFieldName");
put("fieldType", "setFieldType");
put("fieldFormat", "setFieldFormat");
put("fieldLength", "setFieldLength");
put("fieldPrecision", "setFieldPrecision");
}
};
FieldLoadSaveValidator<String[]> stringArrayLoadSaveValidator = new ArrayLoadSaveValidator<String>(new StringLoadSaveValidator(), 5);
Map<String, FieldLoadSaveValidator<?>> attrValidatorMap = new HashMap<String, FieldLoadSaveValidator<?>>();
attrValidatorMap.put("currency", stringArrayLoadSaveValidator);
attrValidatorMap.put("decimal", stringArrayLoadSaveValidator);
attrValidatorMap.put("group", stringArrayLoadSaveValidator);
attrValidatorMap.put("value", stringArrayLoadSaveValidator);
attrValidatorMap.put("fieldName", stringArrayLoadSaveValidator);
attrValidatorMap.put("fieldType", stringArrayLoadSaveValidator);
attrValidatorMap.put("fieldFormat", stringArrayLoadSaveValidator);
attrValidatorMap.put("fieldLength", new PrimitiveIntArrayLoadSaveValidator(new IntLoadSaveValidator(100), 5));
attrValidatorMap.put("fieldPrecision", new PrimitiveIntArrayLoadSaveValidator(new IntLoadSaveValidator(9), 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 GroupByMetaTest method setUpLoadSave.
@Before
public void setUpLoadSave() throws Exception {
KettleEnvironment.init();
PluginRegistry.init(false);
List<String> attributes = Arrays.asList("passAllRows", "directory", "prefix", "aggregateIgnored", "aggregateIgnoredField", "addingLineNrInGroup", "lineNrInGroupField", "alwaysGivingBackOneRow", "groupField", "aggregateField", "subjectField", "aggregateType", "valueField");
Map<String, String> getterMap = new HashMap<String, String>() {
{
put("passAllRows", "passAllRows");
}
};
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("groupField", stringArrayLoadSaveValidator);
attrValidatorMap.put("aggregateField", stringArrayLoadSaveValidator);
attrValidatorMap.put("subjectField", stringArrayLoadSaveValidator);
attrValidatorMap.put("valueField", stringArrayLoadSaveValidator);
attrValidatorMap.put("aggregateType", new PrimitiveIntArrayLoadSaveValidator(new IntLoadSaveValidator(GroupByMeta.typeGroupCode.length), 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);
}
Aggregations