1 32 33 package com.jeantessier.diff; 34 35 import java.io.*; 36 37 import org.xml.sax.*; 38 import org.xml.sax.helpers.*; 39 40 import org.apache.oro.text.perl.*; 41 42 import junit.framework.*; 43 44 public class TestListDiffPrinter extends TestCase implements ErrorHandler { 45 private static final String READER_CLASSNAME = "org.apache.xerces.parsers.SAXParser"; 46 47 private static final String SPECIFIC_ENCODING = "iso-latin-1"; 48 private static final String SPECIFIC_DTD_PREFIX = "./etc"; 49 50 private ListDiffPrinter printer; 51 private XMLReader reader; 52 53 private Perl5Util perl; 54 55 protected void setUp() throws Exception { 56 reader = XMLReaderFactory.createXMLReader(READER_CLASSNAME); 57 reader.setFeature("http://xml.org/sax/features/validation", true); 58 reader.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", true); 59 reader.setErrorHandler(this); 60 61 perl = new Perl5Util(); 62 } 63 64 public void testDefaultDTDPrefix() { 65 printer = new ListDiffPrinter(); 66 67 String xmlDocument = printer.toString(); 68 assertTrue(xmlDocument + "Missing DTD", perl.match("/DOCTYPE \\S+ SYSTEM \"(.*)\"/", xmlDocument)); 69 assertTrue("DTD \"" + perl.group(1) + "\" does not have prefix \"" + ListDiffPrinter.DEFAULT_DTD_PREFIX + "\"", perl.group(1).startsWith(ListDiffPrinter.DEFAULT_DTD_PREFIX)); 70 71 try { 72 reader.parse(new InputSource(new StringReader(xmlDocument))); 73 } catch (SAXException ex) { 74 fail("Could not parse XML Document: " + ex.getMessage() + "\n" + xmlDocument); 75 } catch (IOException ex) { 76 fail("Could not read XML Document: " + ex.getMessage() + "\n" + xmlDocument); 77 } 78 } 79 80 public void testSpecificDTDPrefix() { 81 printer = new ListDiffPrinter(ListDiffPrinter.DEFAULT_ENCODING, SPECIFIC_DTD_PREFIX); 82 83 String xmlDocument = printer.toString(); 84 assertTrue(xmlDocument + "Missing DTD", perl.match("/DOCTYPE \\S+ SYSTEM \"(.*)\"/", xmlDocument)); 85 assertTrue("DTD \"" + perl.group(1) + "\" does not have prefix \"./etc\"", perl.group(1).startsWith(SPECIFIC_DTD_PREFIX)); 86 87 try { 88 reader.parse(new InputSource(new StringReader(xmlDocument))); 89 } catch (SAXException ex) { 90 fail("Could not parse XML Document: " + ex.getMessage() + "\n" + xmlDocument); 91 } catch (IOException ex) { 92 fail("Could not read XML Document: " + ex.getMessage() + "\n" + xmlDocument); 93 } 94 } 95 96 public void testDefaultEncoding() { 97 printer = new ListDiffPrinter(); 98 99 String xmlDocument = printer.toString(); 100 assertTrue(xmlDocument + "Missing encoding", perl.match("/encoding=\"([^\"]*)\"/", xmlDocument)); 101 assertEquals("Encoding", ListDiffPrinter.DEFAULT_ENCODING, perl.group(1)); 102 103 try { 104 reader.parse(new InputSource(new StringReader(xmlDocument))); 105 } catch (SAXException ex) { 106 fail("Could not parse XML Document: " + ex.getMessage() + "\n" + xmlDocument); 107 } catch (IOException ex) { 108 fail("Could not read XML Document: " + ex.getMessage() + "\n" + xmlDocument); 109 } 110 } 111 112 public void testSpecificEncoding() { 113 printer = new ListDiffPrinter(SPECIFIC_ENCODING, ListDiffPrinter.DEFAULT_DTD_PREFIX); 114 115 String xmlDocument = printer.toString(); 116 assertTrue(xmlDocument + "Missing encoding", perl.match("/encoding=\"([^\"]*)\"/", xmlDocument)); 117 assertEquals("Encoding", SPECIFIC_ENCODING, perl.group(1)); 118 119 try { 120 reader.parse(new InputSource(new StringReader(xmlDocument))); 121 } catch (SAXException ex) { 122 fail("Could not parse XML Document: " + ex.getMessage() + "\n" + xmlDocument); 123 } catch (IOException ex) { 124 fail("Could not read XML Document: " + ex.getMessage() + "\n" + xmlDocument); 125 } 126 } 127 128 public void testDefault() { 129 ListDiffPrinter printer = new ListDiffPrinter(ListDiffPrinter.DEFAULT_ENCODING, SPECIFIC_DTD_PREFIX); 130 131 printer.remove("java.lang.Object"); 132 printer.remove("java.lang.Object.Object()"); 133 printer.remove("java.lang.String"); 134 printer.remove("java.util"); 135 printer.remove("java.util.Collection.add(java.lang.Object)"); 136 printer.remove("java.util.Collection.addAll(java.util.Collection)"); 137 138 printer.add("java.lang.Thread"); 139 printer.add("java.lang.Thread.Thread()"); 140 printer.add("java.lang.System"); 141 printer.add("java.io"); 142 printer.add("java.io.PrintStream.println(java.lang.Object)"); 143 printer.add("java.io.PrintWriter.println(java.lang.Object)"); 144 145 String xmlDocument = printer.toString(); 146 147 try { 148 reader.parse(new InputSource(new StringReader(xmlDocument))); 149 } catch (SAXException ex) { 150 fail("Could not parse XML Document: " + ex.getMessage() + "\n" + xmlDocument); 151 } catch (IOException ex) { 152 fail("Could not read XML Document: " + ex.getMessage() + "\n" + xmlDocument); 153 } 154 155 assertTrue("java.lang.Object not in " + xmlDocument, xmlDocument.indexOf("<line>java.lang.Object</line>") != -1); 156 assertTrue("java.lang.Object.Object() not in " + xmlDocument, xmlDocument.indexOf("<line>java.lang.Object.Object()</line>") != -1); 157 assertTrue("java.lang.String not in " + xmlDocument, xmlDocument.indexOf("<line>java.lang.String</line>") != -1); 158 assertTrue("java.util not in " + xmlDocument, xmlDocument.indexOf("<line>java.util</line>") != -1); 159 assertTrue("java.util.Collection.add(java.lang.Object) not in " + xmlDocument, xmlDocument.indexOf("<line>java.util.Collection.add(java.lang.Object)</line>") != -1); 160 assertTrue("java.util.Collection.addAll(java.util.Collection) not in " + xmlDocument, xmlDocument.indexOf("<line>java.util.Collection.add(java.lang.Object)</line>") != -1); 161 162 assertTrue("java.lang.Thread not in " + xmlDocument, xmlDocument.indexOf("<line>java.lang.Thread</line>") != -1); 163 assertTrue("java.lang.Thread.Thread() not in " + xmlDocument, xmlDocument.indexOf("<line>java.lang.Thread.Thread()</line>") != -1); 164 assertTrue("java.lang.System not in " + xmlDocument, xmlDocument.indexOf("<line>java.lang.System</line>") != -1); 165 assertTrue("java.io not in " + xmlDocument, xmlDocument.indexOf("<line>java.io</line>") != -1); 166 assertTrue("java.io.PrintStream.println(java.lang.Object) not in " + xmlDocument, xmlDocument.indexOf("<line>java.io.PrintStream.println(java.lang.Object)</line>") != -1); 167 assertTrue("java.io.PrintWriter.println(java.lang.Object) not in " + xmlDocument, xmlDocument.indexOf("<line>java.io.PrintStream.println(java.lang.Object)</line>") != -1); 168 } 169 170 public void testFullList() { 171 ListDiffPrinter printer = new ListDiffPrinter(false, ListDiffPrinter.DEFAULT_ENCODING, SPECIFIC_DTD_PREFIX); 172 173 printer.remove("java.lang.Object"); 174 printer.remove("java.lang.Object.Object()"); 175 printer.remove("java.lang.String"); 176 printer.remove("java.util"); 177 printer.remove("java.util.Collection.add(java.lang.Object)"); 178 printer.remove("java.util.Collection.addAll(java.util.Collection)"); 179 180 printer.add("java.lang.Thread"); 181 printer.add("java.lang.Thread.Thread()"); 182 printer.add("java.lang.System"); 183 printer.add("java.io"); 184 printer.add("java.io.PrintStream.println(java.lang.Object)"); 185 printer.add("java.io.PrintWriter.println(java.lang.Object)"); 186 187 String xmlDocument = printer.toString(); 188 189 try { 190 reader.parse(new InputSource(new StringReader(xmlDocument))); 191 } catch (SAXException ex) { 192 fail("Could not parse XML Document: " + ex.getMessage() + "\n" + xmlDocument); 193 } catch (IOException ex) { 194 fail("Could not read XML Document: " + ex.getMessage() + "\n" + xmlDocument); 195 } 196 197 assertTrue("java.lang.Object not in " + xmlDocument, xmlDocument.indexOf("<line>java.lang.Object</line>") != -1); 198 assertTrue("java.lang.Object.Object() not in " + xmlDocument, xmlDocument.indexOf("<line>java.lang.Object.Object()</line>") != -1); 199 assertTrue("java.lang.String not in " + xmlDocument, xmlDocument.indexOf("<line>java.lang.String</line>") != -1); 200 assertTrue("java.util not in " + xmlDocument, xmlDocument.indexOf("<line>java.util</line>") != -1); 201 assertTrue("java.util.Collection.add(java.lang.Object) not in " + xmlDocument, xmlDocument.indexOf("<line>java.util.Collection.add(java.lang.Object)</line>") != -1); 202 assertTrue("java.util.Collection.addAll(java.util.Collection) not in " + xmlDocument, xmlDocument.indexOf("<line>java.util.Collection.add(java.lang.Object)</line>") != -1); 203 204 assertTrue("java.lang.Thread not in " + xmlDocument, xmlDocument.indexOf("<line>java.lang.Thread</line>") != -1); 205 assertTrue("java.lang.Thread.Thread() not in " + xmlDocument, xmlDocument.indexOf("<line>java.lang.Thread.Thread()</line>") != -1); 206 assertTrue("java.lang.System not in " + xmlDocument, xmlDocument.indexOf("<line>java.lang.System</line>") != -1); 207 assertTrue("java.io not in " + xmlDocument, xmlDocument.indexOf("<line>java.io</line>") != -1); 208 assertTrue("java.io.PrintStream.println(java.lang.Object) not in " + xmlDocument, xmlDocument.indexOf("<line>java.io.PrintStream.println(java.lang.Object)</line>") != -1); 209 assertTrue("java.io.PrintWriter.println(java.lang.Object) not in " + xmlDocument, xmlDocument.indexOf("<line>java.io.PrintStream.println(java.lang.Object)</line>") != -1); 210 } 211 212 public void testCompressedList() { 213 ListDiffPrinter printer = new ListDiffPrinter(true, ListDiffPrinter.DEFAULT_ENCODING, SPECIFIC_DTD_PREFIX); 214 215 printer.remove("java.lang.Object [C]"); 216 printer.remove("java.lang.Object.Object() [F]"); 217 printer.remove("java.lang.String [C]"); 218 printer.remove("java.util [P]"); 219 printer.remove("java.util.Collection.add(java.lang.Object) [F]"); 220 printer.remove("java.util.Collection.addAll(java.util.Collection) [F]"); 221 222 printer.add("java.lang.Thread [C]"); 223 printer.add("java.lang.Thread.Thread() [F]"); 224 printer.add("java.lang.System [C]"); 225 printer.add("java.io [P]"); 226 printer.add("java.io.PrintStream.println(java.lang.Object) [F]"); 227 printer.add("java.io.PrintWriter.println(java.lang.Object) [F]"); 228 229 String xmlDocument = printer.toString(); 230 231 try { 232 reader.parse(new InputSource(new StringReader(xmlDocument))); 233 } catch (SAXException ex) { 234 fail("Could not parse XML Document: " + ex.getMessage() + "\n" + xmlDocument); 235 } catch (IOException ex) { 236 fail("Could not read XML Document: " + ex.getMessage() + "\n" + xmlDocument); 237 } 238 239 assertTrue("java.lang.Object not in " + xmlDocument, xmlDocument.indexOf("<line>java.lang.Object</line>") != -1); 240 assertTrue("java.lang.Object.Object() in " + xmlDocument, xmlDocument.indexOf("<line>java.lang.Object.Object()</line>") == -1); 241 assertTrue("java.lang.String not in " + xmlDocument, xmlDocument.indexOf("<line>java.lang.String</line>") != -1); 242 assertTrue("java.util not in " + xmlDocument, xmlDocument.indexOf("<line>java.util</line>") != -1); 243 assertTrue("java.util.Collection.add(java.lang.Object) in " + xmlDocument, xmlDocument.indexOf("<line>java.util.Collection.add(java.lang.Object)</line>") == -1); 244 assertTrue("java.util.Collection.addAll(java.util.Collection) in " + xmlDocument, xmlDocument.indexOf("<line>java.util.Collection.add(java.lang.Object)</line>") == -1); 245 246 assertTrue("java.lang.Thread not in " + xmlDocument, xmlDocument.indexOf("<line>java.lang.Thread</line>") != -1); 247 assertTrue("java.lang.Thread.Thread() in " + xmlDocument, xmlDocument.indexOf("<line>java.lang.Thread.Thread()</line>") == -1); 248 assertTrue("java.lang.System not in " + xmlDocument, xmlDocument.indexOf("<line>java.lang.System</line>") != -1); 249 assertTrue("java.io not in " + xmlDocument, xmlDocument.indexOf("<line>java.io</line>") != -1); 250 assertTrue("java.io.PrintStream.println(java.lang.Object) not in " + xmlDocument, xmlDocument.indexOf("<line>java.io.PrintStream.println(java.lang.Object)</line>") == -1); 251 assertTrue("java.io.PrintWriter.println(java.lang.Object) in " + xmlDocument, xmlDocument.indexOf("<line>java.io.PrintStream.println(java.lang.Object)</line>") == -1); 252 } 253 254 public void testCompressedListWithoutSuffixes() { 255 ListDiffPrinter printer = new ListDiffPrinter(true, ListDiffPrinter.DEFAULT_ENCODING, SPECIFIC_DTD_PREFIX); 256 257 printer.remove("java.lang.Object"); 258 printer.remove("java.lang.Object.Object()"); 259 printer.remove("java.lang.String"); 260 printer.remove("java.util"); 261 printer.remove("java.util.Collection.add(java.lang.Object)"); 262 printer.remove("java.util.Collection.addAll(java.util.Collection)"); 263 264 printer.add("java.lang.Thread"); 265 printer.add("java.lang.Thread.Thread()"); 266 printer.add("java.lang.System"); 267 printer.add("java.io"); 268 printer.add("java.io.PrintStream.println(java.lang.Object)"); 269 printer.add("java.io.PrintWriter.println(java.lang.Object)"); 270 271 String xmlDocument = printer.toString(); 272 273 try { 274 reader.parse(new InputSource(new StringReader(xmlDocument))); 275 } catch (SAXException ex) { 276 fail("Could not parse XML Document: " + ex.getMessage() + "\n" + xmlDocument); 277 } catch (IOException ex) { 278 fail("Could not read XML Document: " + ex.getMessage() + "\n" + xmlDocument); 279 } 280 281 assertTrue("java.lang.Object not in " + xmlDocument, xmlDocument.indexOf("<line>java.lang.Object</line>") != -1); 282 assertTrue("java.lang.Object.Object() not in " + xmlDocument, xmlDocument.indexOf("<line>java.lang.Object.Object()</line>") != -1); 283 assertTrue("java.lang.String not in " + xmlDocument, xmlDocument.indexOf("<line>java.lang.String</line>") != -1); 284 assertTrue("java.util not in " + xmlDocument, xmlDocument.indexOf("<line>java.util</line>") != -1); 285 assertTrue("java.util.Collection.add(java.lang.Object) not in " + xmlDocument, xmlDocument.indexOf("<line>java.util.Collection.add(java.lang.Object)</line>") != -1); 286 assertTrue("java.util.Collection.addAll(java.util.Collection) not in " + xmlDocument, xmlDocument.indexOf("<line>java.util.Collection.add(java.lang.Object)</line>") != -1); 287 288 assertTrue("java.lang.Thread not in " + xmlDocument, xmlDocument.indexOf("<line>java.lang.Thread</line>") != -1); 289 assertTrue("java.lang.Thread.Thread() not in " + xmlDocument, xmlDocument.indexOf("<line>java.lang.Thread.Thread()</line>") != -1); 290 assertTrue("java.lang.System not in " + xmlDocument, xmlDocument.indexOf("<line>java.lang.System</line>") != -1); 291 assertTrue("java.io not in " + xmlDocument, xmlDocument.indexOf("<line>java.io</line>") != -1); 292 assertTrue("java.io.PrintStream.println(java.lang.Object) not in " + xmlDocument, xmlDocument.indexOf("<line>java.io.PrintStream.println(java.lang.Object)</line>") != -1); 293 assertTrue("java.io.PrintWriter.println(java.lang.Object) not in " + xmlDocument, xmlDocument.indexOf("<line>java.io.PrintStream.println(java.lang.Object)</line>") != -1); 294 } 295 296 public void testLegitimateSuffixes() { 297 ListDiffPrinter printer = new ListDiffPrinter(true, ListDiffPrinter.DEFAULT_ENCODING, SPECIFIC_DTD_PREFIX); 298 299 printer.remove("removed [P]"); printer.remove("removed.Removed [C]"); printer.remove("removed.Removed.Removed() [F]"); printer.remove("removed.Removed.removed [F]"); printer.remove("removed.OtherRemoved.OtherRemoved() [F]"); printer.remove("removed.OtherRemoved.other_removed [F]"); printer.remove("removedpackage [P]"); printer.remove("removed.package.internal [P]"); printer.remove("other.removed.Removed [C]"); printer.remove("other.removed.Removed.Removed() [F]"); printer.remove("other.removed.OtherRemoved.OtherRemoved() [F]"); 311 printer.add("add [P]"); printer.add("add.Add [C]"); printer.add("add.Add.Add() [F]"); printer.add("add.Add.add [F]"); printer.add("add.OtherAdd.OtherAdd() [F]"); printer.add("add.OtherAdd.add [F]"); printer.add("addpackage [P]"); printer.add("add.package.internal [P]"); printer.add("other.add.Add [C]"); printer.add("other.add.Add.Add() [F]"); printer.add("other.add.OtherAdd.OtherAdd() [F]"); 323 String xmlDocument = printer.toString(); 324 325 try { 326 reader.parse(new InputSource(new StringReader(xmlDocument))); 327 } catch (SAXException ex) { 328 fail("Could not parse XML Document: " + ex.getMessage() + "\n" + xmlDocument); 329 } catch (IOException ex) { 330 fail("Could not read XML Document: " + ex.getMessage() + "\n" + xmlDocument); 331 } 332 333 assertTrue("removed not in " + xmlDocument, xmlDocument.indexOf("<line>removed</line>") != -1); 334 assertTrue("removed.Removed in " + xmlDocument, xmlDocument.indexOf("<line>removed.Removed</line>") == -1); 335 assertTrue("removed.Removed.Removed() in " + xmlDocument, xmlDocument.indexOf("<line>removed.Removed.Removed()</line>") == -1); 336 assertTrue("removed.Removed.removed in " + xmlDocument, xmlDocument.indexOf("<line>removed.Removed.removed</line>") == -1); 337 assertTrue("removed.OtherRemoved.OtherRemoved() in " + xmlDocument, xmlDocument.indexOf("<line>removed.OtherRemoved.OtherRemoved()</line>") == -1); 338 assertTrue("removed.OtherRemoved.other_removed in " + xmlDocument, xmlDocument.indexOf("<line>removed.OtherRemoved.other_removed</line>") == -1); 339 assertTrue("removedpackage not in " + xmlDocument, xmlDocument.indexOf("<line>removedpackage</line>") != -1); 340 assertTrue("removed.package.internal not in " + xmlDocument, xmlDocument.indexOf("<line>removed.package.internal</line>") != -1); 341 assertTrue("other.removed.Removed not in " + xmlDocument, xmlDocument.indexOf("<line>other.removed.Removed</line>") != -1); 342 assertTrue("other.removed.Removed.Removed() in " + xmlDocument, xmlDocument.indexOf("<line>other.removed.Removed.Removed()</line>") == -1); 343 assertTrue("other.removed.OtherRemoved.OtherRemoved() not in " + xmlDocument, xmlDocument.indexOf("<line>other.removed.OtherRemoved.OtherRemoved()</line>") != -1); 344 345 assertTrue("add not in " + xmlDocument, xmlDocument.indexOf("<line>add</line>") != -1); 346 assertTrue("add.Add in " + xmlDocument, xmlDocument.indexOf("<line>add.Add</line>") == -1); 347 assertTrue("add.Add.Add() in " + xmlDocument, xmlDocument.indexOf("<line>add.Add.Add()</line>") == -1); 348 assertTrue("add.Add.add in " + xmlDocument, xmlDocument.indexOf("<line>add.Add.add</line>") == -1); 349 assertTrue("add.OtherAdd.OtherAdd() in " + xmlDocument, xmlDocument.indexOf("<line>add.OtherAdd.OtherAdd()</line>") == -1); 350 assertTrue("add.OtherAdd.other_add in " + xmlDocument, xmlDocument.indexOf("<line>add.OtherAdd.other_add</line>") == -1); 351 assertTrue("addpackage not in " + xmlDocument, xmlDocument.indexOf("<line>addpackage</line>") != -1); 352 assertTrue("add.package.internal not in " + xmlDocument, xmlDocument.indexOf("<line>add.package.internal</line>") != -1); 353 assertTrue("other.add.Add not in " + xmlDocument, xmlDocument.indexOf("<line>other.add.Add</line>") != -1); 354 assertTrue("other.add.Add.Add() in " + xmlDocument, xmlDocument.indexOf("<line>other.add.Add.Add()</line>") == -1); 355 assertTrue("other.add.OtherAdd.OtherAdd() not in " + xmlDocument, xmlDocument.indexOf("<line>other.add.OtherAdd.OtherAdd()</line>") != -1); 356 } 357 358 public void testNoSuffixes() { 359 ListDiffPrinter printer = new ListDiffPrinter(true, ListDiffPrinter.DEFAULT_ENCODING, SPECIFIC_DTD_PREFIX); 360 361 printer.remove("removed"); printer.remove("removed.Removed"); printer.remove("removed.Removed.Removed()"); printer.remove("removed.Removed.removed"); printer.remove("removed.OtherRemoved.OtherRemoved()"); printer.remove("removed.OtherRemoved.other_removed"); printer.remove("removedpackage"); printer.remove("removed.package.internal"); printer.remove("other.removed.Removed"); printer.remove("other.removed.Removed.Removed()"); printer.remove("other.removed.OtherRemoved.OtherRemoved()"); 373 printer.add("add"); printer.add("add.Add"); printer.add("add.Add.Add()"); printer.add("add.Add.add"); printer.add("add.OtherAdd.OtherAdd()"); printer.add("add.OtherAdd.other_add"); printer.add("addpackage"); printer.add("add.package.internal"); printer.add("other.add.Add"); printer.add("other.add.Add.Add()"); printer.add("other.add.OtherAdd.OtherAdd()"); 385 String xmlDocument = printer.toString(); 386 387 try { 388 reader.parse(new InputSource(new StringReader(xmlDocument))); 389 } catch (SAXException ex) { 390 fail("Could not parse XML Document: " + ex.getMessage() + "\n" + xmlDocument); 391 } catch (IOException ex) { 392 fail("Could not read XML Document: " + ex.getMessage() + "\n" + xmlDocument); 393 } 394 395 assertTrue("removed not in " + xmlDocument, xmlDocument.indexOf("<line>removed</line>") != -1); 396 assertTrue("removed.Removed in " + xmlDocument, xmlDocument.indexOf("<line>removed.Removed</line>") != -1); 397 assertTrue("removed.Removed.Removed() in " + xmlDocument, xmlDocument.indexOf("<line>removed.Removed.Removed()</line>") != -1); 398 assertTrue("removed.Removed.removed in " + xmlDocument, xmlDocument.indexOf("<line>removed.Removed.removed</line>") != -1); 399 assertTrue("removed.OtherRemoved.OtherRemoved() in " + xmlDocument, xmlDocument.indexOf("<line>removed.OtherRemoved.OtherRemoved()</line>") != -1); 400 assertTrue("removed.OtherRemoved.other_removed in " + xmlDocument, xmlDocument.indexOf("<line>removed.OtherRemoved.other_removed</line>") != -1); 401 assertTrue("removedpackage not in " + xmlDocument, xmlDocument.indexOf("<line>removedpackage</line>") != -1); 402 assertTrue("removed.package.internal not in " + xmlDocument, xmlDocument.indexOf("<line>removed.package.internal</line>") != -1); 403 assertTrue("other.removed.Removed not in " + xmlDocument, xmlDocument.indexOf("<line>other.removed.Removed</line>") != -1); 404 assertTrue("other.removed.Removed.Removed() in " + xmlDocument, xmlDocument.indexOf("<line>other.removed.Removed.Removed()</line>") != -1); 405 assertTrue("other.removed.OtherRemoved.OtherRemoved() not in " + xmlDocument, xmlDocument.indexOf("<line>other.removed.OtherRemoved.OtherRemoved()</line>") != -1); 406 407 assertTrue("add not in " + xmlDocument, xmlDocument.indexOf("<line>add</line>") != -1); 408 assertTrue("add.Add in " + xmlDocument, xmlDocument.indexOf("<line>add.Add</line>") != -1); 409 assertTrue("add.Add.Add() in " + xmlDocument, xmlDocument.indexOf("<line>add.Add.Add()</line>") != -1); 410 assertTrue("add.Add.add in " + xmlDocument, xmlDocument.indexOf("<line>add.Add.add</line>") != -1); 411 assertTrue("add.OtherAdd.OtherAdd() in " + xmlDocument, xmlDocument.indexOf("<line>add.OtherAdd.OtherAdd()</line>") != -1); 412 assertTrue("add.OtherAdd.other_add in " + xmlDocument, xmlDocument.indexOf("<line>add.OtherAdd.other_add</line>") != -1); 413 assertTrue("addpackage not in " + xmlDocument, xmlDocument.indexOf("<line>addpackage</line>") != -1); 414 assertTrue("add.package.internal not in " + xmlDocument, xmlDocument.indexOf("<line>add.package.internal</line>") != -1); 415 assertTrue("other.add.Add not in " + xmlDocument, xmlDocument.indexOf("<line>other.add.Add</line>") != -1); 416 assertTrue("other.add.Add.Add() in " + xmlDocument, xmlDocument.indexOf("<line>other.add.Add.Add()</line>") != -1); 417 assertTrue("other.add.OtherAdd.OtherAdd() not in " + xmlDocument, xmlDocument.indexOf("<line>other.add.OtherAdd.OtherAdd()</line>") != -1); 418 } 419 420 public void error(SAXParseException ex) { 421 } 423 424 public void fatalError(SAXParseException ex) { 425 } 427 428 public void warning(SAXParseException ex) { 429 } 431 } 432 | Popular Tags |