Search in sources :

Example 26 with LoadSaveTester

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

the class StringCutMetaTest method setUpLoadSave.

@Before
public void setUpLoadSave() throws Exception {
    KettleEnvironment.init();
    PluginRegistry.init(false);
    List<String> attributes = Arrays.asList("fieldInStream", "fieldOutStream", "cutFrom", "cutTo");
    Map<String, String> getterMap = new HashMap<String, String>() {

        {
            put("fieldInStream", "getFieldInStream");
            put("fieldOutStream", "getFieldOutStream");
            put("cutFrom", "getCutFrom");
            put("cutTo", "getCutTo");
        }
    };
    Map<String, String> setterMap = new HashMap<String, String>() {

        {
            put("fieldInStream", "setFieldInStream");
            put("fieldOutStream", "setFieldOutStream");
            put("cutFrom", "setCutFrom");
            put("cutTo", "setCutTo");
        }
    };
    FieldLoadSaveValidator<String[]> stringArrayLoadSaveValidator = new ArrayLoadSaveValidator<String>(new StringLoadSaveValidator(), 5);
    Map<String, FieldLoadSaveValidator<?>> attrValidatorMap = new HashMap<String, FieldLoadSaveValidator<?>>();
    attrValidatorMap.put("fieldInStream", stringArrayLoadSaveValidator);
    attrValidatorMap.put("fieldOutStream", stringArrayLoadSaveValidator);
    attrValidatorMap.put("cutFrom", stringArrayLoadSaveValidator);
    attrValidatorMap.put("cutTo", 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);
}
Also used : 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) ArrayList(java.util.ArrayList) StringLoadSaveValidator(org.pentaho.di.trans.steps.loadsave.validator.StringLoadSaveValidator) Before(org.junit.Before)

Example 27 with LoadSaveTester

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

the class SystemDataMetaTest method setUpLoadSave.

@Before
public void setUpLoadSave() throws Exception {
    KettleEnvironment.init();
    PluginRegistry.init(false);
    List<String> attributes = Arrays.asList("fieldName", "fieldType");
    Map<String, String> getterMap = new HashMap<String, String>() {

        {
            put("fieldName", "getFieldName");
            put("fieldType", "getFieldType");
        }
    };
    Map<String, String> setterMap = new HashMap<String, String>() {

        {
            put("fieldName", "setFieldName");
            put("fieldType", "setFieldType");
        }
    };
    FieldLoadSaveValidator<String[]> stringArrayLoadSaveValidator = new ArrayLoadSaveValidator<String>(new StringLoadSaveValidator(), 5);
    FieldLoadSaveValidator<SystemDataTypes[]> sdtArrayLoadSaveValidator = new ArrayLoadSaveValidator<SystemDataTypes>(new SystemDataTypesLoadSaveValidator(), 5);
    Map<String, FieldLoadSaveValidator<?>> attrValidatorMap = new HashMap<String, FieldLoadSaveValidator<?>>();
    attrValidatorMap.put("fieldName", stringArrayLoadSaveValidator);
    attrValidatorMap.put("fieldType", sdtArrayLoadSaveValidator);
    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 : 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) ArrayList(java.util.ArrayList) StringLoadSaveValidator(org.pentaho.di.trans.steps.loadsave.validator.StringLoadSaveValidator) Before(org.junit.Before)

Example 28 with LoadSaveTester

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

the class TableCompareMetaTest method setUpLoadSave.

@Before
public void setUpLoadSave() throws Exception {
    KettleEnvironment.init();
    PluginRegistry.init(false);
    List<String> attributes = Arrays.asList("referenceConnection", "referenceSchemaField", "referenceTableField", "compareConnection", "compareSchemaField", "compareTableField", "keyFieldsField", "excludeFieldsField", "nrErrorsField", "nrRecordsReferenceField", "nrRecordsCompareField", "nrErrorsLeftJoinField", "nrErrorsInnerJoinField", "nrErrorsRightJoinField", "keyDescriptionField", "valueReferenceField", "valueCompareField");
    Map<String, String> getterMap = new HashMap<String, String>();
    Map<String, String> setterMap = new HashMap<String, String>();
    Map<String, FieldLoadSaveValidator<?>> attrValidatorMap = new HashMap<String, FieldLoadSaveValidator<?>>();
    Map<String, FieldLoadSaveValidator<?>> typeValidatorMap = new HashMap<String, FieldLoadSaveValidator<?>>();
    loadSaveTester = new LoadSaveTester(testMetaClass, attributes, getterMap, setterMap, attrValidatorMap, typeValidatorMap);
}
Also used : HashMap(java.util.HashMap) LoadSaveTester(org.pentaho.di.trans.steps.loadsave.LoadSaveTester) FieldLoadSaveValidator(org.pentaho.di.trans.steps.loadsave.validator.FieldLoadSaveValidator) Before(org.junit.Before)

Example 29 with LoadSaveTester

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

the class TableExistsMetaTest method testLoadSave.

@Test
public void testLoadSave() throws KettleException {
    List<String> attributes = Arrays.asList("Database", "DynamicTablenameField", "ResultFieldName", "Schemaname");
    LoadSaveTester loadSaveTester = new LoadSaveTester(TableExistsMeta.class, attributes);
    loadSaveTester.testSerialization();
}
Also used : LoadSaveTester(org.pentaho.di.trans.steps.loadsave.LoadSaveTester) Test(org.junit.Test)

Example 30 with LoadSaveTester

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

the class TableInputMetaTest method setUpLoadSave.

@Before
public void setUpLoadSave() throws Exception {
    KettleEnvironment.init();
    PluginRegistry.init(false);
    List<String> attributes = Arrays.asList("databaseMeta", "sQL", "rowLimit", "executeEachInputRow", "variableReplacementActive", "lazyConversionActive");
    Map<String, String> getterMap = new HashMap<String, String>();
    Map<String, String> setterMap = new HashMap<String, String>();
    Map<String, FieldLoadSaveValidator<?>> attrValidatorMap = new HashMap<String, FieldLoadSaveValidator<?>>();
    Map<String, FieldLoadSaveValidator<?>> typeValidatorMap = new HashMap<String, FieldLoadSaveValidator<?>>();
    loadSaveTester = new LoadSaveTester(testMetaClass, attributes, getterMap, setterMap, attrValidatorMap, typeValidatorMap);
}
Also used : HashMap(java.util.HashMap) LoadSaveTester(org.pentaho.di.trans.steps.loadsave.LoadSaveTester) FieldLoadSaveValidator(org.pentaho.di.trans.steps.loadsave.validator.FieldLoadSaveValidator) Matchers.anyString(org.mockito.Matchers.anyString) ValueMetaString(org.pentaho.di.core.row.value.ValueMetaString) Before(org.junit.Before)

Aggregations

LoadSaveTester (org.pentaho.di.trans.steps.loadsave.LoadSaveTester)149 HashMap (java.util.HashMap)144 FieldLoadSaveValidator (org.pentaho.di.trans.steps.loadsave.validator.FieldLoadSaveValidator)128 Before (org.junit.Before)86 StringLoadSaveValidator (org.pentaho.di.trans.steps.loadsave.validator.StringLoadSaveValidator)81 ArrayLoadSaveValidator (org.pentaho.di.trans.steps.loadsave.validator.ArrayLoadSaveValidator)67 Test (org.junit.Test)62 ArrayList (java.util.ArrayList)56 IntLoadSaveValidator (org.pentaho.di.trans.steps.loadsave.validator.IntLoadSaveValidator)34 PrimitiveIntArrayLoadSaveValidator (org.pentaho.di.trans.steps.loadsave.validator.PrimitiveIntArrayLoadSaveValidator)24 BooleanLoadSaveValidator (org.pentaho.di.trans.steps.loadsave.validator.BooleanLoadSaveValidator)21 PrimitiveBooleanArrayLoadSaveValidator (org.pentaho.di.trans.steps.loadsave.validator.PrimitiveBooleanArrayLoadSaveValidator)15 DatabaseMetaLoadSaveValidator (org.pentaho.di.trans.steps.loadsave.validator.DatabaseMetaLoadSaveValidator)12 ValueMetaString (org.pentaho.di.core.row.value.ValueMetaString)7 SalesforceMetaTest (org.pentaho.di.trans.steps.salesforce.SalesforceMetaTest)5 ObjectIdLoadSaveValidator (org.pentaho.di.trans.steps.loadsave.validator.ObjectIdLoadSaveValidator)4 ObjectLocationSpecificationMethodLoadSaveValidator (org.pentaho.di.trans.steps.loadsave.validator.ObjectLocationSpecificationMethodLoadSaveValidator)4 Matchers.anyString (org.mockito.Matchers.anyString)3 NonZeroIntLoadSaveValidator (org.pentaho.di.trans.steps.loadsave.validator.NonZeroIntLoadSaveValidator)3 YNLoadSaveValidator (org.pentaho.di.trans.steps.loadsave.validator.YNLoadSaveValidator)3