use of org.pentaho.di.trans.steps.loadsave.validator.DatabaseMetaLoadSaveValidator in project pentaho-kettle by pentaho.
the class JobEntryCheckDbConnectionsLoadSaveTest method createAttributeValidatorsMap.
@Override
protected Map<String, FieldLoadSaveValidator<?>> createAttributeValidatorsMap() {
Map<String, FieldLoadSaveValidator<?>> validators = new HashMap<String, FieldLoadSaveValidator<?>>();
int entries = new Random().nextInt(10) + 1;
validators.put("connections", new ArrayLoadSaveValidator<DatabaseMeta>(new DatabaseMetaLoadSaveValidator(), entries));
validators.put("waitfors", new ArrayLoadSaveValidator<String>(new StringLoadSaveValidator(), entries));
validators.put("waittimes", new PrimitiveIntArrayLoadSaveValidator(new IntLoadSaveValidator(JobEntryCheckDbConnections.unitTimeCode.length), entries));
return validators;
}
use of org.pentaho.di.trans.steps.loadsave.validator.DatabaseMetaLoadSaveValidator in project pentaho-kettle by pentaho.
the class DatabaseJoinMetaTest method setUpLoadSave.
@Before
public void setUpLoadSave() throws Exception {
KettleEnvironment.init();
PluginRegistry.init(false);
List<String> attributes = Arrays.asList("sql", "rowLimit", "outerJoin", "variableReplace", "databaseMeta", "parameterField", "parameterType");
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("parameterField", new ArrayLoadSaveValidator<String>(new StringLoadSaveValidator(), 5));
attrValidatorMap.put("parameterType", new PrimitiveIntArrayLoadSaveValidator(new NonZeroIntLoadSaveValidator(7), 5));
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);
}
use of org.pentaho.di.trans.steps.loadsave.validator.DatabaseMetaLoadSaveValidator 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.DatabaseMetaLoadSaveValidator 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