From b2bf7193d223fc576f8435cc45c145c97f6ce0bc Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Fri, 29 Nov 2013 16:53:05 +0200 Subject: Correct assertion message which changed due to #12915 Converted to TB3 to allow running on only one browser Change-Id: I8a0d20cfb5af798d8b89f3fca86ef7d9d7a37527 --- .../vaadin/launcher/ApplicationRunnerServlet.java | 2 +- .../applicationservlet/NoApplicationClass.html | 26 ------------ .../applicationservlet/NoApplicationClass.java | 49 ++++++++++++++++++++++ 3 files changed, 50 insertions(+), 27 deletions(-) delete mode 100644 uitest/src/com/vaadin/tests/applicationservlet/NoApplicationClass.html create mode 100644 uitest/src/com/vaadin/tests/applicationservlet/NoApplicationClass.java diff --git a/uitest/src/com/vaadin/launcher/ApplicationRunnerServlet.java b/uitest/src/com/vaadin/launcher/ApplicationRunnerServlet.java index a2f3c59f07..47d3a19fde 100644 --- a/uitest/src/com/vaadin/launcher/ApplicationRunnerServlet.java +++ b/uitest/src/com/vaadin/launcher/ApplicationRunnerServlet.java @@ -280,7 +280,7 @@ public class ApplicationRunnerServlet extends LegacyVaadinServlet { } - throw new ClassNotFoundException(); + throw new ClassNotFoundException(baseName); } private Logger getLogger() { diff --git a/uitest/src/com/vaadin/tests/applicationservlet/NoApplicationClass.html b/uitest/src/com/vaadin/tests/applicationservlet/NoApplicationClass.html deleted file mode 100644 index 6ed410fdb6..0000000000 --- a/uitest/src/com/vaadin/tests/applicationservlet/NoApplicationClass.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - -New Test - - - - - - - - - - - - - - - - -
New Test
open/run/ClassThatIsNotPresent?restartApplication
assertText//pre[2]*java.lang.InstantiationException: Failed to load application class: ClassThatIsNotPresent*
- - diff --git a/uitest/src/com/vaadin/tests/applicationservlet/NoApplicationClass.java b/uitest/src/com/vaadin/tests/applicationservlet/NoApplicationClass.java new file mode 100644 index 0000000000..c2222c4608 --- /dev/null +++ b/uitest/src/com/vaadin/tests/applicationservlet/NoApplicationClass.java @@ -0,0 +1,49 @@ +/* + * Copyright 2000-2013 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.applicationservlet; + +import java.util.Collections; +import java.util.List; + +import org.junit.Assert; +import org.junit.Test; +import org.openqa.selenium.By; +import org.openqa.selenium.remote.DesiredCapabilities; + +import com.vaadin.tests.tb3.MultiBrowserTest; + +public class NoApplicationClass extends MultiBrowserTest { + + @Test + public void testInvalidApplicationClass() { + openTestURL(); + String exceptionMessage = getDriver().findElement(By.xpath("//pre[2]")) + .getText(); + Assert.assertTrue(exceptionMessage + .contains("ServletException: ClassThatIsNotPresent")); + } + + @Override + public List getBrowsersToTest() { + return Collections.singletonList(Browser.CHROME + .getDesiredCapabilities()); + } + + @Override + protected String getDeploymentPath() { + return "/run/ClassThatIsNotPresent"; + } +} -- cgit v1.2.3