@ -1,5 +1,5 @@
@@ -1,5 +1,5 @@
/ *
* Copyright 2002 - 2021 the original author or authors .
* Copyright 2002 - 2023 the original author or authors .
*
* Licensed under the Apache License , Version 2 . 0 ( the "License" ) ;
* you may not use this file except in compliance with the License .
@ -18,6 +18,7 @@ package org.springframework.oxm;
@@ -18,6 +18,7 @@ package org.springframework.oxm;
import java.io.ByteArrayInputStream ;
import java.io.StringReader ;
import java.nio.charset.StandardCharsets ;
import javax.xml.namespace.QName ;
import javax.xml.parsers.DocumentBuilder ;
@ -69,7 +70,7 @@ public abstract class AbstractUnmarshallerTests<U extends Unmarshaller> {
@@ -69,7 +70,7 @@ public abstract class AbstractUnmarshallerTests<U extends Unmarshaller> {
protected abstract void testFlight ( Object o ) ;
@Test
public void unmarshalDomSource ( ) throws Exception {
void unmarshalDomSource ( ) throws Exception {
DocumentBuilder builder = DocumentBuilderFactory . newInstance ( ) . newDocumentBuilder ( ) ;
Document document = builder . newDocument ( ) ;
Element flightsElement = document . createElementNS ( "http://samples.springframework.org/flight" , "tns:flights" ) ;
@ -86,21 +87,22 @@ public abstract class AbstractUnmarshallerTests<U extends Unmarshaller> {
@@ -86,21 +87,22 @@ public abstract class AbstractUnmarshallerTests<U extends Unmarshaller> {
}
@Test
public void unmarshalStreamSourceReader ( ) throws Exception {
void unmarshalStreamSourceReader ( ) throws Exception {
StreamSource source = new StreamSource ( new StringReader ( INPUT_STRING ) ) ;
Object flights = unmarshaller . unmarshal ( source ) ;
testFlights ( flights ) ;
}
@Test
public void unmarshalStreamSourceInputStream ( ) throws Exception {
StreamSource source = new StreamSource ( new ByteArrayInputStream ( INPUT_STRING . getBytes ( "UTF-8" ) ) ) ;
void unmarshalStreamSourceInputStream ( ) throws Exception {
StreamSource source = new StreamSource ( new ByteArrayInputStream (
INPUT_STRING . getBytes ( StandardCharsets . UTF_8 ) ) ) ;
Object flights = unmarshaller . unmarshal ( source ) ;
testFlights ( flights ) ;
}
@Test
public void unmarshalSAXSource ( ) throws Exception {
void unmarshalSAXSource ( ) throws Exception {
SAXParserFactory saxParserFactory = SAXParserFactory . newInstance ( ) ;
saxParserFactory . setNamespaceAware ( true ) ;
SAXParser saxParser = saxParserFactory . newSAXParser ( ) ;
@ -111,7 +113,7 @@ public abstract class AbstractUnmarshallerTests<U extends Unmarshaller> {
@@ -111,7 +113,7 @@ public abstract class AbstractUnmarshallerTests<U extends Unmarshaller> {
}
@Test
public void unmarshalStaxSourceXmlStreamReader ( ) throws Exception {
void unmarshalStaxSourceXmlStreamReader ( ) throws Exception {
XMLInputFactory inputFactory = XMLInputFactory . newInstance ( ) ;
XMLStreamReader streamReader = inputFactory . createXMLStreamReader ( new StringReader ( INPUT_STRING ) ) ;
Source source = StaxUtils . createStaxSource ( streamReader ) ;
@ -120,7 +122,7 @@ public abstract class AbstractUnmarshallerTests<U extends Unmarshaller> {
@@ -120,7 +122,7 @@ public abstract class AbstractUnmarshallerTests<U extends Unmarshaller> {
}
@Test
public void unmarshalStaxSourceXmlEventReader ( ) throws Exception {
void unmarshalStaxSourceXmlEventReader ( ) throws Exception {
XMLInputFactory inputFactory = XMLInputFactory . newInstance ( ) ;
XMLEventReader eventReader = inputFactory . createXMLEventReader ( new StringReader ( INPUT_STRING ) ) ;
Source source = StaxUtils . createStaxSource ( eventReader ) ;
@ -129,7 +131,7 @@ public abstract class AbstractUnmarshallerTests<U extends Unmarshaller> {
@@ -129,7 +131,7 @@ public abstract class AbstractUnmarshallerTests<U extends Unmarshaller> {
}
@Test
public void unmarshalJaxp14StaxSourceXmlStreamReader ( ) throws Exception {
void unmarshalJaxp14StaxSourceXmlStreamReader ( ) throws Exception {
XMLInputFactory inputFactory = XMLInputFactory . newInstance ( ) ;
XMLStreamReader streamReader = inputFactory . createXMLStreamReader ( new StringReader ( INPUT_STRING ) ) ;
StAXSource source = new StAXSource ( streamReader ) ;
@ -138,7 +140,7 @@ public abstract class AbstractUnmarshallerTests<U extends Unmarshaller> {
@@ -138,7 +140,7 @@ public abstract class AbstractUnmarshallerTests<U extends Unmarshaller> {
}
@Test
public void unmarshalJaxp14StaxSourceXmlEventReader ( ) throws Exception {
void unmarshalJaxp14StaxSourceXmlEventReader ( ) throws Exception {
XMLInputFactory inputFactory = XMLInputFactory . newInstance ( ) ;
XMLEventReader eventReader = inputFactory . createXMLEventReader ( new StringReader ( INPUT_STRING ) ) ;
StAXSource source = new StAXSource ( eventReader ) ;
@ -147,7 +149,7 @@ public abstract class AbstractUnmarshallerTests<U extends Unmarshaller> {
@@ -147,7 +149,7 @@ public abstract class AbstractUnmarshallerTests<U extends Unmarshaller> {
}
@Test
public void unmarshalPartialStaxSourceXmlStreamReader ( ) throws Exception {
protected void unmarshalPartialStaxSourceXmlStreamReader ( ) throws Exception {
XMLInputFactory inputFactory = XMLInputFactory . newInstance ( ) ;
XMLStreamReader streamReader = inputFactory . createXMLStreamReader ( new StringReader ( INPUT_STRING ) ) ;
streamReader . nextTag ( ) ; // skip to flights