Community
Participate
Working Groups
SAXParseException when reporting test results with XML markup characters in the result text. For example, the below exception is thrown when reporting a test result with the following text: junit.framework.ComparisonFailure: expected:<recreate> but was:<null> at junit.framework.Assert.assertEquals(Assert.java:81) at junit.framework.Assert.assertEquals(Assert.java:87) at org.eclipse.hyades.test.ui.navigator.tests.junit.plugin.FileProxyNodeCacheTest.assertValid(FileProxyNodeCacheTest.java:2649) at org.eclipse.hyades.test.ui.navigator.tests.junit.plugin.FileProxyNodeCacheTest.getProxyFromMarker_(FileProxyNodeCacheTest.java:822) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:45) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:612) at junit.framework.TestCase.runTest(TestCase.java:164) at junit.framework.TestCase.runBare(TestCase.java:130) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:120) at org.eclipse.hyades.test.common.junit.HyadesTestCase.run(HyadesTestCase.java:172) at junit.framework.TestSuite.runTest(TestSuite.java:230) at org.eclipse.hyades.test.common.junit.HyadesTestSuite.runTest(HyadesTestSuite.java:457) at junit.framework.TestSuite.run(TestSuite.java:225) at org.eclipse.hyades.test.common.junit.HyadesTestSuite.doRun(HyadesTestSuite.java:425) at org.eclipse.hyades.test.common.junit.HyadesTestSuite.run(HyadesTestSuite.java:338) at junit.framework.TestSuite.runTest(TestSuite.java:230) at org.eclipse.hyades.test.common.junit.HyadesTestSuite.runTest(HyadesTestSuite.java:457) at junit.framework.TestSuite.run(TestSuite.java:225) at org.eclipse.hyades.test.common.junit.HyadesTestSuite.doRun(HyadesTestSuite.java:425) at org.eclipse.hyades.test.common.junit.HyadesTestSuite.run(HyadesTestSuite.java:338) at junit.framework.TestSuite.runTest(TestSuite.java:230) at org.eclipse.hyades.test.common.junit.HyadesTestSuite.runTest(HyadesTestSuite.java:457) at junit.framework.TestSuite.run(TestSuite.java:225) at org.eclipse.hyades.test.common.junit.HyadesTestSuite.doRun(HyadesTestSuite.java:425) at org.eclipse.hyades.test.common.junit.HyadesTestSuite.run(HyadesTestSuite.java:338) at junit.framework.TestSuite.runTest(TestSuite.java:230) at org.eclipse.hyades.test.common.junit.HyadesTestSuite.runTest(HyadesTestSuite.java:457) at junit.framework.TestSuite.run(TestSuite.java:225) at org.eclipse.hyades.test.common.junit.HyadesTestSuite.doRun(HyadesTestSuite.java:425) at org.eclipse.hyades.test.common.junit.HyadesTestSuite.run(HyadesTestSuite.java:338) at org.eclipse.hyades.test.common.junit.HyadesTestRunner.run(HyadesTestRunner.java:504) at org.eclipse.tptp.test.tools.junit.plugin.runner.PluginJobRunner.access$0(PluginJobRunner.java:1) at org.eclipse.tptp.test.tools.junit.plugin.runner.PluginJobRunner$1.run(PluginJobRunner.java:39) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55) Exception (generated via ASF): [tptp:publication] Dec 16, 2009 3:54:16 AM org.eclipse.datatools.enablement.oda.xml.util.SaxParser run [tptp:publication] WARNING: Exceptions occur during xml parsing [tptp:publication] java.lang.reflect.InvocationTargetException [tptp:publication] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [tptp:publication] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79) [tptp:publication] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [tptp:publication] at java.lang.reflect.Method.invoke(Method.java:618) [tptp:publication] at org.eclipse.datatools.enablement.oda.xml.util.SaxParser.parse(SaxParser.java:168) [tptp:publication] at org.eclipse.datatools.enablement.oda.xml.util.SaxParser.run(SaxParser.java:119) [tptp:publication] at java.lang.Thread.run(Thread.java:811) [tptp:publication] Caused by: org.xml.sax.SAXParseException: The element type "null" must be terminated by the matching end-tag "</null>". [tptp:publication] at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source) [tptp:publication] at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source) [tptp:publication] at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) [tptp:publication] at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) [tptp:publication] at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) [tptp:publication] at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source) [tptp:publication] at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source) [tptp:publication] at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) [tptp:publication] at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) [tptp:publication] at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) [tptp:publication] at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) [tptp:publication] at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) [tptp:publication] at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) [tptp:publication] ... 7 more
Created attachment 154589 [details] Patch.
The text element value in the serialized test result XML was not normalized (see org.eclipse.tptp.test.report.birt.internal.elements.util.TPFExecutionResultSerializer.serialize(OutputStream)) and the normalize API did not normalize white space (see org.eclipse.tptp.test.report.birt.internal.elements.util.SerializerUtilities.normalize(String)). The attached patch checked in to CVS (HEAD). No test case is required since the BIRT Test Reports are an as-is component.
Verified in TPTP-4.6.2-201001041900. Closing.