]> source.dussan.org Git - vaadin-framework.git/commitdiff
Test for #6304
authorArtur Signell <artur.signell@itmill.com>
Tue, 18 Jan 2011 17:31:29 +0000 (17:31 +0000)
committerArtur Signell <artur.signell@itmill.com>
Tue, 18 Jan 2011 17:31:29 +0000 (17:31 +0000)
svn changeset:16942/svn branch:6.5

tests/src/com/vaadin/tests/components/customcomponent/EmbeddedInCustomComponent.html [new file with mode: 0644]
tests/src/com/vaadin/tests/components/customcomponent/EmbeddedInCustomComponent.java [new file with mode: 0644]

diff --git a/tests/src/com/vaadin/tests/components/customcomponent/EmbeddedInCustomComponent.html b/tests/src/com/vaadin/tests/components/customcomponent/EmbeddedInCustomComponent.html
new file mode 100644 (file)
index 0000000..268d307
--- /dev/null
@@ -0,0 +1,37 @@
+<?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>New Test</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">New Test</td></tr>
+</thead><tbody>
+<tr>
+       <td>open</td>
+       <td>/run/com.vaadin.tests.components.customcomponent.EmbeddedInCustomComponent?restartApplication</td>
+       <td></td>
+</tr>
+<tr>
+       <td>screenCapture</td>
+       <td></td>
+       <td>initial</td>
+</tr>
+<tr>
+       <td>open</td>
+       <td>/run/com.vaadin.tests.components.customcomponent.EmbeddedInCustomComponent?restartApplication</td>
+       <td></td>
+</tr>
+<tr>
+       <td>screenCapture</td>
+       <td></td>
+       <td>after-refresh</td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
diff --git a/tests/src/com/vaadin/tests/components/customcomponent/EmbeddedInCustomComponent.java b/tests/src/com/vaadin/tests/components/customcomponent/EmbeddedInCustomComponent.java
new file mode 100644 (file)
index 0000000..8a37d85
--- /dev/null
@@ -0,0 +1,40 @@
+package com.vaadin.tests.components.customcomponent;
+
+import java.util.Date;
+
+import com.vaadin.terminal.ThemeResource;
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.ui.CustomComponent;
+import com.vaadin.ui.Embedded;
+import com.vaadin.ui.HorizontalLayout;
+
+public class EmbeddedInCustomComponent extends TestBase {
+
+    @Override
+    protected void setup() {
+        HorizontalLayout hl = new HorizontalLayout();
+
+        hl.addComponent(wrap("An uncached image",
+                "ok.png?random=" + new Date().getTime()));
+        hl.addComponent(wrap("A cached image", "cancel.png"));
+        addComponent(hl);
+    }
+
+    private CustomComponent wrap(String caption, String themeImage) {
+        Embedded image = new Embedded(caption, new ThemeResource(
+                "../runo/icons/64/" + themeImage));
+        CustomComponent cc = new CustomComponent(image);
+        return cc;
+    }
+
+    @Override
+    protected String getDescription() {
+        return "Two embedded images are shown below, side-by-side. The first one has a random url so it is not cached, the second one is cached.";
+    }
+
+    @Override
+    protected Integer getTicketNumber() {
+        return 6304;
+    }
+
+}