1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 package org.htmlunit.libraries;
16
17 import org.eclipse.jetty.server.Server;
18 import org.htmlunit.WebDriverTestCase;
19 import org.htmlunit.WebServerTestCase;
20 import org.htmlunit.junit.BrowserRunner;
21 import org.htmlunit.junit.annotation.HtmlUnitNYI;
22 import org.junit.AfterClass;
23 import org.junit.BeforeClass;
24 import org.junit.Test;
25 import org.junit.runner.RunWith;
26
27
28
29
30
31
32 @RunWith(BrowserRunner.class)
33 public class MyFacesTest extends WebDriverTestCase {
34
35
36 protected static Server SERVER_;
37
38
39
40
41 @BeforeClass
42 public static void startSesrver() throws Exception {
43 SERVER_ = WebServerTestCase.createWebServer("src/test/resources/libraries/myfaces/4_0_2", null);
44 }
45
46
47
48
49 @AfterClass
50 public static void stopServer() throws Exception {
51 if (SERVER_ != null) {
52 SERVER_.stop();
53 SERVER_.destroy();
54 SERVER_ = null;
55 }
56 }
57
58
59
60
61 @Test
62 @HtmlUnitNYI(CHROME = "org.htmlunit.ScriptException: syntax error",
63 EDGE = "org.htmlunit.ScriptException: syntax error",
64 FF = "org.htmlunit.ScriptException: syntax error",
65 FF_ESR = "org.htmlunit.ScriptException: syntax error")
66 public void checkForJsCompileErrors_4_0_2() throws Exception {
67 try {
68 getWebDriver().get(URL_FIRST + "index.html");
69 }
70 catch (final Exception e) {
71 if (getExpectedAlerts().length > 0) {
72 assertTrue(e.getMessage(), e.getMessage().startsWith(getExpectedAlerts()[0]));
73 return;
74 }
75
76 throw e;
77 }
78 }
79 }