You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by cl...@apache.org on 2013/09/18 09:55:58 UTC

svn commit: r1524322 - in /felix/trunk/ipojo/runtime/core-it/ipojo-compatibility-test/src/test/java/org/apache/felix/ipojo/test/compatibility: Common.java TestBeingConsumedByEquinoxSCR1_4_100.java TestConsumingProviderUsingEquinoxSCR1_4_100.java

Author: clement
Date: Wed Sep 18 07:55:58 2013
New Revision: 1524322

URL: http://svn.apache.org/r1524322
Log:
Add compatibility tests against Equinox Declarative Services 1.4.100

Added:
    felix/trunk/ipojo/runtime/core-it/ipojo-compatibility-test/src/test/java/org/apache/felix/ipojo/test/compatibility/TestBeingConsumedByEquinoxSCR1_4_100.java
    felix/trunk/ipojo/runtime/core-it/ipojo-compatibility-test/src/test/java/org/apache/felix/ipojo/test/compatibility/TestConsumingProviderUsingEquinoxSCR1_4_100.java
      - copied, changed from r1524314, felix/trunk/ipojo/runtime/core-it/ipojo-compatibility-test/src/test/java/org/apache/felix/ipojo/test/compatibility/TestConsumingProviderUsingFelixSCR1_6_2.java
Modified:
    felix/trunk/ipojo/runtime/core-it/ipojo-compatibility-test/src/test/java/org/apache/felix/ipojo/test/compatibility/Common.java

Modified: felix/trunk/ipojo/runtime/core-it/ipojo-compatibility-test/src/test/java/org/apache/felix/ipojo/test/compatibility/Common.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/ipojo-compatibility-test/src/test/java/org/apache/felix/ipojo/test/compatibility/Common.java?rev=1524322&r1=1524321&r2=1524322&view=diff
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/ipojo-compatibility-test/src/test/java/org/apache/felix/ipojo/test/compatibility/Common.java (original)
+++ felix/trunk/ipojo/runtime/core-it/ipojo-compatibility-test/src/test/java/org/apache/felix/ipojo/test/compatibility/Common.java Wed Sep 18 07:55:58 2013
@@ -30,6 +30,7 @@ import org.ops4j.pax.tinybundles.core.Ti
 import org.ops4j.pax.tinybundles.core.TinyBundles;
 import org.osgi.framework.Constants;
 import org.ow2.chameleon.testing.helpers.BaseTest;
+import org.ow2.chameleon.testing.helpers.FrameworkHelper;
 import org.ow2.chameleon.testing.tinybundles.ipojo.IPOJOStrategy;
 
 import java.io.*;
@@ -294,4 +295,8 @@ public abstract class Common extends Bas
             return null;
         }
     }
+
+    public boolean isEquinox() {
+        return FrameworkHelper.isEquinox(context)  || context.toString().contains("eclipse");
+    }
 }

Added: felix/trunk/ipojo/runtime/core-it/ipojo-compatibility-test/src/test/java/org/apache/felix/ipojo/test/compatibility/TestBeingConsumedByEquinoxSCR1_4_100.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/ipojo-compatibility-test/src/test/java/org/apache/felix/ipojo/test/compatibility/TestBeingConsumedByEquinoxSCR1_4_100.java?rev=1524322&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/ipojo-compatibility-test/src/test/java/org/apache/felix/ipojo/test/compatibility/TestBeingConsumedByEquinoxSCR1_4_100.java (added)
+++ felix/trunk/ipojo/runtime/core-it/ipojo-compatibility-test/src/test/java/org/apache/felix/ipojo/test/compatibility/TestBeingConsumedByEquinoxSCR1_4_100.java Wed Sep 18 07:55:58 2013
@@ -0,0 +1,64 @@
+/*
+ * 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.felix.ipojo.test.compatibility;
+
+import org.apache.felix.ipojo.test.compatibility.service.CheckService;
+import org.junit.Test;
+import org.ops4j.pax.exam.Option;
+
+import static org.fest.assertions.Assertions.assertThat;
+import static org.ops4j.pax.exam.CoreOptions.bundle;
+
+/**
+ * Check a configuration using Equinox SCR 1.4.100 (Declarative Services).
+ * iPOJO provider is consumed by a component using SCR.
+ *
+ *
+ * This test is intended to pass on Equinox only.
+ */
+public class TestBeingConsumedByEquinoxSCR1_4_100 extends Common {
+
+    public static String DS_URL = "http://www.dynamis-technologies.com/ipojo/bundles/org.eclipse.equinox.ds_1.4.100" +
+            ".v20130515-2026.jar";
+
+    public static String UTILS_URL = "http://www.dynamis-technologies.com/ipojo/bundles/org.eclipse.equinox.util_1.0" +
+            ".500.v20130404-1337.jar";
+
+    @Override
+    public Option[] bundles() {
+        return new Option[] {
+                bundle(DS_URL),
+                bundle(UTILS_URL),
+                iPOJOHelloProvider(),
+                SCRHelloConsumer()
+        };
+    }
+
+    @Test
+    public void test() {
+        if (! isEquinox()) {
+            System.out.println("Test executed on Equinox only");
+            return;
+        }
+        CheckService checker = osgiHelper.getServiceObject(CheckService.class);
+        assertThat(checker).isNotNull();
+        assertThat(checker.data().get("result")).isEqualTo("hello john doe");
+    }
+}

Copied: felix/trunk/ipojo/runtime/core-it/ipojo-compatibility-test/src/test/java/org/apache/felix/ipojo/test/compatibility/TestConsumingProviderUsingEquinoxSCR1_4_100.java (from r1524314, felix/trunk/ipojo/runtime/core-it/ipojo-compatibility-test/src/test/java/org/apache/felix/ipojo/test/compatibility/TestConsumingProviderUsingFelixSCR1_6_2.java)
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/ipojo-compatibility-test/src/test/java/org/apache/felix/ipojo/test/compatibility/TestConsumingProviderUsingEquinoxSCR1_4_100.java?p2=felix/trunk/ipojo/runtime/core-it/ipojo-compatibility-test/src/test/java/org/apache/felix/ipojo/test/compatibility/TestConsumingProviderUsingEquinoxSCR1_4_100.java&p1=felix/trunk/ipojo/runtime/core-it/ipojo-compatibility-test/src/test/java/org/apache/felix/ipojo/test/compatibility/TestConsumingProviderUsingFelixSCR1_6_2.java&r1=1524314&r2=1524322&rev=1524322&view=diff
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/ipojo-compatibility-test/src/test/java/org/apache/felix/ipojo/test/compatibility/TestConsumingProviderUsingFelixSCR1_6_2.java (original)
+++ felix/trunk/ipojo/runtime/core-it/ipojo-compatibility-test/src/test/java/org/apache/felix/ipojo/test/compatibility/TestConsumingProviderUsingEquinoxSCR1_4_100.java Wed Sep 18 07:55:58 2013
@@ -28,22 +28,25 @@ import static org.ops4j.pax.exam.CoreOpt
 import static org.ops4j.pax.exam.CoreOptions.maven;
 
 /**
- * Check a configuration using Felix SCR 1.6.2.
+ * Check a configuration using Equinox SCR 1.4.100 (Declarative Services).
  * iPOJO consumer is bound to a Hello Service implementation using SCR.
  *
  *
- * This test is intended to pass on Felix, KF and Equinox
+ * This test is intended to pass on Equinox only.
  */
-public class TestConsumingProviderUsingFelixSCR1_6_2 extends Common {
+public class TestConsumingProviderUsingEquinoxSCR1_4_100 extends Common {
 
-    public static final String SCR_ARTIFACTID = "org.apache.felix.scr";
-    public static final String SCR_VERSION = "1.6.2";
-    public static final String SCR_GROUPID = "org.apache.felix";
+    public static String DS_URL = "http://www.dynamis-technologies.com/ipojo/bundles/org.eclipse.equinox.ds_1.4.100" +
+            ".v20130515-2026.jar";
+
+    public static String UTILS_URL = "http://www.dynamis-technologies.com/ipojo/bundles/org.eclipse.equinox.util_1.0" +
+            ".500.v20130404-1337.jar";
 
     @Override
     public Option[] bundles() {
         return new Option[] {
-                bundle(maven(SCR_GROUPID, SCR_ARTIFACTID, SCR_VERSION).getURL()),
+                bundle(DS_URL),
+                bundle(UTILS_URL),
                 SCRHelloProvider(),
                 iPOJOHelloConsumer()
         };
@@ -51,6 +54,10 @@ public class TestConsumingProviderUsingF
 
     @Test
     public void test() {
+        if (! isEquinox()) {
+            System.out.println("Test executed on Equinox only");
+            return;
+        }
         CheckService checker = osgiHelper.getServiceObject(CheckService.class);
         assertThat(checker).isNotNull();
         assertThat(checker.data().get("result")).isEqualTo("hello john doe");