directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r1645515 - in /directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test: ./ src/test/java/org/apache/directory/api/osgi/
Date Sun, 14 Dec 2014 19:27:13 GMT
Author: seelmann
Date: Sun Dec 14 19:27:13 2014
New Revision: 1645515

URL: http://svn.apache.org/r1645515
Log:
Added paxexam test for ldap.codec.core

Added:
    directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiLdapCodecCoreOsgiTest.java
    directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiLdapModelOsgiTest.java
      - copied, changed from r1645474, directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiModelLdapOsgiTest.java
Removed:
    directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiModelLdapOsgiTest.java
Modified:
    directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/pom.xml
    directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiOsgiTestBase.java

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=1645515&r1=1645514&r2=1645515&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 19:27:13
2014
@@ -28,16 +28,17 @@
     <artifactId>api-paxexam-osgi-test</artifactId>
 
     <properties>
+        <logback.version>1.1.2</logback.version>
+        <slf4j.api.version>1.7.7</slf4j.api.version>
         <exam.version>3.4.0</exam.version>
         <url.version>1.6.0</url.version>
-        <logback.version>1.0.6</logback.version>
         <felix.version>4.0.2</felix.version>
     </properties>
 
     <dependencies>
         <dependency>
             <groupId>org.apache.directory.api</groupId>
-            <artifactId>api-ldap-model</artifactId>
+            <artifactId>api-ldap-codec-core</artifactId>
             <version>${api.version}</version>
             <exclusions>
                 <exclusion>
@@ -102,6 +103,16 @@
         </dependency>
     </dependencies>
 
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>org.slf4j</groupId>
+                <artifactId>slf4j-api</artifactId>
+                <version>${slf4j.api.version}</version>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+
     <build>
         <plugins>
             <plugin>

Added: directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiLdapCodecCoreOsgiTest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiLdapCodecCoreOsgiTest.java?rev=1645515&view=auto
==============================================================================
--- directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiLdapCodecCoreOsgiTest.java
(added)
+++ directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiLdapCodecCoreOsgiTest.java
Sun Dec 14 19:27:13 2014
@@ -0,0 +1,95 @@
+/*
+ *   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.LdapStatesEnum;
+import org.apache.directory.api.ldap.codec.actions.addRequest.InitAddRequest;
+import org.apache.directory.api.ldap.codec.actions.addResponse.InitAddResponse;
+import org.apache.directory.api.ldap.codec.actions.bindRequest.InitBindRequest;
+import org.apache.directory.api.ldap.codec.actions.bindResponse.InitBindResponse;
+import org.apache.directory.api.ldap.codec.actions.searchRequest.InitSearchRequest;
+import org.apache.directory.api.ldap.codec.actions.searchResultDone.InitSearchResultDone;
+import org.apache.directory.api.ldap.codec.api.LdapApiService;
+import org.apache.directory.api.ldap.codec.decorators.SearchRequestDecorator;
+import org.apache.directory.api.ldap.codec.search.AndFilter;
+import org.apache.directory.api.ldap.codec.search.SubstringFilter;
+import org.apache.directory.api.ldap.model.message.SearchRequest;
+import org.apache.directory.api.ldap.model.message.SearchRequestImpl;
+import org.junit.Test;
+import org.osgi.framework.ServiceReference;
+
+
+public class ApiLdapCodecCoreOsgiTest extends ApiOsgiTestBase
+{
+
+    @Inject
+    LdapApiService ldapApiService;
+
+
+    @Override
+    protected String getBundleName()
+    {
+        return "org.apache.directory.api.ldap.codec.core";
+    }
+
+
+    @Override
+    protected void useBundleClasses() throws Exception
+    {
+        LdapStatesEnum.END_STATE.isEndState();
+
+        new InitBindRequest();
+        new InitBindResponse();
+        new InitAddRequest();
+        new InitAddResponse();
+        new InitSearchRequest();
+        new InitSearchResultDone();
+
+        new AndFilter();
+        new SubstringFilter();
+
+        SearchRequest decoratedMessage = new SearchRequestImpl();
+        new SearchRequestDecorator( ldapApiService, decoratedMessage );
+    }
+
+
+    @Test
+    public void testInjectLdapApiService()
+    {
+        assertNotNull( ldapApiService );
+    }
+
+
+    @Test
+    public void testLookupLdapApiService()
+    {
+        ServiceReference serviceReference = context.getServiceReference( LdapApiService.class.getName()
);
+        Object service = context.getService( serviceReference );
+        assertNotNull( service );
+        assertTrue( service instanceof LdapApiService );
+    }
+
+}

Copied: directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiLdapModelOsgiTest.java
(from r1645474, directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiModelLdapOsgiTest.java)
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiLdapModelOsgiTest.java?p2=directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiLdapModelOsgiTest.java&p1=directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiModelLdapOsgiTest.java&r1=1645474&r2=1645515&rev=1645515&view=diff
==============================================================================
--- directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiModelLdapOsgiTest.java
(original)
+++ directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiLdapModelOsgiTest.java
Sun Dec 14 19:27:13 2014
@@ -30,7 +30,7 @@ import org.apache.directory.api.ldap.mod
 import org.apache.directory.api.ldap.model.url.LdapUrl;
 
 
-public class ApiModelLdapOsgiTest extends ApiOsgiTestBase
+public class ApiLdapModelOsgiTest extends ApiOsgiTestBase
 {
 
     @Override

Modified: directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiOsgiTestBase.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiOsgiTestBase.java?rev=1645515&r1=1645514&r2=1645515&view=diff
==============================================================================
--- directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiOsgiTestBase.java
(original)
+++ directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiOsgiTestBase.java
Sun Dec 14 19:27:13 2014
@@ -57,7 +57,7 @@ public abstract class ApiOsgiTestBase
 {
 
     @Inject
-    private BundleContext context;
+    protected BundleContext context;
 
     private static Map<String, String> REPLACEMENTS = new HashMap<String, String>();
     static



Mime
View raw message