use of org.pentaho.di.trans.steps.loadsave.validator.ArrayLoadSaveValidator in project pentaho-kettle by pentaho.
the class IngresVectorwiseLoaderMetaTest method setUpLoadSave.
@Before
public void setUpLoadSave() throws Exception {
KettleEnvironment.init();
PluginRegistry.init(false);
List<String> attributes = Arrays.asList("tableName", "fifoFileName", "errorFileName", "continueOnError", "sqlPath", "useStandardConversion", "useAuthentication", "encoding", "delimiter", "useSSV", "useDynamicVNode", "escapingSpecialCharacters", "bufferSize", "usingVwload", "maxNrErrors", "truncatingTable", "fieldStream", "fieldDatabase", "databaseMeta");
// Note - "rejectErrors" is not in the above list because although there is a getter/setter for it
// in the meta class, it's not persisted or loaded. So it's not testable, and like others, there's no
// UI for it either.
// MB - 5/2016
// Note - "fieldFormat" is not in the above list because although there is a getter/setter for it
// in the meta class, it's not persisted or loaded. So it's not testable, and like others, there's no
// UI for it either.
// MB - 5/2016
Map<String, String> getterMap = new HashMap<String, String>();
Map<String, String> setterMap = new HashMap<String, String>() {
{
put("tableName", "setTablename");
}
};
FieldLoadSaveValidator<String[]> stringArrayLoadSaveValidator = new ArrayLoadSaveValidator<String>(new StringLoadSaveValidator(), 5);
Map<String, FieldLoadSaveValidator<?>> attrValidatorMap = new HashMap<String, FieldLoadSaveValidator<?>>();
attrValidatorMap.put("fieldStream", stringArrayLoadSaveValidator);
attrValidatorMap.put("fieldDatabase", 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);
}
use of org.pentaho.di.trans.steps.loadsave.validator.ArrayLoadSaveValidator in project pentaho-kettle by pentaho.
the class LDAPOutputMetaTest method setUp.
@Before
public void setUp() throws Exception {
List<String> attributes = Arrays.asList("updateLookup", "updateStream", "update", "useAuthentication", "Host", "userName", "password", "port", "dnFieldName", "failIfNotExist", "searchBase", "multiValuedSeparator", "operationType", "oldDnFieldName", "newDnFieldName", "deleteRDN");
Map<String, String> getterMap = new HashMap<String, String>() {
{
put("updateLookup", "getUpdateLookup");
put("updateStream", "getUpdateStream");
put("update", "getUpdate");
put("useAuthentication", "getUseAuthentication");
put("Host", "getHost");
put("userName", "getUserName");
put("password", "getPassword");
put("port", "getPort");
put("dnFieldName", "getDnField");
put("failIfNotExist", "isFailIfNotExist");
put("searchBase", "getSearchBaseDN");
put("multiValuedSeparator", "getMultiValuedSeparator");
put("operationType", "getOperationType");
put("oldDnFieldName", "getOldDnFieldName");
put("newDnFieldName", "getNewDnFieldName");
put("deleteRDN", "isDeleteRDN");
}
};
Map<String, String> setterMap = new HashMap<String, String>() {
{
put("updateLookup", "setUpdateLookup");
put("updateStream", "setUpdateStream");
put("update", "setUpdate");
put("useAuthentication", "setUseAuthentication");
put("Host", "setHost");
put("userName", "setUserName");
put("password", "setPassword");
put("port", "setPort");
put("dnFieldName", "setDnField");
put("failIfNotExist", "setFailIfNotExist");
put("searchBase", "setSearchBaseDN");
put("multiValuedSeparator", "setMultiValuedSeparator");
put("operationType", "setOperationType");
put("oldDnFieldName", "setOldDnFieldName");
put("newDnFieldName", "setNewDnFieldName");
put("deleteRDN", "setDeleteRDN");
}
};
FieldLoadSaveValidator<String[]> stringArrayLoadSaveValidator = new ArrayLoadSaveValidator<String>(new StringLoadSaveValidator(), 3);
FieldLoadSaveValidator<Boolean[]> booleanArrayLoadSaveValidator = new ArrayLoadSaveValidator<Boolean>(new BooleanLoadSaveValidator(), 3);
Map<String, FieldLoadSaveValidator<?>> attrValidatorMap = new HashMap<String, FieldLoadSaveValidator<?>>();
attrValidatorMap.put("update", booleanArrayLoadSaveValidator);
attrValidatorMap.put("updateLookup", stringArrayLoadSaveValidator);
attrValidatorMap.put("updateStream", stringArrayLoadSaveValidator);
attrValidatorMap.put("operationType", new IntLoadSaveValidator(5));
Map<String, FieldLoadSaveValidator<?>> typeValidatorMap = new HashMap<String, FieldLoadSaveValidator<?>>();
loadSaveTester = new LoadSaveTester(LDAPOutputMeta.class, attributes, getterMap, setterMap, attrValidatorMap, typeValidatorMap);
PluginRegistry.addPluginType(TwoWayPasswordEncoderPluginType.getInstance());
PluginRegistry.init();
String passwordEncoderPluginID = Const.NVL(EnvUtil.getSystemProperty(Const.KETTLE_PASSWORD_ENCODER_PLUGIN), "Kettle");
Encr.init(passwordEncoderPluginID);
}
use of org.pentaho.di.trans.steps.loadsave.validator.ArrayLoadSaveValidator 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.ArrayLoadSaveValidator 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.ArrayLoadSaveValidator in project pentaho-kettle by pentaho.
the class MailMetaTest method setUpLoadSave.
@Before
public void setUpLoadSave() throws Exception {
KettleEnvironment.init();
PluginRegistry.init(false);
List<String> attributes = Arrays.asList("server", "destination", "destinationCc", "destinationBCc", "replyAddress", "replyName", "subject", "includeDate", "includeSubFolders", "zipFilenameDynamic", "isFilenameDynamic", "dynamicFieldname", "dynamicWildcard", "dynamicZipFilenameField", "sourceFileFoldername", "sourceWildcard", "contactPerson", "contactPhone", "comment", "includingFiles", "zipFiles", "zipFilename", "zipLimitSize", "usingAuthentication", "authenticationUser", "authenticationPassword", "onlySendComment", "useHTML", "usingSecureAuthentication", "usePriority", "port", "priority", "importance", "sensitivity", "secureConnectionType", "encoding", "replyToAddresses", "attachContentFromField", "attachContentField", "attachContentFileNameField", "embeddedImages", "contentIds");
Map<String, String> getterMap = new HashMap<String, String>() {
{
put("isFilenameDynamic", "isDynamicFilename");
}
};
Map<String, String> setterMap = new HashMap<String, String>() {
{
put("isFilenameDynamic", "setisDynamicFilename");
}
};
FieldLoadSaveValidator<String[]> stringArrayLoadSaveValidator = new ArrayLoadSaveValidator<String>(new StringLoadSaveValidator(), 5);
Map<String, FieldLoadSaveValidator<?>> attrValidatorMap = new HashMap<String, FieldLoadSaveValidator<?>>();
attrValidatorMap.put("embeddedImages", stringArrayLoadSaveValidator);
attrValidatorMap.put("contentIds", 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);
}
Aggregations