directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r370810 - /directory/sandbox/trustin/mina-spi/core/src/test/java/org/apache/mina/common/ServiceProviderTest.java
Date Fri, 20 Jan 2006 14:07:42 GMT
Author: trustin
Date: Fri Jan 20 06:07:39 2006
New Revision: 370810

URL: http://svn.apache.org/viewcvs?rev=370810&view=rev
Log:
Related issue: DIRMINA-148 (Provide global service registry which provides IoAcceptors and
IoConnectors using Java SPI.)
* Implemented ServiceProviderTest

Modified:
    directory/sandbox/trustin/mina-spi/core/src/test/java/org/apache/mina/common/ServiceProviderTest.java

Modified: directory/sandbox/trustin/mina-spi/core/src/test/java/org/apache/mina/common/ServiceProviderTest.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trustin/mina-spi/core/src/test/java/org/apache/mina/common/ServiceProviderTest.java?rev=370810&r1=370809&r2=370810&view=diff
==============================================================================
--- directory/sandbox/trustin/mina-spi/core/src/test/java/org/apache/mina/common/ServiceProviderTest.java
(original)
+++ directory/sandbox/trustin/mina-spi/core/src/test/java/org/apache/mina/common/ServiceProviderTest.java
Fri Jan 20 06:07:39 2006
@@ -18,6 +18,13 @@
  */
 package org.apache.mina.common;
 
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import junit.framework.Assert;
 import junit.framework.TestCase;
 
 public class ServiceProviderTest extends TestCase
@@ -30,6 +37,20 @@
 
     public void testDefaultProviders()
     {
-        System.out.println( MINA.getProviders() );
+        Set providers = MINA.getProviders();
+        Assert.assertEquals( 2, providers.size() );
+
+        List providerClassNames = new ArrayList();
+        for( Iterator i = providers.iterator(); i.hasNext(); )
+        {
+            providerClassNames.add( ( ( IoServiceProvider ) i.next() ).getClass().getName()
); 
+        }
+        Collections.sort( providerClassNames );
+        Assert.assertEquals(
+                "org.apache.mina.transport.socket.nio.NioServiceProvider",
+                providerClassNames.get( 0 ) );
+        Assert.assertEquals(
+                "org.apache.mina.transport.vmpipe.VmPipeServiceProvider",
+                providerClassNames.get( 1 ) );
     }
 }



Mime
View raw message