diff options
author | Ilia Motornyi <elmot@vaadin.com> | 2017-01-26 16:27:54 +0200 |
---|---|---|
committer | Aleksi Hietanen <aleksi@vaadin.com> | 2017-01-26 16:27:54 +0200 |
commit | ddbb619651a9073666274592359124ce271725ed (patch) | |
tree | 15f79b7c13f673c5fce05d5f0ab742ddfa8823a6 /uitest | |
parent | 9abf1eeab7196c0ac75a23101c262bfa404d1c84 (diff) | |
download | vaadin-framework-ddbb619651a9073666274592359124ce271725ed.tar.gz vaadin-framework-ddbb619651a9073666274592359124ce271725ed.zip |
JspIntegrationTest as a separate module (#8228)
Part of vaadin/framework8-issues#539
Diffstat (limited to 'uitest')
3 files changed, 0 insertions, 159 deletions
diff --git a/uitest/src/main/webapp/WEB-INF/web.xml b/uitest/src/main/webapp/WEB-INF/web.xml index 31f535e383..4f7ed062a8 100644 --- a/uitest/src/main/webapp/WEB-INF/web.xml +++ b/uitest/src/main/webapp/WEB-INF/web.xml @@ -211,11 +211,6 @@ </servlet-mapping> <servlet-mapping> - <servlet-name>IntegrationTest</servlet-name> - <url-pattern>/integration/*</url-pattern> - </servlet-mapping> - - <servlet-mapping> <servlet-name>CommErrorEmulator</servlet-name> <url-pattern>/commerror/*</url-pattern> </servlet-mapping> diff --git a/uitest/src/main/webapp/statictestfiles/vaadinsessions.jsp b/uitest/src/main/webapp/statictestfiles/vaadinsessions.jsp deleted file mode 100644 index b22787a203..0000000000 --- a/uitest/src/main/webapp/statictestfiles/vaadinsessions.jsp +++ /dev/null @@ -1,54 +0,0 @@ -<!DOCTYPE> -<%@page import="com.vaadin.ui.UI"%> -<%@page import="com.vaadin.server.VaadinSession"%> -<HTML> -<HEAD> -<TITLE>JSP integration</TITLE> -<style> -table { - background: #fff; -} - -td { - border: 1px solid black; - padding: .5em; -} -</style> -</HEAD> -<BODY> - <table> - <tr> - <th align="left" colspan=4>Available UIs:</th> - </tr> - <tr> - <th>Service Name</th> - <th>CSRF token</th> - <th>UI id</th> - <th>UI type</th> - <th>Main content</th> - </tr> - <% - HttpSession httpSession = request.getSession(false); - for (VaadinSession vs : VaadinSession.getAllSessions(httpSession)) { - try { - vs.lock(); - for (UI ui : vs.getUIs()) { - out.append("<tr class='uirow'>"); - out.append("<td>" + vs.getService().getServiceName() - + "</td>"); - out.append("<td>" + vs.getCsrfToken() + "</td>"); - out.append("<td>" + ui.getUIId() + "</td>"); - out.append("<td>" + ui.getClass().getName() + "</td>"); - out.append("<td>" + ui.getContent().getClass().getName() + "</td>"); - out.append("</tr>"); - - } - } finally { - vs.unlock(); - } - - } - %> - </table> -</BODY> -</HTML>
\ No newline at end of file diff --git a/uitest/src/test/java/com/vaadin/tests/integration/JSPIntegrationTest.java b/uitest/src/test/java/com/vaadin/tests/integration/JSPIntegrationTest.java deleted file mode 100644 index 3a7f907354..0000000000 --- a/uitest/src/test/java/com/vaadin/tests/integration/JSPIntegrationTest.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright 2000-2016 Vaadin Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ -package com.vaadin.tests.integration; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotEquals; - -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -import org.junit.Test; -import org.openqa.selenium.By; -import org.openqa.selenium.WebElement; - -import com.vaadin.tests.tb3.SingleBrowserTestPhantomJS2; - -public class JSPIntegrationTest extends SingleBrowserTestPhantomJS2 { - - final String appRunnerTestUrl = getBaseURL() + "/run/Buttons"; - final String jspUrl = getBaseURL() + "/statictestfiles/vaadinsessions.jsp"; - final String integrationUrl = getBaseURL() + "/integration"; - - @Test - public void listVaadinSessions() { - - assertUICount(0); - - // Open a new UI - getDriver().get(integrationUrl); - assertUICount(1); - - // Open a new UI - getDriver().get(integrationUrl); - - // Should now have two UIs for the same service with different uiIds - List<UIData> twoUIs = getUIs(); - assertEquals(2, twoUIs.size()); - assertNotEquals(twoUIs.get(0).uiId, twoUIs.get(1).uiId); - assertEquals(twoUIs.get(0).serviceName, twoUIs.get(1).serviceName); - - getDriver().get(appRunnerTestUrl); - // Should now have two services with 2 + 1 UIs - List<UIData> threeUIs = getUIs(); - assertEquals(3, threeUIs.size()); - Set<String> serviceNames = new HashSet<>(); - Set<Integer> uiIds = new HashSet<>(); - for (UIData uiData : threeUIs) { - serviceNames.add(uiData.serviceName); - uiIds.add(uiData.uiId); - } - assertGreaterOrEqual( - "There should be at least two unique service names", - serviceNames.size(), 2); - assertGreaterOrEqual("There should be at least two unique ui ids", - uiIds.size(), 2); - } - - private static class UIData { - private String serviceName; - private int uiId; - } - - private List<UIData> getUIs() { - List<UIData> uis = new ArrayList<>(); - - getDriver().get(jspUrl); - List<WebElement> rows = getDriver() - .findElements(By.xpath("//tr[@class='uirow']")); - for (WebElement row : rows) { - UIData data = new UIData(); - List<WebElement> tds = row.findElements(By.xpath("./td")); - - data.serviceName = tds.get(0).getText(); - data.uiId = Integer.parseInt(tds.get(2).getText()); - - uis.add(data); - } - - return uis; - } - - private void assertUICount(int i) { - assertEquals(i, getUIs().size()); - } -} |