Search in sources :

Example 1 with NormaliserMeta

use of org.pentaho.di.trans.steps.normaliser.NormaliserMeta in project pentaho-kettle by pentaho.

the class NormalizerMetaTest method loadSaveTest.

@Test
public void loadSaveTest() throws KettleException {
    List<String> attributes = Arrays.asList("normaliserFields");
    NormaliserField testField = new NormaliserField();
    testField.setName("TEST_NAME");
    testField.setValue("TEST_VALUE");
    testField.setNorm("TEST");
    Map<String, FieldLoadSaveValidator<?>> fieldLoadSaveValidatorTypeMap = new HashMap<String, FieldLoadSaveValidator<?>>();
    fieldLoadSaveValidatorTypeMap.put(NormaliserField[].class.getCanonicalName(), new ArrayLoadSaveValidator<NormaliserField>(new NormaliserFieldLoadSaveValidator(testField), 50));
    LoadSaveTester<NormaliserMeta> tester = new LoadSaveTester<NormaliserMeta>(NormaliserMeta.class, attributes, new HashMap<String, String>(), new HashMap<String, String>(), new HashMap<String, FieldLoadSaveValidator<?>>(), fieldLoadSaveValidatorTypeMap);
    tester.testSerialization();
}
Also used : HashMap(java.util.HashMap) LoadSaveTester(org.pentaho.di.trans.steps.loadsave.LoadSaveTester) FieldLoadSaveValidator(org.pentaho.di.trans.steps.loadsave.validator.FieldLoadSaveValidator) NormaliserField(org.pentaho.di.trans.steps.normaliser.NormaliserMeta.NormaliserField) NormaliserMeta(org.pentaho.di.trans.steps.normaliser.NormaliserMeta) Test(org.junit.Test)

Aggregations

HashMap (java.util.HashMap)1 Test (org.junit.Test)1 LoadSaveTester (org.pentaho.di.trans.steps.loadsave.LoadSaveTester)1 FieldLoadSaveValidator (org.pentaho.di.trans.steps.loadsave.validator.FieldLoadSaveValidator)1 NormaliserMeta (org.pentaho.di.trans.steps.normaliser.NormaliserMeta)1 NormaliserField (org.pentaho.di.trans.steps.normaliser.NormaliserMeta.NormaliserField)1