use of org.pentaho.di.trans.steps.loadsave.validator.StringLoadSaveValidator in project pentaho-kettle by pentaho.
the class ExecSQLMetaTest method setUpLoadSave.
@Before
public void setUpLoadSave() throws Exception {
KettleEnvironment.init();
PluginRegistry.init(false);
List<String> attributes = Arrays.asList("databaseMeta", "sql", "executedEachInputRow", "updateField", "insertField", "deleteField", "readField", "singleStatement", "replaceVariables", "quoteString", "params", "arguments");
Map<String, String> getterMap = new HashMap<String, String>();
Map<String, String> setterMap = new HashMap<String, String>() {
{
put("replaceVariables", "setVariableReplacementActive");
}
};
FieldLoadSaveValidator<String[]> stringArrayLoadSaveValidator = new ArrayLoadSaveValidator<String>(new StringLoadSaveValidator(), 5);
Map<String, FieldLoadSaveValidator<?>> attrValidatorMap = new HashMap<String, FieldLoadSaveValidator<?>>();
attrValidatorMap.put("arguments", 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 StringOperationsMetaTest method setUpLoadSave.
@Before
public void setUpLoadSave() throws Exception {
KettleEnvironment.init();
PluginRegistry.init(false);
List<String> attributes = Arrays.asList("padLen", "padChar", "fieldInStream", "fieldOutStream", "trimType", "lowerUpper", "initCap", "maskXML", "digits", "removeSpecialCharacters", "paddingType");
FieldLoadSaveValidator<String[]> stringArrayLoadSaveValidator = new ArrayLoadSaveValidator<String>(new StringLoadSaveValidator(), 5);
Map<String, FieldLoadSaveValidator<?>> attrValidatorMap = new HashMap<String, FieldLoadSaveValidator<?>>();
attrValidatorMap.put("padLen", stringArrayLoadSaveValidator);
attrValidatorMap.put("padChar", stringArrayLoadSaveValidator);
attrValidatorMap.put("fieldInStream", stringArrayLoadSaveValidator);
attrValidatorMap.put("fieldOutStream", stringArrayLoadSaveValidator);
attrValidatorMap.put("trimType", new ArrayLoadSaveValidator<String>(new StringLoadSaveValidator(), 5));
attrValidatorMap.put("lowerUpper", new ArrayLoadSaveValidator<String>(new StringLoadSaveValidator(), 5));
attrValidatorMap.put("initCap", new ArrayLoadSaveValidator<String>(new StringLoadSaveValidator(), 5));
attrValidatorMap.put("maskXML", new ArrayLoadSaveValidator<String>(new StringLoadSaveValidator(), 5));
attrValidatorMap.put("digits", new ArrayLoadSaveValidator<String>(new StringLoadSaveValidator(), 5));
attrValidatorMap.put("removeSpecialCharacters", new ArrayLoadSaveValidator<String>(new StringLoadSaveValidator(), 5));
attrValidatorMap.put("paddingType", new ArrayLoadSaveValidator<String>(new StringLoadSaveValidator(), 5));
Map<String, FieldLoadSaveValidator<?>> typeValidatorMap = new HashMap<String, FieldLoadSaveValidator<?>>();
loadSaveTester = new LoadSaveTester(testMetaClass, attributes, new ArrayList<String>(), new ArrayList<String>(), new HashMap<String, String>(), new HashMap<String, String>(), attrValidatorMap, typeValidatorMap, this);
}
use of org.pentaho.di.trans.steps.loadsave.validator.StringLoadSaveValidator in project pentaho-kettle by pentaho.
the class LDIFInputMetaTest method setUp.
@Before
public void setUp() throws Exception {
List<String> attributes = Arrays.asList("includeFilename", "filenameField", "includeRowNumber", "rowNumberField", "rowLimit", "addtoresultfilename", "multiValuedSeparator", "includeContentType", "contentTypeField", "DNField", "includeDN", "filefield", "dynamicFilenameField", "shortFileFieldName", "pathFieldName", "hiddenFieldName", "lastModificationTimeFieldName", "uriNameFieldName", "rootUriNameFieldName", "extensionFieldName", "sizeFieldName", "fileRequired", "includeSubFolders", "fileName", "fileMask", "excludeFileMask", "inputFields");
Map<String, String> getterMap = new HashMap<String, String>() {
{
put("includeFilename", "getIncludeFilename");
put("filenameField", "getFilenameField");
put("includeRowNumber", "getIncludeRowNumber");
put("rowNumberField", "getRowNumberField");
put("rowLimit", "getRowLimit");
put("addtoresultfilename", "getAddToResultFilename");
put("multiValuedSeparator", "getMultiValuedSeparator");
put("includeContentType", "getIncludeContentType");
put("contentTypeField", "getContentTypeField");
put("DNField", "getDNField");
put("includeDN", "getIncludeDN");
put("filefield", "isFileField");
put("dynamicFilenameField", "getDynamicFilenameField");
put("shortFileFieldName", "getShortFileNameField");
put("pathFieldName", "getPathField");
put("hiddenFieldName", "getHiddenField");
put("lastModificationTimeFieldName", "getLastModificationDateField");
put("uriNameFieldName", "getUriField");
put("rootUriNameFieldName", "getRootUriField");
put("extensionFieldName", "getExtensionField");
put("sizeFieldName", "getSizeField");
put("fileRequired", "getFileRequired");
put("includeSubFolders", "getIncludeSubFolders");
put("fileName", "getFileName");
put("fileMask", "getFileMask");
put("excludeFileMask", "getExcludeFileMask");
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("addtoresultfilename", "setAddToResultFilename");
put("multiValuedSeparator", "setMultiValuedSeparator");
put("includeContentType", "setIncludeContentType");
put("contentTypeField", "setContentTypeField");
put("DNField", "setDNField");
put("includeDN", "setIncludeDN");
put("filefield", "setFileField");
put("dynamicFilenameField", "setDynamicFilenameField");
put("shortFileFieldName", "setShortFileNameField");
put("pathFieldName", "setPathField");
put("hiddenFieldName", "setHiddenField");
put("lastModificationTimeFieldName", "setLastModificationDateField");
put("uriNameFieldName", "setUriField");
put("rootUriNameFieldName", "setRootUriField");
put("extensionFieldName", "setExtensionField");
put("sizeFieldName", "setSizeField");
put("fileRequired", "setFileRequired");
put("includeSubFolders", "setIncludeSubFolders");
put("fileName", "setFileName");
put("fileMask", "setFileMask");
put("excludeFileMask", "setExcludeFileMask");
put("inputFields", "setInputFields");
}
};
FieldLoadSaveValidator<String[]> stringArrayLoadSaveValidator = new ArrayLoadSaveValidator<String>(new StringLoadSaveValidator(), 5);
FieldLoadSaveValidator<LDIFInputField[]> liflsv = new ArrayLoadSaveValidator<LDIFInputField>(new LDIFInputFieldLoadSaveValidator(), 5);
FieldLoadSaveValidator<String[]> YNArrayLoadSaveValidator = new ArrayLoadSaveValidator<String>(new YNLoadSaveValidator(), 5);
Map<String, FieldLoadSaveValidator<?>> attrValidatorMap = new HashMap<String, FieldLoadSaveValidator<?>>();
attrValidatorMap.put("fileName", stringArrayLoadSaveValidator);
attrValidatorMap.put("fileMask", stringArrayLoadSaveValidator);
attrValidatorMap.put("excludeFileMask", stringArrayLoadSaveValidator);
attrValidatorMap.put("fileRequired", YNArrayLoadSaveValidator);
attrValidatorMap.put("includeSubFolders", stringArrayLoadSaveValidator);
attrValidatorMap.put("inputFields", liflsv);
Map<String, FieldLoadSaveValidator<?>> typeValidatorMap = new HashMap<String, FieldLoadSaveValidator<?>>();
loadSaveTester = new LoadSaveTester(LDIFInputMeta.class, 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 LoadFileInputMetaTest method setUp.
@Before
public void setUp() throws Exception {
List<String> attributes = Arrays.asList("includeFilename", "filenameField", "includeRowNumber", "rowNumberField", "rowLimit", "encoding", "DynamicFilenameField", "fileinfield", "addresultfile", "IsIgnoreEmptyFile", "IsIgnoreMissingPath", "shortFileFieldName", "pathFieldName", "hiddenFieldName", "lastModificationTimeFieldName", "uriNameFieldName", "rootUriNameFieldName", "extensionFieldName", "includeSubFolders", "fileName", "fileMask", "excludeFileMask", "fileRequired", "inputFields");
Map<String, String> getterMap = new HashMap<String, String>() {
{
put("includeFilename", "getIncludeFilename");
put("filenameField", "getFilenameField");
put("includeRowNumber", "getIncludeRowNumber");
put("rowNumberField", "getRowNumberField");
put("rowLimit", "getRowLimit");
put("encoding", "getEncoding");
put("DynamicFilenameField", "getDynamicFilenameField");
put("fileinfield", "getFileInFields");
put("addresultfile", "getAddResultFile");
put("IsIgnoreEmptyFile", "isIgnoreEmptyFile");
put("IsIgnoreMissingPath", "isIgnoreMissingPath");
put("shortFileFieldName", "getShortFileNameField");
put("pathFieldName", "getPathField");
put("hiddenFieldName", "isHiddenField");
put("lastModificationTimeFieldName", "getLastModificationDateField");
put("uriNameFieldName", "getUriField");
put("rootUriNameFieldName", "getRootUriField");
put("extensionFieldName", "getExtensionField");
put("includeSubFolders", "getIncludeSubFolders");
put("fileName", "getFileName");
put("fileMask", "getFileMask");
put("excludeFileMask", "getExcludeFileMask");
put("fileRequired", "getFileRequired");
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("DynamicFilenameField", "setDynamicFilenameField");
put("fileinfield", "setFileInFields");
put("addresultfile", "setAddResultFile");
put("IsIgnoreEmptyFile", "setIgnoreEmptyFile");
put("IsIgnoreMissingPath", "setIgnoreMissingPath");
put("shortFileFieldName", "setShortFileNameField");
put("pathFieldName", "setPathField");
put("hiddenFieldName", "setIsHiddenField");
put("lastModificationTimeFieldName", "setLastModificationDateField");
put("uriNameFieldName", "setUriField");
put("rootUriNameFieldName", "setRootUriField");
put("extensionFieldName", "setExtensionField");
put("includeSubFolders", "setIncludeSubFolders");
put("fileName", "setFileName");
put("fileMask", "setFileMask");
put("excludeFileMask", "setExcludeFileMask");
put("fileRequired", "setFileRequired");
put("inputFields", "setInputFields");
}
};
FieldLoadSaveValidator<String[]> stringArrayLoadSaveValidator = new ArrayLoadSaveValidator<String>(new StringLoadSaveValidator(), 5);
FieldLoadSaveValidator<LoadFileInputField[]> lfifArrayLoadSaveValidator = new ArrayLoadSaveValidator<LoadFileInputField>(new LoadFileInputFieldLoadSaveValidator(), 5);
FieldLoadSaveValidator<String[]> YNArrayLoadSaveValidator = new ArrayLoadSaveValidator<String>(new YNLoadSaveValidator(), 5);
Map<String, FieldLoadSaveValidator<?>> attrValidatorMap = new HashMap<String, FieldLoadSaveValidator<?>>();
attrValidatorMap.put("includeSubFolders", stringArrayLoadSaveValidator);
attrValidatorMap.put("fileName", stringArrayLoadSaveValidator);
attrValidatorMap.put("fileMask", stringArrayLoadSaveValidator);
attrValidatorMap.put("excludeFileMask", stringArrayLoadSaveValidator);
attrValidatorMap.put("fileRequired", YNArrayLoadSaveValidator);
attrValidatorMap.put("inputFields", lfifArrayLoadSaveValidator);
Map<String, FieldLoadSaveValidator<?>> typeValidatorMap = new HashMap<String, FieldLoadSaveValidator<?>>();
loadSaveTester = new LoadSaveTester(LoadFileInputMeta.class, 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 InjectorMetaTest method setUpLoadSave.
@Before
public void setUpLoadSave() throws Exception {
KettleEnvironment.init();
PluginRegistry.init(false);
List<String> attributes = Arrays.asList("fieldname", "type", "length", "precision");
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("fieldname", new ArrayLoadSaveValidator<String>(new StringLoadSaveValidator(), 5));
attrValidatorMap.put("type", new PrimitiveIntArrayLoadSaveValidator(new IntLoadSaveValidator(7), 5));
attrValidatorMap.put("length", new PrimitiveIntArrayLoadSaveValidator(new IntLoadSaveValidator(100), 5));
attrValidatorMap.put("precision", new PrimitiveIntArrayLoadSaveValidator(new IntLoadSaveValidator(9), 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);
}
Aggregations