use of org.pentaho.di.trans.steps.loadsave.validator.StringLoadSaveValidator in project pentaho-kettle by pentaho.
the class DataGridMetaTest method setUpLoadSave.
@Before
public void setUpLoadSave() throws Exception {
KettleEnvironment.init();
PluginRegistry.init(false);
List<String> attributes = Arrays.asList("currency", "decimal", "group", "fieldName", "fieldType", "fieldFormat", "fieldLength", "fieldPrecision", "setEmptyString", "dataLines", "fieldNullIf");
Map<String, String> getterMap = new HashMap<>();
Map<String, String> setterMap = new HashMap<String, String>() {
{
put("setEmptyString", "setEmptyString");
}
};
FieldLoadSaveValidator<String[]> stringArrayLoadSaveValidator = new ArrayLoadSaveValidator<String>(new StringLoadSaveValidator(), 3);
Map<String, FieldLoadSaveValidator<?>> attrValidatorMap = new HashMap<String, FieldLoadSaveValidator<?>>();
attrValidatorMap.put("currency", stringArrayLoadSaveValidator);
attrValidatorMap.put("decimal", stringArrayLoadSaveValidator);
attrValidatorMap.put("group", stringArrayLoadSaveValidator);
attrValidatorMap.put("fieldName", stringArrayLoadSaveValidator);
attrValidatorMap.put("fieldType", stringArrayLoadSaveValidator);
attrValidatorMap.put("fieldFormat", stringArrayLoadSaveValidator);
attrValidatorMap.put("fieldLength", new PrimitiveIntArrayLoadSaveValidator(new IntLoadSaveValidator(75), 3));
attrValidatorMap.put("fieldPrecision", new PrimitiveIntArrayLoadSaveValidator(new IntLoadSaveValidator(9), 3));
attrValidatorMap.put("setEmptyString", new PrimitiveBooleanArrayLoadSaveValidator(new BooleanLoadSaveValidator(), 3));
attrValidatorMap.put("dataLines", new DataGridLinesLoadSaveValidator());
attrValidatorMap.put("fieldNullIf", 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.StringLoadSaveValidator in project pentaho-kettle by pentaho.
the class DBProcMetaTest method setUpLoadSave.
@Before
public void setUpLoadSave() throws Exception {
KettleEnvironment.init();
PluginRegistry.init(false);
List<String> attributes = Arrays.asList("procedure", "resultName", "resultType", "autoCommit", "argumentType", "argument", "argumentDirection", "database");
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("argument", stringArrayLoadSaveValidator);
attrValidatorMap.put("argumentDirection", stringArrayLoadSaveValidator);
attrValidatorMap.put("argumentType", new PrimitiveIntArrayLoadSaveValidator(new IntLoadSaveValidator(7), 5));
attrValidatorMap.put("database", new DatabaseMetaLoadSaveValidator());
attrValidatorMap.put("resultType", new IntLoadSaveValidator(7));
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.StringLoadSaveValidator in project pentaho-kettle by pentaho.
the class DenormalizerMetaTest method setUpLoadSave.
@Before
public void setUpLoadSave() throws Exception {
KettleEnvironment.init();
PluginRegistry.init(false);
List<String> attributes = Arrays.asList("groupField", "keyField", "denormaliserTargetField");
Map<String, String> getterMap = new HashMap<String, String>() {
// CHECKSTYLE IGNORE EmptyBlock FOR NEXT 3 LINES
{
// put( "fieldName", "getFieldName" );
}
};
Map<String, String> setterMap = new HashMap<String, String>() {
// CHECKSTYLE IGNORE EmptyBlock FOR NEXT 3 LINES
{
// put( "fieldName", "setFieldName" );
}
};
FieldLoadSaveValidator<String[]> stringArrayLoadSaveValidator = new ArrayLoadSaveValidator<String>(new StringLoadSaveValidator(), 5);
Map<String, FieldLoadSaveValidator<?>> attrValidatorMap = new HashMap<String, FieldLoadSaveValidator<?>>();
attrValidatorMap.put("groupField", stringArrayLoadSaveValidator);
attrValidatorMap.put("denormaliserTargetField", new ArrayLoadSaveValidator<DenormaliserTargetField>(new DenormaliserTargetFieldLoadSaveValidator(), 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.validator.StringLoadSaveValidator in project pentaho-kettle by pentaho.
the class ConstantMetaTest method setUpLoadSave.
@Before
public void setUpLoadSave() throws Exception {
KettleEnvironment.init();
PluginRegistry.init(false);
List<String> attributes = Arrays.asList("currency", "decimal", "group", "value", "fieldName", "fieldType", "fieldFormat", "fieldLength", "fieldPrecision", "setEmptyString");
Map<String, String> getterMap = new HashMap<String, String>() {
{
put("setEmptyString", "isSetEmptyString");
}
};
Map<String, String> setterMap = new HashMap<String, String>() {
{
put("setEmptyString", "setEmptyString");
}
};
FieldLoadSaveValidator<String[]> stringArrayLoadSaveValidator = new ArrayLoadSaveValidator<String>(new StringLoadSaveValidator(), 5);
PrimitiveIntArrayLoadSaveValidator intArrayLoadSaveValidator = new PrimitiveIntArrayLoadSaveValidator(new IntLoadSaveValidator(), 5);
PrimitiveBooleanArrayLoadSaveValidator booleanArrayLoadSaveValidator = new PrimitiveBooleanArrayLoadSaveValidator(new BooleanLoadSaveValidator(), 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", intArrayLoadSaveValidator);
attrValidatorMap.put("fieldPrecision", intArrayLoadSaveValidator);
attrValidatorMap.put("setEmptyString", booleanArrayLoadSaveValidator);
Map<String, FieldLoadSaveValidator<?>> typeValidatorMap = new HashMap<String, FieldLoadSaveValidator<?>>();
loadSaveTester = new LoadSaveTester<ConstantMeta>(testMetaClass, attributes, new ArrayList<String>(), new ArrayList<String>(), getterMap, setterMap, attrValidatorMap, typeValidatorMap, this);
}
use of org.pentaho.di.trans.steps.loadsave.validator.StringLoadSaveValidator in project pentaho-kettle by pentaho.
the class DeleteMetaTest method setUpLoadSave.
@Before
public void setUpLoadSave() throws Exception {
PluginRegistry.init(false);
List<String> attributes = Arrays.asList("schemaName", "tableName", "commitSize", "databaseMeta", "keyStream", "keyLookup", "keyCondition", "keyStream2");
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("keyStream", stringArrayLoadSaveValidator);
attrValidatorMap.put("keyLookup", stringArrayLoadSaveValidator);
attrValidatorMap.put("keyCondition", stringArrayLoadSaveValidator);
attrValidatorMap.put("keyStream2", stringArrayLoadSaveValidator);
attrValidatorMap.put("databaseMeta", new DatabaseMetaLoadSaveValidator());
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