@ -16,8 +16,9 @@
@@ -16,8 +16,9 @@
package org.springframework.oxm.jaxb ;
import java.io.File ;
import java.io.IOException ;
import java.io.StringReader ;
import javax.activation.DataHandler ;
import javax.activation.FileDataSource ;
import javax.xml.bind.JAXBElement ;
@ -26,7 +27,11 @@ import javax.xml.stream.XMLStreamReader;
@@ -26,7 +27,11 @@ import javax.xml.stream.XMLStreamReader;
import javax.xml.transform.Source ;
import javax.xml.transform.stream.StreamSource ;
import static org.junit.Assert.* ;
import org.junit.Test ;
import static org.mockito.BDDMockito.given ;
import static org.mockito.BDDMockito.mock ;
import org.springframework.core.io.ClassPathResource ;
import org.springframework.core.io.Resource ;
import org.springframework.oxm.AbstractUnmarshallerTests ;
@ -36,9 +41,6 @@ import org.springframework.oxm.jaxb.test.Flights;
@@ -36,9 +41,6 @@ import org.springframework.oxm.jaxb.test.Flights;
import org.springframework.oxm.mime.MimeContainer ;
import org.springframework.util.xml.StaxUtils ;
import static org.junit.Assert.* ;
import static org.mockito.BDDMockito.* ;
/ * *
* @author Arjen Poutsma
* @author Biju Kunjummen
@ -134,4 +136,13 @@ public class Jaxb2UnmarshallerTests extends AbstractUnmarshallerTests {
@@ -134,4 +136,13 @@ public class Jaxb2UnmarshallerTests extends AbstractUnmarshallerTests {
"test" , airplane . getValue ( ) . getName ( ) ) ;
}
@Test
public void unmarshalFile ( ) throws IOException {
Resource resource = new ClassPathResource ( "jaxb2.xml" , getClass ( ) ) ;
File file = resource . getFile ( ) ;
Flights f = ( Flights ) unmarshaller . unmarshal ( new StreamSource ( file ) ) ;
testFlights ( f ) ;
}
}