commons-commits mailing list archives

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

URL: http://svn.apache.org/viewvc?rev=1088169&view=rev
Log:
added two test cases that use the DiscoverClass to find SPI class/instance

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=1088169&r1=1088168&r2=1088169&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 22:58:51 2011
@@ -17,6 +17,7 @@
 package org.apache.commons.discovery.test;
 
 import static junit.framework.Assert.assertEquals;
+import static junit.framework.Assert.assertNotNull;
 import static junit.framework.Assert.assertTrue;
 import static junit.framework.Assert.fail;
 
@@ -220,6 +221,22 @@ public class TestAll {
     }
 
     @Test
+    public void findServiceClass() {
+        DiscoverClass discoverClass = new DiscoverClass();
+        Class<? extends TestInterface2> serviceClass = discoverClass.find(TestInterface2.class);
+
+        assertNotNull(serviceClass);
+    }
+
+    @Test
+    public void findServiceClassAndInstantiate() throws Exception {
+        DiscoverClass discoverClass = new DiscoverClass();
+        TestInterface2 serviceImpl = discoverClass.newInstance(TestInterface2.class);
+
+        assertNotNull(serviceImpl);
+    }
+
+    @Test
     public void testLowLevelFind() {
         org.apache.commons.discovery.log.SimpleLog.setLevel(logLevel);
 



Mime
View raw message