commons-commits mailing list archives

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

URL: http://svn.apache.org/viewvc?rev=1088171&view=rev
Log:
reorganized test methods

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=1088171&r1=1088170&r2=1088171&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 23:05:14 2011
@@ -221,14 +221,6 @@ public class TestAll {
     }
 
     @Test
-    public void findServiceClassAndInstantiate() throws Exception {
-        DiscoverClass discoverClass = new DiscoverClass();
-        TestInterface2 serviceImpl = discoverClass.newInstance(TestInterface2.class);
-
-        assertNotNull(serviceImpl);
-    }
-
-    @Test
     public void lowLevelFind() {
         org.apache.commons.discovery.log.SimpleLog.setLevel(logLevel);
 
@@ -311,6 +303,17 @@ public class TestAll {
 
     }
 
+    @Test
+    public void instantiateViaDiscoverClass() throws Exception {
+        ClassLoaders loaders = ClassLoaders.getAppLoaders(TestInterface2.class, getClass(),
false);
+
+        DiscoverClass discoverClass = new DiscoverClass(loaders);
+        TestInterface2 serviceImpl = discoverClass.newInstance(TestInterface2.class);
+
+        assertNotNull(serviceImpl);
+        assertEquals(TestImpl2_1.class, serviceImpl.getClass());
+    }
+
     /**
      * This allows the tests to run as a standalone application.
      */



Mime
View raw message