summaryrefslogtreecommitdiffstats
path: root/uitest
diff options
context:
space:
mode:
authorJohannes Dahlström <johannesd@vaadin.com>2014-12-11 17:07:15 +0200
committerJohannes Dahlström <johannesd@vaadin.com>2014-12-11 17:35:40 +0200
commit4f41def1e6cae667d4c39bbff8664895e46d7a76 (patch)
tree80525f18ce0520074c0e2948b9e56403e8536343 /uitest
parentb8a38c38caea01eb21ab0e02b77f87bc6bf31214 (diff)
downloadvaadin-framework-4f41def1e6cae667d4c39bbff8664895e46d7a76.tar.gz
vaadin-framework-4f41def1e6cae667d4c39bbff8664895e46d7a76.zip
Remove editor row discard methods; rename "commit" to "save" (#13334)
Change-Id: Ic7cec3c3750db8a2e0b23a4d38f63e9642999e3e
Diffstat (limited to 'uitest')
-rw-r--r--uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridBasicFeatures.java10
-rw-r--r--uitest/src/com/vaadin/tests/components/grid/basicfeatures/client/GridEditorRowClientTest.java21
-rw-r--r--uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridEditorRowTest.java25
-rw-r--r--uitest/src/com/vaadin/tests/widgetset/client/grid/GridBasicClientFeaturesWidget.java18
4 files changed, 30 insertions, 44 deletions
diff --git a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridBasicFeatures.java b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridBasicFeatures.java
index 88579154dc..3a3c822311 100644
--- a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridBasicFeatures.java
+++ b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridBasicFeatures.java
@@ -816,23 +816,17 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> {
c.editItem(100);
}
}, null);
- createClickAction("Commit", "Editor row", new Command<Grid, String>() {
+ createClickAction("Save", "Editor row", new Command<Grid, String>() {
@Override
public void execute(Grid c, String value, Object data) {
try {
- c.commitEditorRow();
+ c.saveEditorRow();
} catch (CommitException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}, null);
- createClickAction("Discard", "Editor row", new Command<Grid, String>() {
- @Override
- public void execute(Grid c, String value, Object data) {
- c.discardEditorRow();
- }
- }, null);
createClickAction("Cancel edit", "Editor row",
new Command<Grid, String>() {
@Override
diff --git a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/client/GridEditorRowClientTest.java b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/client/GridEditorRowClientTest.java
index 4c64eac6e5..b08e007295 100644
--- a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/client/GridEditorRowClientTest.java
+++ b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/client/GridEditorRowClientTest.java
@@ -121,13 +121,13 @@ public class GridEditorRowClientTest extends GridBasicClientFeaturesTest {
}
@Test
- public void testCommit() {
+ public void testSave() {
selectMenuPath("Component", "Editor row", "Edit row 100");
- List<WebElement> widgets = getEditorRow().findElements(
- By.className("gwt-TextBox"));
+ WebElement textField = getEditorRow().findElements(
+ By.className("gwt-TextBox")).get(0);
- widgets.get(0).sendKeys(" changed");
+ textField.sendKeys(" changed");
WebElement saveButton = getEditorRow().findElement(
By.className("v-editor-row-save"));
@@ -139,16 +139,17 @@ public class GridEditorRowClientTest extends GridBasicClientFeaturesTest {
}
@Test
- public void testDiscard() {
+ public void testProgrammaticSave() {
selectMenuPath("Component", "Editor row", "Edit row 100");
- List<WebElement> widgets = getEditorRow().findElements(
- By.className("gwt-TextBox"));
+ WebElement textField = getEditorRow().findElements(
+ By.className("gwt-TextBox")).get(0);
- widgets.get(0).sendKeys(" changed");
+ textField.sendKeys(" changed");
- selectMenuPath("Component", "Editor row", "Discard");
+ selectMenuPath("Component", "Editor row", "Save");
- assertEquals("(100, 0)", getGridElement().getCell(100, 0).getText());
+ assertEquals("(100, 0) changed", getGridElement().getCell(100, 0)
+ .getText());
}
}
diff --git a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridEditorRowTest.java b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridEditorRowTest.java
index a8f5a54c29..7f3d4ff325 100644
--- a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridEditorRowTest.java
+++ b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridEditorRowTest.java
@@ -118,15 +118,15 @@ public class GridEditorRowTest extends GridBasicFeaturesTest {
}
@Test
- public void testCommit() {
+ public void testSave() {
selectMenuPath("Component", "Editor row", "Edit item 100");
- List<WebElement> widgets = getEditorRow().findElements(
- By.className("v-textfield"));
+ WebElement textField = getEditorRow().findElements(
+ By.className("v-textfield")).get(0);
- widgets.get(0).click();
+ textField.click();
- widgets.get(0).sendKeys(" changed");
+ textField.sendKeys(" changed");
WebElement saveButton = getEditorRow().findElement(
By.className("v-editor-row-save"));
@@ -138,16 +138,19 @@ public class GridEditorRowTest extends GridBasicFeaturesTest {
}
@Test
- public void testDiscard() {
+ public void testProgrammaticSave() {
selectMenuPath("Component", "Editor row", "Edit item 100");
- List<WebElement> widgets = getEditorRow().findElements(
- By.className("v-textfield"));
+ WebElement textField = getEditorRow().findElements(
+ By.className("v-textfield")).get(0);
+
+ textField.click();
- widgets.get(0).sendKeys(" changed");
+ textField.sendKeys(" changed");
- selectMenuPath("Component", "Editor row", "Discard");
+ selectMenuPath("Component", "Editor row", "Save");
- assertEquals("(100, 0)", getGridElement().getCell(100, 0).getText());
+ assertEquals("(100, 0) changed", getGridElement().getCell(100, 0)
+ .getText());
}
}
diff --git a/uitest/src/com/vaadin/tests/widgetset/client/grid/GridBasicClientFeaturesWidget.java b/uitest/src/com/vaadin/tests/widgetset/client/grid/GridBasicClientFeaturesWidget.java
index b462a8b56c..ae1e8445d0 100644
--- a/uitest/src/com/vaadin/tests/widgetset/client/grid/GridBasicClientFeaturesWidget.java
+++ b/uitest/src/com/vaadin/tests/widgetset/client/grid/GridBasicClientFeaturesWidget.java
@@ -114,7 +114,7 @@ public class GridBasicClientFeaturesWidget extends
}
@Override
- public void commit(EditorRowRequest<List<Data>> request) {
+ public void save(EditorRowRequest<List<Data>> request) {
log.setText("Row " + request.getRowIndex() + " edit committed");
List<Data> rowData = ds.getRow(request.getRowIndex());
@@ -136,11 +136,6 @@ public class GridBasicClientFeaturesWidget extends
}
@Override
- public void discard(EditorRowRequest<List<Data>> request) {
- bind(request);
- }
-
- @Override
public TextBox getWidget(GridColumn<?, List<Data>> column) {
if (grid.getColumns().indexOf(column) == 0
&& !(grid.getSelectionModel() instanceof None)) {
@@ -900,17 +895,10 @@ public class GridBasicClientFeaturesWidget extends
}
}, "Component", "Editor row");
- addMenuCommand("Commit", new ScheduledCommand() {
- @Override
- public void execute() {
- grid.commitEditorRow();
- }
- }, "Component", "Editor row");
-
- addMenuCommand("Discard", new ScheduledCommand() {
+ addMenuCommand("Save", new ScheduledCommand() {
@Override
public void execute() {
- grid.discardEditorRow();
+ grid.saveEditorRow();
}
}, "Component", "Editor row");