Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 254504

Summary: XML Encoding Tests failing after XMLContentDescriber changes
Product: [WebTools] WTP Source Editing Reporter: Nick Sandonato <nsand.dev>
Component: wst.xmlAssignee: Nick Sandonato <nsand.dev>
Status: RESOLVED FIXED QA Contact: Nitin Dahyabhai <thatnitind>
Severity: normal    
Priority: P3 CC: valentinbaciu
Version: 3.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on: 254517, 254522    
Bug Blocks:    
Attachments:
Description Flags
junit patch none

Description Nick Sandonato CLA 2008-11-06 15:20:32 EST
Recent changes to the XMLContentDescriber (bug 251748) have caused new tests to begin failing.

1. Tests that utilize encoding="Shift_JIS" or encoding="EUC-JP". These end up causing an MalformedInputException, because the InputStreamReader is created with "UTF-8" as the encoding.

2. Tests that have illformed encodings (e.g., encoding="UTF-8?>) used to have their encoding "best guessed" by the XMLContentDescriber. It seems like the algorithm changed, and it causes an incorrect encoding to be guessed (i.e., it things the encoding for the above is UTF-8?>).
Comment 1 Nick Sandonato CLA 2008-11-06 17:07:38 EST
Created attachment 117268 [details]
junit patch

Commenting out the tests that were affected by the most recent changes to the XMLContentDescriber.

TestContentDescription
  testFile104()
  testFile110()
  testFile116()

TestCodedReader
  testFile104()
  testFile110()
  testFile116()

TestContentTypeDetectionForXML
  testFile105()
  testFile116()

Fixed the expected contentType of TestContentTypeDetectionForXML#testFile120WS to now expect "org.eclipse.core.runtime.xml" since the XMLContentDescriber now recognizes leading linefeeds.
Comment 2 Nick Sandonato CLA 2009-06-01 11:24:49 EDT
These tests are functional again.