|
Lines 54-60
Link Here
|
| 54 |
private static final RegularExpression reColVal7 = new RegularExpression("<span class=\"summary\">([^>]+)</span>", |
54 |
private static final RegularExpression reColVal7 = new RegularExpression("<span class=\"summary\">([^>]+)</span>", |
| 55 |
"i"); |
55 |
"i"); |
| 56 |
|
56 |
|
| 57 |
public void testMatchV220() throws IOException { |
57 |
public void testMatchCollabNetV1() throws IOException { |
| 58 |
BufferedReader in = new BufferedReader(new StringReader(EXAMPLE_REPORT)); |
58 |
BufferedReader in = new BufferedReader(new StringReader(EXAMPLE_REPORT)); |
| 59 |
Match match = new Match(); |
59 |
Match match = new Match(); |
| 60 |
BugzillaSearchHit hit = createHit(new NullProgressMonitor(), in, match, |
60 |
BugzillaSearchHit hit = createHit(new NullProgressMonitor(), in, match, |
|
Lines 138-143
Link Here
|
| 138 |
public static String readSeverity(String line) { |
138 |
public static String readSeverity(String line) { |
| 139 |
Match match = new Match(); |
139 |
Match match = new Match(); |
| 140 |
if (reColVal1.matches(line, match)) { |
140 |
if (reColVal1.matches(line, match)) { |
|
|
141 |
assertEquals("nor", line); |
| 141 |
return match.getCapturedText(1); |
142 |
return match.getCapturedText(1); |
| 142 |
} else { |
143 |
} else { |
| 143 |
return "none"; |
144 |
return "none"; |
|
Lines 147-152
Link Here
|
| 147 |
public static String readPriority(String line) { |
148 |
public static String readPriority(String line) { |
| 148 |
Match match = new Match(); |
149 |
Match match = new Match(); |
| 149 |
if (reColVal2.matches(line, match)) { |
150 |
if (reColVal2.matches(line, match)) { |
|
|
151 |
assertEquals("priority", line); |
| 150 |
return match.getCapturedText(1); |
152 |
return match.getCapturedText(1); |
| 151 |
} else { |
153 |
} else { |
| 152 |
return "none"; |
154 |
return "none"; |
|
Lines 156-161
Link Here
|
| 156 |
public static String readPlatform(String line) { |
158 |
public static String readPlatform(String line) { |
| 157 |
Match match = new Match(); |
159 |
Match match = new Match(); |
| 158 |
if (reColVal3.matches(line, match)) { |
160 |
if (reColVal3.matches(line, match)) { |
|
|
161 |
assertEquals("platform", line); |
| 159 |
return match.getCapturedText(1); |
162 |
return match.getCapturedText(1); |
| 160 |
} else { |
163 |
} else { |
| 161 |
return "none"; |
164 |
return "none"; |
|
Lines 165-170
Link Here
|
| 165 |
public static String readOwner(String line) { |
168 |
public static String readOwner(String line) { |
| 166 |
Match match = new Match(); |
169 |
Match match = new Match(); |
| 167 |
if (reColVal4.matches(line, match)) { |
170 |
if (reColVal4.matches(line, match)) { |
|
|
171 |
assertEquals("owner", line); |
| 168 |
return match.getCapturedText(1); |
172 |
return match.getCapturedText(1); |
| 169 |
} else { |
173 |
} else { |
| 170 |
return "none"; |
174 |
return "none"; |
|
Lines 174-179
Link Here
|
| 174 |
public static String readStatus(String line) { |
178 |
public static String readStatus(String line) { |
| 175 |
Match match = new Match(); |
179 |
Match match = new Match(); |
| 176 |
if (reColVal5.matches(line, match)) { |
180 |
if (reColVal5.matches(line, match)) { |
|
|
181 |
assertEquals("status", line); |
| 177 |
return match.getCapturedText(1); |
182 |
return match.getCapturedText(1); |
| 178 |
} else { |
183 |
} else { |
| 179 |
return "none"; |
184 |
return "none"; |
|
Lines 183-188
Link Here
|
| 183 |
public static String readResolution(String line) { |
188 |
public static String readResolution(String line) { |
| 184 |
Match match = new Match(); |
189 |
Match match = new Match(); |
| 185 |
if (reColVal6.matches(line, match)) { |
190 |
if (reColVal6.matches(line, match)) { |
|
|
191 |
assertEquals("resolution", line); |
| 186 |
return match.getCapturedText(1); |
192 |
return match.getCapturedText(1); |
| 187 |
} else { |
193 |
} else { |
| 188 |
return "none"; |
194 |
return "none"; |
|
Lines 192-197
Link Here
|
| 192 |
public static String readSummary(String line) { |
198 |
public static String readSummary(String line) { |
| 193 |
Match match = new Match(); |
199 |
Match match = new Match(); |
| 194 |
if (reColVal7.matches(line, match)) { |
200 |
if (reColVal7.matches(line, match)) { |
|
|
201 |
assertEquals("summary", line); |
| 195 |
return match.getCapturedText(1); |
202 |
return match.getCapturedText(1); |
| 196 |
} else { |
203 |
} else { |
| 197 |
return "none"; |
204 |
return "none"; |