Search in sources :

Example 1 with TextFileInputFieldValidator

use of org.pentaho.di.trans.steps.loadsave.validator.TextFileInputFieldValidator in project pentaho-kettle by pentaho.

the class CsvInputMetaTest method setUpLoadSave.

@Before
public void setUpLoadSave() throws Exception {
    KettleEnvironment.init();
    PluginRegistry.init(false);
    List<String> attributes = Arrays.asList("BufferSize", "Delimiter", "Enclosure", "Encoding", "Filename", "FilenameField", "InputFields", "RowNumField", "AddResultFile", "HeaderPresent", "IncludingFilename", "LazyConversionActive", "NewlinePossibleInFields", "RunningInParallel");
    Map<String, String> getterMap = new HashMap<String, String>() {

        {
            put("hasHeader", "hasHeader");
            put("includeFilename", "includeFilename");
            put("includeRowNumber", "includeRowNumber");
        }
    };
    Map<String, String> setterMap = new HashMap<String, String>() {

        {
            put("includeFilename", "includeFilename");
            put("includeRowNumber", "includeRowNumber");
        }
    };
    FieldLoadSaveValidator<String[]> stringArrayLoadSaveValidator = new ArrayLoadSaveValidator<String>(new StringLoadSaveValidator(), 5);
    Map<String, FieldLoadSaveValidator<?>> attrValidatorMap = new HashMap<String, FieldLoadSaveValidator<?>>();
    attrValidatorMap.put("InputFields", new ArrayLoadSaveValidator<TextFileInputField>(new TextFileInputFieldValidator(), 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);
}
Also used : TextFileInputFieldValidator(org.pentaho.di.trans.steps.loadsave.validator.TextFileInputFieldValidator) ArrayLoadSaveValidator(org.pentaho.di.trans.steps.loadsave.validator.ArrayLoadSaveValidator) HashMap(java.util.HashMap) LoadSaveTester(org.pentaho.di.trans.steps.loadsave.LoadSaveTester) FieldLoadSaveValidator(org.pentaho.di.trans.steps.loadsave.validator.FieldLoadSaveValidator) TextFileInputField(org.pentaho.di.trans.steps.textfileinput.TextFileInputField) ArrayList(java.util.ArrayList) StringLoadSaveValidator(org.pentaho.di.trans.steps.loadsave.validator.StringLoadSaveValidator) Before(org.junit.Before)

Aggregations

ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 Before (org.junit.Before)1 LoadSaveTester (org.pentaho.di.trans.steps.loadsave.LoadSaveTester)1 ArrayLoadSaveValidator (org.pentaho.di.trans.steps.loadsave.validator.ArrayLoadSaveValidator)1 FieldLoadSaveValidator (org.pentaho.di.trans.steps.loadsave.validator.FieldLoadSaveValidator)1 StringLoadSaveValidator (org.pentaho.di.trans.steps.loadsave.validator.StringLoadSaveValidator)1 TextFileInputFieldValidator (org.pentaho.di.trans.steps.loadsave.validator.TextFileInputFieldValidator)1 TextFileInputField (org.pentaho.di.trans.steps.textfileinput.TextFileInputField)1