1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 package org.htmlunit.libraries;
16
17 import java.net.URL;
18
19 import org.eclipse.jetty.server.Server;
20 import org.htmlunit.WebDriverTestCase;
21 import org.htmlunit.WebServerTestCase;
22 import org.htmlunit.junit.BrowserRunner;
23 import org.junit.AfterClass;
24 import org.junit.BeforeClass;
25 import org.junit.Test;
26 import org.junit.runner.RunWith;
27 import org.openqa.selenium.WebDriver;
28
29
30
31
32
33
34
35 @RunWith(BrowserRunner.class)
36 public class CurvyCornersTest extends WebDriverTestCase {
37
38
39 protected static Server SERVER_;
40
41
42
43
44 @BeforeClass
45 public static void startSesrver() throws Exception {
46 SERVER_ = WebServerTestCase.createWebServer("src/test/resources/libraries/curvyCorners/1.2.9-beta/", null);
47 }
48
49
50
51
52 @AfterClass
53 public static void stopServer() throws Exception {
54 if (SERVER_ != null) {
55 SERVER_.stop();
56 SERVER_.destroy();
57 SERVER_ = null;
58 }
59 }
60
61
62
63
64 protected URL getBaseUrl() {
65 return URL_FIRST;
66 }
67
68
69
70
71 @Test
72 public void demo() throws Exception {
73 doTest("demo.html");
74 }
75
76
77
78
79 @Test
80 public void demo2() throws Exception {
81 doTest("demo2.html");
82 }
83
84 private void doTest(final String filename) throws Exception {
85 final WebDriver driver = getWebDriver();
86 driver.get(getBaseUrl() + filename);
87 }
88 }