Skip to content

Commit

Permalink
Resolve as many StAX unit test fails as possible
Browse files Browse the repository at this point in the history
  • Loading branch information
rolfl committed Jul 2, 2021
1 parent 118853b commit 4f9af12
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/java/org/jdom2/input/StAXStreamWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ public void writeCharacters(final String chars) throws XMLStreamException {
if (parent instanceof Element) {
if (activetext != null) {
activetext.append(chars);
} else {
} else if (chars.length() > 0) {
activetext = factory.text(chars);
factory.addContent(parent, activetext);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,14 @@

@SuppressWarnings("javadoc")
public final class TestStAXEventOutputter extends AbstractTestOutputter {

// ******************************************************************************
// ******************************************************************************
// StAX is really ugly - it breaks SurrogatePair handling with non-UTF8 encoding
// As a result, some of these test cases fail in Recent Java versions
// - most test*Surrogate*Pair tests.
// ******************************************************************************
// ******************************************************************************

private final static XMLOutputFactory soutfactory = XMLOutputFactory.newInstance();
private final static XMLInputFactory sinfactory = XMLInputFactory.newInstance();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@

@SuppressWarnings("javadoc")
public class TestStAXReader2Writer extends AbstractTestRoundTrip {

// ******************************************************************************
// ******************************************************************************
// StAX is really ugly - it has broken namespace and comment handling
// As a result, some of these test cases fail
// testComplex - because StAX ignores a Comment content
// testNamespaces - because StAX Can't handle redeclaring default Namespace to ""
// ******************************************************************************
// ******************************************************************************

@Override
Document prepare(Document doc) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@
@SuppressWarnings("javadoc")
public final class TestStAXStreamOutputter extends AbstractTestOutputter {

// ******************************************************************************
// ******************************************************************************
// StAX is really ugly - it breaks SurrogatePair handling with non-UTF8 encoding
// As a result, some of these test cases fail in Recent Java versions
// - most test*Surrogate*Pair tests.
// ******************************************************************************
// ******************************************************************************

private static final XMLOutputFactory soutfactory = XMLOutputFactory.newInstance();
private static final XMLInputFactory sinfactory = XMLInputFactory.newInstance();
Expand Down

0 comments on commit 4f9af12

Please sign in to comment.