MCPcopy Index your code
hub / github.com/HtmlUnit/htmlunit / WebTestCase

Class WebTestCase

src/test/java/org/htmlunit/WebTestCase.java:73–642  ·  view source on GitHub ↗

Common superclass for HtmlUnit tests. @author Mike Bowler @author David D. Kilzer @author Marc Guillemot @author Chris Erskine @author Michael Ottati @author Daniel Gredler @author Ahmed Ashour @author Ronald Brill

Source from the content-addressed store, hash-verified

71 * @author Ronald Brill
72 */
73@ClassTemplate
74@ExtendWith({BrowserVersionClassTemplateInvocationContextProvider.class,
75 SetExpectedAlertsBeforeTestExecutionCallback.class,
76 ErrorOutputChecker.class})
77@TestMethodOrder(MethodOrderer.DisplayName.class)
78public abstract class WebTestCase {
79
80 /** The html5 doctype. */
81 public static final String DOCTYPE_HTML = "<!DOCTYPE html>\n";
82
83 /**
84 * Make the test method name available to the tests.
85 */
86 public TestInfo testInfo_;
87
88 // /** Logging support. */
89 // private static final Log LOG = LogFactory.getLog(WebTestCase.class);
90
91 /** save the environment */
92 private static final Locale SAVE_LOCALE = Locale.getDefault();
93
94 // 12346 seems to be in use on our CI server
95
96 /** The listener port for the web server. */
97 public static final int PORT = Integer.parseInt(System.getProperty("htmlunit.test.port", "22222"));
98
99 /** The second listener port for the web server, used for cross-origin tests. */
100 public static final int PORT2 = Integer.parseInt(System.getProperty("htmlunit.test.port2", "22223"));
101
102 /** The third listener port for the web server, used for cross-origin tests. */
103 public static final int PORT3 = Integer.parseInt(System.getProperty("htmlunit.test.port3", "22224"));
104
105 /** The listener port used for our primitive server tests. */
106 public static final int PORT_PRIMITIVE_SERVER = Integer.parseInt(
107 System.getProperty("htmlunit.test.port_primitive", "22225"));
108
109 /** The listener port used for our proxy tests. */
110 public static final int PORT_PROXY_SERVER = Integer.parseInt(
111 System.getProperty("htmlunit.test.port_proxy", "22226"));
112
113 /** The SOCKS proxy port to use for SOCKS proxy tests. */
114 public static final int SOCKS_PROXY_PORT = Integer.parseInt(
115 System.getProperty("htmlunit.test.socksproxy.port", "22227"));
116
117 /** The SOCKS proxy host to use for SOCKS proxy tests. */
118 public static final String SOCKS_PROXY_HOST = System.getProperty("htmlunit.test.socksproxy.host", "localhost");
119
120 /** The default time used to wait for the expected alerts. */
121 protected static final Duration DEFAULT_WAIT_TIME = Duration.ofSeconds(1);
122
123 /** Constant for the URL which is used in the tests. */
124 public static final URL URL_FIRST;
125
126 /** Constant for the URL which is used in the tests. */
127 public static final URL URL_SECOND;
128
129 /**
130 * Constant for the URL which is used in the tests.

Callers

nothing calls this directly

Calls 3

getDefaultMethod · 0.80
getPropertyMethod · 0.80
parseIntMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…