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.annotation.HtmlUnitNYI;
21 import org.junit.jupiter.api.AfterAll;
22 import org.junit.jupiter.api.BeforeAll;
23 import org.junit.jupiter.api.Test;
24
25
26
27
28
29
30 public class MyFacesTest extends WebDriverTestCase {
31
32
33 protected static Server SERVER_;
34
35
36
37
38 @BeforeAll
39 public static void startSesrver() throws Exception {
40 SERVER_ = WebServerTestCase.createWebServer("src/test/resources/libraries/myfaces/4_0_2", null);
41 }
42
43
44
45
46 @AfterAll
47 public static void stopServer() throws Exception {
48 if (SERVER_ != null) {
49 SERVER_.stop();
50 SERVER_.destroy();
51 SERVER_ = null;
52 }
53 }
54
55
56
57
58 @Test
59 @HtmlUnitNYI(CHROME = "org.htmlunit.ScriptException: syntax error",
60 EDGE = "org.htmlunit.ScriptException: syntax error",
61 FF = "org.htmlunit.ScriptException: syntax error",
62 FF_ESR = "org.htmlunit.ScriptException: syntax error")
63 public void checkForJsCompileErrors_4_0_2() throws Exception {
64 try {
65 getWebDriver().get(URL_FIRST + "index.html");
66 }
67 catch (final Exception e) {
68 if (getExpectedAlerts().length > 0) {
69 assertTrue(e.getMessage(), e.getMessage().startsWith(getExpectedAlerts()[0]));
70 return;
71 }
72
73 throw e;
74 }
75 }
76 }