use of org.pentaho.di.trans.steps.loadsave.validator.IntLoadSaveValidator in project pentaho-kettle by pentaho.
the class FilesToResultMetaTest method testStepMeta.
@Test
public void testStepMeta() throws KettleException {
List<String> attributes = Arrays.asList("filename_field", "file_type");
Map<String, String> getterMap = new HashMap<String, String>();
getterMap.put("filename_field", "getFilenameField");
getterMap.put("file_type", "getFileType");
Map<String, String> setterMap = new HashMap<String, String>();
setterMap.put("filename_field", "setFilenameField");
setterMap.put("file_type", "setFileType");
Map<String, FieldLoadSaveValidator<?>> fieldLoadSaveValidatorAttributeMap = new HashMap<String, FieldLoadSaveValidator<?>>();
fieldLoadSaveValidatorAttributeMap.put("file_type", new IntLoadSaveValidator(ResultFile.fileTypeCode.length));
LoadSaveTester loadSaveTester = new LoadSaveTester(FilesToResultMeta.class, attributes, getterMap, setterMap, fieldLoadSaveValidatorAttributeMap, new HashMap<String, FieldLoadSaveValidator<?>>());
loadSaveTester.testSerialization();
}
use of org.pentaho.di.trans.steps.loadsave.validator.IntLoadSaveValidator in project pentaho-kettle by pentaho.
the class JobEntryWaitForSQLLoadSaveTest method createAttributeValidatorsMap.
@Override
protected Map<String, FieldLoadSaveValidator<?>> createAttributeValidatorsMap() {
Map<String, FieldLoadSaveValidator<?>> validators = new HashMap<String, FieldLoadSaveValidator<?>>();
validators.put("successCondition", new IntLoadSaveValidator(JobEntryWaitForSQL.successConditionsCode.length));
return validators;
}
use of org.pentaho.di.trans.steps.loadsave.validator.IntLoadSaveValidator in project pentaho-kettle by pentaho.
the class JobEntrySFTPPUTLoadSaveTest method createAttributeValidatorsMap.
@Override
protected Map<String, FieldLoadSaveValidator<?>> createAttributeValidatorsMap() {
Map<String, FieldLoadSaveValidator<?>> validators = new HashMap<String, FieldLoadSaveValidator<?>>();
validators.put("afterFTPS", new IntLoadSaveValidator(JobEntrySFTPPUT.afterFTPSCode.length));
return validators;
}
use of org.pentaho.di.trans.steps.loadsave.validator.IntLoadSaveValidator in project pentaho-kettle by pentaho.
the class JobEntryPGPEncryptFilesLoadSaveTest method createAttributeValidatorsMap.
@Override
protected Map<String, FieldLoadSaveValidator<?>> createAttributeValidatorsMap() {
Map<String, FieldLoadSaveValidator<?>> validators = new HashMap<String, FieldLoadSaveValidator<?>>();
int count = new Random().nextInt(50) + 1;
validators.put("action_type", new PrimitiveIntArrayLoadSaveValidator(new IntLoadSaveValidator(JobEntryPGPEncryptFiles.actionTypeCodes.length), count));
validators.put("source_filefolder", new ArrayLoadSaveValidator<String>(new StringLoadSaveValidator(), count));
validators.put("userid", new ArrayLoadSaveValidator<String>(new StringLoadSaveValidator(), count));
validators.put("destination_filefolder", new ArrayLoadSaveValidator<String>(new StringLoadSaveValidator(), count));
validators.put("wildcard", new ArrayLoadSaveValidator<String>(new StringLoadSaveValidator(), count));
return validators;
}
use of org.pentaho.di.trans.steps.loadsave.validator.IntLoadSaveValidator in project pentaho-kettle by pentaho.
the class CheckSumMetaTest method testSerialization.
@Test
public void testSerialization() throws KettleException {
List<String> attributes = Arrays.asList("FieldName", "ResultFieldName", "CheckSumType", "CompatibilityMode", "ResultType", "oldChecksumBehaviour", "fieldSeparatorString", "evaluationMethod");
Map<String, String> getterMap = new HashMap<>();
Map<String, String> setterMap = new HashMap<>();
getterMap.put("CheckSumType", "getTypeByDesc");
getterMap.put("evaluationMethod", "getEvaluationMethod");
FieldLoadSaveValidator<String[]> stringArrayLoadSaveValidator = new ArrayLoadSaveValidator<>(new StringLoadSaveValidator(), 5);
Map<String, FieldLoadSaveValidator<?>> attrValidatorMap = new HashMap<>();
attrValidatorMap.put("FieldName", stringArrayLoadSaveValidator);
attrValidatorMap.put("CheckSumType", new IntLoadSaveValidator(CheckSumMeta.checksumtypeCodes.length));
attrValidatorMap.put("ResultType", new IntLoadSaveValidator(CheckSumMeta.resultTypeCode.length));
attrValidatorMap.put("evaluationMethod", new IntLoadSaveValidator(CheckSumMeta.EVALUATION_METHOD_CODES.length));
Map<String, FieldLoadSaveValidator<?>> typeValidatorMap = new HashMap<>();
LoadSaveTester<CheckSumMeta> loadSaveTester = new LoadSaveTester<>(CheckSumMeta.class, attributes, getterMap, setterMap, attrValidatorMap, typeValidatorMap, this);
loadSaveTester.testSerialization();
}
Aggregations