diff options
author | Leif Åstrand <leif@vaadin.com> | 2012-11-21 13:17:39 +0200 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2012-11-21 13:17:39 +0200 |
commit | 7d9c4c5e06a95f4aa5eb371a2f5b5418b92fac64 (patch) | |
tree | 90ff67118b79eff22a05346b6122e3ab210cc847 /uitest/src/com/vaadin/tests/resources | |
parent | 19baf19b7ef1a372154ba8bcbd5e35fb6ec1f3ef (diff) | |
download | vaadin-framework-7d9c4c5e06a95f4aa5eb371a2f5b5418b92fac64.tar.gz vaadin-framework-7d9c4c5e06a95f4aa5eb371a2f5b5418b92fac64.zip |
Reomove DynamicConnectorResource (#10227)
Change-Id: I9e91f9d57e22d3df621a19e0250339d5d2763827
Diffstat (limited to 'uitest/src/com/vaadin/tests/resources')
-rw-r--r-- | uitest/src/com/vaadin/tests/resources/ConnectorResourceTest.html | 27 | ||||
-rw-r--r-- | uitest/src/com/vaadin/tests/resources/ConnectorResourceTest.java | 70 |
2 files changed, 0 insertions, 97 deletions
diff --git a/uitest/src/com/vaadin/tests/resources/ConnectorResourceTest.html b/uitest/src/com/vaadin/tests/resources/ConnectorResourceTest.html deleted file mode 100644 index f400bacffa..0000000000 --- a/uitest/src/com/vaadin/tests/resources/ConnectorResourceTest.html +++ /dev/null @@ -1,27 +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>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.resources.ConnectorResourceTest?restartApplication</td> - <td></td> -</tr> -<tr> - <td>screenCapture</td> - <td></td> - <td></td> -</tr> - -</tbody></table> -</body> -</html> diff --git a/uitest/src/com/vaadin/tests/resources/ConnectorResourceTest.java b/uitest/src/com/vaadin/tests/resources/ConnectorResourceTest.java deleted file mode 100644 index 580188fd9b..0000000000 --- a/uitest/src/com/vaadin/tests/resources/ConnectorResourceTest.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.vaadin.tests.resources; - -import java.awt.image.BufferedImage; -import java.io.IOException; -import java.util.HashMap; - -import javax.imageio.ImageIO; - -import com.vaadin.server.DynamicConnectorResource; -import com.vaadin.server.VaadinRequest; -import com.vaadin.server.VaadinResponse; -import com.vaadin.tests.components.AbstractTestUI; -import com.vaadin.ui.Embedded; - -public class ConnectorResourceTest extends AbstractTestUI { - - private static final String DYNAMIC_IMAGE_NAME = "requestImage.png"; - - @Override - protected void setup(VaadinRequest request) { - addComponent(new Embedded(DYNAMIC_IMAGE_NAME, - new DynamicConnectorResource(this, DYNAMIC_IMAGE_NAME))); - addComponent(new Embedded("Dynamic text", new DynamicConnectorResource( - this, DYNAMIC_IMAGE_NAME, new HashMap<String, String>() { - { - put("text", "Dynamic%20text"); - } - }))); - } - - @Override - protected String getTestDescription() { - // Adding description would break screenshots -> too lazy to change - return null; - } - - @Override - protected Integer getTicketNumber() { - return Integer.valueOf("9419"); - } - - @Override - public boolean handleConnectorRequest(VaadinRequest request, - VaadinResponse response, String path) throws IOException { - if (DYNAMIC_IMAGE_NAME.equals(path)) { - // Create an image, draw the "text" parameter to it and output it to - // the browser. - String text = request.getParameter("text"); - if (text == null) { - text = DYNAMIC_IMAGE_NAME; - } - BufferedImage bi = getImage(text); - response.setContentType("image/png"); - ImageIO.write(bi, "png", response.getOutputStream()); - - return true; - } else { - return super.handleConnectorRequest(request, response, path); - } - } - - private BufferedImage getImage(String text) { - BufferedImage bi = new BufferedImage(150, 30, - BufferedImage.TYPE_3BYTE_BGR); - bi.getGraphics() - .drawChars(text.toCharArray(), 0, text.length(), 10, 20); - return bi; - } - -} |