Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 297951 - SAXParseException when reporting test results with XML markup characters in the result text.
Summary: SAXParseException when reporting test results with XML markup characters in t...
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: TPTP (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P2 major (vote)
Target Milestone: ---   Edit
Assignee: Paul Slauenwhite CLA
QA Contact: Kathy Chan CLA
URL:
Whiteboard: bvt
Keywords:
Depends on:
Blocks: 211751
  Show dependency tree
 
Reported: 2009-12-16 07:17 EST by Paul Slauenwhite CLA
Modified: 2016-05-05 10:29 EDT (History)
2 users (show)

See Also:


Attachments
Patch. (4.27 KB, patch)
2009-12-16 14:41 EST, Paul Slauenwhite CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Slauenwhite CLA 2009-12-16 07:17:47 EST
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
Comment 1 Paul Slauenwhite CLA 2009-12-16 14:41:08 EST
Created attachment 154589 [details]
Patch.
Comment 2 Paul Slauenwhite CLA 2009-12-16 14:41:28 EST
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.
Comment 3 Paul Slauenwhite CLA 2010-01-07 10:48:53 EST
Verified in TPTP-4.6.2-201001041900.

Closing.