use of org.pentaho.di.trans.steps.loadsave.validator.FieldLoadSaveValidator in project pentaho-kettle by pentaho.
the class XBaseInputMetaTest method setUpLoadSave.
@Before
public void setUpLoadSave() throws Exception {
KettleEnvironment.init();
PluginRegistry.init(false);
List<String> attributes = Arrays.asList("dbfFileName", "rowLimit", "rowNrAdded", "rowNrField", "acceptingFilenames", "acceptingField", "acceptingStepName", "includeFilename", "filenameField", "charactersetName");
Map<String, String> getterMap = new HashMap<String, String>();
getterMap.put("includeFilename", "includeFilename");
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 YamlInputMetaTest method setUpLoadSave.
@Before
public void setUpLoadSave() throws Exception {
KettleEnvironment.init();
PluginRegistry.init(false);
List<String> attributes = Arrays.asList("includeFilename", "filenameField", "includeRowNumber", "rowNumberField", "rowLimit", "encoding", "yamlField", "inFields", "IsAFile", "addResultFile", "validating", "IsIgnoreEmptyFile", "doNotFailIfNoFile", "fileName", "fileMask", "fileRequired", "includeSubFolders", "inputFields");
Map<String, String> getterMap = new HashMap<String, String>() {
{
put("includeFilename", "includeFilename");
put("filenameField", "getFilenameField");
put("includeRowNumber", "includeRowNumber");
put("rowNumberField", "getRowNumberField");
put("rowLimit", "getRowLimit");
put("encoding", "getEncoding");
put("yamlField", "getYamlField");
put("inFields", "isInFields");
put("IsAFile", "getIsAFile");
put("addResultFile", "addResultFile");
put("validating", "isValidating");
put("IsIgnoreEmptyFile", "isIgnoreEmptyFile");
put("doNotFailIfNoFile", "isdoNotFailIfNoFile");
put("fileName", "getFileName");
put("fileMask", "getFileMask");
put("fileRequired", "getFileRequired");
put("includeSubFolders", "getIncludeSubFolders");
put("inputFields", "getInputFields");
}
};
Map<String, String> setterMap = new HashMap<String, String>() {
{
put("includeFilename", "setIncludeFilename");
put("filenameField", "setFilenameField");
put("includeRowNumber", "setIncludeRowNumber");
put("rowNumberField", "setRowNumberField");
put("rowLimit", "setRowLimit");
put("encoding", "setEncoding");
put("yamlField", "setYamlField");
put("inFields", "setInFields");
put("IsAFile", "setIsAFile");
put("addResultFile", "setAddResultFile");
put("validating", "setValidating");
put("IsIgnoreEmptyFile", "setIgnoreEmptyFile");
put("doNotFailIfNoFile", "setdoNotFailIfNoFile");
put("fileName", "setFileName");
put("fileMask", "setFileMask");
put("fileRequired", "setFileRequired");
put("includeSubFolders", "setIncludeSubFolders");
put("inputFields", "setInputFields");
}
};
FieldLoadSaveValidator<String[]> stringArrayLoadSaveValidator = new ArrayLoadSaveValidator<String>(new StringLoadSaveValidator(), 5);
FieldLoadSaveValidator<YamlInputField[]> yamlInputFieldArrayLoadSaveValidator = new ArrayLoadSaveValidator<YamlInputField>(new YamlInputFieldLoadSaveValidator(), 5);
Map<String, FieldLoadSaveValidator<?>> attrValidatorMap = new HashMap<String, FieldLoadSaveValidator<?>>();
attrValidatorMap.put("fileName", stringArrayLoadSaveValidator);
attrValidatorMap.put("fileRequired", stringArrayLoadSaveValidator);
attrValidatorMap.put("fileMask", stringArrayLoadSaveValidator);
attrValidatorMap.put("includeSubFolders", stringArrayLoadSaveValidator);
attrValidatorMap.put("inputFields", yamlInputFieldArrayLoadSaveValidator);
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 JobEntryEvalTableContentLoadSaveTest method createAttributeValidatorsMap.
@Override
protected Map<String, FieldLoadSaveValidator<?>> createAttributeValidatorsMap() {
Map<String, FieldLoadSaveValidator<?>> validators = new HashMap<String, FieldLoadSaveValidator<?>>();
validators.put("successCondition", new IntLoadSaveValidator(JobEntryEvalTableContent.successConditionsCode.length));
return validators;
}
use of org.pentaho.di.trans.steps.loadsave.validator.FieldLoadSaveValidator in project pentaho-kettle by pentaho.
the class JobEntryGetPOPLoadSaveTest method createAttributeValidatorsMap.
@Override
protected Map<String, FieldLoadSaveValidator<?>> createAttributeValidatorsMap() {
Map<String, FieldLoadSaveValidator<?>> validators = new HashMap<String, FieldLoadSaveValidator<?>>();
validators.put("valueImapList", new IntLoadSaveValidator(MailConnectionMeta.valueIMAPListCode.length));
validators.put("conditionReceivedDate", new IntLoadSaveValidator(MailConnectionMeta.conditionDateCode.length));
validators.put("actiontype", new IntLoadSaveValidator(MailConnectionMeta.actionTypeCode.length));
validators.put("afterGetIMAP", new IntLoadSaveValidator(MailConnectionMeta.afterGetIMAPCode.length));
return validators;
}
use of org.pentaho.di.trans.steps.loadsave.validator.FieldLoadSaveValidator 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;
}
Aggregations