]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fixed broken tests
authorArtur Signell <artur@vaadin.com>
Fri, 5 Apr 2013 15:41:52 +0000 (18:41 +0300)
committerVaadin Code Review <review@vaadin.com>
Tue, 9 Apr 2013 06:41:32 +0000 (06:41 +0000)
* Added missing screenshot identifiers
* Removed redundant test
* DebugConsole -> DebugWindow
* Updated test to show why serialization fails
* Fixed problems caused by added maximize button

Change-Id: I5cf76fec7170747120b7243f9693851cd52c12af

17 files changed:
uitest/src/com/vaadin/tests/components/calendar/CalendarSizeTest1000x600px.html
uitest/src/com/vaadin/tests/components/calendar/CalendarSizeTest100percentXundefined.html
uitest/src/com/vaadin/tests/components/calendar/CalendarSizeTest100x100percent.html
uitest/src/com/vaadin/tests/components/calendar/CalendarSizeTest300pxXundefined.html
uitest/src/com/vaadin/tests/components/calendar/CalendarSizeTestSizeFull.html [deleted file]
uitest/src/com/vaadin/tests/components/calendar/CalendarSizeTestUndefinedX100percent.html
uitest/src/com/vaadin/tests/components/calendar/CalendarSizeTestUndefinedX300px.html
uitest/src/com/vaadin/tests/components/calendar/CalendarSizeTestUndefinedXUndefined.html
uitest/src/com/vaadin/tests/components/ui/UIInitException.html
uitest/src/com/vaadin/tests/components/ui/UISerialization.java
uitest/src/com/vaadin/tests/components/window/CloseSubWindow.html
uitest/src/com/vaadin/tests/components/window/CloseSubWindow.java
uitest/src/com/vaadin/tests/components/window/SubWindowOrder.html
uitest/src/com/vaadin/tests/components/window/WindowMaximizeRestoreTest.html
uitest/src/com/vaadin/tests/components/window/WindowWithInvalidCloseListener.html
uitest/src/com/vaadin/tests/debug/DebugWindowPresent.html
uitest/src/com/vaadin/tests/requesthandlers/AppResource404.html

index 66d2c2f126fd4108cffdf0c320ed6e4b87703d67..bd4c67136109508dc5ffcc58fdc16d80ca70ceeb 100644 (file)
@@ -24,7 +24,7 @@
 <tr>
        <td>screenCapture</td>
        <td></td>
-       <td></td>
+       <td>month</td>
 </tr>
 <tr>
        <td>mouseClick</td>
@@ -34,7 +34,7 @@
 <tr>
        <td>screenCapture</td>
        <td></td>
-       <td></td>
+       <td>week</td>
 </tr>
 </tbody></table>
 </body>
index 7c963f547fd42f1a533b393d06991637ec389c8d..64b5444d34fbd0665f899f95104737ad9a05aaa5 100644 (file)
@@ -24,7 +24,7 @@
 <tr>
        <td>screenCapture</td>
        <td></td>
-       <td></td>
+       <td>month</td>
 </tr>
 <tr>
        <td>mouseClick</td>
@@ -34,7 +34,7 @@
 <tr>
        <td>screenCapture</td>
        <td></td>
-       <td></td>
+       <td>week</td>
 </tr>
 </tbody></table>
 </body>
index 19f03db784ed99563f69d7b2dd0c51b0baecd5ef..0905034b136a24ed6bcdf8d84954815a9df9dbe1 100644 (file)
@@ -24,7 +24,7 @@
 <tr>
        <td>screenCapture</td>
        <td></td>
-       <td></td>
+       <td>month</td>
 </tr>
 <tr>
        <td>mouseClick</td>
@@ -34,7 +34,7 @@
 <tr>
        <td>screenCapture</td>
        <td></td>
-       <td></td>
+       <td>week</td>
 </tr>
 </tbody></table>
 </body>
index 70f6dbd75b532ee5d45ec42be33f2a577142822e..99327a01df3dd47c771469cdabf8905c0027b66c 100644 (file)
@@ -24,7 +24,7 @@
 <tr>
        <td>screenCapture</td>
        <td></td>
-       <td></td>
+       <td>month</td>
 </tr>
 <tr>
        <td>mouseClick</td>
@@ -34,7 +34,7 @@
 <tr>
        <td>screenCapture</td>
        <td></td>
-       <td></td>
+       <td>week</td>
 </tr>
 </tbody></table>
 </body>
diff --git a/uitest/src/com/vaadin/tests/components/calendar/CalendarSizeTestSizeFull.html b/uitest/src/com/vaadin/tests/components/calendar/CalendarSizeTestSizeFull.html
deleted file mode 100644 (file)
index 59d3922..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head profile="http://selenium-ide.openqa.org/profiles/test-case">
-<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-<link rel="selenium.base" href="" />
-<title>sizeTestSizeFull</title>
-</head>
-<body>
-<table cellpadding="1" cellspacing="1" border="1">
-<thead>
-<tr><td rowspan="1" colspan="3">sizeTestSizeFull</td></tr>
-</thead><tbody>
-<tr>
-       <td>open</td>
-       <td>/run/com.vaadin.tests.components.calendar.CalendarTest?testBench&amp;restartApplication</td>
-       <td></td>
-</tr>
-<tr>
-       <td>assertText</td>
-       <td>vaadin=runcomvaadintestscomponentscalendarCalendarTest::/VGridLayout[0]/VHorizontalLayout[1]/Slot[1]/VLabel[0]</td>
-       <td>Jan 2000</td>
-</tr>
-<tr>
-       <td>screenCapture</td>
-       <td></td>
-       <td></td>
-</tr>
-<tr>
-       <td>mouseClick</td>
-       <td>vaadin=runcomvaadintestscomponentscalendarCalendarTest::/VGridLayout[0]/VCalendar[0]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[1]/domChild[2]/domChild[0]/domChild[0]</td>
-       <td>9,56</td>
-</tr>
-<tr>
-       <td>screenCapture</td>
-       <td></td>
-       <td></td>
-</tr>
-</tbody></table>
-</body>
-</html>
index d48917904c57fb7ac3030af8590519268c520af8..2e4c811ff1411f64cce0278c378d38ee678f2811 100644 (file)
@@ -24,7 +24,7 @@
 <tr>
        <td>screenCapture</td>
        <td></td>
-       <td></td>
+       <td>month</td>
 </tr>
 <tr>
        <td>mouseClick</td>
@@ -34,7 +34,7 @@
 <tr>
        <td>screenCapture</td>
        <td></td>
-       <td></td>
+       <td>week</td>
 </tr>
 </tbody></table>
 </body>
index 2dfce006356b24ddf4b5365ad74bb2f297c41376..cca66c7145e27f975bcea7e782a2064589364abb 100644 (file)
@@ -24,7 +24,7 @@
 <tr>
        <td>screenCapture</td>
        <td></td>
-       <td></td>
+       <td>month</td>
 </tr>
 <tr>
        <td>mouseClick</td>
@@ -34,7 +34,7 @@
 <tr>
        <td>screenCapture</td>
        <td></td>
-       <td></td>
+       <td>week</td>
 </tr>
 </tbody></table>
 </body>
index 3bfae6be353ee0a54102d273aa126b4ffdca200b..e4a8da691b3e3e4d407ea9e750f50a571820faff 100644 (file)
@@ -24,7 +24,7 @@
 <tr>
        <td>screenCapture</td>
        <td></td>
-       <td></td>
+       <td>month</td>
 </tr>
 <tr>
        <td>mouseClick</td>
@@ -34,7 +34,7 @@
 <tr>
        <td>screenCapture</td>
        <td></td>
-       <td></td>
+       <td>week</td>
 </tr>
 </tbody></table>
 </body>
index c2b1b3305965069cdee18b6e9b3a087d0ea09b32..68b11e7942a41762628c326de203bf7ccd75d325 100644 (file)
@@ -17,9 +17,9 @@
        <td></td>
 </tr>
 <tr>
-       <td>assertText</td>
-       <td>//html/body/div/pre</td>
+       <td>assertTextPresent</td>
        <td>Catch me if you can</td>
+       <td></td>
 </tr>
 </tbody></table>
 </body>
index 5f3d8d97de1087862c180022098d3ed7912a6a4a..90021a0bf43b8eca6dae971220205285188942fb 100644 (file)
@@ -20,15 +20,19 @@ import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
+import java.io.PrintWriter;
 import java.io.Serializable;
+import java.io.StringWriter;
 import java.util.Date;
 
 import com.vaadin.server.VaadinRequest;
+import com.vaadin.shared.ui.label.ContentMode;
 import com.vaadin.tests.components.AbstractTestUI;
 import com.vaadin.tests.util.Log;
 import com.vaadin.ui.Button;
 import com.vaadin.ui.Button.ClickEvent;
 import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.Label;
 
 public class UISerialization extends AbstractTestUI {
 
@@ -42,21 +46,29 @@ public class UISerialization extends AbstractTestUI {
             @Override
             public void buttonClick(ClickEvent event) {
                 Date d = new Date();
-                byte[] result = serialize(UISerialization.this);
-                long elapsed = new Date().getTime() - d.getTime();
-                log.log("Serialized UI in " + elapsed + "ms into "
-                        + result.length + " bytes");
-                Object diffStateBefore = getConnectorTracker().getDiffState(
-                        UISerialization.this);
-                UISerialization app = (UISerialization) deserialize(result);
-                log.log("Deserialized UI in " + elapsed + "ms");
-                Object diffStateAfter = getConnectorTracker().getDiffState(
-                        UISerialization.this);
-                if (diffStateBefore.equals(diffStateAfter)) {
-                    log.log("Diff states match, size: "
-                            + diffStateBefore.toString().length());
-                } else {
-                    log.log("Diff states do not match");
+                try {
+                    byte[] result = serialize(UISerialization.this);
+                    long elapsed = new Date().getTime() - d.getTime();
+                    log.log("Serialized UI in " + elapsed + "ms into "
+                            + result.length + " bytes");
+                    Object diffStateBefore = getConnectorTracker()
+                            .getDiffState(UISerialization.this);
+                    UISerialization app = (UISerialization) deserialize(result);
+                    log.log("Deserialized UI in " + elapsed + "ms");
+                    Object diffStateAfter = getConnectorTracker().getDiffState(
+                            UISerialization.this);
+                    if (diffStateBefore.equals(diffStateAfter)) {
+                        log.log("Diff states match, size: "
+                                + diffStateBefore.toString().length());
+                    } else {
+                        log.log("Diff states do not match");
+                    }
+                } catch (Exception e) {
+                    log.log("Exception caught: " + e.getMessage());
+                    StringWriter sw = new StringWriter();
+                    e.printStackTrace(new PrintWriter(sw));
+                    addComponent(new Label(sw.toString(),
+                            ContentMode.PREFORMATTED));
                 }
 
             }
@@ -64,20 +76,16 @@ public class UISerialization extends AbstractTestUI {
     }
 
     protected void serializeInstance(Class<?> cls)
-            throws InstantiationException, IllegalAccessException {
+            throws InstantiationException, IllegalAccessException, IOException {
         serialize((Serializable) cls.newInstance());
     }
 
-    protected byte[] serialize(Serializable serializable) {
+    protected byte[] serialize(Serializable serializable) throws IOException {
         ByteArrayOutputStream os = new ByteArrayOutputStream();
         ObjectOutputStream oos;
-        try {
-            oos = new ObjectOutputStream(os);
-            oos.writeObject(serializable);
-            return os.toByteArray();
-        } catch (IOException e) {
-            throw new RuntimeException("Serialization failed", e);
-        }
+        oos = new ObjectOutputStream(os);
+        oos.writeObject(serializable);
+        return os.toByteArray();
     }
 
     protected Object deserialize(byte[] result) {
index 6e3eb906b7d81bca6cf54882f8018c3452bb9052..ac81dfdefb1bbbcb99fdf9232d3ef62481eb31e7 100644 (file)
        <td>/run/com.vaadin.tests.components.window.CloseSubWindow?restartApplication</td>
        <td></td>
 </tr>
-<tr>
-       <td>waitForVaadin</td>
-       <td></td>
-       <td></td>
-</tr>
 <tr>
        <td>click</td>
        <td>vaadin=runcomvaadintestscomponentswindowCloseSubWindow::PID_Sopensub/domChild[0]/domChild[0]</td>
@@ -45,7 +40,7 @@
 <!--Click close in title bar-->
 <tr>
        <td>click</td>
-       <td>vaadin=runcomvaadintestscomponentswindowCloseSubWindow::/VWindow[0]/domChild[0]/domChild[0]/domChild[1]</td>
+       <td>vaadin=runcomvaadintestscomponentswindowCloseSubWindow::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td>
        <td></td>
 </tr>
 <tr>
index e2a59b60057c321054c1281d8696eb74c2b55ccc..6aad3e9170676de03a1def0709475ffb62b1c228 100644 (file)
@@ -33,7 +33,7 @@ public class CloseSubWindow extends TestBase {
     private Window createClosableSubWindow(final String title) {
         VerticalLayout layout = new VerticalLayout();
         layout.setMargin(true);
-        layout.setSizeFull();
+        layout.setSizeUndefined();
         final Window window = new Window(title, layout);
         window.setSizeUndefined();
         window.setClosable(true);
index 0476de6c357e80802dfe562572be214cf58196ee..8374a90b52724ce9cf31c18d838ab668c9baa5ee 100644 (file)
@@ -90,7 +90,7 @@
 <!--Close window 4, which is the topmost window-->
 <tr>
        <td>mouseClick</td>
-       <td>vaadin=runcomvaadintestscomponentswindowSubWindowOrder::/VWindow[3]/domChild[0]/domChild[0]/domChild[1]</td>
+       <td>vaadin=runcomvaadintestscomponentswindowSubWindowOrder::/VWindow[3]/domChild[0]/domChild[0]/domChild[2]</td>
        <td>11,15</td>
 </tr>
 <tr>
 <!--Close Dialog 3 (topmost)-->
 <tr>
        <td>mouseClick</td>
-       <td>vaadin=runcomvaadintestscomponentswindowSubWindowOrder::/VWindow[2]/domChild[0]/domChild[0]/domChild[1]</td>
+       <td>vaadin=runcomvaadintestscomponentswindowSubWindowOrder::/VWindow[2]/domChild[0]/domChild[0]/domChild[2]</td>
        <td>6,8</td>
 </tr>
 <!--Make Dialog 5 (topmost) non-modal-->
 <!--Close dialog 5-->
 <tr>
        <td>mouseClick</td>
-       <td>vaadin=runcomvaadintestscomponentswindowSubWindowOrder::/VWindow[2]/domChild[0]/domChild[0]/domChild[1]</td>
+       <td>vaadin=runcomvaadintestscomponentswindowSubWindowOrder::/VWindow[2]/domChild[0]/domChild[0]/domChild[2]</td>
        <td>10,5</td>
 </tr>
 <tr>
index 090579d81dbaa2160795a135e0cea9369fae2d3f..ed76caed54847337aff349d4b366fb37c1c32d4f 100644 (file)
 </tr>
 <tr>
        <td>screenCapture</td>
-       <td>window-2-original-pos-window-1-centered</td>
+       <td>window-2-original-pos-window-1-centered-again</td>
        <td></td>
 </tr>
 <tr>
index 923276b61387bcf5de3da5b0828faeab61d95d0d..fa63e5e1e6ca3262ac97c5df035c8348010005f6 100644 (file)
@@ -18,7 +18,7 @@
 </tr>
 <tr>
        <td>mouseClick</td>
-       <td>vaadin=runcomvaadintestscomponentswindowWindowWithInvalidCloseListener::/VWindow[0]/domChild[0]/domChild[0]/domChild[1]</td>
+       <td>vaadin=runcomvaadintestscomponentswindowWindowWithInvalidCloseListener::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td>
        <td>6,7</td>
 </tr>
 <tr>
index 11640ef6c39cf1cf20e3a9e927f730274834c143..fb4c266db1082ae677c628127ea7d9359f70e547 100644 (file)
@@ -28,7 +28,7 @@
 </tr>
 <tr>
        <td>assertElementPresent</td>
-       <td>vaadin=runcomvaadintestsdebugDebugWindowPresent::Root/VDebugConsole[0]</td>
+       <td>vaadin=runcomvaadintestsdebugDebugWindowPresent::Root/VDebugWindow[0]</td>
        <td></td>
 </tr>
 <tr>
@@ -38,7 +38,7 @@
 </tr>
 <tr>
        <td>assertElementNotPresent</td>
-       <td>vaadin=runcomvaadintestsdebugDebugWindowPresent::Root/VDebugConsole[0]</td>
+       <td>vaadin=runcomvaadintestsdebugDebugWindowPresent::Root/VDebugWindow[0]</td>
        <td></td>
 </tr>
 <tr>
@@ -48,7 +48,7 @@
 </tr>
 <tr>
        <td>assertElementNotPresent</td>
-       <td>vaadin=runcomvaadintestsdebugDebugWindowPresent::Root/VDebugConsole[0]</td>
+       <td>vaadin=runcomvaadintestsdebugDebugWindowPresent::Root/VDebugWindow[0]</td>
        <td></td>
 </tr>
 <tr>
@@ -58,7 +58,7 @@
 </tr>
 <tr>
        <td>assertElementNotPresent</td>
-       <td>vaadin=runcomvaadintestsdebugDebugWindowPresent::Root/VDebugConsole[0]</td>
+       <td>vaadin=runcomvaadintestsdebugDebugWindowPresent::Root/VDebugWindow[0]</td>
        <td></td>
 </tr>
 <tr>
@@ -68,7 +68,7 @@
 </tr>
 <tr>
        <td>assertElementNotPresent</td>
-       <td>vaadin=runcomvaadintestsdebugDebugWindowPresent::Root/VDebugConsole[0]</td>
+       <td>vaadin=runcomvaadintestsdebugDebugWindowPresent::Root/VDebugWindow[0]</td>
        <td></td>
 </tr>
 <tr>
@@ -78,7 +78,7 @@
 </tr>
 <tr>
        <td>assertElementNotPresent</td>
-       <td>vaadin=runcomvaadintestsdebugDebugWindowPresent::Root/VDebugConsole[0]</td>
+       <td>vaadin=runcomvaadintestsdebugDebugWindowPresent::Root/VDebugWindow[0]</td>
        <td></td>
 </tr>
 <tr>
@@ -88,7 +88,7 @@
 </tr>
 <tr>
        <td>assertElementNotPresent</td>
-       <td>vaadin=runcomvaadintestsdebugDebugWindowPresent::Root/VDebugConsole[0]</td>
+       <td>vaadin=runcomvaadintestsdebugDebugWindowPresent::Root/VDebugWindow[0]</td>
        <td></td>
 </tr>
 <tr>
@@ -98,7 +98,7 @@
 </tr>
 <tr>
        <td>assertElementNotPresent</td>
-       <td>vaadin=runcomvaadintestsdebugDebugWindowPresent::Root/VDebugConsole[0]</td>
+       <td>vaadin=runcomvaadintestsdebugDebugWindowPresent::Root/VDebugWindow[0]</td>
        <td></td>
 </tr>
 </tbody></table>
index 16f3db6a1ae9d4ce55239ea65104e40dd8b8654e..543faa30dd9cf6370ba0f74216d922de60e30712 100644 (file)
 </tr>
 <tr>
        <td>assertTextPresent</td>
-       <td>/APP can not be found</td>
+       <td>HTTP ERROR 404</td>
+       <td></td>
+</tr>
+<tr>
+       <td>assertTextPresent</td>
+       <td>Problem accessing /run/APP/</td>
        <td></td>
 </tr>
 <tr>