use of org.talend.dataprep.api.dataset.row.DataSetRow in project data-prep by Talend.
the class AbsoluteTest method test_apply_in_newcolumn_not_applicable.
@Test
public void test_apply_in_newcolumn_not_applicable() {
// given
final Map<String, String> values = new HashMap<>();
values.put("0000", "Vincent");
values.put("0001", "-10");
values.put("0002", "May 20th 2015");
final DataSetRow row = new DataSetRow(values);
final Map<String, Object> expectedValues = new HashMap<>();
expectedValues.put("0000", "Vincent");
expectedValues.put("0001", "-10");
expectedValues.put("0002", "May 20th 2015");
absFloatParameters.put("column_id", "0000");
absFloatParameters.put(ActionsUtils.CREATE_NEW_COLUMN, "true");
// when
ActionTestWorkbench.test(row, actionRegistry, factory.create(action, absFloatParameters));
// then
assertEquals(expectedValues, row.values());
}
use of org.talend.dataprep.api.dataset.row.DataSetRow in project data-prep by Talend.
the class AbsoluteTest method test_apply_inplace.
@Test
public void test_apply_inplace() {
// given
final Map<String, String> values = new HashMap<>();
values.put("0000", "Vincent");
values.put("0001", "-10");
values.put("0002", "May 20th 2015");
final DataSetRow row = new DataSetRow(values);
final Map<String, Object> expectedValues = new HashMap<>();
expectedValues.put("0000", "Vincent");
expectedValues.put("0001", "10");
expectedValues.put("0002", "May 20th 2015");
absFloatParameters.put("column_id", "0001");
// when
ActionTestWorkbench.test(row, actionRegistry, factory.create(action, absFloatParameters));
// then
assertEquals(expectedValues, row.values());
}
use of org.talend.dataprep.api.dataset.row.DataSetRow in project data-prep by Talend.
the class AbsoluteTest method testAbsoluteFloatWithNegativeInt.
@Test
public void testAbsoluteFloatWithNegativeInt() {
// given
final Map<String, String> values = new HashMap<>();
// $NON-NLS-1$
values.put(FLOAT_COLUMN, "-542");
final DataSetRow row = new DataSetRow(values);
assertFloat(row, "542");
}
use of org.talend.dataprep.api.dataset.row.DataSetRow in project data-prep by Talend.
the class AbsoluteTest method test_AbsoluteFloatWithHugeValue.
@Test
public void test_AbsoluteFloatWithHugeValue() {
// given
final Map<String, String> values = new HashMap<>();
// $NON-NLS-1$
values.put(FLOAT_COLUMN, "12345678.1");
final DataSetRow row = new DataSetRow(values);
assertFloat(row, "12345678.1");
}
use of org.talend.dataprep.api.dataset.row.DataSetRow in project data-prep by Talend.
the class AbsoluteTest method testAbsoluteFloatWithNegative_big_number.
@Test
public void testAbsoluteFloatWithNegative_big_number() {
// given
final Map<String, String> values = new HashMap<>();
// $NON-NLS-1$
values.put(FLOAT_COLUMN, "-891234567898");
final DataSetRow row = new DataSetRow(values);
assertFloat(row, "891234567898");
}
Aggregations