/*
 * Copyright (C) 2011, 2015 XStream Committers.
 * All rights reserved.
 *
 * The software in this package is published under the terms of the BSD
 * style license a copy of which has been included with this distribution in
 * the LICENSE.txt file.
 * 
 * Created on 30. September 2011 by Joerg Schaible
 */
package com.thoughtworks.xstream.io.xml;

import com.thoughtworks.xstream.XStreamException;
import com.thoughtworks.xstream.io.HierarchicalStreamDriver;
import com.thoughtworks.xstream.io.HierarchicalStreamReader;

import java.io.StringReader;

public class BEAStaxReaderTest extends AbstractXMLReaderTest {
    
    private HierarchicalStreamDriver driver = new BEAStaxDriver();

    // factory method
    @Override
    protected HierarchicalStreamReader createReader(String xml) throws Exception {
        return driver.createReader(new StringReader(xml));
    }

    @Override
    public void testIsXXEVulnerable() throws Exception {
        // Implementation ignores XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES
    }

    public void todoIsXXEVulnerable() throws Exception {
        try {
            super.testIsXXEVulnerable();
            fail("Thrown " + XStreamException.class.getName() + " expected");
        } catch (final XStreamException e) {
            final String message = e.getMessage();
            if (message.contains("Package")) {
                throw e;
            }
        }
    }

    // inherits tests from superclass
}

@@ -247,17 +247,16 @@
 file.%0A *
- 
 %0A * Crea
@@ -356,50 +356,30 @@
 ort 
-com.thoughtworks.xstream.XStreamException;
+java.io.StringReader;%0A
 %0Aimp
@@ -502,37 +502,8 @@
 r;%0A%0A
-import java.io.StringReader;%0A
 %0Apub
@@ -562,20 +562,16 @@
 rTest %7B%0A
-    
 %0A    pri
@@ -575,16 +575,22 @@
 private 
+final 
 Hierarch
@@ -725,16 +725,22 @@
 eReader(
+final 
 String x
@@ -929,452 +929,175 @@
 ion 
-ignores XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES%0A    %7D%0A%0A    public void todoIsXXEVulnerable() throws Exception %7B%0A        try %7B%0A            super.testIsXXEVulnerable();%0A            fail(%22Thrown %22 + XStreamException.class.getName() + %22 expected%22);%0A        %7D catch (final XStreamException e) %7B%0A            final String message = e.getMessage();%0A            if (message.contains(%22Package%22)) %7B%0A                throw e;%0A            %7D%0A        %7D
+wrongly claims not to handle external entities.%0A        // On top it ignores XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES !!%0A        // super.testIsXXEVulnerable();
 %0A   

Improve comment.