use of org.pentaho.di.trans.steps.loadsave.validator.FieldLoadSaveValidator 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.validator.FieldLoadSaveValidator 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);
}
use of org.pentaho.di.trans.steps.loadsave.validator.FieldLoadSaveValidator in project pentaho-kettle by pentaho.
the class MemoryGroupByMetaTest method setUpLoadSave.
@Before
public void setUpLoadSave() throws Exception {
KettleEnvironment.init();
PluginRegistry.init(false);
List<String> attributes = Arrays.asList("alwaysGivingBackOneRow", "groupField", "aggregateField", "subjectField", "aggregateType", "valueField");
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(MemoryGroupByMeta.typeGroupCode.length), 5));
Map<String, FieldLoadSaveValidator<?>> typeValidatorMap = new HashMap<String, FieldLoadSaveValidator<?>>();
loadSaveTester = new LoadSaveTester<MemoryGroupByMeta>(testMetaClass, attributes, new ArrayList<String>(), new ArrayList<String>(), new HashMap<String, String>(), new HashMap<String, String>(), attrValidatorMap, typeValidatorMap, this);
}
use of org.pentaho.di.trans.steps.loadsave.validator.FieldLoadSaveValidator in project pentaho-kettle by pentaho.
the class MultiMergeJoinMetaTest method setUpLoadSave.
@Before
public void setUpLoadSave() throws Exception {
KettleEnvironment.init();
PluginRegistry.init(false);
multiMergeMeta = new MultiMergeJoinMeta();
List<String> attributes = Arrays.asList("joinType", "keyFields", "inputSteps");
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("keyFields", stringArrayLoadSaveValidator);
attrValidatorMap.put("inputSteps", 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.validator.FieldLoadSaveValidator in project pentaho-kettle by pentaho.
the class MySQLBulkLoaderMetaTest method testRoundTrip.
@Test
public void testRoundTrip() throws KettleException {
List<String> attributes = Arrays.asList(/*"connection",*/
"schema", "table", "encoding", "delimiter", "enclosure", "escape_char", "replace", "ignore", "local", "fifo_file_name", "bulk_size", "stream_name", "field_name", "field_format_ok");
Map<String, String> getterMap = new HashMap<String, String>();
// getterMap.put( "connection", "" );
getterMap.put("schema", "getSchemaName");
getterMap.put("table", "getTableName");
getterMap.put("encoding", "getEncoding");
getterMap.put("delimiter", "getDelimiter");
getterMap.put("enclosure", "getEnclosure");
getterMap.put("escape_char", "getEscapeChar");
getterMap.put("replace", "isReplacingData");
getterMap.put("ignore", "isIgnoringErrors");
getterMap.put("local", "isLocalFile");
getterMap.put("fifo_file_name", "getFifoFileName");
getterMap.put("bulk_size", "getBulkSize");
getterMap.put("stream_name", "getFieldTable");
getterMap.put("field_name", "getFieldStream");
getterMap.put("field_format_ok", "getFieldFormatType");
Map<String, String> setterMap = new HashMap<String, String>();
// setterMap.put( "connection", "" );
setterMap.put("schema", "setSchemaName");
setterMap.put("table", "setTableName");
setterMap.put("encoding", "setEncoding");
setterMap.put("delimiter", "setDelimiter");
setterMap.put("enclosure", "setEnclosure");
setterMap.put("escape_char", "setEscapeChar");
setterMap.put("replace", "setReplacingData");
setterMap.put("ignore", "setIgnoringErrors");
setterMap.put("local", "setLocalFile");
setterMap.put("fifo_file_name", "setFifoFileName");
setterMap.put("bulk_size", "setBulkSize");
setterMap.put("stream_name", "setFieldTable");
setterMap.put("field_name", "setFieldStream");
setterMap.put("field_format_ok", "setFieldFormatType");
Map<String, FieldLoadSaveValidator<?>> fieldLoadSaveValidatorAttributeMap = new HashMap<String, FieldLoadSaveValidator<?>>();
FieldLoadSaveValidator<String[]> stringArrayLoadSaveValidator = new ArrayLoadSaveValidator<String>(new StringLoadSaveValidator(), 25);
FieldLoadSaveValidator<int[]> fieldFormatTypeArrayLoadSaveValidator = new PrimitiveIntArrayLoadSaveValidator(new IntLoadSaveValidator(MySQLBulkLoaderMeta.getFieldFormatTypeCodes().length), 25);
fieldLoadSaveValidatorAttributeMap.put("stream_name", stringArrayLoadSaveValidator);
fieldLoadSaveValidatorAttributeMap.put("field_name", stringArrayLoadSaveValidator);
fieldLoadSaveValidatorAttributeMap.put("field_format_ok", fieldFormatTypeArrayLoadSaveValidator);
LoadSaveTester loadSaveTester = new LoadSaveTester(MySQLBulkLoaderMeta.class, attributes, getterMap, setterMap, fieldLoadSaveValidatorAttributeMap, new HashMap<String, FieldLoadSaveValidator<?>>());
loadSaveTester.testSerialization();
}
Aggregations