1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 package org.htmlunit.fuzzer;
16
17 import java.io.IOException;
18 import java.io.InputStream;
19 import java.nio.charset.StandardCharsets;
20
21 import org.apache.commons.io.IOUtils;
22 import org.htmlunit.WebClient;
23 import org.htmlunit.WebTestCase;
24 import org.htmlunit.junit.BrowserRunner;
25 import org.junit.Test;
26 import org.junit.runner.RunWith;
27
28
29
30
31
32
33
34 @RunWith(BrowserRunner.class)
35 public class FuzzerTest extends WebTestCase {
36
37
38
39
40 @Test
41 public void case54522() throws Exception {
42
43 test("test-54522.html");
44 }
45
46
47
48
49 @Test
50 public void case54523() throws Exception {
51
52 test("test-54523.html");
53 }
54
55
56
57
58 @Test
59 public void case54524() throws Exception {
60
61 test("test-54524.html");
62 }
63
64
65
66
67 @Test
68 public void case54526() throws Exception {
69
70 test("test-54526.html");
71 }
72
73
74
75
76 @Test
77 public void case54527() throws Exception {
78
79 test("test-54527.html");
80 }
81
82
83
84
85 @Test
86 public void case54528() throws Exception {
87
88 test("test-54528.html");
89 }
90
91
92
93
94 @Test
95 public void case54535() throws Exception {
96
97 test("test-54535.html");
98 }
99
100
101
102
103 @Test
104 public void case54613() throws Exception {
105
106 test("test-54613.html");
107 }
108
109
110
111
112 @Test
113 public void case54965() throws Exception {
114
115 test("test-54965.html");
116 }
117
118
119
120
121 @Test
122 public void case55628() throws Exception {
123
124 test("test-55628.html");
125 }
126
127
128
129
130 @Test
131 public void case55747() throws Exception {
132
133 test("test-55747.html");
134 }
135
136
137
138
139 @Test
140 public void case56702() throws Exception {
141
142 test("test-56702.html");
143 }
144
145
146
147
148 @Test
149 public void case58943() throws Exception {
150
151 test("test-58943.html");
152 }
153
154
155
156
157 @Test
158 public void case67067() throws Exception {
159
160 test("test-67067.html");
161 }
162
163
164
165
166 @Test
167 public void case67493() throws Exception {
168
169 test("test-67493.html");
170 }
171
172 private void test(final String inputFileName) throws Exception {
173 final InputStream file = getClass().getClassLoader()
174 .getResourceAsStream("org/htmlunit/fuzzer/" + inputFileName);
175 final String input = IOUtils.toString(file, StandardCharsets.UTF_8);
176
177 try (WebClient webClient = new WebClient(getBrowserVersion())) {
178
179 webClient.getOptions().setThrowExceptionOnScriptError(false);
180
181 webClient.getOptions().setThrowExceptionOnFailingStatusCode(false);
182
183 webClient.loadHtmlCodeIntoCurrentWindow(input);
184 }
185 catch (final IllegalArgumentException e) {
186 }
187 catch (final IOException e) {
188 }
189 }
190 }