use of org.pentaho.di.trans.steps.nullif.NullIfMeta.Field in project pentaho-kettle by pentaho.
the class NullIfMetaTest method setFieldValueTest.
@Test
public void setFieldValueTest() {
Field field = new Field();
System.setProperty(Const.KETTLE_EMPTY_STRING_DIFFERS_FROM_NULL, "N");
field.setFieldValue("theValue");
assertEquals("theValue", field.getFieldValue());
}
use of org.pentaho.di.trans.steps.nullif.NullIfMeta.Field in project pentaho-kettle by pentaho.
the class NullIfMetaTest method setFieldValueNullTest.
@Test
public void setFieldValueNullTest() {
Field field = new Field();
System.setProperty(Const.KETTLE_EMPTY_STRING_DIFFERS_FROM_NULL, "N");
field.setFieldValue(null);
assertEquals(null, field.getFieldValue());
}
use of org.pentaho.di.trans.steps.nullif.NullIfMeta.Field in project pentaho-kettle by pentaho.
the class NullIfTest method createArrayWithOneField.
private static Field[] createArrayWithOneField(String fieldName, String fieldValue) {
Field field = new Field();
field.setFieldName(fieldName);
field.setFieldValue(fieldValue);
return new Field[] { field };
}
use of org.pentaho.di.trans.steps.nullif.NullIfMeta.Field in project pentaho-kettle by pentaho.
the class NullIfMetaTest method setFieldValueNullWithEmptyStringsDiffersFromNullTest.
@Test
public void setFieldValueNullWithEmptyStringsDiffersFromNullTest() {
Field field = new Field();
System.setProperty(Const.KETTLE_EMPTY_STRING_DIFFERS_FROM_NULL, "Y");
field.setFieldValue(null);
assertEquals("", field.getFieldValue());
}
use of org.pentaho.di.trans.steps.nullif.NullIfMeta.Field in project pentaho-kettle by pentaho.
the class NullIfMetaTest method setUp.
@Before
public void setUp() throws Exception {
List<String> attributes = Arrays.asList("fields");
Map<String, String> getterMap = new HashMap<String, String>() {
{
put("fields", "getFields");
}
};
Map<String, String> setterMap = new HashMap<String, String>() {
{
put("fields", "setFields");
}
};
Field field = new Field();
field.setFieldName("fieldName");
field.setFieldValue("fieldValue");
FieldLoadSaveValidator<Field[]> fieldArrayLoadSaveValidator = new ArrayLoadSaveValidator<Field>(new NullIfFieldLoadSaveValidator(field), 5);
Map<String, FieldLoadSaveValidator<?>> typeValidatorMap = new HashMap<String, FieldLoadSaveValidator<?>>();
typeValidatorMap.put(Field[].class.getCanonicalName(), fieldArrayLoadSaveValidator);
Map<String, FieldLoadSaveValidator<?>> attrValidatorMap = new HashMap<String, FieldLoadSaveValidator<?>>();
attrValidatorMap.put("fields", fieldArrayLoadSaveValidator);
loadSaveTester = new LoadSaveTester(NullIfMeta.class, attributes, getterMap, setterMap, attrValidatorMap, typeValidatorMap);
}
Aggregations