1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package net.sourceforge.jeuclid.test;
20
21 import java.lang.reflect.Method;
22 import java.lang.reflect.Modifier;
23 import java.util.Set;
24 import java.util.TreeSet;
25
26 import net.sourceforge.jeuclid.DOMBuilder;
27 import net.sourceforge.jeuclid.MathMLParserSupport;
28 import net.sourceforge.jeuclid.MathMLSerializer;
29 import net.sourceforge.jeuclid.elements.JEuclidElementFactory;
30 import net.sourceforge.jeuclid.elements.content.semantic.Annotation;
31 import net.sourceforge.jeuclid.elements.content.semantic.Semantics;
32 import net.sourceforge.jeuclid.elements.generic.DocumentElement;
33 import net.sourceforge.jeuclid.elements.generic.MathImpl;
34 import net.sourceforge.jeuclid.elements.presentation.enlivening.Maction;
35 import net.sourceforge.jeuclid.elements.presentation.general.Menclose;
36 import net.sourceforge.jeuclid.elements.presentation.general.Merror;
37 import net.sourceforge.jeuclid.elements.presentation.general.Mfenced;
38 import net.sourceforge.jeuclid.elements.presentation.general.Mfrac;
39 import net.sourceforge.jeuclid.elements.presentation.general.Mpadded;
40 import net.sourceforge.jeuclid.elements.presentation.general.Mphantom;
41 import net.sourceforge.jeuclid.elements.presentation.general.Mroot;
42 import net.sourceforge.jeuclid.elements.presentation.general.Mrow;
43 import net.sourceforge.jeuclid.elements.presentation.general.Msqrt;
44 import net.sourceforge.jeuclid.elements.presentation.general.Mstyle;
45 import net.sourceforge.jeuclid.elements.presentation.script.Mmultiscripts;
46 import net.sourceforge.jeuclid.elements.presentation.script.Mover;
47 import net.sourceforge.jeuclid.elements.presentation.script.Mprescripts;
48 import net.sourceforge.jeuclid.elements.presentation.script.Msub;
49 import net.sourceforge.jeuclid.elements.presentation.script.Msubsup;
50 import net.sourceforge.jeuclid.elements.presentation.script.Msup;
51 import net.sourceforge.jeuclid.elements.presentation.script.Munder;
52 import net.sourceforge.jeuclid.elements.presentation.script.Munderover;
53 import net.sourceforge.jeuclid.elements.presentation.script.None;
54 import net.sourceforge.jeuclid.elements.presentation.table.Maligngroup;
55 import net.sourceforge.jeuclid.elements.presentation.table.Malignmark;
56 import net.sourceforge.jeuclid.elements.presentation.table.Mlabeledtr;
57 import net.sourceforge.jeuclid.elements.presentation.table.Mtable;
58 import net.sourceforge.jeuclid.elements.presentation.table.Mtd;
59 import net.sourceforge.jeuclid.elements.presentation.table.Mtr;
60 import net.sourceforge.jeuclid.elements.presentation.token.Mglyph;
61 import net.sourceforge.jeuclid.elements.presentation.token.Mi;
62 import net.sourceforge.jeuclid.elements.presentation.token.Mn;
63 import net.sourceforge.jeuclid.elements.presentation.token.Mo;
64 import net.sourceforge.jeuclid.elements.presentation.token.Ms;
65 import net.sourceforge.jeuclid.elements.presentation.token.Mspace;
66 import net.sourceforge.jeuclid.elements.presentation.token.Mtext;
67
68 import org.junit.Assert;
69 import org.junit.Test;
70 import org.w3c.dom.Document;
71 import org.w3c.dom.events.Event;
72 import org.w3c.dom.events.EventListener;
73 import org.w3c.dom.events.EventTarget;
74 import org.w3c.dom.mathml.MathMLActionElement;
75 import org.w3c.dom.mathml.MathMLAlignGroupElement;
76 import org.w3c.dom.mathml.MathMLAlignMarkElement;
77 import org.w3c.dom.mathml.MathMLAnnotationElement;
78 import org.w3c.dom.mathml.MathMLDocument;
79 import org.w3c.dom.mathml.MathMLElement;
80 import org.w3c.dom.mathml.MathMLEncloseElement;
81 import org.w3c.dom.mathml.MathMLFencedElement;
82 import org.w3c.dom.mathml.MathMLFractionElement;
83 import org.w3c.dom.mathml.MathMLGlyphElement;
84 import org.w3c.dom.mathml.MathMLLabeledRowElement;
85 import org.w3c.dom.mathml.MathMLMathElement;
86 import org.w3c.dom.mathml.MathMLMultiScriptsElement;
87 import org.w3c.dom.mathml.MathMLOperatorElement;
88 import org.w3c.dom.mathml.MathMLPaddedElement;
89 import org.w3c.dom.mathml.MathMLPresentationContainer;
90 import org.w3c.dom.mathml.MathMLPresentationToken;
91 import org.w3c.dom.mathml.MathMLRadicalElement;
92 import org.w3c.dom.mathml.MathMLScriptElement;
93 import org.w3c.dom.mathml.MathMLSemanticsElement;
94 import org.w3c.dom.mathml.MathMLSpaceElement;
95 import org.w3c.dom.mathml.MathMLStringLitElement;
96 import org.w3c.dom.mathml.MathMLStyleElement;
97 import org.w3c.dom.mathml.MathMLTableCellElement;
98 import org.w3c.dom.mathml.MathMLTableElement;
99 import org.w3c.dom.mathml.MathMLTableRowElement;
100 import org.w3c.dom.mathml.MathMLUnderOverElement;
101
102
103
104
105
106
107
108 public class DOMModelTest {
109
110
111 private int docCount;
112
113 private int mathCount;
114
115 private int miCount;
116
117
118
119
120 public DOMModelTest() {
121
122 }
123
124
125
126
127
128
129
130 @Test
131 public void testID() throws Exception {
132 final Document docWithID = MathMLParserSupport
133 .parseString("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?><math mode=\"display\">"
134 + "<mrow id='abc'><mn>1</mn></mrow></math>");
135
136 final MathMLDocument docElement = DOMBuilder.getInstance()
137 .createJeuclidDom(docWithID);
138
139 final MathMLMathElement mathElement = (MathMLMathElement) docElement
140 .getFirstChild();
141
142 Assert.assertEquals(mathElement.getDisplay(), "block");
143 final MathMLPresentationContainer row = (MathMLPresentationContainer) mathElement
144 .getFirstChild();
145 Assert.assertNotNull(row);
146 Assert.assertEquals(row.getId(), "abc");
147 }
148
149
150
151
152
153
154
155 @Test
156 public void testSerialization() throws Exception {
157 final String shouldBe = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?><math mode=\"display\" xmlns='http://www.w3.org/1998/Math/MathML'>"
158 + "<mrow id='abc'><mn>1</mn></mrow></math>";
159 final Document origDoc = MathMLParserSupport.parseString(shouldBe);
160 final MathMLDocument mathMLDoc = DOMBuilder.getInstance()
161 .createJeuclidDom(origDoc);
162 final String reserialStr = MathMLSerializer.serializeDocument(
163 mathMLDoc, false, false);
164
165 final Document reserial = MathMLParserSupport.parseString(reserialStr);
166 Assert.assertTrue("is: " + reserialStr + "\nshould be: " + shouldBe,
167 reserial.isEqualNode(origDoc));
168 }
169
170
171
172
173
174
175
176 @Test
177 public void testSerialization2() throws Exception {
178 final String shouldBe = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?><math mode=\"display\" xmlns='http://www.w3.org/1998/Math/MathML'>"
179 + "<mtext>Alignment<malignmark/>Test</mtext></math>";
180 final Document origDoc = MathMLParserSupport.parseString(shouldBe);
181 final MathMLDocument mathMLDoc = DOMBuilder.getInstance()
182 .createJeuclidDom(origDoc);
183 final String reserialStr = MathMLSerializer.serializeDocument(
184 mathMLDoc, false, false);
185
186 final Document reserial = MathMLParserSupport.parseString(reserialStr);
187 Assert.assertTrue("is: " + reserialStr + "\nshould be: " + shouldBe,
188 reserial.isEqualNode(origDoc));
189 }
190
191
192
193
194
195
196
197 @Test
198 public void testMOAttrs() throws Exception {
199 final Document doc = MathMLParserSupport
200 .parseString("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?><math mode=\"display\">"
201 + "<mo stretchy='true'>X</mo>"
202 + "<mo stretchy='false'>Y</mo>"
203 + "<mo>}</mo>"
204 + "<mo>≔</mo>"
205 + "<mo>”</mo>"
206 + "<mo stretchy='false'>)</mo>"
207 + "<mo>)</mo>"
208 + "</math>");
209 final MathMLDocument docElement = DOMBuilder.getInstance()
210 .createJeuclidDom(doc);
211
212 final MathMLMathElement mathElement = (MathMLMathElement) docElement
213 .getFirstChild();
214
215 final MathMLOperatorElement mo = (MathMLOperatorElement) mathElement
216 .getChildNodes().item(0);
217 Assert.assertNotNull(mo);
218 Assert.assertTrue(Boolean.parseBoolean(mo.getStretchy()));
219 final Mo mo2 = (Mo) mathElement.getChildNodes().item(1);
220 Assert.assertNotNull(mo2);
221 Assert.assertFalse(Boolean.parseBoolean(mo2.getStretchy()));
222 final Mo mo3 = (Mo) mathElement.getChildNodes().item(2);
223
224 Assert.assertTrue(Boolean.parseBoolean(mo3.getStretchy()));
225 final Mo mo4 = (Mo) mathElement.getChildNodes().item(3);
226 Assert.assertFalse(Boolean.parseBoolean(mo4.getStretchy()));
227 final Mo mo5 = (Mo) mathElement.getChildNodes().item(4);
228 Assert.assertTrue(Boolean.parseBoolean(mo5.getStretchy()));
229 final Mo mo6 = (Mo) mathElement.getChildNodes().item(5);
230 Assert.assertFalse(Boolean.parseBoolean(mo6.getStretchy()));
231 final Mo mo7 = (Mo) mathElement.getChildNodes().item(6);
232 Assert.assertTrue(Boolean.parseBoolean(mo7.getStretchy()));
233 }
234
235
236
237
238
239
240
241
242 @Test
243 public void testInterfaces() throws Exception {
244
245
246
247
248
249 final Document ownerDocument = new DocumentElement();
250
251 Assert.assertTrue(JEuclidElementFactory.elementFromName(null, "math",
252 ownerDocument) instanceof MathMLMathElement);
253 Assert.assertTrue(JEuclidElementFactory.elementFromName(null, "mi",
254 ownerDocument) instanceof MathMLPresentationToken);
255 Assert.assertTrue(JEuclidElementFactory.elementFromName(null, "mn",
256 ownerDocument) instanceof MathMLPresentationToken);
257 Assert.assertTrue(JEuclidElementFactory.elementFromName(null, "mo",
258 ownerDocument) instanceof MathMLOperatorElement);
259 Assert.assertTrue(JEuclidElementFactory.elementFromName(null, "mtext",
260 ownerDocument) instanceof MathMLPresentationToken);
261 Assert.assertTrue(JEuclidElementFactory.elementFromName(null, "mspace",
262 ownerDocument) instanceof MathMLSpaceElement);
263 Assert.assertTrue(JEuclidElementFactory.elementFromName(null, "ms",
264 ownerDocument) instanceof MathMLStringLitElement);
265 Assert.assertTrue(JEuclidElementFactory.elementFromName(null, "mglyph",
266 ownerDocument) instanceof MathMLGlyphElement);
267 Assert.assertTrue(JEuclidElementFactory.elementFromName(null, "mrow",
268 ownerDocument) instanceof MathMLPresentationContainer);
269 Assert.assertTrue(JEuclidElementFactory.elementFromName(null, "mfrac",
270 ownerDocument) instanceof MathMLFractionElement);
271 Assert.assertTrue(JEuclidElementFactory.elementFromName(null, "msqrt",
272 ownerDocument) instanceof MathMLRadicalElement);
273 Assert.assertTrue(JEuclidElementFactory.elementFromName(null, "mroot",
274 ownerDocument) instanceof MathMLRadicalElement);
275 Assert.assertTrue(JEuclidElementFactory.elementFromName(null, "mstyle",
276 ownerDocument) instanceof MathMLStyleElement);
277 Assert.assertTrue(JEuclidElementFactory.elementFromName(null, "merror",
278 ownerDocument) instanceof MathMLPresentationContainer);
279 Assert.assertTrue(JEuclidElementFactory.elementFromName(null,
280 "mpadded", ownerDocument) instanceof MathMLPaddedElement);
281 Assert
282 .assertTrue(JEuclidElementFactory.elementFromName(null,
283 "mphantom", ownerDocument) instanceof MathMLPresentationContainer);
284 Assert.assertTrue(JEuclidElementFactory.elementFromName(null,
285 "mfenced", ownerDocument) instanceof MathMLFencedElement);
286 Assert.assertTrue(JEuclidElementFactory.elementFromName(null,
287 "menclose", ownerDocument) instanceof MathMLEncloseElement);
288 Assert.assertTrue(JEuclidElementFactory.elementFromName(null, "msub",
289 ownerDocument) instanceof MathMLScriptElement);
290 Assert.assertTrue(JEuclidElementFactory.elementFromName(null, "msup",
291 ownerDocument) instanceof MathMLScriptElement);
292 Assert.assertTrue(JEuclidElementFactory.elementFromName(null,
293 "msubsup", ownerDocument) instanceof MathMLScriptElement);
294 Assert.assertTrue(JEuclidElementFactory.elementFromName(null, "munder",
295 ownerDocument) instanceof MathMLUnderOverElement);
296 Assert.assertTrue(JEuclidElementFactory.elementFromName(null, "mover",
297 ownerDocument) instanceof MathMLUnderOverElement);
298 Assert.assertTrue(JEuclidElementFactory.elementFromName(null,
299 "munderover", ownerDocument) instanceof MathMLUnderOverElement);
300 Assert
301 .assertTrue(JEuclidElementFactory.elementFromName(null,
302 "mmultiscripts", ownerDocument) instanceof MathMLMultiScriptsElement);
303 Assert.assertTrue(JEuclidElementFactory.elementFromName(null, "mtable",
304 ownerDocument) instanceof MathMLTableElement);
305 Assert
306 .assertTrue(JEuclidElementFactory.elementFromName(null,
307 "mlabeledtr", ownerDocument) instanceof MathMLLabeledRowElement);
308 Assert.assertTrue(JEuclidElementFactory.elementFromName(null, "mtr",
309 ownerDocument) instanceof MathMLTableRowElement);
310 Assert.assertTrue(JEuclidElementFactory.elementFromName(null, "mtd",
311 ownerDocument) instanceof MathMLTableCellElement);
312 Assert
313 .assertTrue(JEuclidElementFactory.elementFromName(null,
314 "maligngroup", ownerDocument) instanceof MathMLAlignGroupElement);
315 Assert.assertTrue(JEuclidElementFactory.elementFromName(null,
316 "malignmark", ownerDocument) instanceof MathMLAlignMarkElement);
317 Assert.assertTrue(JEuclidElementFactory.elementFromName(null,
318 "maction", ownerDocument) instanceof MathMLActionElement);
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624 Assert
625 .assertTrue(JEuclidElementFactory.elementFromName(null,
626 "annotation", ownerDocument) instanceof MathMLAnnotationElement);
627 Assert.assertTrue(JEuclidElementFactory.elementFromName(null,
628 "semantics", ownerDocument) instanceof MathMLSemanticsElement);
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667 }
668
669
670
671
672
673
674
675 @Test
676 public void testFrac() throws Exception {
677 final Document d = new DocumentElement();
678 final MathMLFractionElement mfrac = (MathMLFractionElement) d
679 .createElement(Mfrac.ELEMENT);
680 final Mi mi = (Mi) d.createElement(Mi.ELEMENT);
681 final Mrow mrow = (Mrow) d.createElement(Mrow.ELEMENT);
682 final Mi mi2 = (Mi) d.createElement(Mi.ELEMENT);
683 mfrac.setDenominator(mi);
684 mfrac.setNumerator(mrow);
685 Assert.assertEquals(mi, mfrac.getDenominator());
686 Assert.assertEquals(mrow, mfrac.getNumerator());
687 Assert.assertEquals(mfrac.getChildNodes().getLength(), 2);
688 mfrac.setNumerator(mi2);
689 Assert.assertEquals(mi, mfrac.getDenominator());
690 Assert.assertEquals(mi2, mfrac.getNumerator());
691 Assert.assertEquals(mfrac.getChildNodes().getLength(), 2);
692 }
693
694
695
696
697
698
699
700 @Test
701 public void testMMultiScripts() throws Exception {
702 final Document doc = MathMLParserSupport
703 .parseString("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?><math mode=\"display\">"
704 + "<mmultiscripts>"
705 + "<mo>x</mo>"
706 + "<mi>a</mi>"
707 + "<mi>b</mi>"
708 + "<mprescripts/>"
709 + "<mi>c</mi>"
710 + "<mi>d</mi>" + "</mmultiscripts>" + "</math>");
711 final MathMLDocument docElement = DOMBuilder.getInstance()
712 .createJeuclidDom(doc);
713 final MathMLMathElement mathElement = (MathMLMathElement) docElement
714 .getFirstChild();
715
716 final MathMLMultiScriptsElement multi = (MathMLMultiScriptsElement) mathElement
717 .getChildNodes().item(0);
718
719 Assert.assertEquals(multi.getBase().getTextContent(), "x");
720 Assert.assertEquals(multi.getSubScript(1).getTextContent(), "a");
721 Assert.assertEquals(multi.getSuperScript(1).getTextContent(), "b");
722 Assert.assertEquals(multi.getPreSubScript(1).getTextContent(), "c");
723 Assert.assertEquals(multi.getPreSuperScript(1).getTextContent(), "d");
724 Assert.assertEquals(multi.getNumprescriptcolumns(), 1);
725 Assert.assertEquals(multi.getNumscriptcolumns(), 1);
726 final Mi mi = (Mi) docElement.createElement(Mi.ELEMENT);
727 multi.insertPreSubScriptBefore(0, mi);
728 Assert.assertEquals(multi.getNumprescriptcolumns(), 2);
729 Assert.assertEquals(multi.getChildNodes().getLength(), 8);
730 }
731
732
733
734
735
736
737
738 @Test
739 public void testMMultiScripts2() throws Exception {
740 final Document doc = MathMLParserSupport
741 .parseString("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?><math mode=\"display\">"
742 + "<mmultiscripts>" + "</mmultiscripts>" + "</math>");
743 final MathMLDocument docElement = DOMBuilder.getInstance()
744 .createJeuclidDom(doc);
745 final MathMLMathElement mathElement = (MathMLMathElement) docElement
746 .getFirstChild();
747 final MathMLMultiScriptsElement multi = (MathMLMultiScriptsElement) mathElement
748 .getChildNodes().item(0);
749 multi.setSubScriptAt(1, (MathMLElement) docElement
750 .createElement(Mi.ELEMENT));
751 Assert.assertEquals(multi.getChildNodes().getLength(), 3);
752 multi.setSuperScriptAt(1, (MathMLElement) docElement
753 .createElement(Mi.ELEMENT));
754 Assert.assertEquals(multi.getChildNodes().getLength(), 3);
755 multi.insertPreSuperScriptBefore(0, (MathMLElement) docElement
756 .createElement(Mi.ELEMENT));
757 Assert.assertEquals(multi.getChildNodes().getLength(), 6);
758 multi.insertPreSubScriptBefore(0, (Mi) docElement
759 .createElement(Mi.ELEMENT));
760 Assert.assertEquals(multi.getChildNodes().getLength(), 8);
761
762 Assert.assertNull(multi.getSubScript(0));
763 Assert.assertNull(multi.getSuperScript(0));
764 Assert.assertNull(multi.getSubScript(20));
765 Assert.assertNull(multi.getSuperScript(20));
766 }
767
768
769
770
771
772
773
774 @Test
775 public void testEvents() throws Exception {
776 final Document doc = MathMLParserSupport
777 .parseString("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?><math mode=\"display\">"
778 + "<mi>x</mi>" + "</math>");
779 final MathMLDocument docElement = DOMBuilder.getInstance()
780 .createJeuclidDom(doc);
781 final MathMLMathElement mathElement = (MathMLMathElement) docElement
782 .getFirstChild();
783
784 final MathMLElement mi = (MathMLElement) mathElement.getChildNodes()
785 .item(0);
786
787 this.docCount = 0;
788 this.mathCount = 0;
789 this.miCount = 0;
790
791 ((EventTarget) mathElement).addEventListener("DOMSubtreeModified",
792 new EventListener() {
793
794 public void handleEvent(final Event evt) {
795 DOMModelTest.this.mathCount++;
796 }
797 }, false);
798
799 ((EventTarget) mi).addEventListener("DOMSubtreeModified",
800 new EventListener() {
801
802 public void handleEvent(final Event evt) {
803 DOMModelTest.this.miCount++;
804
805 }
806 }, false);
807 ((EventTarget) docElement).addEventListener("DOMSubtreeModified",
808 new EventListener() {
809
810 public void handleEvent(final Event evt) {
811 DOMModelTest.this.docCount++;
812 }
813 }, false);
814 mathElement.appendChild(docElement.createElement(Mi.ELEMENT));
815 Assert.assertTrue("Event must not be called on Mi", this.miCount == 0);
816 Assert.assertTrue("Event must be called on Math", this.mathCount > 0);
817 Assert.assertTrue("Event must be called on Document", this.docCount > 0);
818 }
819
820
821
822
823
824
825
826 @Test
827 public void testBadSupSuper() throws Exception {
828 final Document ownerDocument = new DocumentElement();
829
830 final MathMLScriptElement msup = (MathMLScriptElement) ownerDocument
831 .createElement(Msup.ELEMENT);
832 final MathMLScriptElement msubsup = (MathMLScriptElement) ownerDocument
833 .createElement(Msubsup.ELEMENT);
834 final MathMLScriptElement msub = (MathMLScriptElement) ownerDocument
835 .createElement(Msub.ELEMENT);
836 msup.getSuperscript();
837 msup.getSubscript();
838 msub.getSuperscript();
839 msub.getSubscript();
840 msubsup.getSuperscript();
841 msubsup.getSubscript();
842 }
843
844 private void testImpl(final Class<?> whichClass) throws Exception {
845 final String name = whichClass.getName();
846 final Method[] methods = whichClass.getDeclaredMethods();
847 final Set<String> names = new TreeSet<String>();
848 for (final Method m : methods) {
849 names.add(m.getName());
850 }
851 Assert.assertTrue(name + " must override newNode",
852 names.contains("newNode"));
853 Assert.assertFalse(name + " must not override getTagName",
854 names.contains("getTagName"));
855 Assert.assertTrue(name + " must be final",
856 Modifier.isFinal(whichClass.getModifiers()));
857
858 }
859
860
861
862
863
864
865
866 @Test
867 public void testProperImplementation() throws Exception {
868 this.testImpl(MathImpl.class);
869 this.testImpl(Mfenced.class);
870 this.testImpl(Mfrac.class);
871 this.testImpl(Menclose.class);
872 this.testImpl(Mphantom.class);
873 this.testImpl(Msup.class);
874 this.testImpl(Msub.class);
875 this.testImpl(Mmultiscripts.class);
876 this.testImpl(Mprescripts.class);
877 this.testImpl(None.class);
878 this.testImpl(Msubsup.class);
879 this.testImpl(Munder.class);
880 this.testImpl(Mover.class);
881 this.testImpl(Munderover.class);
882 this.testImpl(Mspace.class);
883 this.testImpl(Ms.class);
884 this.testImpl(Mstyle.class);
885 this.testImpl(Msqrt.class);
886 this.testImpl(Mroot.class);
887 this.testImpl(Mtable.class);
888 this.testImpl(Mtr.class);
889 this.testImpl(Mlabeledtr.class);
890 this.testImpl(Mtd.class);
891 this.testImpl(Mo.class);
892 this.testImpl(Mi.class);
893 this.testImpl(Mn.class);
894 this.testImpl(Mtext.class);
895 this.testImpl(Mrow.class);
896 this.testImpl(Maligngroup.class);
897 this.testImpl(Malignmark.class);
898 this.testImpl(Semantics.class);
899 this.testImpl(Annotation.class);
900 this.testImpl(Mpadded.class);
901 this.testImpl(Merror.class);
902 this.testImpl(Maction.class);
903 this.testImpl(Mglyph.class);
904 }
905 }