commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r829395 - in /commons/proper/lang/trunk/src/test/org/apache/commons/lang: ArrayUtilsTest.java ValidateTest.java
Date Sat, 24 Oct 2009 16:04:23 GMT
Author: sebb
Date: Sat Oct 24 16:04:22 2009
New Revision: 829395

URL: http://svn.apache.org/viewvc?rev=829395&view=rev
Log:
Fix internal raw types

Modified:
    commons/proper/lang/trunk/src/test/org/apache/commons/lang/ArrayUtilsTest.java
    commons/proper/lang/trunk/src/test/org/apache/commons/lang/ValidateTest.java

Modified: commons/proper/lang/trunk/src/test/org/apache/commons/lang/ArrayUtilsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/org/apache/commons/lang/ArrayUtilsTest.java?rev=829395&r1=829394&r2=829395&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/test/org/apache/commons/lang/ArrayUtilsTest.java (original)
+++ commons/proper/lang/trunk/src/test/org/apache/commons/lang/ArrayUtilsTest.java Sat Oct
24 16:04:22 2009
@@ -70,7 +70,7 @@
     //-----------------------------------------------------------------------
     public void testConstructor() {
         assertNotNull(new ArrayUtils());
-        Constructor[] cons = ArrayUtils.class.getDeclaredConstructors();
+        Constructor<?>[] cons = ArrayUtils.class.getDeclaredConstructors();
         assertEquals(1, cons.length);
         assertEquals(true, Modifier.isPublic(cons[0].getModifiers()));
         assertEquals(true, Modifier.isPublic(ArrayUtils.class.getModifiers()));
@@ -170,7 +170,7 @@
     
     //-----------------------------------------------------------------------
     public void testToMap() {
-        Map map = ArrayUtils.toMap(new String[][] {{"foo", "bar"}, {"hello", "world"}});
+        Map<?, ?> map = ArrayUtils.toMap(new String[][] {{"foo", "bar"}, {"hello",
"world"}});
         
         assertEquals("bar", map.get("foo"));
         assertEquals("world", map.get("hello"));
@@ -189,7 +189,7 @@
             fail("exception expected");
         } catch (IllegalArgumentException ex) {}
         
-        map = ArrayUtils.toMap(new Object[] {new Map.Entry() {
+        map = ArrayUtils.toMap(new Object[] {new Map.Entry<Object, Object>() {
             public Object getKey() {
                 return "foo";
             }

Modified: commons/proper/lang/trunk/src/test/org/apache/commons/lang/ValidateTest.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/org/apache/commons/lang/ValidateTest.java?rev=829395&r1=829394&r2=829395&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/test/org/apache/commons/lang/ValidateTest.java (original)
+++ commons/proper/lang/trunk/src/test/org/apache/commons/lang/ValidateTest.java Sat Oct 24
16:04:22 2009
@@ -176,9 +176,9 @@
 
     //-----------------------------------------------------------------------
     public void testNotEmptyCollection1() {
-        Collection coll = new ArrayList();
+        Collection<Integer> coll = new ArrayList<Integer>();
         try {
-            Validate.notEmpty((Collection) null);
+            Validate.notEmpty((Collection<?>) null);
             fail("Expecting IllegalArgumentException");
         } catch (IllegalArgumentException ex) {
             assertEquals("The validated collection is empty", ex.getMessage());
@@ -195,9 +195,9 @@
 
     //-----------------------------------------------------------------------
     public void testNotEmptyCollection2() {
-        Collection coll = new ArrayList();
+        Collection<Integer> coll = new ArrayList<Integer>();
         try {
-            Validate.notEmpty((Collection) null, "MSG");
+            Validate.notEmpty((Collection<?>) null, "MSG");
             fail("Expecting IllegalArgumentException");
         } catch (IllegalArgumentException ex) {
             assertEquals("MSG", ex.getMessage());
@@ -214,9 +214,9 @@
 
     //-----------------------------------------------------------------------
     public void testNotEmptyMap1() {
-        Map map = new HashMap();
+        Map<String, Integer> map = new HashMap<String, Integer>();
         try {
-            Validate.notEmpty((Map) null);
+            Validate.notEmpty((Map<?, ?>) null);
             fail("Expecting IllegalArgumentException");
         } catch (IllegalArgumentException ex) {
             assertEquals("The validated map is empty", ex.getMessage());
@@ -233,9 +233,9 @@
 
     //-----------------------------------------------------------------------
     public void testNotEmptyMap2() {
-        Map map = new HashMap();
+        Map<String, Integer> map = new HashMap<String, Integer>();
         try {
-            Validate.notEmpty((Map) null, "MSG");
+            Validate.notEmpty((Map<?, ?>) null, "MSG");
             fail("Expecting IllegalArgumentException");
         } catch (IllegalArgumentException ex) {
             assertEquals("MSG", ex.getMessage());
@@ -510,12 +510,12 @@
 
     //-----------------------------------------------------------------------
     public void testNoNullElementsCollection1() {
-        List coll = new ArrayList();
+        List<String> coll = new ArrayList<String>();
         coll.add("a");
         coll.add("b");
         Validate.noNullElements(coll);
         try {
-            Validate.noNullElements((Collection) null);
+            Validate.noNullElements((Collection<?>) null);
             fail("Expecting IllegalArgumentException");
         } catch (IllegalArgumentException ex) {
             assertEquals("The validated object is null", ex.getMessage());
@@ -531,12 +531,12 @@
 
     //-----------------------------------------------------------------------
     public void testNoNullElementsCollection2() {
-        List coll = new ArrayList();
+        List<String> coll = new ArrayList<String>();
         coll.add("a");
         coll.add("b");
         Validate.noNullElements(coll, "MSG");
         try {
-            Validate.noNullElements((Collection) null, "MSG");
+            Validate.noNullElements((Collection<?>) null, "MSG");
             fail("Expecting IllegalArgumentException");
         } catch (IllegalArgumentException ex) {
             assertEquals("The validated object is null", ex.getMessage());
@@ -552,7 +552,7 @@
 
     //-----------------------------------------------------------------------
     public void testAllElementsOfType() {
-        List coll = new ArrayList();
+        List<Object> coll = new ArrayList<Object>();
         coll.add("a");
         coll.add("b");
         Validate.allElementsOfType(coll, String.class, "MSG");
@@ -571,7 +571,7 @@
             assertEquals("The validated collection contains an element not of type java.lang.String
at index: 1", ex.getMessage());
         }
         
-        coll = new ArrayList();
+        coll = new ArrayList<Object>();
         coll.add(new Integer(5));
         coll.add(new Double(2.0d));
         Validate.allElementsOfType(coll, Number.class, "MSG");
@@ -591,7 +591,7 @@
 
     public void testConstructor() {
         assertNotNull(new Validate());
-        Constructor[] cons = Validate.class.getDeclaredConstructors();
+        Constructor<?>[] cons = Validate.class.getDeclaredConstructors();
         assertEquals(1, cons.length);
         assertEquals(true, Modifier.isPublic(cons[0].getModifiers()));
         assertEquals(true, Modifier.isPublic(Validate.class.getModifiers()));



Mime
View raw message