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 2014/12/14 23:57:04 UTC

svn commit: r1645538 - in /directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test: ./ src/test/java/org/apache/directory/api/osgi/

Author: seelmann
Date: Sun Dec 14 22:57:04 2014
New Revision: 1645538

URL: http://svn.apache.org/r1645538
Log:
More tests

Added:
    directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiLdapExtrasAciOsgiTest.java
      - copied, changed from r1645524, directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiLdapExtraAciOsgiTest.java
    directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiLdapExtrasCodecApiOsgiTest.java
    directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiLdapNetMinaOsgiTest.java
    directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiLdapSchemaConverterOsgiTest.java
Removed:
    directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiLdapExtraAciOsgiTest.java
Modified:
    directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/pom.xml

Modified: directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/pom.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/pom.xml?rev=1645538&r1=1645537&r2=1645538&view=diff
==============================================================================
--- directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/pom.xml (original)
+++ directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/pom.xml Sun Dec 14 22:57:04 2014
@@ -38,7 +38,7 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.directory.api</groupId>
-            <artifactId>api-ldap-codec-core</artifactId>
+            <artifactId>api-ldap-net-mina</artifactId>
             <version>${api.version}</version>
             <exclusions>
                 <exclusion>
@@ -60,10 +60,32 @@
         </dependency>
         <dependency>
             <groupId>org.apache.directory.api</groupId>
+            <artifactId>api-ldap-schema-converter</artifactId>
+            <version>${api.version}</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>antlr</groupId>
+                    <artifactId>antlr</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.directory.api</groupId>
             <artifactId>api-ldap-extras-aci</artifactId>
             <version>${api.version}</version>
             <exclusions>
                 <exclusion>
+                    <groupId>antlr</groupId>
+                    <artifactId>antlr</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.directory.api</groupId>
+            <artifactId>api-ldap-extras-codec-api</artifactId>
+            <version>${api.version}</version>
+            <exclusions>
+                <exclusion>
                     <groupId>antlr</groupId>
                     <artifactId>antlr</artifactId>
                 </exclusion>

Copied: directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiLdapExtrasAciOsgiTest.java (from r1645524, directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiLdapExtraAciOsgiTest.java)
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiLdapExtrasAciOsgiTest.java?p2=directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiLdapExtrasAciOsgiTest.java&p1=directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiLdapExtraAciOsgiTest.java&r1=1645524&r2=1645538&rev=1645538&view=diff
==============================================================================
--- directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiLdapExtraAciOsgiTest.java (original)
+++ directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiLdapExtrasAciOsgiTest.java Sun Dec 14 22:57:04 2014
@@ -28,7 +28,7 @@ import org.apache.directory.api.ldap.aci
 import org.apache.directory.api.ldap.aci.UserClass;
 
 
-public class ApiLdapExtraAciOsgiTest extends ApiOsgiTestBase
+public class ApiLdapExtrasAciOsgiTest extends ApiOsgiTestBase
 {
 
     @Override

Added: directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiLdapExtrasCodecApiOsgiTest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiLdapExtrasCodecApiOsgiTest.java?rev=1645538&view=auto
==============================================================================
--- directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiLdapExtrasCodecApiOsgiTest.java (added)
+++ directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiLdapExtrasCodecApiOsgiTest.java Sun Dec 14 22:57:04 2014
@@ -0,0 +1,63 @@
+/*
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *   or more contributor license agreements.  See the NOTICE file
+ *   distributed with this work for additional information
+ *   regarding copyright ownership.  The ASF licenses this file
+ *   to you under the Apache License, Version 2.0 (the
+ *   "License"); you may not use this file except in compliance
+ *   with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing,
+ *   software distributed under the License is distributed on an
+ *   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *   KIND, either express or implied.  See the License for the
+ *   specific language governing permissions and limitations
+ *   under the License.
+ *
+ */
+package org.apache.directory.api.osgi;
+
+
+import org.apache.directory.api.ldap.extras.controls.SynchronizationModeEnum;
+import org.apache.directory.api.ldap.extras.controls.ad.AdDirSyncImpl;
+import org.apache.directory.api.ldap.extras.controls.ppolicy.PasswordPolicyImpl;
+import org.apache.directory.api.ldap.extras.controls.syncrepl.syncInfoValue.SyncInfoValueImpl;
+import org.apache.directory.api.ldap.extras.controls.syncrepl.syncState.SyncStateValueImpl;
+import org.apache.directory.api.ldap.extras.extended.pwdModify.PasswordModifyRequestImpl;
+import org.apache.directory.api.ldap.extras.extended.pwdModify.PasswordModifyResponseImpl;
+import org.apache.directory.api.ldap.extras.extended.startTls.StartTlsRequestImpl;
+import org.apache.directory.api.ldap.extras.extended.startTls.StartTlsResponseImpl;
+import org.apache.directory.api.ldap.extras.extended.whoAmI.WhoAmIRequestImpl;
+import org.apache.directory.api.ldap.extras.extended.whoAmI.WhoAmIResponseImpl;
+import org.apache.directory.api.ldap.model.name.Dn;
+
+
+public class ApiLdapExtrasCodecApiOsgiTest extends ApiOsgiTestBase
+{
+
+    @Override
+    protected String getBundleName()
+    {
+        return "org.apache.directory.api.ldap.extras.codec.api";
+    }
+
+
+    @Override
+    protected void useBundleClasses() throws Exception
+    {
+        SynchronizationModeEnum.REFRESH_AND_PERSIST.getValue();
+        new AdDirSyncImpl().getOid();
+        new PasswordPolicyImpl().getOid();
+        new SyncStateValueImpl( true ).getCookie();
+        new SyncInfoValueImpl().getType();
+        new PasswordModifyRequestImpl().getUserIdentity();
+        new PasswordModifyResponseImpl( 5 ).setResponseName( "foo" );
+        new WhoAmIRequestImpl();
+        new WhoAmIResponseImpl().setDn( new Dn( "uid=admin,ou=system" ) );
+        new StartTlsRequestImpl();
+        new StartTlsResponseImpl();
+    }
+
+}

Added: directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiLdapNetMinaOsgiTest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiLdapNetMinaOsgiTest.java?rev=1645538&view=auto
==============================================================================
--- directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiLdapNetMinaOsgiTest.java (added)
+++ directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiLdapNetMinaOsgiTest.java Sun Dec 14 22:57:04 2014
@@ -0,0 +1,73 @@
+/*
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *   or more contributor license agreements.  See the NOTICE file
+ *   distributed with this work for additional information
+ *   regarding copyright ownership.  The ASF licenses this file
+ *   to you under the Apache License, Version 2.0 (the
+ *   "License"); you may not use this file except in compliance
+ *   with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing,
+ *   software distributed under the License is distributed on an
+ *   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *   KIND, either express or implied.  See the License for the
+ *   specific language governing permissions and limitations
+ *   under the License.
+ *
+ */
+package org.apache.directory.api.osgi;
+
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import javax.inject.Inject;
+
+import org.apache.directory.api.ldap.codec.protocol.mina.LdapProtocolCodecFactory;
+import org.apache.directory.api.ldap.codec.protocol.mina.LdapProtocolDecoder;
+import org.apache.directory.api.ldap.codec.protocol.mina.LdapProtocolEncoder;
+import org.junit.Test;
+import org.osgi.framework.ServiceReference;
+
+
+public class ApiLdapNetMinaOsgiTest extends ApiOsgiTestBase
+{
+
+    @Inject
+    LdapProtocolCodecFactory ldapProtocolCodecFactory;
+
+
+    @Override
+    protected String getBundleName()
+    {
+        return "org.apache.directory.api.ldap.net.mina";
+    }
+
+
+    @Override
+    protected void useBundleClasses() throws Exception
+    {
+        new LdapProtocolDecoder();
+        new LdapProtocolEncoder();
+    }
+
+
+    @Test
+    public void testInjectLdapProtocolCodecFactory()
+    {
+        assertNotNull( ldapProtocolCodecFactory );
+    }
+
+
+    @Test
+    public void testLookupLdapProtocolCodecFactory()
+    {
+        ServiceReference serviceReference = context.getServiceReference( LdapProtocolCodecFactory.class.getName() );
+        Object service = context.getService( serviceReference );
+        assertNotNull( service );
+        assertTrue( service instanceof LdapProtocolCodecFactory );
+    }
+
+}

Added: directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiLdapSchemaConverterOsgiTest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiLdapSchemaConverterOsgiTest.java?rev=1645538&view=auto
==============================================================================
--- directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiLdapSchemaConverterOsgiTest.java (added)
+++ directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiLdapSchemaConverterOsgiTest.java Sun Dec 14 22:57:04 2014
@@ -0,0 +1,60 @@
+/*
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *   or more contributor license agreements.  See the NOTICE file
+ *   distributed with this work for additional information
+ *   regarding copyright ownership.  The ASF licenses this file
+ *   to you under the Apache License, Version 2.0 (the
+ *   "License"); you may not use this file except in compliance
+ *   with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing,
+ *   software distributed under the License is distributed on an
+ *   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *   KIND, either express or implied.  See the License for the
+ *   specific language governing permissions and limitations
+ *   under the License.
+ *
+ */
+package org.apache.directory.api.osgi;
+
+
+import java.io.ByteArrayInputStream;
+import java.io.StringWriter;
+import java.io.Writer;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.directory.api.converter.schema.Schema;
+import org.apache.directory.api.converter.schema.SchemaToLdif;
+
+
+public class ApiLdapSchemaConverterOsgiTest extends ApiOsgiTestBase
+{
+
+    @Override
+    protected String getBundleName()
+    {
+        return "org.apache.directory.api.ldap.schema.converter";
+    }
+
+
+    @Override
+    protected void useBundleClasses() throws Exception
+    {
+        List<Schema> schemas = new ArrayList<Schema>();
+
+        Schema schema = new Schema();
+        schema.setName( "foo" );
+        schema.setInput( new ByteArrayInputStream(
+            "attributetype ( 1.3.6.1.4.1.18060.0.4.2.3.14 NAME ( 'at' 'attribute' ) )".getBytes() ) );
+
+        Writer out = new StringWriter( 2048 );
+        schema.setOutput( out );
+        schemas.add( schema );
+
+        SchemaToLdif.transform( schemas );
+    }
+
+}