directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r1647659 - in /directory/apacheds/trunk: ./ osgi-integ/ osgi-integ/src/ osgi-integ/src/main/ osgi-integ/src/main/java/ osgi-integ/src/main/resources/ osgi-integ/src/test/ osgi-integ/src/test/java/ osgi-integ/src/test/java/org/ osgi-integ/sr...
Date Tue, 23 Dec 2014 19:57:32 GMT
Author: seelmann
Date: Tue Dec 23 19:57:31 2014
New Revision: 1647659

URL: http://svn.apache.org/r1647659
Log:
DIRSERVER-2041: Add OSGi (pax-exam) tests for ApacheDS

Added:
    directory/apacheds/trunk/osgi-integ/   (with props)
    directory/apacheds/trunk/osgi-integ/pom.xml
    directory/apacheds/trunk/osgi-integ/src/
    directory/apacheds/trunk/osgi-integ/src/main/
    directory/apacheds/trunk/osgi-integ/src/main/java/
    directory/apacheds/trunk/osgi-integ/src/main/resources/
    directory/apacheds/trunk/osgi-integ/src/test/
    directory/apacheds/trunk/osgi-integ/src/test/java/
    directory/apacheds/trunk/osgi-integ/src/test/java/org/
    directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/
    directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/
    directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/
    directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/
    directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/
    directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerCoreApiOsgiTest.java
    directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerCoreOsgiTest.java
    directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerCoreSharedOsgiTest.java
    directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerI18nOsgiTest.java
    directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerInterceptorsAdminOsgiTest.java
    directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerInterceptorsAuthNOsgiTest.java
    directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerInterceptorsAuthZOsgiTest.java
    directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerInterceptorsNumberOsgiTest.java
    directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerJdbmPartitionOsgiTest.java
    directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerMavibotPartitionOsgiTest.java
    directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerOsgiTestBase.java
    directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerProtocolKerberosOsgiTest.java
    directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerProtocolLdapOsgiTest.java
    directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerServiceBuilderOsgiTest.java
    directory/apacheds/trunk/osgi-integ/src/test/resources/
    directory/apacheds/trunk/osgi-integ/src/test/resources/exam.properties
    directory/apacheds/trunk/osgi-integ/src/test/resources/logback.xml
Modified:
    directory/apacheds/trunk/pom.xml

Propchange: directory/apacheds/trunk/osgi-integ/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Dec 23 19:57:31 2014
@@ -0,0 +1,12 @@
+target
+.project
+.classpath
+.settings
+eclipse-classes
+*.log
+*.iml
+*.ipr
+dependency-reduced-pom.xml
+META-INF
+bin
+

Added: directory/apacheds/trunk/osgi-integ/pom.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/osgi-integ/pom.xml?rev=1647659&view=auto
==============================================================================
--- directory/apacheds/trunk/osgi-integ/pom.xml (added)
+++ directory/apacheds/trunk/osgi-integ/pom.xml Tue Dec 23 19:57:31 2014
@@ -0,0 +1,311 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.apache.directory.server</groupId>
+    <artifactId>apacheds-parent</artifactId>
+    <version>2.0.0-M20-SNAPSHOT</version>
+  </parent>
+
+  <artifactId>apacheds-osgi-integ</artifactId>
+  <name>ApacheDS OSGi Integration Tests</name>
+
+  <dependencies>
+    <!-- Bundles under test -->
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-i18n</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-core</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-core-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-core-annotations</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-core-avl</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-core-constants</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-core-jndi</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-core-shared</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-http-directory-bridge</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-http-integration</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-interceptors-admin</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-interceptors-authn</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-interceptors-authz</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-interceptors-changelog</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-interceptors-collective</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-interceptors-event</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-interceptors-exception</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-interceptors-hash</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-interceptors-journal</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-interceptors-logger</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-interceptors-normalization</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-interceptors-number</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-interceptors-operational</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-interceptors-referral</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-interceptors-schema</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-interceptors-subtree</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-interceptors-trigger</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-protocol-ldap</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-protocol-kerberos</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-protocol-dhcp</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-protocol-dns</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-protocol-ntp</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-protocol-shared</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-xdbm-partition</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-jdbm-partition</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-mavibot-partition</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-ldif-partition</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-server-annotations</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-server-config</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-server-jndi</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-service-builder</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.bouncycastle</groupId>
+      <artifactId>bcprov-jdk15on</artifactId>
+    </dependency>
+    
+
+    <!-- Test and PAX dependencies -->
+    <dependency>
+      <groupId>org.apache.servicemix.bundles</groupId>
+      <artifactId>org.apache.servicemix.bundles.javax-inject</artifactId>
+      <version>1_2</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>ch.qos.logback</groupId>
+      <artifactId>logback-classic</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.ops4j.pax.exam</groupId>
+      <artifactId>pax-exam-container-forked</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.ops4j.pax.exam</groupId>
+      <artifactId>pax-exam-junit4</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.ops4j.pax.exam</groupId>
+      <artifactId>pax-exam-link-mvn</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.ops4j.pax.url</groupId>
+      <artifactId>pax-url-aether</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.felix</groupId>
+      <artifactId>org.apache.felix.framework</artifactId>
+      <scope>test</scope>
+    </dependency>
+<!--         <dependency> -->
+<!--             <groupId>org.eclipse</groupId> -->
+<!--             <artifactId>osgi</artifactId> -->
+<!--             <version>3.9.1-v20140110-1610</version> -->
+<!--             <scope>test</scope> -->
+<!--         </dependency> -->
+  </dependencies>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-dependency-plugin</artifactId>
+        <executions>
+          <execution>
+            <goals>
+              <goal>copy-dependencies</goal>
+            </goals>
+            <phase>generate-resources</phase>
+            <configuration>
+              <includeScope>runtime</includeScope>
+              <outputFile>${project.build.directory}/test-classes/deps.txt</outputFile>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+    <pluginManagement>
+      <plugins>
+        <!--This plugin's configuration is used to store Eclipse m2e settings 
+          only. It has no influence on the Maven build itself. -->
+        <plugin>
+          <groupId>org.eclipse.m2e</groupId>
+          <artifactId>lifecycle-mapping</artifactId>
+          <version>1.0.0</version>
+          <configuration>
+            <lifecycleMappingMetadata>
+              <pluginExecutions>
+                <pluginExecution>
+                  <pluginExecutionFilter>
+                    <groupId>
+                      org.apache.maven.plugins
+                    </groupId>
+                    <artifactId>
+                      maven-dependency-plugin
+                    </artifactId>
+                    <versionRange>
+                      [2.8,)
+                    </versionRange>
+                    <goals>
+                      <goal>copy-dependencies</goal>
+                    </goals>
+                  </pluginExecutionFilter>
+                  <action>
+                    <ignore />
+                  </action>
+                </pluginExecution>
+              </pluginExecutions>
+            </lifecycleMappingMetadata>
+          </configuration>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+  </build>
+
+</project>
\ No newline at end of file

Added: directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerCoreApiOsgiTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerCoreApiOsgiTest.java?rev=1647659&view=auto
==============================================================================
--- directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerCoreApiOsgiTest.java (added)
+++ directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerCoreApiOsgiTest.java Tue Dec 23 19:57:31 2014
@@ -0,0 +1,54 @@
+/*
+ *   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.server.osgi.integ;
+
+
+import org.apache.directory.api.ldap.model.name.Dn;
+import org.apache.directory.api.ldap.schema.manager.impl.DefaultSchemaManager;
+import org.apache.directory.server.core.api.CacheService;
+import org.apache.directory.server.core.api.LdapPrincipal;
+import org.apache.directory.server.core.api.administrative.SubschemaAAP;
+import org.apache.directory.server.core.api.entry.ClonedServerEntry;
+import org.apache.directory.server.core.api.normalization.FilterNormalizingVisitor;
+import org.apache.directory.server.core.api.schema.SchemaPartition;
+
+
+public class ServerCoreApiOsgiTest extends ServerOsgiTestBase
+{
+
+    @Override
+    protected String getBundleName()
+    {
+        return "org.apache.directory.server.core.api";
+    }
+
+
+    @Override
+    protected void useBundleClasses() throws Exception
+    {
+        new CacheService();
+        new LdapPrincipal();
+        new SubschemaAAP( new Dn( "cn=foo" ), "uuid" );
+        new ClonedServerEntry();
+        FilterNormalizingVisitor.isFilterChar( 'a' );
+        new SchemaPartition( new DefaultSchemaManager() );
+    }
+
+}

Added: directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerCoreOsgiTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerCoreOsgiTest.java?rev=1647659&view=auto
==============================================================================
--- directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerCoreOsgiTest.java (added)
+++ directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerCoreOsgiTest.java Tue Dec 23 19:57:31 2014
@@ -0,0 +1,49 @@
+/*
+ *   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.server.osgi.integ;
+
+
+import org.apache.directory.api.ldap.model.entry.DefaultEntry;
+import org.apache.directory.server.core.DefaultDirectoryService;
+import org.apache.directory.server.core.DefaultOperationManager;
+import org.apache.directory.server.core.security.CoreKeyStoreSpi;
+import org.apache.directory.server.core.security.TlsKeyGenerator;
+
+
+public class ServerCoreOsgiTest extends ServerOsgiTestBase
+{
+
+    @Override
+    protected String getBundleName()
+    {
+        return "org.apache.directory.server.core";
+    }
+
+
+    @Override
+    protected void useBundleClasses() throws Exception
+    {
+        DefaultDirectoryService ds = new DefaultDirectoryService();
+        new DefaultOperationManager( ds );
+        new CoreKeyStoreSpi( ds );
+        TlsKeyGenerator.addKeyPair( new DefaultEntry() );
+    }
+
+}

Added: directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerCoreSharedOsgiTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerCoreSharedOsgiTest.java?rev=1647659&view=auto
==============================================================================
--- directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerCoreSharedOsgiTest.java (added)
+++ directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerCoreSharedOsgiTest.java Tue Dec 23 19:57:31 2014
@@ -0,0 +1,48 @@
+/*
+ *   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.server.osgi.integ;
+
+
+import org.apache.directory.api.ldap.model.entry.DefaultEntry;
+import org.apache.directory.server.core.shared.DefaultDnFactory;
+import org.apache.directory.server.core.shared.NullStringSerializer;
+import org.apache.directory.server.core.shared.partition.DefaultPartitionNexus;
+
+
+public class ServerCoreSharedOsgiTest extends ServerOsgiTestBase
+{
+
+    @Override
+    protected String getBundleName()
+    {
+        return "org.apache.directory.server.core.shared";
+    }
+
+
+    @Override
+    protected void useBundleClasses() throws Exception
+    {
+        new DefaultDnFactory( null, null );
+        NullStringSerializer.INSTANCE.serialize( null );
+        NullStringSerializer.INSTANCE.deserialize( null );
+        new DefaultPartitionNexus( new DefaultEntry() );
+    }
+
+}

Added: directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerI18nOsgiTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerI18nOsgiTest.java?rev=1647659&view=auto
==============================================================================
--- directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerI18nOsgiTest.java (added)
+++ directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerI18nOsgiTest.java Tue Dec 23 19:57:31 2014
@@ -0,0 +1,47 @@
+/*
+ *   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.server.osgi.integ;
+
+
+import static org.junit.Assert.assertNotNull;
+
+import org.apache.directory.server.i18n.I18n;
+
+
+public class ServerI18nOsgiTest extends ServerOsgiTestBase
+{
+
+    @Override
+    protected String getBundleName()
+    {
+        return "org.apache.directory.server.i18n";
+    }
+
+
+    @Override
+    protected void useBundleClasses() throws Exception
+    {
+        I18n errorCode = I18n.ERR_10;
+        assertNotNull( errorCode );
+        assertNotNull( errorCode.getErrorCode() );
+        assertNotNull( I18n.err( errorCode ) );
+    }
+
+}

Added: directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerInterceptorsAdminOsgiTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerInterceptorsAdminOsgiTest.java?rev=1647659&view=auto
==============================================================================
--- directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerInterceptorsAdminOsgiTest.java (added)
+++ directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerInterceptorsAdminOsgiTest.java Tue Dec 23 19:57:31 2014
@@ -0,0 +1,42 @@
+/*
+ *   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.server.osgi.integ;
+
+
+import org.apache.directory.server.core.admin.AdministrativePointInterceptor;
+
+
+public class ServerInterceptorsAdminOsgiTest extends ServerOsgiTestBase
+{
+
+    @Override
+    protected String getBundleName()
+    {
+        return "org.apache.directory.server.interceptors.admin";
+    }
+
+
+    @Override
+    protected void useBundleClasses() throws Exception
+    {
+        new AdministrativePointInterceptor();
+    }
+
+}

Added: directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerInterceptorsAuthNOsgiTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerInterceptorsAuthNOsgiTest.java?rev=1647659&view=auto
==============================================================================
--- directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerInterceptorsAuthNOsgiTest.java (added)
+++ directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerInterceptorsAuthNOsgiTest.java Tue Dec 23 19:57:31 2014
@@ -0,0 +1,50 @@
+/*
+ *   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.server.osgi.integ;
+
+
+import org.apache.directory.server.core.authn.AuthenticationInterceptor;
+import org.apache.directory.server.core.authn.DelegatingAuthenticator;
+import org.apache.directory.server.core.authn.SimpleAuthenticator;
+import org.apache.directory.server.core.authn.StrongAuthenticator;
+import org.apache.directory.server.core.authn.ppolicy.PpolicyConfigContainer;
+
+
+public class ServerInterceptorsAuthNOsgiTest extends ServerOsgiTestBase
+{
+
+    @Override
+    protected String getBundleName()
+    {
+        return "org.apache.directory.server.interceptors.authn";
+    }
+
+
+    @Override
+    protected void useBundleClasses() throws Exception
+    {
+        new AuthenticationInterceptor();
+        new DelegatingAuthenticator();
+        new SimpleAuthenticator( 1000 );
+        new StrongAuthenticator();
+        new PpolicyConfigContainer();
+    }
+
+}

Added: directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerInterceptorsAuthZOsgiTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerInterceptorsAuthZOsgiTest.java?rev=1647659&view=auto
==============================================================================
--- directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerInterceptorsAuthZOsgiTest.java (added)
+++ directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerInterceptorsAuthZOsgiTest.java Tue Dec 23 19:57:31 2014
@@ -0,0 +1,47 @@
+/*
+ *   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.server.osgi.integ;
+
+
+import org.apache.directory.api.ldap.schema.manager.impl.DefaultSchemaManager;
+import org.apache.directory.server.core.authz.AciAuthorizationInterceptor;
+import org.apache.directory.server.core.authz.DefaultAuthorizationInterceptor;
+import org.apache.directory.server.core.authz.support.ACDFEngine;
+
+
+public class ServerInterceptorsAuthZOsgiTest extends ServerOsgiTestBase
+{
+
+    @Override
+    protected String getBundleName()
+    {
+        return "org.apache.directory.server.interceptors.authz";
+    }
+
+
+    @Override
+    protected void useBundleClasses() throws Exception
+    {
+        new DefaultAuthorizationInterceptor();
+        new AciAuthorizationInterceptor();
+        new ACDFEngine( new DefaultSchemaManager() );
+    }
+
+}

Added: directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerInterceptorsNumberOsgiTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerInterceptorsNumberOsgiTest.java?rev=1647659&view=auto
==============================================================================
--- directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerInterceptorsNumberOsgiTest.java (added)
+++ directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerInterceptorsNumberOsgiTest.java Tue Dec 23 19:57:31 2014
@@ -0,0 +1,42 @@
+/*
+ *   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.server.osgi.integ;
+
+
+import org.apache.directory.server.core.number.NumberIncrementingInterceptor;
+
+
+public class ServerInterceptorsNumberOsgiTest extends ServerOsgiTestBase
+{
+
+    @Override
+    protected String getBundleName()
+    {
+        return "org.apache.directory.server.interceptors.number";
+    }
+
+
+    @Override
+    protected void useBundleClasses() throws Exception
+    {
+        new NumberIncrementingInterceptor();
+    }
+
+}

Added: directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerJdbmPartitionOsgiTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerJdbmPartitionOsgiTest.java?rev=1647659&view=auto
==============================================================================
--- directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerJdbmPartitionOsgiTest.java (added)
+++ directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerJdbmPartitionOsgiTest.java Tue Dec 23 19:57:31 2014
@@ -0,0 +1,53 @@
+/*
+ *   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.server.osgi.integ;
+
+
+import org.apache.directory.api.ldap.model.name.Dn;
+import org.apache.directory.api.ldap.model.schema.SchemaManager;
+import org.apache.directory.api.ldap.schema.manager.impl.DefaultSchemaManager;
+import org.apache.directory.server.core.partition.impl.btree.jdbm.DnSerializer;
+import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmIndex;
+import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmPartition;
+import org.apache.directory.server.core.partition.impl.btree.jdbm.ParentIdAndRdnSerializer;
+import org.apache.directory.server.core.shared.DefaultDnFactory;
+
+
+public class ServerJdbmPartitionOsgiTest extends ServerOsgiTestBase
+{
+
+    @Override
+    protected String getBundleName()
+    {
+        return "org.apache.directory.server.jdbm.partition";
+    }
+
+
+    @Override
+    protected void useBundleClasses() throws Exception
+    {
+        new JdbmIndex<String>( "foo", false );
+        SchemaManager schemaManager = new DefaultSchemaManager();
+        new JdbmPartition( schemaManager, new DefaultDnFactory( schemaManager, null ) );
+        new ParentIdAndRdnSerializer( schemaManager );
+        new DnSerializer( schemaManager ).serialize( new Dn( "cn=foo" ) );
+    }
+
+}

Added: directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerMavibotPartitionOsgiTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerMavibotPartitionOsgiTest.java?rev=1647659&view=auto
==============================================================================
--- directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerMavibotPartitionOsgiTest.java (added)
+++ directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerMavibotPartitionOsgiTest.java Tue Dec 23 19:57:31 2014
@@ -0,0 +1,56 @@
+/*
+ *   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.server.osgi.integ;
+
+
+import org.apache.directory.api.ldap.model.name.Dn;
+import org.apache.directory.api.ldap.model.schema.SchemaManager;
+import org.apache.directory.api.ldap.schema.manager.impl.DefaultSchemaManager;
+import org.apache.directory.mavibot.btree.BTree;
+import org.apache.directory.mavibot.btree.BTreeFactory;
+import org.apache.directory.server.core.partition.impl.btree.mavibot.DnSerializer;
+import org.apache.directory.server.core.partition.impl.btree.mavibot.MavibotIndex;
+import org.apache.directory.server.core.partition.impl.btree.mavibot.MavibotPartition;
+import org.apache.directory.server.core.shared.DefaultDnFactory;
+
+
+public class ServerMavibotPartitionOsgiTest extends ServerOsgiTestBase
+{
+
+    @Override
+    protected String getBundleName()
+    {
+        return "org.apache.directory.server.mavibot.partition";
+    }
+
+
+    @Override
+    protected void useBundleClasses() throws Exception
+    {
+        new MavibotIndex<String>( "foo", false );
+        SchemaManager schemaManager = new DefaultSchemaManager();
+        new MavibotPartition( schemaManager, new DefaultDnFactory( schemaManager, null ) );
+        new DnSerializer().serialize( new Dn( "cn=foo" ) );
+
+        BTree<Object, Object> mavibotBTree = BTreeFactory.createInMemoryBTree();
+        mavibotBTree.close();
+    }
+
+}

Added: directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerOsgiTestBase.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerOsgiTestBase.java?rev=1647659&view=auto
==============================================================================
--- directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerOsgiTestBase.java (added)
+++ directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerOsgiTestBase.java Tue Dec 23 19:57:31 2014
@@ -0,0 +1,156 @@
+/*
+ *   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.server.osgi.integ;
+
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.ops4j.pax.exam.CoreOptions.composite;
+import static org.ops4j.pax.exam.CoreOptions.junitBundles;
+import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
+import static org.ops4j.pax.exam.CoreOptions.options;
+import static org.ops4j.pax.exam.CoreOptions.systemPackages;
+import static org.ops4j.pax.exam.CoreOptions.systemProperty;
+import static org.ops4j.pax.exam.CoreOptions.url;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import javax.inject.Inject;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.Configuration;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.junit.PaxExam;
+import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
+import org.ops4j.pax.exam.spi.reactors.PerClass;
+import org.ops4j.pax.exam.util.PathUtils;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+
+
+@RunWith(PaxExam.class)
+@ExamReactorStrategy(PerClass.class)
+public abstract class ServerOsgiTestBase
+{
+
+    @Inject
+    protected BundleContext context;
+
+    private static Set<String> SKIPS = new HashSet<String>();
+    static
+    {
+        // SKIPS.add( "antlr-2.7.7.jar" );
+        // SKIPS.add( "xpp3-1.1.4c.jar" );
+        // SKIPS.add( "dom4j-1.6.1.jar" );
+    }
+
+
+    @Configuration
+    public Option[] config() throws IOException
+    {
+        List<Option> dependencies = new ArrayList<Option>();
+
+        URL resource = getClass().getResource( "/" );
+        File targetTestClassesDir = new File( resource.getFile() );
+        File targetDependenciesDir = new File( targetTestClassesDir.getParent(), "dependency" );
+        File[] files = targetDependenciesDir.listFiles();
+        for ( File file : files )
+        {
+            if ( !SKIPS.contains( file.getName() ) )
+            {
+                dependencies.add( url( file.toURI().toString() ) );
+            }
+        }
+
+        // shuffle dependencies, there mustn't be any dependency on order
+        Collections.shuffle( dependencies );
+
+        return options(
+            systemProperty( "org.ops4j.pax.logging.DefaultServiceLog.level" ).value( "WARN" ),
+            systemProperty( "logback.configurationFile" ).value(
+                "file:" + PathUtils.getBaseDir() + "/src/test/resources/logback.xml" ),
+            systemPackages( "javax.xml.stream;version=1.0.0", "javax.xml.stream.util;version=1.0.0",
+                "javax.xml.stream.events;version=1.0.0" ), mavenBundle( "ch.qos.logback", "logback-classic", "1.0.6" ),
+            mavenBundle( "ch.qos.logback", "logback-core", "1.0.6" ), junitBundles(),
+            composite( dependencies.toArray( new Option[0] ) ) );
+    }
+
+
+    @Test
+    public void testInjectContext()
+    {
+        assertNotNull( context );
+    }
+
+
+    @Test
+    public void testBundleActivation()
+    {
+        String bundleName = getBundleName();
+
+        boolean bundleFound = false;
+        boolean bundleActive = false;
+        Bundle[] bundles = context.getBundles();
+        for ( Bundle bundle : bundles )
+        {
+            //System.out.println( "### bundle=" + bundle + " " + bundle.getState() );
+            if ( bundle != null && bundle.getSymbolicName() != null && bundle.getSymbolicName().equals( bundleName ) )
+            {
+                bundleFound = true;
+                if ( bundle.getState() == Bundle.ACTIVE )
+                {
+                    bundleActive = true;
+                }
+            }
+        }
+
+        assertTrue( "Bundle " + bundleName + " not found.", bundleFound );
+        assertTrue( "Bundle " + bundleName + " is not active.", bundleActive );
+    }
+
+
+    /**
+     * @return the symbolic name of the bundle under test.
+     */
+    protected abstract String getBundleName();
+
+
+    @Test
+    public void testUseBundleClasses() throws Exception
+    {
+        useBundleClasses();
+    }
+
+
+    /**
+     * Implementations should use the bundle's classes to check if they are accessible.
+     * @throws Exception
+     */
+    protected abstract void useBundleClasses() throws Exception;
+
+}

Added: directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerProtocolKerberosOsgiTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerProtocolKerberosOsgiTest.java?rev=1647659&view=auto
==============================================================================
--- directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerProtocolKerberosOsgiTest.java (added)
+++ directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerProtocolKerberosOsgiTest.java Tue Dec 23 19:57:31 2014
@@ -0,0 +1,61 @@
+/*
+ *   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.server.osgi.integ;
+
+
+import org.apache.directory.server.kerberos.ChangePasswordConfig;
+import org.apache.directory.server.kerberos.KerberosConfig;
+import org.apache.directory.server.kerberos.changepwd.ChangePasswordServer;
+import org.apache.directory.server.kerberos.changepwd.service.ChangePasswordService;
+import org.apache.directory.server.kerberos.kdc.KdcServer;
+import org.apache.directory.server.kerberos.kdc.authentication.AuthenticationService;
+import org.apache.directory.server.kerberos.kdc.ticketgrant.TicketGrantingService;
+import org.apache.directory.server.kerberos.protocol.codec.KerberosProtocolCodecFactory;
+import org.apache.directory.server.kerberos.sam.SamSubsystem;
+import org.apache.directory.server.kerberos.sam.TimestampChecker;
+
+
+public class ServerProtocolKerberosOsgiTest extends ServerOsgiTestBase
+{
+
+    @Override
+    protected String getBundleName()
+    {
+        return "org.apache.directory.server.protocol.kerberos";
+    }
+
+
+    @Override
+    protected void useBundleClasses() throws Exception
+    {
+        new KerberosConfig();
+        new ChangePasswordConfig();
+        new KdcServer();
+        new TicketGrantingService();
+        new AuthenticationService();
+        KerberosProtocolCodecFactory.getInstance().getDecoder( null );
+        KerberosProtocolCodecFactory.getInstance().getEncoder( null );
+        new ChangePasswordServer();
+        new ChangePasswordService();
+        new TimestampChecker();
+        SamSubsystem.getInstance();
+    }
+
+}

Added: 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=1647659&view=auto
==============================================================================
--- directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerProtocolLdapOsgiTest.java (added)
+++ directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerProtocolLdapOsgiTest.java Tue Dec 23 19:57:31 2014
@@ -0,0 +1,65 @@
+/*
+ *   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.server.osgi.integ;
+
+
+import org.apache.directory.server.ldap.LdapProtocolUtils;
+import org.apache.directory.server.ldap.LdapServer;
+import org.apache.directory.server.ldap.LdapSession;
+import org.apache.directory.server.ldap.LdapSessionManager;
+import org.apache.directory.server.ldap.handlers.extended.StartTlsHandler;
+import org.apache.directory.server.ldap.handlers.request.AddRequestHandler;
+import org.apache.directory.server.ldap.handlers.request.SearchRequestHandler;
+import org.apache.directory.server.ldap.handlers.response.SearchResultEntryHandler;
+import org.apache.directory.server.ldap.handlers.sasl.gssapi.GssapiMechanismHandler;
+import org.apache.directory.server.ldap.handlers.sasl.plain.PlainMechanismHandler;
+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;
+
+
+public class ServerProtocolLdapOsgiTest extends ServerOsgiTestBase
+{
+
+    @Override
+    protected String getBundleName()
+    {
+        return "org.apache.directory.server.protocol.ldap";
+    }
+
+
+    @Override
+    protected void useBundleClasses() throws Exception
+    {
+        LdapProtocolUtils.createCookie( 23, "foo" );
+        new LdapSessionManager();
+        new LdapSession( new DummySession() );
+        new LdapServer();
+        new AddRequestHandler();
+        new SearchRequestHandler();
+        new SearchResultEntryHandler();
+        new StartTlsHandler();
+        new PlainMechanismHandler();
+        new GssapiMechanismHandler();
+        new ReplicationConsumerImpl();
+        new SyncReplRequestHandler();
+    }
+
+}

Added: directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerServiceBuilderOsgiTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerServiceBuilderOsgiTest.java?rev=1647659&view=auto
==============================================================================
--- directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerServiceBuilderOsgiTest.java (added)
+++ directory/apacheds/trunk/osgi-integ/src/test/java/org/apache/directory/server/osgi/integ/ServerServiceBuilderOsgiTest.java Tue Dec 23 19:57:31 2014
@@ -0,0 +1,39 @@
+/*
+ *   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.server.osgi.integ;
+
+
+public class ServerServiceBuilderOsgiTest extends ServerOsgiTestBase
+{
+
+    @Override
+    protected String getBundleName()
+    {
+        return "org.apache.directory.server.service.builder";
+    }
+
+
+    @Override
+    protected void useBundleClasses() throws Exception
+    {
+        // TODO: create, start, stop some services?
+    }
+
+}

Added: directory/apacheds/trunk/osgi-integ/src/test/resources/exam.properties
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/osgi-integ/src/test/resources/exam.properties?rev=1647659&view=auto
==============================================================================
--- directory/apacheds/trunk/osgi-integ/src/test/resources/exam.properties (added)
+++ directory/apacheds/trunk/osgi-integ/src/test/resources/exam.properties Tue Dec 23 19:57:31 2014
@@ -0,0 +1,18 @@
+#############################################################################
+#    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.
+#############################################################################
+
+pax.exam.logging = none

Added: directory/apacheds/trunk/osgi-integ/src/test/resources/logback.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/osgi-integ/src/test/resources/logback.xml?rev=1647659&view=auto
==============================================================================
--- directory/apacheds/trunk/osgi-integ/src/test/resources/logback.xml (added)
+++ directory/apacheds/trunk/osgi-integ/src/test/resources/logback.xml Tue Dec 23 19:57:31 2014
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+<configuration>
+  <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+    <encoder>
+      <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
+    </encoder>
+  </appender>
+
+  <root level="error">
+    <appender-ref ref="STDOUT" />
+  </root>
+</configuration>
\ No newline at end of file

Modified: directory/apacheds/trunk/pom.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/pom.xml?rev=1647659&r1=1647658&r2=1647659&view=diff
==============================================================================
--- directory/apacheds/trunk/pom.xml (original)
+++ directory/apacheds/trunk/pom.xml Tue Dec 23 19:57:31 2014
@@ -78,6 +78,10 @@
     <slf4j.api.version>1.7.7</slf4j.api.version>
     <slf4j.log4j12.version>1.7.7</slf4j.log4j12.version>
     <wrapper.version>3.2.3</wrapper.version>
+    <pax-exam.version>3.5.0</pax-exam.version>
+    <pax-url.version>2.2.0</pax-url.version>
+    <org.apache.felix.version>4.4.1</org.apache.felix.version>
+    <logback.version>1.1.2</logback.version>
   </properties>
 
   <url>http://directory.apache.org/apacheds/1.5</url>
@@ -146,6 +150,7 @@
     <!--<module>dependencies</module>-->
     <!--<module>service-osgi</module>-->
     <!--<module>component-hub</module>-->
+    <module>osgi-integ</module>
   </modules>
 
   <build>
@@ -578,6 +583,12 @@
       
       <dependency>
         <groupId>${project.groupId}</groupId>
+        <artifactId>apacheds-http-directory-bridge</artifactId>
+        <version>${project.version}</version>
+      </dependency>
+      
+      <dependency>
+        <groupId>${project.groupId}</groupId>
         <artifactId>apacheds-http-integration</artifactId>
         <version>${project.version}</version>
       </dependency>
@@ -1065,6 +1076,42 @@
         <version>${org.apache.directory.junit.junit-addons.version}</version>
       </dependency>
 
+      <dependency>
+        <groupId>org.ops4j.pax.exam</groupId>
+        <artifactId>pax-exam-container-forked</artifactId>
+        <version>${pax-exam.version}</version>
+      </dependency>
+
+      <dependency>
+        <groupId>org.ops4j.pax.exam</groupId>
+        <artifactId>pax-exam-junit4</artifactId>
+        <version>${pax-exam.version}</version>
+      </dependency>
+
+      <dependency>
+        <groupId>org.ops4j.pax.exam</groupId>
+        <artifactId>pax-exam-link-mvn</artifactId>
+        <version>${pax-exam.version}</version>
+      </dependency>
+
+      <dependency>
+        <groupId>org.ops4j.pax.url</groupId>
+        <artifactId>pax-url-aether</artifactId>
+        <version>${pax-url.version}</version>
+      </dependency>
+
+      <dependency>
+        <groupId>org.apache.felix</groupId>
+        <artifactId>org.apache.felix.framework</artifactId>
+        <version>${org.apache.felix.version}</version>
+      </dependency>
+
+      <dependency>
+        <groupId>ch.qos.logback</groupId>
+        <artifactId>logback-classic</artifactId>
+        <version>${logback.version}</version>
+      </dependency>
+
       <!-- Logging dependencies -->
 
       <dependency>



Mime
View raw message