2 * Copyright 2000-2016 Vaadin Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 * use this file except in compliance with the License. You may obtain a copy of
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 * License for the specific language governing permissions and limitations under
16 package com.vaadin.tests.components.grid.basicfeatures.client;
18 import static org.junit.Assert.assertEquals;
20 import org.junit.Test;
22 import com.vaadin.tests.components.grid.basicfeatures.GridBasicClientFeaturesTest;
24 public class GridRowHandleRefreshTest extends GridBasicClientFeaturesTest {
27 public void testRefreshingThroughRowHandle() {
30 assertEquals("Unexpected initial state", "(0, 0)",
31 getGridElement().getCell(0, 0).getText());
32 selectMenuPath("Component", "State", "Edit and refresh Row 0");
33 assertEquals("Cell contents did not update correctly", "Foo",
34 getGridElement().getCell(0, 0).getText());
38 public void testDelayedRefreshingThroughRowHandle()
39 throws InterruptedException {
42 assertEquals("Unexpected initial state", "(0, 0)",
43 getGridElement().getCell(0, 0).getText());
44 selectMenuPath("Component", "State", "Delayed edit of Row 0");
45 // Still the same data
46 assertEquals("Cell contents did not update correctly", "(0, 0)",
47 getGridElement().getCell(0, 0).getText());
49 // Data should be updated
50 assertEquals("Cell contents did not update correctly", "Bar",
51 getGridElement().getCell(0, 0).getText());
55 public void testRefreshingWhenNotInViewThroughRowHandle() {
58 assertEquals("Unexpected initial state", "(0, 0)",
59 getGridElement().getCell(0, 0).getText());
60 getGridElement().scrollToRow(100);
61 selectMenuPath("Component", "State", "Edit and refresh Row 0");
62 assertEquals("Cell contents did not update correctly", "Foo",
63 getGridElement().getCell(0, 0).getText());