cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cschnei...@apache.org
Subject svn commit: r1414772 - in /cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw: handlers/JaxRSUtilsTest.java hooks/BundleTestContext.java service/UtilsTest.java util/ClassUtilsTest.java
Date Wed, 28 Nov 2012 15:52:27 GMT
Author: cschneider
Date: Wed Nov 28 15:52:25 2012
New Revision: 1414772

URL: http://svn.apache.org/viewvc?rev=1414772&view=rev
Log:
Fixing some warnings

Removed:
    cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/hooks/BundleTestContext.java
Modified:
    cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/JaxRSUtilsTest.java
    cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/service/UtilsTest.java
    cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/util/ClassUtilsTest.java

Modified: cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/JaxRSUtilsTest.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/JaxRSUtilsTest.java?rev=1414772&r1=1414771&r2=1414772&view=diff
==============================================================================
--- cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/JaxRSUtilsTest.java
(original)
+++ cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/JaxRSUtilsTest.java
Wed Nov 28 15:52:25 2012
@@ -65,6 +65,7 @@ public class JaxRSUtilsTest extends Test
         assertEquals(AegisElementProvider.class.getName(), providers.get(0).getClass().getName());
     }
 
+    @SuppressWarnings("rawtypes")
     public void testServiceProviders() {
         Map<String, Object> props = new HashMap<String, Object>();
         props.put(Constants.RS_PROVIDER_PROP_KEY, new Object[] {
@@ -131,6 +132,7 @@ public class JaxRSUtilsTest extends Test
         assertEquals(JAXBElementProvider.class.getName(), providers.get(1).getClass().getName());
     }
 
+    @SuppressWarnings("rawtypes")
     public void testCustomGlobalProvider() throws Exception {
         ServiceReference sref = EasyMock.createNiceMock(ServiceReference.class);
         BundleContext bc = EasyMock.createNiceMock(BundleContext.class);
@@ -152,6 +154,7 @@ public class JaxRSUtilsTest extends Test
         assertSame(p, providers.get(0));
     }
 
+    @SuppressWarnings("rawtypes")
     public void testNoCustomGlobalProvider() throws Exception {
         ServiceReference sref = EasyMock.createNiceMock(ServiceReference.class);
         BundleContext bc = EasyMock.createNiceMock(BundleContext.class);
@@ -173,6 +176,7 @@ public class JaxRSUtilsTest extends Test
         assertEquals(0, providers.size());
     }
 
+    @SuppressWarnings("rawtypes")
     public void testCustomGlobalProviderExpected() throws Exception {
         ServiceReference sref = EasyMock.createNiceMock(ServiceReference.class);
         BundleContext bc = EasyMock.createNiceMock(BundleContext.class);

Modified: cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/service/UtilsTest.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/service/UtilsTest.java?rev=1414772&r1=1414771&r2=1414772&view=diff
==============================================================================
--- cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/service/UtilsTest.java
(original)
+++ cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/service/UtilsTest.java
Wed Nov 28 15:52:25 2012
@@ -18,6 +18,7 @@
  */
 package org.apache.cxf.dosgi.dsw.service;
 
+import static org.junit.Assert.assertArrayEquals;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 
@@ -58,12 +59,12 @@ public class UtilsTest {
         sl.add(s3);
         sl.add(new Object()); // must be skipped
 
-        assertEquals(null, Utils.normalizeStringPlus(new Object()));
-        assertEquals(new String[] {
+        assertArrayEquals(null, Utils.normalizeStringPlus(new Object()));
+        assertArrayEquals(new String[] {
             s1
         }, Utils.normalizeStringPlus(s1));
-        assertEquals(sa, Utils.normalizeStringPlus(sa));
-        assertEquals(sa, Utils.normalizeStringPlus(sl));
+        assertArrayEquals(sa, Utils.normalizeStringPlus(sa));
+        assertArrayEquals(sa, Utils.normalizeStringPlus(sl));
 
     }
 

Modified: cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/util/ClassUtilsTest.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/util/ClassUtilsTest.java?rev=1414772&r1=1414771&r2=1414772&view=diff
==============================================================================
--- cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/util/ClassUtilsTest.java
(original)
+++ cxf/dosgi/trunk/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/util/ClassUtilsTest.java
Wed Nov 28 15:52:25 2012
@@ -27,25 +27,31 @@ import java.util.Map;
 import junit.framework.TestCase;
 
 public class ClassUtilsTest extends TestCase {
-    @SuppressWarnings("unchecked")
+
     public void testGetInterfaceClass() {
         assertEquals(String.class, ClassUtils.getInterfaceClass("Hello", "java.lang.String"));
         assertNull(ClassUtils.getInterfaceClass("Hello", "java.lang.Integer"));
-        assertEquals(List.class, ClassUtils.getInterfaceClass(new ArrayList(), "java.util.List"));
-        assertEquals(Collection.class, ClassUtils.getInterfaceClass(new ArrayList(), "java.util.Collection"));
+        assertEquals(List.class, ClassUtils.getInterfaceClass(new ArrayList<String>(),
"java.util.List"));
+        assertEquals(Collection.class, ClassUtils.getInterfaceClass(new ArrayList<String>(),
"java.util.Collection"));
     }
     
     public void testGetInterfaceClassFromSubclass() {
 	    assertEquals(Map.class, ClassUtils.getInterfaceClass(new MySubclassFour(), "java.util.Map"));
 	    assertNull(ClassUtils.getInterfaceClass(new MySubclassFour(), "java.util.UnknownType"));
     }
-    static class MyMapSubclass extends HashMap{}
 
+    @SuppressWarnings({ "serial", "rawtypes" })
+    private static class MyMapSubclass extends HashMap{}
+
+    @SuppressWarnings("serial")
     static class MySubclassOne extends MyMapSubclass{}
 
+    @SuppressWarnings("serial")
     static class MySubclassTwo extends MySubclassOne{}
 
+    @SuppressWarnings("serial")
     static class MySubclassThree extends MySubclassTwo{}
 
+    @SuppressWarnings("serial")
     static class MySubclassFour extends MySubclassThree{}
 }



Mime
View raw message