use of org.pentaho.di.trans.steps.loadsave.validator.IntLoadSaveValidator in project pentaho-kettle by pentaho.
the class JobEntrySetVariablesLoadSaveTest method createAttributeValidatorsMap.
@Override
protected Map<String, FieldLoadSaveValidator<?>> createAttributeValidatorsMap() {
Map<String, FieldLoadSaveValidator<?>> validators = new HashMap<String, FieldLoadSaveValidator<?>>();
validators.put("fileVariableType", new IntLoadSaveValidator(JobEntrySetVariables.variableTypeCode.length));
int count = new Random().nextInt(50) + 1;
validators.put("variableName", new ArrayLoadSaveValidator<String>(new StringLoadSaveValidator(), count));
validators.put("variableValue", new ArrayLoadSaveValidator<String>(new StringLoadSaveValidator(), count));
validators.put("variableType", new PrimitiveIntArrayLoadSaveValidator(new IntLoadSaveValidator(JobEntryPGPEncryptFiles.actionTypeCodes.length), count));
return validators;
}
use of org.pentaho.di.trans.steps.loadsave.validator.IntLoadSaveValidator in project pentaho-kettle by pentaho.
the class ZipFileMetaLoadSaveTest method setUpLoadSave.
@Before
public void setUpLoadSave() throws Exception {
KettleEnvironment.init();
PluginRegistry.init(false);
List<String> attributes = Arrays.asList("dynamicSourceFileNameField", "dynamicTargetFileNameField", "baseFolderField", "moveToFolderField", "addResultFilenames", "overwriteZipEntry", "createParentFolder", "keepSouceFolder", "operationType");
Map<String, String> getterMap = new HashMap<String, String>();
getterMap.put("addResultFilenames", "isaddTargetFileNametoResult");
Map<String, String> setterMap = new HashMap<String, String>();
setterMap.put("addResultFilenames", "setaddTargetFileNametoResult");
Map<String, FieldLoadSaveValidator<?>> attrValidatorMap = new HashMap<String, FieldLoadSaveValidator<?>>();
attrValidatorMap.put("operationType", new IntLoadSaveValidator(ZipFileMeta.operationTypeCode.length));
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.IntLoadSaveValidator in project pentaho-kettle by pentaho.
the class JobEntryFTPDeleteLoadSaveTest method createAttributeValidatorsMap.
@Override
protected Map<String, FieldLoadSaveValidator<?>> createAttributeValidatorsMap() {
Map<String, FieldLoadSaveValidator<?>> validators = new HashMap<String, FieldLoadSaveValidator<?>>();
validators.put("fTPSConnectionType", new IntLoadSaveValidator(FTPSConnection.connection_type_Code.length));
return validators;
}
use of org.pentaho.di.trans.steps.loadsave.validator.IntLoadSaveValidator in project pentaho-kettle by pentaho.
the class JobEntryFTPSGetLoadSaveTest method createAttributeValidatorsMap.
@Override
protected Map<String, FieldLoadSaveValidator<?>> createAttributeValidatorsMap() {
Map<String, FieldLoadSaveValidator<?>> validators = new HashMap<String, FieldLoadSaveValidator<?>>();
validators.put("connection_type", new IntLoadSaveValidator(FTPSConnection.connection_type_Code.length));
validators.put("ifFileExists", new IntLoadSaveValidator(JobEntryFTPSGet.FILE_EXISTS_ACTIONS.length));
return validators;
}
use of org.pentaho.di.trans.steps.loadsave.validator.IntLoadSaveValidator in project pentaho-kettle by pentaho.
the class JobEntryEvalFilesMetricsLoadSaveTest method createAttributeValidatorsMap.
@Override
protected Map<String, FieldLoadSaveValidator<?>> createAttributeValidatorsMap() {
Map<String, FieldLoadSaveValidator<?>> validators = new HashMap<String, FieldLoadSaveValidator<?>>();
int sourceFileCount = new Random().nextInt(50) + 1;
validators.put("sourceFileFolder", new ArrayLoadSaveValidator<String>(new StringLoadSaveValidator(), sourceFileCount));
validators.put("sourceWildcard", new ArrayLoadSaveValidator<String>(new StringLoadSaveValidator(), sourceFileCount));
validators.put("sourceIncludeSubfolders", new ArrayLoadSaveValidator<String>(new StringLoadSaveValidator(), sourceFileCount));
validators.put("successConditionType", new IntLoadSaveValidator(JobEntrySimpleEval.successNumberConditionCode.length));
validators.put("sourceFiles", new IntLoadSaveValidator(JobEntryEvalFilesMetrics.SourceFilesCodes.length));
validators.put("evaluationType", new IntLoadSaveValidator(JobEntryEvalFilesMetrics.EvaluationTypeCodes.length));
validators.put("scale", new IntLoadSaveValidator(JobEntryEvalFilesMetrics.scaleCodes.length));
return validators;
}
Aggregations