diff options
author | Artur Signell <artur@vaadin.com> | 2013-10-07 18:12:06 +0300 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2013-10-08 12:25:17 +0000 |
commit | f488825d46c984cea841534178b094be3a562eea (patch) | |
tree | 2fe8898d4bb7a520ddfdb7b81e0392abe7a505da /uitest/src/com/vaadin/tests/push/BasicPush.java | |
parent | 63e16e6547b4a7c067a9a1fa53dcecb9d704016b (diff) | |
download | vaadin-framework-f488825d46c984cea841534178b094be3a562eea.tar.gz vaadin-framework-f488825d46c984cea841534178b094be3a562eea.zip |
Update TB3+ convention to use a separate *Test file
For any issue there should be a UI class, e.g. LabelSomething and a
Test class which has the name of the UI + Test, e.g. LabelSomethingTest.
The LabelSomethingTest contains ALL tests which depend on LabelSomething
and are named accordingly to what they test.
For special and legacy cases also LegacyApplication and UIProvider are
supported in addition to UI classes
Change-Id: Ifc0180b377284bbd029202494ad194d324f8213b
Diffstat (limited to 'uitest/src/com/vaadin/tests/push/BasicPush.java')
-rw-r--r-- | uitest/src/com/vaadin/tests/push/BasicPush.java | 75 |
1 files changed, 0 insertions, 75 deletions
diff --git a/uitest/src/com/vaadin/tests/push/BasicPush.java b/uitest/src/com/vaadin/tests/push/BasicPush.java index d1a9fb575f..d6c45a2ed0 100644 --- a/uitest/src/com/vaadin/tests/push/BasicPush.java +++ b/uitest/src/com/vaadin/tests/push/BasicPush.java @@ -18,16 +18,11 @@ package com.vaadin.tests.push; import java.util.Timer; import java.util.TimerTask; -import org.junit.Assert; -import org.junit.Test; -import org.openqa.selenium.WebElement; - import com.vaadin.annotations.Push; import com.vaadin.data.util.ObjectProperty; import com.vaadin.server.VaadinRequest; import com.vaadin.shared.ui.label.ContentMode; import com.vaadin.tests.components.AbstractTestUI; -import com.vaadin.tests.tb3.MultiBrowserTest; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Label; @@ -35,76 +30,6 @@ import com.vaadin.ui.Label; @Push public class BasicPush extends AbstractTestUI { - public static abstract class BasicPushTest extends MultiBrowserTest { - - @Test - public void testPush() { - openTestURL(); - - // Test client initiated push - Assert.assertEquals(0, getClientCounter()); - getIncrementButton().click(); - Assert.assertEquals( - "Client counter not incremented by button click", 1, - getClientCounter()); - getIncrementButton().click(); - getIncrementButton().click(); - getIncrementButton().click(); - Assert.assertEquals( - "Four clicks should have incremented counter to 4", 4, - getClientCounter()); - - // Test server initiated push - getServerCounterStartButton().click(); - try { - Assert.assertEquals(0, getServerCounter()); - sleep(3000); - int serverCounter = getServerCounter(); - if (serverCounter < 1) { - // No push has happened - Assert.fail("No push has occured within 3s"); - } - sleep(3000); - if (getServerCounter() <= serverCounter) { - // No push has happened - Assert.fail("Only one push took place within 6s"); - - } - } finally { - // Avoid triggering push assertions - getServerCounterStopButton().click(); - } - } - - private int getServerCounter() { - return Integer.parseInt(getServerCounterElement().getText()); - } - - private int getClientCounter() { - return Integer.parseInt(getClientCounterElement().getText()); - } - - private WebElement getServerCounterElement() { - return vaadinElement("/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[4]/VLabel[0]"); - } - - private WebElement getServerCounterStartButton() { - return vaadinElement("/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[5]/VButton[0]/domChild[0]/domChild[0]"); - } - - private WebElement getServerCounterStopButton() { - return vaadinElement("/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[6]/VButton[0]/domChild[0]/domChild[0]"); - } - - private WebElement getIncrementButton() { - return vaadinElement("/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[2]/VButton[0]/domChild[0]/domChild[0]"); - } - - private WebElement getClientCounterElement() { - return vaadinElement("/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[1]/VLabel[0]"); - } - } - private ObjectProperty<Integer> counter = new ObjectProperty<Integer>(0); private ObjectProperty<Integer> counter2 = new ObjectProperty<Integer>(0); |