@@ -194,7 +194,23 @@ public void testMarshalSaxResult() throws Exception {
194194 verify (handlerMock );
195195 }
196196
197- public void testSupports () throws Exception {
197+ public void testSupportsContextPath () throws Exception {
198+ Method createFlights = ObjectFactory .class .getDeclaredMethod ("createFlights" );
199+ assertTrue ("Jaxb2Marshaller does not support Flights" ,
200+ marshaller .supports (createFlights .getGenericReturnType ()));
201+ Method createFlight = ObjectFactory .class .getDeclaredMethod ("createFlight" , FlightType .class );
202+ assertTrue ("Jaxb2Marshaller does not support JAXBElement<FlightsType>" ,
203+ marshaller .supports (createFlight .getGenericReturnType ()));
204+ assertFalse ("Jaxb2Marshaller supports non-parameterized JAXBElement" , marshaller .supports (JAXBElement .class ));
205+ JAXBElement <Jaxb2MarshallerTest > testElement =
206+ new JAXBElement <Jaxb2MarshallerTest >(new QName ("something" ), Jaxb2MarshallerTest .class , null , this );
207+ assertFalse ("Jaxb2Marshaller supports wrong JAXBElement" , marshaller .supports (testElement .getClass ()));
208+ }
209+
210+ public void testSupportsClassesToBeBound () throws Exception {
211+ marshaller = new Jaxb2Marshaller ();
212+ marshaller .setClassesToBeBound (new Class []{Flights .class , FlightType .class });
213+ marshaller .afterPropertiesSet ();
198214 Method createFlights = ObjectFactory .class .getDeclaredMethod ("createFlights" );
199215 assertTrue ("Jaxb2Marshaller does not support Flights" ,
200216 marshaller .supports (createFlights .getGenericReturnType ()));
0 commit comments