use of org.talend.dataprep.api.dataset.row.DataSetRow in project data-prep by Talend.
the class DeleteAllEmptyTest method should_delete_with_empty_row.
@Test
public void should_delete_with_empty_row() {
// given
// row 1
final DataSetRow row1 = getRow("David", "Bowie");
// row 2
final DataSetRow row2 = getRow("David", "Bowie");
// row 3
final DataSetRow row3 = getRow("", "");
// when
ActionTestWorkbench.test(Arrays.asList(row1, row2, row3), actionRegistry, factory.create(action, parameters));
// then
assertThat(row1.isDeleted(), is(false));
assertThat(row2.isDeleted(), is(false));
assertThat(row3.isDeleted(), is(true));
}
use of org.talend.dataprep.api.dataset.row.DataSetRow in project data-prep by Talend.
the class DeleteEmptyTest method should_delete_because_value_is_made_of_spaces.
@Test
public void should_delete_because_value_is_made_of_spaces() {
// given
final Map<String, String> values = new HashMap<>();
values.put("0000", "David Bowie");
values.put("0001", " ");
final DataSetRow row = new DataSetRow(values);
// when
ActionTestWorkbench.test(row, actionRegistry, factory.create(action, parameters));
// then
assertTrue(row.isDeleted());
}
use of org.talend.dataprep.api.dataset.row.DataSetRow in project data-prep by Talend.
the class DeleteEmptyTest method should_delete_because_null.
@Test
public void should_delete_because_null() {
// given
final Map<String, String> values = new HashMap<>();
values.put("0000", "David Bowie");
values.put("0001", null);
final DataSetRow row = new DataSetRow(values);
// when
ActionTestWorkbench.test(row, actionRegistry, factory.create(action, parameters));
// then
assertTrue(row.isDeleted());
}
use of org.talend.dataprep.api.dataset.row.DataSetRow in project data-prep by Talend.
the class DeleteEmptyTest method should_not_delete_because_value_set_of_number.
@Test
public void should_not_delete_because_value_set_of_number() {
// given
final Map<String, String> values = new HashMap<>();
values.put("0000", "David Bowie");
values.put("0001", "45");
final DataSetRow row = new DataSetRow(values);
// when
ActionTestWorkbench.test(row, actionRegistry, factory.create(action, parameters));
// then
assertFalse(row.isDeleted());
}
use of org.talend.dataprep.api.dataset.row.DataSetRow in project data-prep by Talend.
the class DeleteEmptyTest method should_not_delete_because_value_set_2.
@Test
public void should_not_delete_because_value_set_2() {
// given
final Map<String, String> values = new HashMap<>();
values.put("0000", "David Bowie");
values.put("0001", " a value ");
final DataSetRow row = new DataSetRow(values);
// when
ActionTestWorkbench.test(row, actionRegistry, factory.create(action, parameters));
// then
assertFalse(row.isDeleted());
}
Aggregations