You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

NoApplicationClassTest.java 993B

123456789101112131415161718192021222324252627282930313233
  1. package com.vaadin.tests.applicationservlet;
  2. import static org.junit.Assert.assertTrue;
  3. import org.junit.Test;
  4. import org.openqa.selenium.By;
  5. import com.vaadin.tests.tb3.SingleBrowserTest;
  6. public class NoApplicationClassTest extends SingleBrowserTest {
  7. @Test
  8. public void testInvalidApplicationClass() {
  9. openTestURL();
  10. String exceptionMessage = getDriver().findElement(By.xpath("//pre[1]"))
  11. .getText();
  12. String expected = "ServletException: java.lang.ClassNotFoundException: ClassThatIsNotPresent";
  13. assertTrue(String.format(
  14. "Unexpected error message.\n expected to contain: '%s'\n was: %s",
  15. expected, exceptionMessage),
  16. exceptionMessage.contains(expected));
  17. }
  18. @Override
  19. protected String getDeploymentPath() {
  20. return "/run/ClassThatIsNotPresent";
  21. }
  22. @Override
  23. protected void openTestURL(String... parameters) {
  24. driver.get(getTestUrl());
  25. }
  26. }