cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1229332 [3/5] - in /cxf/trunk: common/common/src/main/java/org/apache/cxf/common/util/ rt/core/src/main/java/org/apache/cxf/bus/osgi/ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxr...
Date Mon, 09 Jan 2012 20:07:23 GMT
Modified: cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/AtomPojoProviderTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/AtomPojoProviderTest.java?rev=1229332&r1=1229331&r2=1229332&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/AtomPojoProviderTest.java (original)
+++ cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/AtomPojoProviderTest.java Mon Jan  9 20:07:20 2012
@@ -54,7 +54,8 @@ public class AtomPojoProviderTest extend
     
     @Test
     public void testWriteFeedWithBuilders() throws Exception {
-        AtomPojoProvider provider = (AtomPojoProvider)ctx.getBean("atom");
+        @SuppressWarnings("unchecked")
+        AtomPojoProvider<Books> provider = (AtomPojoProvider<Books>)ctx.getBean("atom");
         assertNotNull(provider);
         provider.setFormattedOutput(true);
         ByteArrayOutputStream bos = new ByteArrayOutputStream();
@@ -77,7 +78,8 @@ public class AtomPojoProviderTest extend
     
     @Test
     public void testWriteEntryWithBuilders() throws Exception {
-        AtomPojoProvider provider = (AtomPojoProvider)ctx.getBean("atom2");
+        @SuppressWarnings("unchecked")
+        AtomPojoProvider<Book> provider = (AtomPojoProvider<Book>)ctx.getBean("atom2");
         assertNotNull(provider);
         provider.setFormattedOutput(true);
         ByteArrayOutputStream bos = new ByteArrayOutputStream();
@@ -91,25 +93,25 @@ public class AtomPojoProviderTest extend
     
     @Test
     public void testReadEntryWithBuilders() throws Exception {
-        AtomPojoProvider provider = (AtomPojoProvider)ctx.getBean("atom3");
+        @SuppressWarnings("unchecked")
+        AtomPojoProvider<Book> provider = (AtomPojoProvider<Book>)ctx.getBean("atom3");
         assertNotNull(provider);
         doTestReadEntry(provider);
     }
     
     @Test
     public void testReadEntryWithoutBuilders() throws Exception {
-        doTestReadEntry(new AtomPojoProvider());
+        doTestReadEntry(new AtomPojoProvider<Book>());
     }
     
-    @SuppressWarnings("unchecked")
-    private void doTestReadEntry(AtomPojoProvider provider) throws Exception {
+    private void doTestReadEntry(AtomPojoProvider<Book> provider) throws Exception {
         provider.setFormattedOutput(true);
         ByteArrayOutputStream bos = new ByteArrayOutputStream();
         MediaType mt = MediaType.valueOf("application/atom+xml;type=entry");
         provider.writeTo(new Book("a"), Book.class, Book.class, new Annotation[]{}, mt, null, bos);
         //System.out.println(bos.toString());
         ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
-        Book book = (Book)provider.readFrom((Class)Book.class, Book.class, 
+        Book book = (Book)provider.readFrom(Book.class, Book.class, 
                                             new Annotation[]{}, mt, null, bis);
         assertEquals("a", book.getName());
     }
@@ -117,19 +119,19 @@ public class AtomPojoProviderTest extend
     
     @Test
     public void testReadFeedWithBuilders() throws Exception {
-        AtomPojoProvider provider = (AtomPojoProvider)ctx.getBean("atom4");
+        @SuppressWarnings("unchecked")
+        AtomPojoProvider<Books> provider = (AtomPojoProvider<Books>)ctx.getBean("atom4");
         assertNotNull(provider);
         doTestReadFeed(provider);
     }
     
     @Test
     public void testReadFeedWithoutBuilders() throws Exception {
-        AtomPojoProvider provider = new AtomPojoProvider();
+        AtomPojoProvider<Books> provider = new AtomPojoProvider<Books>();
         doTestReadFeed(provider);
     }
 
-    @SuppressWarnings("unchecked")
-    private void doTestReadFeed(AtomPojoProvider provider) throws Exception {
+    private void doTestReadFeed(AtomPojoProvider<Books> provider) throws Exception {
         ByteArrayOutputStream bos = new ByteArrayOutputStream();
         MediaType mt = MediaType.valueOf("application/atom+xml;type=feed");
         Books books = new Books();
@@ -139,7 +141,7 @@ public class AtomPojoProviderTest extend
         books.setBooks(bs);
         provider.writeTo(books, Books.class, Books.class, new Annotation[]{}, mt, null, bos);
         ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
-        Books books2 = (Books)provider.readFrom((Class)Books.class, Books.class, 
+        Books books2 = provider.readFrom(Books.class, Books.class, 
                                             new Annotation[]{}, mt, null, bis);
         List<Book> list = books2.getBooks();
         assertEquals(2, list.size());
@@ -184,7 +186,8 @@ public class AtomPojoProviderTest extend
                 String s = element.getContent();
                                 
                 Unmarshaller um = 
-                    new JAXBElementProvider().getJAXBContext(Book.class, Book.class).createUnmarshaller();
+                    new JAXBElementProvider<Book>().getJAXBContext(Book.class, Book.class)
+                        .createUnmarshaller();
                 return (Book)um.unmarshal(new StringReader(s));
             } catch (Exception ex) {
                 // ignore

Modified: cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/BinaryDataProviderTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/BinaryDataProviderTest.java?rev=1229332&r1=1229331&r2=1229332&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/BinaryDataProviderTest.java (original)
+++ cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/BinaryDataProviderTest.java Mon Jan  9 20:07:20 2012
@@ -42,7 +42,7 @@ public class BinaryDataProviderTest exte
     
     @Test
     public void testIsWriteable() {
-        MessageBodyWriter<Object> p = new BinaryDataProvider();
+        MessageBodyWriter<Object> p = new BinaryDataProvider<Object>();
         assertTrue(p.isWriteable(byte[].class, null, null, null)
                    && p.isWriteable(InputStream.class, null, null, null)
                    && p.isWriteable(File.class, null, null, null)
@@ -51,14 +51,14 @@ public class BinaryDataProviderTest exte
     
     @Test
     public void testIsReadable() {
-        MessageBodyReader<Object> p = new BinaryDataProvider();
+        MessageBodyReader<Object> p = new BinaryDataProvider<Object>();
         assertTrue(p.isReadable(byte[].class, null, null, null)
                    && p.isReadable(InputStream.class, null, null, null)
                    && !p.isReadable(File.class, null, null, null)
                    && !p.isReadable(int[].class, null, null, null));
     }
     
-    @SuppressWarnings("unchecked")
+    @SuppressWarnings({ "unchecked", "rawtypes" })
     @Test
     public void testReadFrom() throws Exception {
         MessageBodyReader p = new BinaryDataProvider();
@@ -76,7 +76,7 @@ public class BinaryDataProviderTest exte
         assertEquals(IOUtils.toString(r), "hi");
     }
     
-    @SuppressWarnings("unchecked")
+    @SuppressWarnings({ "unchecked", "rawtypes" })
     @Test
     public void testWriteTo() throws Exception {
         MessageBodyWriter p = new BinaryDataProvider();

Modified: cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/DataBindingJSONProviderTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/DataBindingJSONProviderTest.java?rev=1229332&r1=1229331&r2=1229332&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/DataBindingJSONProviderTest.java (original)
+++ cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/DataBindingJSONProviderTest.java Mon Jan  9 20:07:20 2012
@@ -68,7 +68,7 @@ public class DataBindingJSONProviderTest
         Service s = new JAXRSServiceImpl(Collections.singletonList(c2), true);
         DataBinding binding = new SDODataBinding();
         binding.initialize(s);
-        DataBindingJSONProvider p = new DataBindingJSONProvider();
+        DataBindingJSONProvider<Structure> p = new DataBindingJSONProvider<Structure>();
         p.setDataBinding(binding);
         p.setNamespaceMap(Collections.singletonMap("http://apache.org/structure/types", "p0"));
         Structure struct = new StructureImpl();
@@ -84,7 +84,6 @@ public class DataBindingJSONProviderTest
         assertEquals(bos.toString(), data);
     }
     
-    @SuppressWarnings("unchecked")
     @Test
     public void testSDORead() throws Exception {
         String data = "{\"p0.Structure\":{\"@xsi.type\":\"p0:Structure\",\"p0.text\":\"sdo\",\"p0.int\":3"
@@ -92,11 +91,11 @@ public class DataBindingJSONProviderTest
         Service s = new JAXRSServiceImpl(Collections.singletonList(c2), true);
         DataBinding binding = new SDODataBinding();
         binding.initialize(s);
-        DataBindingJSONProvider p = new DataBindingJSONProvider();
+        DataBindingJSONProvider<Structure> p = new DataBindingJSONProvider<Structure>();
         p.setDataBinding(binding);
         p.setNamespaceMap(Collections.singletonMap("http://apache.org/structure/types", "p0"));
         ByteArrayInputStream is = new ByteArrayInputStream(data.getBytes());
-        Structure struct = (Structure)p.readFrom(Structure.class, Structure.class,
+        Structure struct = p.readFrom(Structure.class, Structure.class,
                                       new Annotation[0], MediaType.APPLICATION_JSON_TYPE, 
                                       new MetadataMap<String, String>(), is);
         assertEquals("sdo", struct.getText());
@@ -119,14 +118,13 @@ public class DataBindingJSONProviderTest
         assertEquals(bos.toString(), data);
     }
     
-    @SuppressWarnings("unchecked")
     @Test
     public void testJAXBRead() throws Exception {
         String data = "{\"Book\":{\"id\":127,\"name\":\"CXF\",\"state\":\"\"}}";
         Service s = new JAXRSServiceImpl(Collections.singletonList(c), true);
         DataBinding binding = new JAXBDataBinding();
         binding.initialize(s);
-        DataBindingJSONProvider p = new DataBindingJSONProvider();
+        DataBindingJSONProvider<Book> p = new DataBindingJSONProvider<Book>();
         p.setDataBinding(binding);
         ByteArrayInputStream is = new ByteArrayInputStream(data.getBytes());
         Book book = (Book)p.readFrom(Book.class, Book.class,
@@ -178,13 +176,12 @@ public class DataBindingJSONProviderTest
         doTestAegisRead(data);
     }
     
-    @SuppressWarnings("unchecked")
     public void doTestAegisRead(String data) throws Exception {
         Service s = new JAXRSServiceImpl(Collections.singletonList(c), true);
         s.put("readXsiType", true);
         AegisDatabinding binding = new AegisDatabinding();
         binding.initialize(s);
-        DataBindingJSONProvider p = new DataBindingJSONProvider();
+        DataBindingJSONProvider<Book> p = new DataBindingJSONProvider<Book>();
         p.setDataBinding(binding);
         ByteArrayInputStream is = new ByteArrayInputStream(data.getBytes());
         Book book = (Book)p.readFrom(Book.class, Book.class,

Modified: cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/DataBindingProviderTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/DataBindingProviderTest.java?rev=1229332&r1=1229331&r2=1229332&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/DataBindingProviderTest.java (original)
+++ cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/DataBindingProviderTest.java Mon Jan  9 20:07:20 2012
@@ -93,15 +93,14 @@ public class DataBindingProviderTest ext
         doTestAegisRead(data);
     }
     
-    @SuppressWarnings("unchecked")
     public void doTestAegisRead(String data) throws Exception { 
         Service s = new JAXRSServiceImpl(Collections.singletonList(c), true);
         s.put("readXsiType", true);
         AegisDatabinding binding = new AegisDatabinding();
         binding.initialize(s);
-        DataBindingProvider p = new DataBindingProvider(binding);
+        DataBindingProvider<Book> p = new DataBindingProvider<Book>(binding);
         ByteArrayInputStream is = new ByteArrayInputStream(data.getBytes());
-        Book book = (Book)p.readFrom(Book.class, Book.class,
+        Book book = p.readFrom(Book.class, Book.class,
                                       new Annotation[0], MediaType.APPLICATION_XML_TYPE, 
                                       new MetadataMap<String, String>(), is);
         assertEquals("CXF", book.getName());
@@ -143,7 +142,7 @@ public class DataBindingProviderTest ext
         Service s = new JAXRSServiceImpl(Collections.singletonList(c2), true);
         DataBinding binding = new SDODataBinding();
         binding.initialize(s);
-        DataBindingProvider p = new DataBindingProvider(binding);
+        DataBindingProvider<Structure> p = new DataBindingProvider<Structure>(binding);
         Structure struct = new StructureImpl();
         struct.getTexts().add("text1");
         struct.setText("sdo");
@@ -160,7 +159,6 @@ public class DataBindingProviderTest ext
         assertEquals(bos.toString(), data);
     }
     
-    @SuppressWarnings("unchecked")
     @Test
     public void testSDORead() throws Exception {
         String data = "<p0:Structure xmlns:p0=\"http://apache.org/structure/types\" " 
@@ -171,7 +169,7 @@ public class DataBindingProviderTest ext
         Service s = new JAXRSServiceImpl(Collections.singletonList(c2), true);
         DataBinding binding = new SDODataBinding();
         binding.initialize(s);
-        DataBindingProvider p = new DataBindingProvider(binding);
+        DataBindingProvider<Structure> p = new DataBindingProvider<Structure>(binding);
         ByteArrayInputStream is = new ByteArrayInputStream(data.getBytes());
         Structure struct = (Structure)p.readFrom(Structure.class, Structure.class,
                                       new Annotation[0], MediaType.APPLICATION_XML_TYPE, 
@@ -181,13 +179,12 @@ public class DataBindingProviderTest ext
         assertEquals(3, struct.getInt());
     }
     
-    @SuppressWarnings("unchecked")
     @Test
     public void testXmlBeansWrite() throws Exception {
         Service s = new JAXRSServiceImpl(Collections.singletonList(c3), true);
         DataBinding binding = new XmlBeansDataBinding();
         binding.initialize(s);
-        DataBindingProvider p = new DataBindingProvider(binding);
+        DataBindingProvider<Address> p = new DataBindingProvider<Address>(binding);
         Address address = Address.Factory.newInstance();
         address.setAddressLine1("Street 1");
         
@@ -199,7 +196,6 @@ public class DataBindingProviderTest ext
         assertEquals(bos.toString(), data);
     }
     
-    @SuppressWarnings("unchecked")
     @Test
     public void testXmlBeansRead() throws Exception {
         String data = "<tns:Address xmlns:tns=\"http://cxf.apache.org/jaxrs/providers/xmlbeans/types\">"
@@ -207,7 +203,7 @@ public class DataBindingProviderTest ext
         Service s = new JAXRSServiceImpl(Collections.singletonList(c3), true);
         DataBinding binding = new XmlBeansDataBinding();
         binding.initialize(s);
-        DataBindingProvider p = new DataBindingProvider(binding);
+        DataBindingProvider<Address> p = new DataBindingProvider<Address>(binding);
         ByteArrayInputStream is = new ByteArrayInputStream(data.getBytes());
         Address address = (Address)p.readFrom(Address.class, Address.class,
                                       new Annotation[0], MediaType.APPLICATION_XML_TYPE, 

Modified: cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/DataSourceProviderTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/DataSourceProviderTest.java?rev=1229332&r1=1229331&r2=1229332&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/DataSourceProviderTest.java (original)
+++ cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/DataSourceProviderTest.java Mon Jan  9 20:07:20 2012
@@ -38,7 +38,7 @@ public class DataSourceProviderTest exte
 
     @Test
     public void testReadDataHandler() throws Exception {
-        DataSourceProvider p = new DataSourceProvider();
+        DataSourceProvider<DataHandler> p = new DataSourceProvider<DataHandler>();
         DataHandler ds = (DataHandler)p.readFrom(DataHandler.class, null, new Annotation[]{}, 
                    MediaType.valueOf("image/png"), new MetadataMap<String, String>(), 
                    new ByteArrayInputStream("image".getBytes()));
@@ -49,7 +49,7 @@ public class DataSourceProviderTest exte
     
     @Test
     public void testWriteDataHandler() throws Exception {
-        DataSourceProvider p = new DataSourceProvider();
+        DataSourceProvider<DataHandler> p = new DataSourceProvider<DataHandler>();
         DataHandler ds = new DataHandler(new InputStreamDataSource(
                              new ByteArrayInputStream("image".getBytes()), 
                              "image/png")); 
@@ -62,7 +62,7 @@ public class DataSourceProviderTest exte
     
     @Test
     public void testReadDataSource() throws Exception {
-        DataSourceProvider p = new DataSourceProvider();
+        DataSourceProvider<DataSource> p = new DataSourceProvider<DataSource>();
         DataSource ds = (DataSource)p.readFrom(DataSource.class, null, new Annotation[]{}, 
                    MediaType.valueOf("image/png"), new MetadataMap<String, String>(), 
                    new ByteArrayInputStream("image".getBytes()));
@@ -73,7 +73,7 @@ public class DataSourceProviderTest exte
     
     @Test
     public void testWriteDataSource() throws Exception {
-        DataSourceProvider p = new DataSourceProvider();
+        DataSourceProvider<DataSource> p = new DataSourceProvider<DataSource>();
         DataSource ds = new InputStreamDataSource(new ByteArrayInputStream("image".getBytes()), 
                                                   "image/png"); 
         ByteArrayOutputStream os = new ByteArrayOutputStream(); 
@@ -87,7 +87,7 @@ public class DataSourceProviderTest exte
     
     @Test
     public void testWriteDataSourceWithDiffCT() throws Exception {
-        DataSourceProvider p = new DataSourceProvider();
+        DataSourceProvider<DataSource> p = new DataSourceProvider<DataSource>();
         DataSource ds = new InputStreamDataSource(new ByteArrayInputStream("image".getBytes()), 
                                                   "image/png"); 
         ByteArrayOutputStream os = new ByteArrayOutputStream();

Modified: cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/FormEncodingProviderTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/FormEncodingProviderTest.java?rev=1229332&r1=1229331&r2=1229332&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/FormEncodingProviderTest.java (original)
+++ cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/FormEncodingProviderTest.java Mon Jan  9 20:07:20 2012
@@ -36,35 +36,31 @@ import org.apache.cxf.jaxrs.impl.Metadat
 import org.apache.cxf.jaxrs.utils.HttpUtils;
 
 import org.junit.Assert;
-import org.junit.Before;
 import org.junit.Test;
 
 public class FormEncodingProviderTest extends Assert {
 
-    private FormEncodingProvider ferp;
 
-    @Before
-    public void setUp() {
-        ferp = new FormEncodingProvider();
-    }
-
-    @SuppressWarnings("unchecked")
     @Test
     public void testReadFrom() throws Exception {
+        @SuppressWarnings("rawtypes")
+        FormEncodingProvider<MultivaluedMap> ferp 
+            = new FormEncodingProvider<MultivaluedMap>();
         InputStream is = getClass().getResourceAsStream("singleValPostBody.txt");
+        @SuppressWarnings("unchecked")
         MultivaluedMap<String, String> mvMap = 
-            (MultivaluedMap<String, String>)ferp.readFrom((Class)MultivaluedMap.class, null, 
+            (MultivaluedMap<String, String>)ferp.readFrom(MultivaluedMap.class, null, 
                 new Annotation[]{}, MediaType.APPLICATION_FORM_URLENCODED_TYPE, null, is);
         assertEquals("Wrong entry for foo", "bar", mvMap.getFirst("foo"));
         assertEquals("Wrong entry for boo", "far", mvMap.getFirst("boo"));
 
     }
     
-    @SuppressWarnings("unchecked")
     @Test
     public void testReadFromForm() throws Exception {
+        FormEncodingProvider<Form> ferp = new FormEncodingProvider<Form>();
         InputStream is = getClass().getResourceAsStream("singleValPostBody.txt");
-        Form form = (Form)ferp.readFrom((Class)Form.class, null, 
+        Form form = ferp.readFrom(Form.class, null, 
                 new Annotation[]{}, MediaType.APPLICATION_FORM_URLENCODED_TYPE, null, is);
         MultivaluedMap<String, String> mvMap = form.getData();
         assertEquals("Wrong entry for foo", "bar", mvMap.getFirst("foo"));
@@ -77,6 +73,10 @@ public class FormEncodingProviderTest ex
     public void testDecoded() throws Exception {
         String values = "foo=1+2&bar=1+3";
         
+        @SuppressWarnings("rawtypes")
+        FormEncodingProvider<MultivaluedMap> ferp 
+            = new FormEncodingProvider<MultivaluedMap>();
+        @SuppressWarnings("rawtypes")
         MultivaluedMap<String, String> mvMap = 
             (MultivaluedMap<String, String>)ferp.readFrom((Class)MultivaluedMap.class, null, 
                 new Annotation[]{}, MediaType.APPLICATION_FORM_URLENCODED_TYPE, null, 
@@ -90,9 +90,11 @@ public class FormEncodingProviderTest ex
     @Test
     public void testEncoded() throws Exception {
         String values = "foo=1+2&bar=1+3";
-        
+        @SuppressWarnings("rawtypes")
+        FormEncodingProvider<MultivaluedMap> ferp 
+            = new FormEncodingProvider<MultivaluedMap>();
         MultivaluedMap<String, String> mvMap = 
-            (MultivaluedMap<String, String>)ferp.readFrom((Class)MultivaluedMap.class, null, 
+            (MultivaluedMap<String, String>)ferp.readFrom(MultivaluedMap.class, null, 
                 new Annotation[]{CustomMap.class.getAnnotations()[0]}, 
                     MediaType.APPLICATION_FORM_URLENCODED_TYPE, null, 
                     new ByteArrayInputStream(values.getBytes()));
@@ -101,13 +103,12 @@ public class FormEncodingProviderTest ex
 
     }
     
-    @SuppressWarnings("unchecked")
     @Test
     public void testCustomMapImpl() throws Exception {
         String values = "foo=1+2&bar=1+3&baz=4";
-        
-        MultivaluedMap<String, String> mvMap = 
-            (MultivaluedMap<String, String>)ferp.readFrom((Class)CustomMap.class, null, 
+        FormEncodingProvider<CustomMap> ferp = new FormEncodingProvider<CustomMap>();
+
+        MultivaluedMap<String, String> mvMap = ferp.readFrom(CustomMap.class, null, 
                           new Annotation[]{}, MediaType.APPLICATION_FORM_URLENCODED_TYPE, null, 
                           new ByteArrayInputStream(values.getBytes()));
         assertEquals(3, mvMap.size());
@@ -120,13 +121,12 @@ public class FormEncodingProviderTest ex
 
     }
     
-    @SuppressWarnings("unchecked")
     @Test
     public void testMultiLines() throws Exception {
         String values = "foo=1+2&bar=line1%0D%0Aline+2&baz=4";
+        FormEncodingProvider<CustomMap> ferp = new FormEncodingProvider<CustomMap>();
         
-        MultivaluedMap<String, String> mvMap = 
-            (MultivaluedMap<String, String>)ferp.readFrom((Class)CustomMap.class, null, 
+        MultivaluedMap<String, String> mvMap = ferp.readFrom(CustomMap.class, null, 
                           new Annotation[]{}, MediaType.APPLICATION_FORM_URLENCODED_TYPE, null, 
                           new ByteArrayInputStream(values.getBytes()));
         assertEquals(3, mvMap.size());
@@ -146,6 +146,8 @@ public class FormEncodingProviderTest ex
         mvMap.add("a", "a1");
         mvMap.add("a", "a2");
         
+        FormEncodingProvider<MultivaluedMap<?, ?>> ferp 
+            = new FormEncodingProvider<MultivaluedMap<?, ?>>();
         ByteArrayOutputStream bos = new ByteArrayOutputStream(); 
         ferp.writeTo(mvMap, MultivaluedMap.class, MultivaluedMap.class, 
                      new Annotation[0], MediaType.APPLICATION_FORM_URLENCODED_TYPE, 
@@ -161,6 +163,8 @@ public class FormEncodingProviderTest ex
         mvMap.add("a", "a2");
         mvMap.add("b", "b1");
         
+        FormEncodingProvider<MultivaluedMap<?, ?>> ferp 
+            = new FormEncodingProvider<MultivaluedMap<?, ?>>();
         ByteArrayOutputStream bos = new ByteArrayOutputStream(); 
         ferp.writeTo(mvMap, MultivaluedMap.class, MultivaluedMap.class, 
                      new Annotation[0], MediaType.APPLICATION_FORM_URLENCODED_TYPE, 
@@ -175,6 +179,8 @@ public class FormEncodingProviderTest ex
         mvMap.add("a", "a1");
         mvMap.add("b", "b1");
         ByteArrayOutputStream bos = new ByteArrayOutputStream(); 
+        FormEncodingProvider<MultivaluedMap<?, ?>> ferp 
+            = new FormEncodingProvider<MultivaluedMap<?, ?>>();
         ferp.writeTo(mvMap, MultivaluedMap.class, MultivaluedMap.class, 
                      new Annotation[0], MediaType.APPLICATION_FORM_URLENCODED_TYPE, 
                      new MetadataMap<String, Object>(), bos);
@@ -186,6 +192,8 @@ public class FormEncodingProviderTest ex
     public void testWriteForm() throws Exception {
         Form form = new Form();
         ByteArrayOutputStream bos = new ByteArrayOutputStream(); 
+        FormEncodingProvider<Form> ferp 
+            = new FormEncodingProvider<Form>();
         ferp.writeTo(form.set("a", "a1").set("b", "b1"), Form.class, Form.class, 
                      new Annotation[0], MediaType.APPLICATION_FORM_URLENCODED_TYPE, 
                      new MetadataMap<String, Object>(), bos);
@@ -193,14 +201,15 @@ public class FormEncodingProviderTest ex
         assertEquals("Wrong value", "a=a1&b=b1", result);  
     }
     
-    @SuppressWarnings("unchecked")
     @Test
     public void testValidation() throws Exception {
+        FormEncodingProvider<CustomMap> ferp 
+            = new FormEncodingProvider<CustomMap>();
         ferp.setValidator(new CustomFormValidator());
         String values = "foo=1+2&bar=1+3";
         
         try {
-            ferp.readFrom((Class)CustomMap.class, null, new Annotation[]{}, 
+            ferp.readFrom(CustomMap.class, null, new Annotation[]{}, 
                           MediaType.APPLICATION_FORM_URLENCODED_TYPE, null, 
                 new ByteArrayInputStream(values.getBytes()));
             fail();
@@ -216,9 +225,14 @@ public class FormEncodingProviderTest ex
     public void testReadFromMultiples() throws Exception {
         InputStream is = getClass().getResourceAsStream("multiValPostBody.txt");
         
+        @SuppressWarnings("rawtypes")
+        FormEncodingProvider<MultivaluedMap> ferp 
+            = new FormEncodingProvider<MultivaluedMap>();
+        
         MultivaluedMap<String, String> mvMap = 
-            (MultivaluedMap<String, String>)ferp.readFrom((Class)MultivaluedMap.class, null,
+            (MultivaluedMap<String, String>)ferp.readFrom(MultivaluedMap.class, null,
                 new Annotation[]{}, MediaType.APPLICATION_FORM_URLENCODED_TYPE, null, is);
+        
         List<String> vals = mvMap.get("foo");
 
         assertEquals("Wrong size for foo params", 2, vals.size());
@@ -238,9 +252,12 @@ public class FormEncodingProviderTest ex
         
         byte[] iso88591bytes = helloStringUTF16.getBytes("ISO-8859-1");
         String helloStringISO88591 = new String(iso88591bytes, "ISO-8859-1");
+        @SuppressWarnings("rawtypes")
+        FormEncodingProvider<MultivaluedMap> ferp 
+            = new FormEncodingProvider<MultivaluedMap>();
         
         MultivaluedMap<String, String> mvMap = 
-            (MultivaluedMap<String, String>)ferp.readFrom((Class)MultivaluedMap.class, null,
+            (MultivaluedMap<String, String>)ferp.readFrom(MultivaluedMap.class, null,
                 new Annotation[]{}, 
                 MediaType.valueOf(MediaType.APPLICATION_FORM_URLENCODED + ";charset=ISO-8859-1"), null, 
                 new ByteArrayInputStream(iso88591bytes));
@@ -253,9 +270,13 @@ public class FormEncodingProviderTest ex
     public void testReadChineeseChars() throws Exception {
         
         String s = "name=中文";
-        
+
+        @SuppressWarnings("rawtypes")
+        FormEncodingProvider<MultivaluedMap> ferp 
+            = new FormEncodingProvider<MultivaluedMap>();
+
         MultivaluedMap<String, String> mvMap = 
-            (MultivaluedMap<String, String>)ferp.readFrom((Class)MultivaluedMap.class, null,
+            (MultivaluedMap<String, String>)ferp.readFrom(MultivaluedMap.class, null,
                 new Annotation[]{}, 
                 MediaType.valueOf(MediaType.APPLICATION_FORM_URLENCODED + ";charset=UTF-8"), null, 
                 new ByteArrayInputStream(s.getBytes("UTF-8")));
@@ -265,16 +286,22 @@ public class FormEncodingProviderTest ex
     
     @Test
     public void testReadableMap() {
+        FormEncodingProvider<MultivaluedMap<String, String>> ferp 
+            = new FormEncodingProvider<MultivaluedMap<String, String>>();
         assertTrue(ferp.isReadable(MultivaluedMap.class, null, null, null));
     }
     
     @Test
     public void testReadableForm() {
+        FormEncodingProvider<Form> ferp 
+            = new FormEncodingProvider<Form>();
         assertTrue(ferp.isReadable(Form.class, null, null, null));
     }
 
     @Test
     public void testAnnotations() {
+        FormEncodingProvider<Form> ferp 
+            = new FormEncodingProvider<Form>();
         assertEquals("application/x-www-form-urlencoded", ferp.getClass().getAnnotation(Consumes.class)
                      .value()[0]);
     }

Modified: cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/JAXBElementProviderTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/JAXBElementProviderTest.java?rev=1229332&r1=1229331&r2=1229332&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/JAXBElementProviderTest.java (original)
+++ cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/JAXBElementProviderTest.java Mon Jan  9 20:07:20 2012
@@ -91,7 +91,6 @@ import org.junit.Test;
 
 public class JAXBElementProviderTest extends Assert {
 
-    @SuppressWarnings("unchecked")
     @Test
     public void testReadFromISO() throws Exception {
         
@@ -102,23 +101,22 @@ public class JAXBElementProviderTest ext
         
         byte[] iso88591bytes = bookStringUTF16.getBytes("ISO-8859-1");
         
-        JAXBElementProvider p = new JAXBElementProvider();
-        Book book = (Book)p.readFrom((Class)Book.class, null,
+        JAXBElementProvider<Book> p = new JAXBElementProvider<Book>();
+        Book book = p.readFrom(Book.class, null,
                 new Annotation[]{}, 
                 MediaType.valueOf(MediaType.APPLICATION_XML), null, 
                 new ByteArrayInputStream(iso88591bytes));
         assertEquals(book.getName(), nameStringUTF16);
     }
 
-    @SuppressWarnings("unchecked")
     @Test
     public void testReadChineeseChars() throws Exception {
         
         String nameStringUTF16 = "中文";
         
         String bookStringUTF16 = "<Book><name>" + nameStringUTF16 + "</name></Book>";
-        JAXBElementProvider p = new JAXBElementProvider();
-        Book book = (Book)p.readFrom((Class)Book.class, null,
+        JAXBElementProvider<Book> p = new JAXBElementProvider<Book>();
+        Book book = p.readFrom(Book.class, null,
                 new Annotation[]{}, 
                 MediaType.valueOf(MediaType.APPLICATION_XML + ";charset=UTF-8"), null, 
                 new ByteArrayInputStream(bookStringUTF16.getBytes("UTF-8")));
@@ -129,7 +127,7 @@ public class JAXBElementProviderTest ext
     public void testSingleJAXBContext() throws Exception {
         ClassResourceInfo cri = 
             ResourceUtils.createClassResourceInfo(JAXBResource.class, JAXBResource.class, true, true);
-        JAXBElementProvider provider = new JAXBElementProvider();
+        JAXBElementProvider<Book> provider = new JAXBElementProvider<Book>();
         provider.setSingleJaxbContext(true);
         provider.init(Collections.singletonList(cri));
         JAXBContext bookContext = provider.getJAXBContext(Book.class, Book.class);
@@ -142,7 +140,7 @@ public class JAXBElementProviderTest ext
     public void testExtraClass() throws Exception {
         ClassResourceInfo cri = 
             ResourceUtils.createClassResourceInfo(BookStore.class, BookStore.class, true, true);
-        JAXBElementProvider provider = new JAXBElementProvider();
+        JAXBElementProvider<SuperBook> provider = new JAXBElementProvider<SuperBook>();
         provider.setSingleJaxbContext(true);
         provider.setExtraClass(new Class[]{SuperBook.class});
         provider.init(Collections.singletonList(cri));
@@ -156,7 +154,7 @@ public class JAXBElementProviderTest ext
     public void testExtraClassWithoutSingleContext() throws Exception {
         ClassResourceInfo cri = 
             ResourceUtils.createClassResourceInfo(BookStore.class, BookStore.class, true, true);
-        JAXBElementProvider provider = new JAXBElementProvider();
+        JAXBElementProvider<SuperBook> provider = new JAXBElementProvider<SuperBook>();
         provider.setExtraClass(new Class[]{SuperBook.class});
         provider.init(Collections.singletonList(cri));
         JAXBContext bookContext = provider.getJAXBContext(Book.class, Book.class);
@@ -170,7 +168,7 @@ public class JAXBElementProviderTest ext
     
     @Test
     public void testExtraClassWithGenerics() throws Exception {
-        JAXBElementProvider provider = new JAXBElementProvider();
+        JAXBElementProvider<?> provider = new JAXBElementProvider<Object>();
         provider.setExtraClass(new Class[]{XmlObject.class});
         testXmlList(provider);
     }
@@ -179,7 +177,7 @@ public class JAXBElementProviderTest ext
     public void testExtraClassWithGenericsAndSingleContext() throws Exception {
         ClassResourceInfo cri = 
             ResourceUtils.createClassResourceInfo(XmlListResource.class, XmlListResource.class, true, true);
-        JAXBElementProvider provider = new JAXBElementProvider();
+        JAXBElementProvider<?> provider = new JAXBElementProvider<Object>();
         provider.setExtraClass(new Class[]{XmlObject.class});
         provider.init(Collections.singletonList(cri));
         testXmlList(provider);
@@ -187,7 +185,7 @@ public class JAXBElementProviderTest ext
     }
     
     @SuppressWarnings("unchecked")
-    private void testXmlList(JAXBElementProvider provider) throws Exception {
+    private void testXmlList(JAXBElementProvider<?> provider) throws Exception {
         
         List<XmlObject> list = new ArrayList<XmlObject>();
         for (int i = 0; i < 10; i++) {
@@ -229,7 +227,7 @@ public class JAXBElementProviderTest ext
     
     @Test
     public void testIsSupportedWithJaxbIndex() {
-        JAXBElementProvider provider = new JAXBElementProvider();
+        JAXBElementProvider<TestBean> provider = new JAXBElementProvider<TestBean>();
         assertTrue(provider.isSupported(TestBean.class, TestBean.class, new Annotation[]{}));
     }
     
@@ -239,7 +237,7 @@ public class JAXBElementProviderTest ext
     }
     
     private void testIsWriteableCollection(String mName) throws Exception {
-        JAXBElementProvider provider = new JAXBElementProvider();
+        JAXBElementProvider<?> provider = new JAXBElementProvider<Object>();
         provider.setCollectionWrapperName("foo");
         Method m = CollectionsResource.class.getMethod(mName, new Class[0]);
         assertTrue(provider.isWriteable(m.getReturnType(), m.getGenericReturnType(),
@@ -272,17 +270,19 @@ public class JAXBElementProviderTest ext
         doWriteUnqualifiedCollection(true, "getBooksArray", "setBooksArray", Book[].class);
     }
     
-    public void doWriteUnqualifiedCollection(boolean setName, String mName, String setterName, 
-                                             Class<?> type) throws Exception {
-        JAXBElementProvider provider = new JAXBElementProvider();
+    public <T> void doWriteUnqualifiedCollection(boolean setName, String mName, 
+                                                 String setterName, 
+                                                 Class<T> type) throws Exception {
+        JAXBElementProvider<T> provider = new JAXBElementProvider<T>();
         if (setName) {
             provider.setCollectionWrapperName("Books");
         }
         List<Book> books = new ArrayList<Book>();
         books.add(new Book("CXF in Action", 123L));
         books.add(new Book("CXF Rocks", 124L));
-        Object o = type.isArray() ? books.toArray() : type == Set.class 
-            ? new HashSet<Book>(books) : books;
+        @SuppressWarnings("unchecked")
+        T o = (T)(type.isArray() ? books.toArray() : type == Set.class 
+            ? new HashSet<Book>(books) : books);
         
         Method m = CollectionsResource.class.getMethod(mName, new Class[0]);
         ByteArrayOutputStream bos = new ByteArrayOutputStream();
@@ -303,7 +303,7 @@ public class JAXBElementProviderTest ext
     
     @Test
     public void testWriteDerivedType() throws Exception {
-        JAXBElementProvider provider = new JAXBElementProvider();
+        JAXBElementProvider<Book> provider = new JAXBElementProvider<Book>();
         provider.setJaxbElementClassNames(Collections.singletonList(Book.class.getName()));
         Book b = new SuperBook("CXF in Action", 123L, 124L);
         
@@ -315,7 +315,7 @@ public class JAXBElementProviderTest ext
     
     @Test
     public void testWriteDerivedType2() throws Exception {
-        JAXBElementProvider provider = new JAXBElementProvider();
+        JAXBElementProvider<Book> provider = new JAXBElementProvider<Book>();
         Book b = new SuperBook("CXF in Action", 123L, 124L);
         
         ByteArrayOutputStream bos = new ByteArrayOutputStream();
@@ -327,7 +327,7 @@ public class JAXBElementProviderTest ext
     
     @Test
     public void testWriteWithCustomPrefixes() throws Exception {
-        JAXBElementProvider provider = new JAXBElementProvider();
+        JAXBElementProvider<TagVO2> provider = new JAXBElementProvider<TagVO2>();
         provider.setNamespacePrefixes(
             Collections.singletonMap("http://tags", "prefix"));
         TagVO2 tag = new TagVO2("a", "b");
@@ -340,7 +340,7 @@ public class JAXBElementProviderTest ext
     
     @Test
     public void testWriteCollectionWithCustomPrefixes() throws Exception {
-        JAXBElementProvider provider = new JAXBElementProvider();
+        JAXBElementProvider<List<TagVO2>> provider = new JAXBElementProvider<List<TagVO2>>();
         provider.setNamespacePrefixes(
             Collections.singletonMap("http://tags", "prefix"));
         TagVO2 tag = new TagVO2("a", "b");
@@ -375,7 +375,8 @@ public class JAXBElementProviderTest ext
     public void doTestWriteWithoutXmlRootElement(String name, boolean unmarshalAsJaxbElement,
                                                  boolean marshalAsJaxbElement) 
         throws Exception {
-        JAXBElementProvider provider = new JAXBElementProvider();
+        JAXBElementProvider<org.apache.cxf.jaxrs.fortest.jaxb.SuperBook> provider 
+            = new JAXBElementProvider<org.apache.cxf.jaxrs.fortest.jaxb.SuperBook>();
         if (!marshalAsJaxbElement) {
             provider.setJaxbElementClassMap(Collections.singletonMap(
                 org.apache.cxf.jaxrs.fortest.jaxb.SuperBook.class.getName(), 
@@ -397,7 +398,8 @@ public class JAXBElementProviderTest ext
     @Test
     public void testWriteCollectionWithoutXmlRootElement() 
         throws Exception {
-        JAXBElementProvider provider = new JAXBElementProvider();
+        JAXBElementProvider<List<org.apache.cxf.jaxrs.fortest.jaxb.SuperBook>> provider 
+            = new JAXBElementProvider<List<org.apache.cxf.jaxrs.fortest.jaxb.SuperBook>>();
         provider.setCollectionWrapperName("{http://superbooks}SuperBooks");
         provider.setJaxbElementClassMap(Collections.singletonMap(
                 org.apache.cxf.jaxrs.fortest.jaxb.SuperBook.class.getName(), 
@@ -422,7 +424,8 @@ public class JAXBElementProviderTest ext
     
     @Test
     public void testWriteWithoutXmlRootElementDerived() throws Exception {
-        JAXBElementProvider provider = new JAXBElementProvider();
+        JAXBElementProvider<org.apache.cxf.jaxrs.fortest.jaxb.Book> provider 
+            = new JAXBElementProvider<org.apache.cxf.jaxrs.fortest.jaxb.Book>();
         provider.setJaxbElementClassMap(Collections.singletonMap(
             org.apache.cxf.jaxrs.fortest.jaxb.Book.class.getName(), "Book"));
         org.apache.cxf.jaxrs.fortest.jaxb.Book b = 
@@ -436,10 +439,9 @@ public class JAXBElementProviderTest ext
         readSuperBook2(bos.toString(), false);
     }
     
-    @SuppressWarnings("unchecked")
     @Test
     public void testWriteWithoutXmlRootElementWithPackageInfo() throws Exception {
-        JAXBElementProvider provider = new JAXBElementProvider();
+        JAXBElementProvider<Book2NoRootElement> provider = new JAXBElementProvider<Book2NoRootElement>();
         provider.setMarshallAsJaxbElement(true);
         Book2NoRootElement book = new Book2NoRootElement(333);
         ByteArrayOutputStream bos = new ByteArrayOutputStream();
@@ -452,18 +454,16 @@ public class JAXBElementProviderTest ext
         provider.setUnmarshallAsJaxbElement(true);
         
         ByteArrayInputStream is = new ByteArrayInputStream(bos.toByteArray());
-        Book2NoRootElement book2 = 
-            (Book2NoRootElement)provider.readFrom(
-                       (Class)Book2NoRootElement.class, 
+        Book2NoRootElement book2 = provider.readFrom(
+                       Book2NoRootElement.class, 
                        Book2NoRootElement.class,
                        new Annotation[0], MediaType.TEXT_XML_TYPE, new MetadataMap<String, String>(), is);
         assertEquals(book2.getId(), book.getId());
     }
     
-    @SuppressWarnings("unchecked")
     @Test
     public void testWriteWithXmlRootElementAndPackageInfo() throws Exception {
-        JAXBElementProvider provider = new JAXBElementProvider();
+        JAXBElementProvider<Book2> provider = new JAXBElementProvider<Book2>();
         Book2 book = new Book2(333);
         ByteArrayOutputStream bos = new ByteArrayOutputStream();
         provider.writeTo(book, Book2.class, 
@@ -473,18 +473,17 @@ public class JAXBElementProviderTest ext
         assertTrue(bos.toString().contains("thebook2"));
         assertTrue(bos.toString().contains("http://superbooks"));
         ByteArrayInputStream is = new ByteArrayInputStream(bos.toByteArray());
-        Book2 book2 = 
-            (Book2)provider.readFrom(
-                       (Class)Book2.class, 
+        Book2 book2 = provider.readFrom(
+                       Book2.class, 
                        Book2.class,
                        new Annotation[0], MediaType.TEXT_XML_TYPE, new MetadataMap<String, String>(), is);
         assertEquals(book2.getId(), book.getId());
     }
     
     @Test
-    @SuppressWarnings("unchecked")
     public void testWriteWithoutXmlRootElementObjectFactory() throws Exception {
-        JAXBElementProvider provider = new JAXBElementProvider();
+        JAXBElementProvider<org.apache.cxf.jaxrs.fortest.jaxb.SuperBook2> provider 
+            = new JAXBElementProvider<org.apache.cxf.jaxrs.fortest.jaxb.SuperBook2>();
         provider.setJaxbElementClassMap(Collections.singletonMap(
             org.apache.cxf.jaxrs.fortest.jaxb.SuperBook2.class.getName(), 
             "{http://books}SuperBook2"));
@@ -496,66 +495,64 @@ public class JAXBElementProviderTest ext
                          org.apache.cxf.jaxrs.fortest.jaxb.SuperBook2.class,
                          new Annotation[0], MediaType.TEXT_XML_TYPE, 
                          new MetadataMap<String, Object>(), bos);
-        JAXBElementProvider provider2 = new JAXBElementProvider();
+        JAXBElementProvider<org.apache.cxf.jaxrs.fortest.jaxb.SuperBook2> provider2 
+            = new JAXBElementProvider<org.apache.cxf.jaxrs.fortest.jaxb.SuperBook2>();
         ByteArrayInputStream is = new ByteArrayInputStream(bos.toByteArray());
-        org.apache.cxf.jaxrs.fortest.jaxb.SuperBook2 book = 
-            (org.apache.cxf.jaxrs.fortest.jaxb.SuperBook2)provider2.readFrom(
-                       (Class)org.apache.cxf.jaxrs.fortest.jaxb.SuperBook2.class, 
+        org.apache.cxf.jaxrs.fortest.jaxb.SuperBook2 book = provider2.readFrom(
+                       org.apache.cxf.jaxrs.fortest.jaxb.SuperBook2.class, 
                        org.apache.cxf.jaxrs.fortest.jaxb.SuperBook2.class,
                        new Annotation[0], MediaType.TEXT_XML_TYPE, new MetadataMap<String, String>(), is);
         assertEquals(124L, book.getSuperId());
     }
     
-    @SuppressWarnings("unchecked")
     private void readSuperBook(String data, boolean xsiTypeExpected) throws Exception {
         if (xsiTypeExpected) {
             assertTrue(data.contains("xsi:type"));
         }
-        JAXBElementProvider provider = new JAXBElementProvider();
+        JAXBElementProvider<SuperBook> provider = new JAXBElementProvider<SuperBook>();
         ByteArrayInputStream is = new ByteArrayInputStream(data.getBytes());
-        SuperBook book = (SuperBook)provider.readFrom(
-                       (Class)SuperBook.class, SuperBook.class,
+        SuperBook book = provider.readFrom(
+                       SuperBook.class, SuperBook.class,
                        new Annotation[0], MediaType.TEXT_XML_TYPE, new MetadataMap<String, String>(), is);
         assertEquals(124L, book.getSuperId());
     }
     
-    @SuppressWarnings("unchecked")
     @Test
     public void testReadSuperBookWithJaxbElement() throws Exception {
         final String data = "<BookNoRootElement>"
             + "<name>superbook</name><id>111</id>" 
             + "</BookNoRootElement>";
-        JAXBElementProvider provider = new JAXBElementProvider();
+        JAXBElementProvider<BookNoRootElement> provider 
+            = new JAXBElementProvider<BookNoRootElement>();
         provider.setUnmarshallAsJaxbElement(true);
         ByteArrayInputStream is = new ByteArrayInputStream(data.getBytes());
-        BookNoRootElement book = (BookNoRootElement)provider.readFrom(
-                       (Class)BookNoRootElement.class, BookNoRootElement.class,
+        BookNoRootElement book = provider.readFrom(
+                       BookNoRootElement.class, BookNoRootElement.class,
                        new Annotation[0], MediaType.TEXT_XML_TYPE, new MetadataMap<String, String>(), is);
         assertEquals(111L, book.getId());
         assertEquals("superbook", book.getName());
     }
     
-    @SuppressWarnings("unchecked")
     @Test
     public void testReadSuperBookWithJaxbElementAndTransform() throws Exception {
         final String data = "<BookNoRootElement xmlns=\"http://books\">"
             + "<name>superbook</name><id>111</id>" 
             + "</BookNoRootElement>";
-        JAXBElementProvider provider = new JAXBElementProvider();
+        JAXBElementProvider<BookNoRootElement> provider = new JAXBElementProvider<BookNoRootElement>();
         provider.setUnmarshallAsJaxbElement(true);
         provider.setInTransformElements(Collections.singletonMap(
              "{http://books}*", ""));
         ByteArrayInputStream is = new ByteArrayInputStream(data.getBytes());
-        BookNoRootElement book = (BookNoRootElement)provider.readFrom(
-                       (Class)BookNoRootElement.class, BookNoRootElement.class,
+        BookNoRootElement book = provider.readFrom(
+                       BookNoRootElement.class, BookNoRootElement.class,
                        new Annotation[0], MediaType.TEXT_XML_TYPE, new MetadataMap<String, String>(), is);
         assertEquals(111L, book.getId());
         assertEquals("superbook", book.getName());
     }
     
-    @SuppressWarnings("unchecked")
     private void readSuperBook2(String data, boolean unmarshalAsJaxbElement) throws Exception {
-        JAXBElementProvider provider = new JAXBElementProvider();
+        JAXBElementProvider<org.apache.cxf.jaxrs.fortest.jaxb.SuperBook> provider 
+            = new JAXBElementProvider<org.apache.cxf.jaxrs.fortest.jaxb.SuperBook>();
         if (!unmarshalAsJaxbElement) {
             provider.setJaxbElementClassMap(Collections.singletonMap(
                 org.apache.cxf.jaxrs.fortest.jaxb.SuperBook.class.getName(), "SuperBook"));
@@ -563,16 +560,15 @@ public class JAXBElementProviderTest ext
             provider.setUnmarshallAsJaxbElement(true);
         }
         ByteArrayInputStream is = new ByteArrayInputStream(data.getBytes());
-        org.apache.cxf.jaxrs.fortest.jaxb.SuperBook book = 
-            (org.apache.cxf.jaxrs.fortest.jaxb.SuperBook)provider.readFrom(
-                       (Class)org.apache.cxf.jaxrs.fortest.jaxb.SuperBook.class, 
+        org.apache.cxf.jaxrs.fortest.jaxb.SuperBook book = provider.readFrom(
+                       org.apache.cxf.jaxrs.fortest.jaxb.SuperBook.class, 
                        org.apache.cxf.jaxrs.fortest.jaxb.SuperBook.class,
                        new Annotation[0], MediaType.TEXT_XML_TYPE, new MetadataMap<String, String>(), is);
         assertEquals(124L, book.getSuperId());
     }
     
     private void doTestWriteJAXBCollection(String mName) throws Exception {
-        JAXBElementProvider provider = new JAXBElementProvider();
+        JAXBElementProvider<List<?>> provider = new JAXBElementProvider<List<?>>();
         List<JAXBElement<Book>> books = new ArrayList<JAXBElement<Book>>();
         books.add(new JAXBElement<Book>(new QName("Books"), Book.class, null, 
             new Book("CXF in Action", 123L)));
@@ -588,7 +584,7 @@ public class JAXBElementProviderTest ext
     
     @Test
     public void testWriteQualifiedCollection() throws Exception {
-        JAXBElementProvider provider = new JAXBElementProvider();
+        JAXBElementProvider<List<TagVO2>> provider = new JAXBElementProvider<List<TagVO2>>();
         provider.setCollectionWrapperName("{http://tags}tags");
         List<TagVO2> tags = new ArrayList<TagVO2>();
         tags.add(new TagVO2("A", "B"));
@@ -626,12 +622,11 @@ public class JAXBElementProviderTest ext
         readAppendElementsNoNs(data, Collections.singletonMap("list", "tags"));
     }
     
-    @SuppressWarnings("unchecked")
     private void readAppendElementsNoNs(String data, Map<String, String> appendMap) throws Exception {
-        JAXBElementProvider provider = new JAXBElementProvider();
+        JAXBElementProvider<ManyTags> provider = new JAXBElementProvider<ManyTags>();
         provider.setInAppendElements(appendMap);
         ByteArrayInputStream is = new ByteArrayInputStream(data.getBytes());
-        Object o = provider.readFrom((Class)ManyTags.class, ManyTags.class,
+        Object o = provider.readFrom(ManyTags.class, ManyTags.class,
                       new Annotation[0], MediaType.TEXT_XML_TYPE, new MetadataMap<String, String>(), is);
         ManyTags holder = (ManyTags)o;
         assertNotNull(holder);    
@@ -642,14 +637,13 @@ public class JAXBElementProviderTest ext
     
     
     @Test
-    @SuppressWarnings("unchecked")
     public void testInDropElement() throws Exception {
         String data = "<Extra><ManyTags><tags><list><group>b</group><name>a</name></list></tags>"
             + "</ManyTags></Extra>";
-        JAXBElementProvider provider = new JAXBElementProvider();
+        JAXBElementProvider<ManyTags> provider = new JAXBElementProvider<ManyTags>();
         provider.setInDropElements(Collections.singletonList("Extra"));
         ByteArrayInputStream is = new ByteArrayInputStream(data.getBytes());
-        Object o = provider.readFrom((Class)ManyTags.class, ManyTags.class,
+        Object o = provider.readFrom(ManyTags.class, ManyTags.class,
                       new Annotation[0], MediaType.TEXT_XML_TYPE, new MetadataMap<String, String>(), is);
         ManyTags holder = (ManyTags)o;
         assertNotNull(holder);    
@@ -674,32 +668,30 @@ public class JAXBElementProviderTest ext
     }
     
     
-    @SuppressWarnings("unchecked")
     private void readTagVO2AfterTransform(String data, String keyValue) throws Exception {
-        JAXBElementProvider provider = new JAXBElementProvider();
+        JAXBElementProvider<TagVO2> provider = new JAXBElementProvider<TagVO2>();
         Map<String, String> map = new HashMap<String, String>();
         map.put(keyValue, "{http://tags}thetag");
         provider.setInTransformElements(map);
         ByteArrayInputStream is = new ByteArrayInputStream(data.getBytes());
-        Object o = provider.readFrom((Class)TagVO2.class, TagVO2.class,
+        Object o = provider.readFrom(TagVO2.class, TagVO2.class,
                       new Annotation[0], MediaType.TEXT_XML_TYPE, new MetadataMap<String, String>(), is);
         TagVO2 tag2 = (TagVO2)o;
         assertEquals("A", tag2.getName());
         assertEquals("B", tag2.getGroup());    
     }
     
-    @SuppressWarnings("unchecked")
     @Test
     public void testInNsElementsFromLocals() throws Exception {
         String data = "<?xml version='1.0' encoding='UTF-8'?>"
             + "<tagholder><thetag><group>B</group><name>A</name></thetag></tagholder>";
-        JAXBElementProvider provider = new JAXBElementProvider();
+        JAXBElementProvider<TagVO2Holder> provider = new JAXBElementProvider<TagVO2Holder>();
         Map<String, String> map = new HashMap<String, String>();
         map.put("tagholder", "{http://tags}tagholder");
         map.put("thetag", "{http://tags}thetag");
         provider.setInTransformElements(map);
         ByteArrayInputStream is = new ByteArrayInputStream(data.getBytes());
-        Object o = provider.readFrom((Class)TagVO2Holder.class, TagVO2Holder.class,
+        Object o = provider.readFrom(TagVO2Holder.class, TagVO2Holder.class,
                       new Annotation[0], MediaType.TEXT_XML_TYPE, new MetadataMap<String, String>(), is);
         TagVO2Holder holder = (TagVO2Holder)o;
         TagVO2 tag2 = holder.getTagValue();
@@ -707,19 +699,18 @@ public class JAXBElementProviderTest ext
         assertEquals("B", tag2.getGroup());    
     }
     
-    @SuppressWarnings("unchecked")
     @Test
     public void testInNsElementsFromLocalsWildcard() throws Exception {
         String data = "<?xml version='1.0' encoding='UTF-8'?>"
             + "<tagholder><thetag><group>B</group><name>A</name></thetag></tagholder>";
-        JAXBElementProvider provider = new JAXBElementProvider();
+        JAXBElementProvider<TagVO2Holder> provider = new JAXBElementProvider<TagVO2Holder>();
         Map<String, String> map = new LinkedHashMap<String, String>();
         map.put("group", "group");
         map.put("name", "name");
         map.put("*", "{http://tags}*");
         provider.setInTransformElements(map);
         ByteArrayInputStream is = new ByteArrayInputStream(data.getBytes());
-        Object o = provider.readFrom((Class)TagVO2Holder.class, TagVO2Holder.class,
+        Object o = provider.readFrom(TagVO2Holder.class, TagVO2Holder.class,
                       new Annotation[0], MediaType.TEXT_XML_TYPE, new MetadataMap<String, String>(), is);
         TagVO2Holder holder = (TagVO2Holder)o;
         TagVO2 tag2 = holder.getTagValue();
@@ -727,20 +718,19 @@ public class JAXBElementProviderTest ext
         assertEquals("B", tag2.getGroup());    
     }
     
-    @SuppressWarnings("unchecked")
     @Test
     public void testInNsElementsFromLocalsWildcard2() throws Exception {
         String data = "<?xml version='1.0' encoding='UTF-8'?>"
             + "<ns2:tagholder xmlns:ns2=\"http://tags2\" attr=\"attribute\"><ns2:thetag><group>B</group>"
             + "<name>A</name></ns2:thetag></ns2:tagholder>";
-        JAXBElementProvider provider = new JAXBElementProvider();
+        JAXBElementProvider<TagVO2Holder> provider = new JAXBElementProvider<TagVO2Holder>();
         Map<String, String> map = new LinkedHashMap<String, String>();
         map.put("group", "group");
         map.put("name", "name");
         map.put("{http://tags2}*", "{http://tags}*");
         provider.setInTransformElements(map);
         ByteArrayInputStream is = new ByteArrayInputStream(data.getBytes());
-        Object o = provider.readFrom((Class)TagVO2Holder.class, TagVO2Holder.class,
+        Object o = provider.readFrom(TagVO2Holder.class, TagVO2Holder.class,
                       new Annotation[0], MediaType.TEXT_XML_TYPE, new MetadataMap<String, String>(), is);
         TagVO2Holder holder = (TagVO2Holder)o;
         TagVO2 tag2 = holder.getTagValue();
@@ -748,14 +738,13 @@ public class JAXBElementProviderTest ext
         assertEquals("B", tag2.getGroup());    
     }
     
-    @SuppressWarnings("unchecked")
     private void readTagVOAfterTransform(String data, String keyValue) throws Exception {
-        JAXBElementProvider provider = new JAXBElementProvider();
+        JAXBElementProvider<TagVO> provider = new JAXBElementProvider<TagVO>();
         Map<String, String> map = new HashMap<String, String>();
         map.put(keyValue, "tagVO");
         provider.setInTransformElements(map);
         ByteArrayInputStream is = new ByteArrayInputStream(data.getBytes());
-        Object o = provider.readFrom((Class)TagVO.class, TagVO.class,
+        Object o = provider.readFrom(TagVO.class, TagVO.class,
                       new Annotation[0], MediaType.TEXT_XML_TYPE, new MetadataMap<String, String>(), is);
         TagVO tag2 = (TagVO)o;
         assertEquals("A", tag2.getName());
@@ -764,7 +753,7 @@ public class JAXBElementProviderTest ext
     
     @Test
     public void testOutAttributesAsElements() throws Exception {
-        JAXBElementProvider provider = new JAXBElementProvider();
+        JAXBElementProvider<TagVO2Holder> provider = new JAXBElementProvider<TagVO2Holder>();
         Map<String, String> map = new HashMap<String, String>();
         map.put("{http://tags}thetag", "thetag");
         map.put("{http://tags}tagholder", "tagholder");
@@ -785,7 +774,7 @@ public class JAXBElementProviderTest ext
     public void testOutAttributesAsElementsForList() throws Exception {
 
         //Provider
-        JAXBElementProvider provider = new JAXBElementProvider();
+        JAXBElementProvider<List<?>> provider = new JAXBElementProvider<List<?>>();
         provider.setCollectionWrapperName("tagholders");
         Map<String, String> map = new HashMap<String, String>();
         map.put("{http://tags}*", "*");
@@ -821,7 +810,7 @@ public class JAXBElementProviderTest ext
     
     @Test
     public void testOutAppendElementsDiffNs() throws Exception {
-        JAXBElementProvider provider = new JAXBElementProvider();
+        JAXBElementProvider<TagVO2> provider = new JAXBElementProvider<TagVO2>();
         Map<String, String> map = new HashMap<String, String>();
         map.put("{http://tags}thetag", "{http://tagsvo2}t");
         provider.setOutAppendElements(map);
@@ -836,7 +825,7 @@ public class JAXBElementProviderTest ext
     
     @Test
     public void testOutAppendNsElementBeforeLocal() throws Exception {
-        JAXBElementProvider provider = new JAXBElementProvider();
+        JAXBElementProvider<TagVO> provider = new JAXBElementProvider<TagVO>();
         Map<String, String> map = new HashMap<String, String>();
         map.put("tagVO", "{http://tagsvo2}t");
         provider.setOutAppendElements(map);
@@ -851,7 +840,7 @@ public class JAXBElementProviderTest ext
     
     @Test
     public void testOutAppendLocalBeforeLocal() throws Exception {
-        JAXBElementProvider provider = new JAXBElementProvider();
+        JAXBElementProvider<TagVO> provider = new JAXBElementProvider<TagVO>();
         Map<String, String> map = new HashMap<String, String>();
         map.put("tagVO", "supertag");
         provider.setOutAppendElements(map);
@@ -866,7 +855,7 @@ public class JAXBElementProviderTest ext
     
     @Test
     public void testOutAppendElementsSameNs() throws Exception {
-        JAXBElementProvider provider = new JAXBElementProvider();
+        JAXBElementProvider<TagVO2> provider = new JAXBElementProvider<TagVO2>();
         Map<String, String> map = new HashMap<String, String>();
         map.put("{http://tags}thetag", "{http://tags}t");
         provider.setOutAppendElements(map);
@@ -883,7 +872,7 @@ public class JAXBElementProviderTest ext
         
     @Test
     public void testOutElementsMapLocalNsToLocalNs() throws Exception {
-        JAXBElementProvider provider = new JAXBElementProvider();
+        JAXBElementProvider<TagVO2> provider = new JAXBElementProvider<TagVO2>();
         Map<String, String> map = new HashMap<String, String>();
         map.put("{http://tags}thetag", "{http://tagsvo2}t");
         provider.setOutTransformElements(map);
@@ -899,7 +888,7 @@ public class JAXBElementProviderTest ext
     
     @Test
     public void testOutElementsMapLocalNsToLocal() throws Exception {
-        JAXBElementProvider provider = new JAXBElementProvider();
+        JAXBElementProvider<TagVO2> provider = new JAXBElementProvider<TagVO2>();
         Map<String, String> map = new HashMap<String, String>();
         map.put("{http://tags}thetag", "t");
         provider.setOutTransformElements(map);
@@ -914,7 +903,7 @@ public class JAXBElementProviderTest ext
     
     @Test
     public void testOutElementsMapLocalNsToLocalWildcard() throws Exception {
-        JAXBElementProvider provider = new JAXBElementProvider();
+        JAXBElementProvider<TagVO2Holder> provider = new JAXBElementProvider<TagVO2Holder>();
         Map<String, String> map = new HashMap<String, String>();
         map.put("{http://tags}*", "*");
         provider.setOutTransformElements(map);
@@ -931,7 +920,7 @@ public class JAXBElementProviderTest ext
     
     @Test
     public void testOutElementsMapLocalNsToLocalWildcard2() throws Exception {
-        JAXBElementProvider provider = new JAXBElementProvider();
+        JAXBElementProvider<TagVO2Holder> provider = new JAXBElementProvider<TagVO2Holder>();
         Map<String, String> map = new HashMap<String, String>();
         map.put("{http://tags}*", "{http://tags2}*");
         provider.setOutTransformElements(map);
@@ -950,7 +939,7 @@ public class JAXBElementProviderTest ext
     
     @Test
     public void testOutElementsMapLocalToLocalNs() throws Exception {
-        JAXBElementProvider provider = new JAXBElementProvider();
+        JAXBElementProvider<TagVO> provider = new JAXBElementProvider<TagVO>();
         Map<String, String> map = new HashMap<String, String>();
         map.put("tagVO", "{http://tags}thetag");
         provider.setOutTransformElements(map);
@@ -965,7 +954,7 @@ public class JAXBElementProviderTest ext
     
     @Test
     public void testOutElementsMapLocalToLocal() throws Exception {
-        JAXBElementProvider provider = new JAXBElementProvider();
+        JAXBElementProvider<TagVO> provider = new JAXBElementProvider<TagVO>();
         Map<String, String> map = new HashMap<String, String>();
         map.put("tagVO", "thetag");
         map.put("group", "group2");
@@ -981,7 +970,7 @@ public class JAXBElementProviderTest ext
     
     @Test
     public void testDropElements() throws Exception {
-        JAXBElementProvider provider = new JAXBElementProvider();
+        JAXBElementProvider<ManyTags> provider = new JAXBElementProvider<ManyTags>();
         List<String> list = new ArrayList<String>();
         list.add("tagVO");
         list.add("ManyTags");
@@ -1002,7 +991,7 @@ public class JAXBElementProviderTest ext
     
     @Test
     public void testDropQualifiedElements() throws Exception {
-        JAXBElementProvider provider = new JAXBElementProvider();
+        JAXBElementProvider<TagVO2> provider = new JAXBElementProvider<TagVO2>();
         List<String> list = new ArrayList<String>();
         list.add("{http://tags}thetag");
         provider.setOutDropElements(list);
@@ -1027,11 +1016,10 @@ public class JAXBElementProviderTest ext
     }
     
     @Test
-    @SuppressWarnings("unchecked")
     public void testReadMalformedXML() throws Exception {
-        JAXBElementProvider provider = new JAXBElementProvider();
+        JAXBElementProvider<Book> provider = new JAXBElementProvider<Book>();
         try {
-            provider.readFrom((Class)Book.class, Book.class,
+            provider.readFrom(Book.class, Book.class,
                        new Annotation[0], MediaType.TEXT_XML_TYPE, new MetadataMap<String, String>(), 
                        new ByteArrayInputStream("<Book>".getBytes()));
             fail("404 is expected");
@@ -1041,13 +1029,13 @@ public class JAXBElementProviderTest ext
     }
     
     @SuppressWarnings("unchecked")
-    private void doReadUnqualifiedCollection(String data, String mName, Class<?> type) throws Exception {
-        JAXBElementProvider provider = new JAXBElementProvider();
+    private <T> void doReadUnqualifiedCollection(String data, String mName, Class<T> type) throws Exception {
+        JAXBElementProvider<T> provider = new JAXBElementProvider<T>();
         Method m = CollectionsResource.class.getMethod(mName, 
                                                        new Class[]{type});
         ByteArrayInputStream is = new ByteArrayInputStream(data.getBytes());
         Object o = provider.readFrom(
-                      (Class)m.getParameterTypes()[0], m.getGenericParameterTypes()[0],
+                       type, m.getGenericParameterTypes()[0],
                        new Annotation[0], MediaType.TEXT_XML_TYPE, new MetadataMap<String, String>(), is);
         assertNotNull(o);
         Book b1 = null;
@@ -1092,7 +1080,9 @@ public class JAXBElementProviderTest ext
     }
     
     @SuppressWarnings("unchecked")
-    public void doReadQualifiedCollection(String data, boolean isArray) throws Exception {
+    public void doReadQualifiedCollection(String data,
+                                          boolean isArray) throws Exception {
+        @SuppressWarnings("rawtypes")
         JAXBElementProvider provider = new JAXBElementProvider();
         Method m = null;
         if (!isArray) {
@@ -1103,7 +1093,7 @@ public class JAXBElementProviderTest ext
         
         ByteArrayInputStream is = new ByteArrayInputStream(data.getBytes());
         Object o = provider.readFrom(
-                      (Class)m.getParameterTypes()[0], m.getGenericParameterTypes()[0],
+                       m.getParameterTypes()[0], m.getGenericParameterTypes()[0],
                        new Annotation[0], MediaType.TEXT_XML_TYPE, new MetadataMap<String, String>(), is);
         assertNotNull(o);
         TagVO2 t1 = null;
@@ -1126,7 +1116,7 @@ public class JAXBElementProviderTest ext
     
     @Test
     public void testSetSchemasFromClasspath() {
-        JAXBElementProvider provider = new JAXBElementProvider();
+        JAXBElementProvider<?> provider = new JAXBElementProvider<Object>();
         List<String> locations = new ArrayList<String>();
         locations.add("classpath:/test.xsd");
         provider.setSchemas(locations);
@@ -1136,7 +1126,7 @@ public class JAXBElementProviderTest ext
     
     @Test
     public void testSetSchemasFromDisk() throws Exception {
-        JAXBElementProvider provider = new JAXBElementProvider();
+        JAXBElementProvider<?> provider = new JAXBElementProvider<Object>();
         List<String> locations = new ArrayList<String>();
         String loc = getClass().getClassLoader().getResource("test.xsd").toURI().getPath();
         
@@ -1148,7 +1138,7 @@ public class JAXBElementProviderTest ext
     
     @Test
     public void testWriteWithValidation() throws Exception {
-        JAXBElementProvider provider = new JAXBElementProvider();
+        JAXBElementProvider<Book2> provider = new JAXBElementProvider<Book2>();
         List<String> locations = new ArrayList<String>();
         String loc = getClass().getClassLoader().getResource("book1.xsd").toURI().getPath();
         locations.add(loc);
@@ -1170,7 +1160,7 @@ public class JAXBElementProviderTest ext
     
     @Test
     public void testWriteWithFailedValidation() throws Exception {
-        JAXBElementProvider provider = new JAXBElementProvider();
+        JAXBElementProvider<Book2> provider = new JAXBElementProvider<Book2>();
         List<String> locations = new ArrayList<String>();
         String loc = getClass().getClassLoader().getResource("test.xsd").toURI().getPath();
         locations.add(loc);
@@ -1195,7 +1185,7 @@ public class JAXBElementProviderTest ext
     
     @Test 
     public void testIsReadableWithJaxbIndex() {
-        JAXBElementProvider p = new JAXBElementProvider();
+        JAXBElementProvider<TestBean> p = new JAXBElementProvider<TestBean>();
         assertTrue(p.isReadable(TestBean.class, 
                                 TestBean.class, 
                                 new Annotation[]{}, MediaType.APPLICATION_XML_TYPE));
@@ -1203,7 +1193,7 @@ public class JAXBElementProviderTest ext
     
     @Test 
     public void testResponseIsNotReadable() {
-        JAXBElementProvider p = new JAXBElementProvider();
+        JAXBElementProvider<Response> p = new JAXBElementProvider<Response>();
         assertFalse(p.isReadable(Response.class, 
                                  Response.class, 
                                  new Annotation[]{}, MediaType.APPLICATION_XML_TYPE));
@@ -1211,7 +1201,7 @@ public class JAXBElementProviderTest ext
     
     @Test 
     public void testResponseIsNotReadable2() {
-        JAXBElementProvider p = new JAXBElementProvider();
+        JAXBElementProvider<Response> p = new JAXBElementProvider<Response>();
         p.setUnmarshallAsJaxbElement(true);
         assertFalse(p.isReadable(Response.class, 
                                  Response.class, 
@@ -1221,14 +1211,15 @@ public class JAXBElementProviderTest ext
     
     @Test 
     public void testXMLSourceIsNotReadable() {
-        JAXBElementProvider p = new JAXBElementProvider();
+        JAXBElementProvider<XMLSource> p = new JAXBElementProvider<XMLSource>();
         assertFalse(p.isReadable(XMLSource.class, 
                                  XMLSource.class, 
                                  new Annotation[]{}, MediaType.APPLICATION_XML_TYPE));
     }
     @Test 
     public void testPackageContextObjectFactory() {
-        JAXBElementProvider p = new JAXBElementProvider();
+        JAXBElementProvider<org.apache.cxf.jaxrs.fortest.jaxb.Book> p 
+            = new JAXBElementProvider<org.apache.cxf.jaxrs.fortest.jaxb.Book>();
         assertTrue(p.isReadable(org.apache.cxf.jaxrs.fortest.jaxb.Book.class, 
                                 org.apache.cxf.jaxrs.fortest.jaxb.Book.class, 
                                 new Annotation[]{}, MediaType.APPLICATION_XML_TYPE));
@@ -1253,7 +1244,7 @@ public class JAXBElementProviderTest ext
         
         final TestMarshaller m = new TestMarshaller();
         
-        JAXBElementProvider provider = new JAXBElementProvider() {
+        JAXBElementProvider<Object> provider = new JAXBElementProvider<Object>() {
             @Override
             protected Marshaller createMarshaller(Object obj, Class<?> cls, Type genericType, String enc)
                 throws JAXBException {



Mime
View raw message