You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by se...@apache.org on 2015/03/29 00:42:14 UTC
svn commit: r1669844 - in /directory/apacheds/trunk/osgi-integ: pom.xml
src/test/java/org/apache/directory/server/osgi/integ/ServerProtocolLdapOsgiTest.java
Author: seelmann
Date: Sat Mar 28 23:42:14 2015
New Revision: 1669844
URL: http://svn.apache.org/r1669844
Log:
Additional OSGi test
Modified:
directory/apacheds/trunk/osgi-integ/pom.xml
directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerProtocolLdapOsgiTest.java
Modified: directory/apacheds/trunk/osgi-integ/pom.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/osgi-integ/pom.xml?rev=1669844&r1=1669843&r2=1669844&view=diff
==============================================================================
--- directory/apacheds/trunk/osgi-integ/pom.xml (original)
+++ directory/apacheds/trunk/osgi-integ/pom.xml Sat Mar 28 23:42:14 2015
@@ -199,7 +199,11 @@
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
</dependency>
-
+ <dependency>
+ <groupId>org.apache.directory.api</groupId>
+ <artifactId>api-ldap-net-mina</artifactId>
+ <version>${org.apache.directory.api.version}</version>
+ </dependency>
<!-- Test and PAX dependencies -->
<dependency>
Modified: directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerProtocolLdapOsgiTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerProtocolLdapOsgiTest.java?rev=1669844&r1=1669843&r2=1669844&view=diff
==============================================================================
--- directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerProtocolLdapOsgiTest.java (original)
+++ directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerProtocolLdapOsgiTest.java Sat Mar 28 23:42:14 2015
@@ -20,6 +20,12 @@
package org.apache.directory.server.osgi.integ;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import org.apache.directory.api.ldap.codec.api.LdapApiServiceFactory;
+import org.apache.directory.api.ldap.codec.protocol.mina.LdapProtocolCodecFactory;
import org.apache.directory.server.ldap.LdapProtocolUtils;
import org.apache.directory.server.ldap.LdapServer;
import org.apache.directory.server.ldap.LdapSession;
@@ -33,6 +39,7 @@ import org.apache.directory.server.ldap.
import org.apache.directory.server.ldap.replication.consumer.ReplicationConsumerImpl;
import org.apache.directory.server.ldap.replication.provider.SyncReplRequestHandler;
import org.apache.mina.core.session.DummySession;
+import org.junit.Test;
public class ServerProtocolLdapOsgiTest extends ServerOsgiTestBase
@@ -62,4 +69,23 @@ public class ServerProtocolLdapOsgiTest
new SyncReplRequestHandler();
}
+
+ @Test
+ public void testLdapApiServiceFactoryIsInitializedByOsgi()
+ {
+ assertTrue( LdapApiServiceFactory.isInitialized() );;
+ assertFalse( LdapApiServiceFactory.isUsingStandaloneImplementation() );
+ assertNotNull( LdapApiServiceFactory.getSingleton() );
+ assertNotNull( LdapApiServiceFactory.getSingleton().getProtocolCodecFactory() );
+ }
+
+
+ @Test
+ public void testLdapServerHasProtocolCodecFactoryInitializedByOsgi()
+ {
+ LdapServer ldapServer = new LdapServer();
+ assertNotNull( ldapServer.getProtocolCodecFactory() );
+ assertTrue( ldapServer.getProtocolCodecFactory() instanceof LdapProtocolCodecFactory );
+ }
+
}