Search in sources :

Example 1 with MappingParametersLoadSaveValidator

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

the class SimpleMappingMetaTest method setUpLoadSave.

@Before
public void setUpLoadSave() throws Exception {
    KettleEnvironment.init();
    PluginRegistry.init(false);
    List<String> attributes = Arrays.asList("transName", "fileName", "directoryPath", "transObjectId", "specificationMethod", "inputMapping", "outputMapping", "mappingParameters");
    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("transObjectId", new ObjectIdLoadSaveValidator());
    attrValidatorMap.put("specificationMethod", new ObjectLocationSpecificationMethodLoadSaveValidator());
    attrValidatorMap.put("inputMapping", new MappingIODefinitionLoadSaveValidator());
    attrValidatorMap.put("outputMapping", new MappingIODefinitionLoadSaveValidator());
    attrValidatorMap.put("mappingParameters", new MappingParametersLoadSaveValidator());
    Map<String, FieldLoadSaveValidator<?>> typeValidatorMap = new HashMap<String, FieldLoadSaveValidator<?>>();
    loadSaveTester = new LoadSaveTester(testMetaClass, attributes, getterMap, setterMap, attrValidatorMap, typeValidatorMap);
}
Also used : MappingParametersLoadSaveValidator(org.pentaho.di.trans.steps.loadsave.validator.MappingParametersLoadSaveValidator) ObjectLocationSpecificationMethodLoadSaveValidator(org.pentaho.di.trans.steps.loadsave.validator.ObjectLocationSpecificationMethodLoadSaveValidator) HashMap(java.util.HashMap) LoadSaveTester(org.pentaho.di.trans.steps.loadsave.LoadSaveTester) FieldLoadSaveValidator(org.pentaho.di.trans.steps.loadsave.validator.FieldLoadSaveValidator) MappingIODefinitionLoadSaveValidator(org.pentaho.di.trans.steps.loadsave.validator.MappingIODefinitionLoadSaveValidator) ObjectIdLoadSaveValidator(org.pentaho.di.trans.steps.loadsave.validator.ObjectIdLoadSaveValidator) Before(org.junit.Before)

Example 2 with MappingParametersLoadSaveValidator

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

the class MappingMetaTest method setUpLoadSave.

@Before
public void setUpLoadSave() throws Exception {
    KettleEnvironment.init();
    PluginRegistry.init(false);
    List<String> attributes = Arrays.asList("transName", "fileName", "directoryPath", "allowingMultipleInputs", "allowingMultipleOutputs", "specificationMethod", "transObjectId", "inputMappings", "outputMappings", "mappingParameters");
    Map<String, FieldLoadSaveValidator<?>> attrValidatorMap = new HashMap<String, FieldLoadSaveValidator<?>>();
    attrValidatorMap.put("specificationMethod", new ObjectLocationSpecificationMethodLoadSaveValidator());
    attrValidatorMap.put("transObjectId", new ObjectIdLoadSaveValidator());
    attrValidatorMap.put("inputMappings", new ListLoadSaveValidator<MappingIODefinition>(new MappingIODefinitionLoadSaveValidator(), 5));
    attrValidatorMap.put("outputMappings", new ListLoadSaveValidator<MappingIODefinition>(new MappingIODefinitionLoadSaveValidator(), 5));
    attrValidatorMap.put("mappingParameters", new MappingParametersLoadSaveValidator());
    Map<String, FieldLoadSaveValidator<?>> typeValidatorMap = new HashMap<String, FieldLoadSaveValidator<?>>();
    loadSaveTester = new LoadSaveTester(testMetaClass, attributes, new HashMap<String, String>(), new HashMap<String, String>(), attrValidatorMap, typeValidatorMap);
}
Also used : MappingParametersLoadSaveValidator(org.pentaho.di.trans.steps.loadsave.validator.MappingParametersLoadSaveValidator) ObjectLocationSpecificationMethodLoadSaveValidator(org.pentaho.di.trans.steps.loadsave.validator.ObjectLocationSpecificationMethodLoadSaveValidator) HashMap(java.util.HashMap) LoadSaveTester(org.pentaho.di.trans.steps.loadsave.LoadSaveTester) FieldLoadSaveValidator(org.pentaho.di.trans.steps.loadsave.validator.FieldLoadSaveValidator) MappingIODefinitionLoadSaveValidator(org.pentaho.di.trans.steps.loadsave.validator.MappingIODefinitionLoadSaveValidator) ObjectIdLoadSaveValidator(org.pentaho.di.trans.steps.loadsave.validator.ObjectIdLoadSaveValidator) Before(org.junit.Before)

Aggregations

HashMap (java.util.HashMap)2 Before (org.junit.Before)2 LoadSaveTester (org.pentaho.di.trans.steps.loadsave.LoadSaveTester)2 FieldLoadSaveValidator (org.pentaho.di.trans.steps.loadsave.validator.FieldLoadSaveValidator)2 MappingIODefinitionLoadSaveValidator (org.pentaho.di.trans.steps.loadsave.validator.MappingIODefinitionLoadSaveValidator)2 MappingParametersLoadSaveValidator (org.pentaho.di.trans.steps.loadsave.validator.MappingParametersLoadSaveValidator)2 ObjectIdLoadSaveValidator (org.pentaho.di.trans.steps.loadsave.validator.ObjectIdLoadSaveValidator)2 ObjectLocationSpecificationMethodLoadSaveValidator (org.pentaho.di.trans.steps.loadsave.validator.ObjectLocationSpecificationMethodLoadSaveValidator)2