commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1088082 - /commons/proper/discovery/trunk/src/test/org/apache/commons/discovery/test/TestAll.java
Date Sat, 02 Apr 2011 18:49:41 GMT
Author: simonetripodi
Date: Sat Apr  2 18:49:41 2011
New Revision: 1088082

URL: http://svn.apache.org/viewvc?rev=1088082&view=rev
Log:
tests switched to generics

Modified:
    commons/proper/discovery/trunk/src/test/org/apache/commons/discovery/test/TestAll.java

Modified: commons/proper/discovery/trunk/src/test/org/apache/commons/discovery/test/TestAll.java
URL: http://svn.apache.org/viewvc/commons/proper/discovery/trunk/src/test/org/apache/commons/discovery/test/TestAll.java?rev=1088082&r1=1088081&r2=1088082&view=diff
==============================================================================
--- commons/proper/discovery/trunk/src/test/org/apache/commons/discovery/test/TestAll.java
(original)
+++ commons/proper/discovery/trunk/src/test/org/apache/commons/discovery/test/TestAll.java
Sat Apr  2 18:49:41 2011
@@ -188,10 +188,10 @@ public class TestAll {
         TestInterface1 ti = null;
         
         try {
-            ti = (TestInterface1)DiscoverSingleton.find(null,
-                                   new SPInterface(TestInterface1.class),
+            ti = DiscoverSingleton.find(null,
+                                   new SPInterface<TestInterface1>(TestInterface1.class),
                                    new PropertiesHolder("TestInterface.properties"),
-                                   new DefaultClassHolder(TestImpl1_2.class.getName()));
+                                   new DefaultClassHolder<TestInterface1>(TestImpl1_2.class.getName()));
 
             assertTrue(ti.getClass().getName() + "!=" + TestImpl1_1.class.getName(),
                        ti.getClass().getName().equals(TestImpl1_1.class.getName()));
@@ -207,10 +207,10 @@ public class TestAll {
         TestInterface2 ti = null;
         
         try {
-            ti = (TestInterface2)DiscoverSingleton.find(null,
-                                   new SPInterface(TestInterface2.class),
+            ti = DiscoverSingleton.find(null,
+                                   new SPInterface<TestInterface2>(TestInterface2.class),
                                    null,
-                                   new DefaultClassHolder(TestImpl2_2.class.getName()));
+                                   new DefaultClassHolder<TestInterface2>(TestImpl2_2.class.getName()));
 
             assertTrue(ti.getClass().getName() + "!=" + TestImpl2_1.class.getName(),
                        ti.getClass().getName().equals(TestImpl2_1.class.getName()));
@@ -226,12 +226,12 @@ public class TestAll {
         ClassLoaders loaders = ClassLoaders.getAppLoaders(TestInterface2.class, getClass(),
false);
         String name = "org.apache.commons.discovery.test.TestImpl2_1";
         
-        DiscoverClasses discovery = new DiscoverClasses(loaders);
-        ResourceClassIterator iter = discovery.findResourceClasses(name);
+        DiscoverClasses<TestInterface2> discovery = new DiscoverClasses<TestInterface2>(loaders);
+        ResourceClassIterator<TestInterface2> iter = discovery.findResourceClasses(name);
         while (iter.hasNext()) {
-            ResourceClass resource = iter.nextResourceClass();
+            ResourceClass<TestInterface2> resource = iter.nextResourceClass();
             try {                
-                Class implClass = resource.loadClass();
+                Class<TestInterface2> implClass = resource.loadClass();
                 if ( implClass != null ) {
                     assertEquals("org.apache.commons.discovery.test.TestImpl2_1", implClass.getName());
                     return;
@@ -295,7 +295,7 @@ public class TestAll {
         ClassLoaders loaders = ClassLoaders.getAppLoaders(TestInterface2.class, getClass(),
false);
         
         DiscoverClass discover = new DiscoverClass(loaders);
-        Class implClass = discover.find(TestInterface2.class);
+        Class<?> implClass = discover.find(TestInterface2.class);
         
         assertTrue("Failed to find an implementation class", implClass != null);
         assertEquals("org.apache.commons.discovery.test.TestImpl2_1", implClass.getName());



Mime
View raw message