directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r1647019 - in /directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test: pom.xml src/test/java/org/apache/directory/api/osgi/ApiDsmlParserOsgiTest.java src/test/java/org/apache/directory/api/osgi/ApiOsgiTestBase.java
Date Sat, 20 Dec 2014 17:10:30 GMT
Author: seelmann
Date: Sat Dec 20 17:10:29 2014
New Revision: 1647019

URL: http://svn.apache.org/r1647019
Log:
Add OSGi test for DSML parser. Took some time to get dom4j running. Maven dependencies use
the original dom4j, xpp3, antlr artifacts. In the test when setting up the OSGi runtime those
are replaced by our OSGi-ified versions.

Added:
    directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiDsmlParserOsgiTest.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=1647019&r1=1647018&r2=1647019&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 Sat Dec 20 17:10:29
2014
@@ -40,87 +40,45 @@
             <groupId>org.apache.directory.api</groupId>
             <artifactId>api-ldap-client-api</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-net-mina</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-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-util</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-sp</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-trigger</artifactId>
             <version>${api.version}</version>
-            <exclusions>
-                <exclusion>
-                    <groupId>antlr</groupId>
-                    <artifactId>antlr</artifactId>
-                </exclusion>
-            </exclusions>
         </dependency>
         <dependency>
-            <groupId>org.apache.directory.studio</groupId>
-            <artifactId>org.antlr.antlr</artifactId>
-            <version>2.7.7</version>
+            <groupId>org.apache.directory.api</groupId>
+            <artifactId>api-dsml-parser</artifactId>
+            <version>${api.version}</version>
             <exclusions>
                 <exclusion>
-                    <groupId>antlr</groupId>
-                    <artifactId>antlr</artifactId>
+                    <groupId>xml-apis</groupId>
+                    <artifactId>xml-apis</artifactId>
                 </exclusion>
             </exclusions>
         </dependency>
@@ -167,6 +125,12 @@
             <version>${felix.version}</version>
             <scope>test</scope>
         </dependency>
+<!--         <dependency> -->
+<!--             <groupId>org.eclipse</groupId> -->
+<!--             <artifactId>osgi</artifactId> -->
+<!--             <version>3.9.1-v20140110-1610</version> -->
+<!--             <scope>test</scope> -->
+<!--         </dependency> -->
     </dependencies>
 
     <dependencyManagement>
@@ -224,7 +188,9 @@
                                         </goals>
                                     </pluginExecutionFilter>
                                     <action>
-                                        <ignore></ignore>
+                                        <execute>
+                                            <runOnIncremental>true</runOnIncremental>
+                                        </execute>
                                     </action>
                                 </pluginExecution>
                             </pluginExecutions>

Added: directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiDsmlParserOsgiTest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiDsmlParserOsgiTest.java?rev=1647019&view=auto
==============================================================================
--- directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiDsmlParserOsgiTest.java
(added)
+++ directory/sandbox/seelmann/osgi-testing/api-paxexam-osgi-test/src/test/java/org/apache/directory/api/osgi/ApiDsmlParserOsgiTest.java
Sat Dec 20 17:10:29 2014
@@ -0,0 +1,77 @@
+/*
+ *   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.dsmlv2.ParserUtils;
+import org.apache.directory.api.dsmlv2.request.AddRequestDsml;
+import org.apache.directory.api.dsmlv2.request.Dsmlv2Grammar;
+import org.apache.directory.api.dsmlv2.request.SearchRequestDsml;
+import org.apache.directory.api.dsmlv2.response.LdapResultDsml;
+import org.apache.directory.api.dsmlv2.response.SearchResponse;
+import org.apache.directory.api.dsmlv2.response.SearchResultDoneDsml;
+import org.apache.directory.api.dsmlv2.response.SearchResultEntryDsml;
+import org.apache.directory.api.ldap.codec.api.LdapApiService;
+import org.apache.directory.api.ldap.model.message.AddRequestImpl;
+import org.apache.directory.api.ldap.model.message.LdapResultImpl;
+import org.apache.directory.api.ldap.model.message.ReferralImpl;
+import org.apache.directory.api.ldap.model.message.ResultCodeEnum;
+import org.apache.directory.api.ldap.model.name.Dn;
+import org.apache.directory.api.ldap.model.url.LdapUrl;
+import org.dom4j.tree.BaseElement;
+
+
+public class ApiDsmlParserOsgiTest extends ApiOsgiTestBase
+{
+
+    @Override
+    protected String getBundleName()
+    {
+        return "org.apache.directory.api.dsmlv2.parser";
+    }
+
+
+    @Override
+    protected void useBundleClasses() throws Exception
+    {
+        new Dsmlv2Grammar();
+
+        new AddRequestDsml( null );
+        new SearchRequestDsml( null );
+
+        ParserUtils.base64Encode( "abc" );
+        new Dn( "cn=foo" );
+        new LdapUrl( "ldap://example.com/" );
+        ResultCodeEnum.TOO_LATE.getMessage();
+        ParserUtils.needsBase64Encoding( null );
+        ParserUtils.parseAndVerifyRequestID( "5", null );
+        new BaseElement( "foo" );
+        context.getService( context.getServiceReference( LdapApiService.class.getName() )
);
+        new AddRequestImpl();
+        new ReferralImpl();
+        new LdapResultImpl();
+
+        new SearchResponse();
+        new LdapResultDsml( null, null, null );
+        new SearchResultEntryDsml( null );
+        new SearchResultDoneDsml( null );
+    }
+
+}

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=1647019&r1=1647018&r2=1647019&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
Sat Dec 20 17:10:29 2014
@@ -27,6 +27,7 @@ import static org.ops4j.pax.exam.CoreOpt
 import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
 import static org.ops4j.pax.exam.CoreOptions.options;
 import static org.ops4j.pax.exam.CoreOptions.systemProperty;
+import static org.ops4j.pax.exam.CoreOptions.systemPackages;
 
 import java.io.IOException;
 import java.util.ArrayList;
@@ -62,7 +63,12 @@ public abstract class ApiOsgiTestBase
     private static Map<String, String> REPLACEMENTS = new HashMap<String, String>();
     static
     {
-        // REPLACEMENTS.put( "antlr:antlr:jar:2.7.7:compile", "org.apache.directory.studio:org.antlr.antlr:jar:2.7.7:compile"
);
+        REPLACEMENTS.put( "antlr:antlr:jar:2.7.7:compile",
+            "org.apache.directory.studio:org.antlr.antlr:jar:2.7.7:compile" );
+        REPLACEMENTS.put( "xpp3:xpp3:jar:1.1.4c:compile",
+            "org.apache.directory.studio:org.xpp3.xpp3:jar:1.1.4.c:compile" );
+        REPLACEMENTS.put( "dom4j:dom4j:jar:1.6.1:compile",
+            "org.apache.directory.studio:org.dom4j.dom4j:jar:1.6.1:compile" );
     }
 
 
@@ -90,7 +96,8 @@ public abstract class ApiOsgiTestBase
             systemProperty( "org.ops4j.pax.logging.DefaultServiceLog.level" ).value( "WARN"
),
             systemProperty( "logback.configurationFile" ).value(
                 "file:" + PathUtils.getBaseDir() + "/src/test/resources/logback.xml" ),
-            mavenBundle( "ch.qos.logback", "logback-classic", "1.0.6" ),
+            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( mavibotDependencies.toArray( new Option[0] ) ) );
     }



Mime
View raw message