aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbono...@apache.org
Subject svn commit: r1601196 - in /aries/trunk/jmx/jmx-whiteboard: pom.xml src/test/java/org/apache/aries/jmx/whiteboard/integration/MBeanServerTest.java src/test/java/org/apache/aries/jmx/whiteboard/integration/helper/IntegrationTestBase.java
Date Sun, 08 Jun 2014 06:26:07 GMT
Author: jbonofre
Date: Sun Jun  8 06:26:06 2014
New Revision: 1601196

URL: http://svn.apache.org/r1601196
Log:
Upgrade to Pax Exam 3.4.0 and fix jmx-whiteboard itests

Modified:
    aries/trunk/jmx/jmx-whiteboard/pom.xml
    aries/trunk/jmx/jmx-whiteboard/src/test/java/org/apache/aries/jmx/whiteboard/integration/MBeanServerTest.java
    aries/trunk/jmx/jmx-whiteboard/src/test/java/org/apache/aries/jmx/whiteboard/integration/helper/IntegrationTestBase.java

Modified: aries/trunk/jmx/jmx-whiteboard/pom.xml
URL: http://svn.apache.org/viewvc/aries/trunk/jmx/jmx-whiteboard/pom.xml?rev=1601196&r1=1601195&r2=1601196&view=diff
==============================================================================
--- aries/trunk/jmx/jmx-whiteboard/pom.xml (original)
+++ aries/trunk/jmx/jmx-whiteboard/pom.xml Sun Jun  8 06:26:06 2014
@@ -79,7 +79,9 @@
         <aries.osgi.import.service>
             javax.management.MBeanServer
         </aries.osgi.import.service>
-        <lastReleaseVersion>1.0.0</lastReleaseVersion>
+
+        <exam.version>3.4.0</exam.version>
+        <url.version>1.6.0</url.version>
     </properties>
 
     <build>
@@ -156,27 +158,44 @@
         <dependency>
             <groupId>org.ops4j.pax.exam</groupId>
             <artifactId>pax-exam</artifactId>
-            <version>1.2.4</version>
+            <version>${exam.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.exam</groupId>
+            <artifactId>pax-exam-junit4</artifactId>
+            <version>${exam.version}</version>
             <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>org.ops4j.pax.exam</groupId>
-            <artifactId>pax-exam-junit</artifactId>
-            <version>1.2.4</version>
+            <artifactId>pax-exam-container-forked</artifactId>
+            <version>${exam.version}</version>
             <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>org.ops4j.pax.exam</groupId>
-            <artifactId>pax-exam-container-default</artifactId>
-            <version>1.2.4</version>
+            <artifactId>pax-exam-link-mvn</artifactId>
+            <version>${exam.version}</version>
             <scope>test</scope>
         </dependency>
         <dependency>
-            <groupId>org.ops4j.pax.swissbox</groupId>
-            <artifactId>pax-swissbox-tinybundles</artifactId>
-            <version>1.2.0</version>
+            <groupId>org.ops4j.pax.url</groupId>
+            <artifactId>pax-url-aether</artifactId>
+            <version>${url.version}</version>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.tinybundles</groupId>
+            <artifactId>tinybundles</artifactId>
+            <version>2.0.0</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.eclipse</groupId>
+            <artifactId>org.eclipse.osgi</artifactId>
+            <version>3.8.0.v20120529-1548</version>
+        </dependency>
     </dependencies>
 
     <profiles>

Modified: aries/trunk/jmx/jmx-whiteboard/src/test/java/org/apache/aries/jmx/whiteboard/integration/MBeanServerTest.java
URL: http://svn.apache.org/viewvc/aries/trunk/jmx/jmx-whiteboard/src/test/java/org/apache/aries/jmx/whiteboard/integration/MBeanServerTest.java?rev=1601196&r1=1601195&r2=1601196&view=diff
==============================================================================
--- aries/trunk/jmx/jmx-whiteboard/src/test/java/org/apache/aries/jmx/whiteboard/integration/MBeanServerTest.java
(original)
+++ aries/trunk/jmx/jmx-whiteboard/src/test/java/org/apache/aries/jmx/whiteboard/integration/MBeanServerTest.java
Sun Jun  8 06:26:06 2014
@@ -28,13 +28,16 @@ import org.apache.aries.jmx.whiteboard.i
 import org.apache.aries.jmx.whiteboard.integration.helper.TestClassMBean;
 import org.junit.Test;
 import org.junit.runner.RunWith;
-import org.ops4j.pax.exam.junit.JUnit4TestRunner;
+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.osgi.framework.ServiceRegistration;
 
 /**
  * The <code>MBeanTest</code> tests MBean registration with MBean Servers
  */
-@RunWith(JUnit4TestRunner.class)
+@RunWith(PaxExam.class)
+@ExamReactorStrategy(PerClass.class)
 public class MBeanServerTest extends IntegrationTestBase {
 
     @Test

Modified: aries/trunk/jmx/jmx-whiteboard/src/test/java/org/apache/aries/jmx/whiteboard/integration/helper/IntegrationTestBase.java
URL: http://svn.apache.org/viewvc/aries/trunk/jmx/jmx-whiteboard/src/test/java/org/apache/aries/jmx/whiteboard/integration/helper/IntegrationTestBase.java?rev=1601196&r1=1601195&r2=1601196&view=diff
==============================================================================
--- aries/trunk/jmx/jmx-whiteboard/src/test/java/org/apache/aries/jmx/whiteboard/integration/helper/IntegrationTestBase.java
(original)
+++ aries/trunk/jmx/jmx-whiteboard/src/test/java/org/apache/aries/jmx/whiteboard/integration/helper/IntegrationTestBase.java
Sun Jun  8 06:26:06 2014
@@ -18,17 +18,14 @@
  */
 package org.apache.aries.jmx.whiteboard.integration.helper;
 
-import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
-import static org.ops4j.pax.exam.CoreOptions.options;
-import static org.ops4j.pax.exam.CoreOptions.provision;
-import static org.ops4j.pax.exam.CoreOptions.waitForFrameworkStartup;
-import static org.ops4j.pax.exam.CoreOptions.wrappedBundle;
+import static org.ops4j.pax.exam.CoreOptions.*;
 import static org.ops4j.pax.exam.OptionUtils.combine;
 
 import java.io.File;
 import java.util.Dictionary;
 import java.util.Hashtable;
 
+import javax.inject.Inject;
 import javax.management.InstanceNotFoundException;
 import javax.management.MBeanServer;
 import javax.management.MBeanServerFactory;
@@ -39,10 +36,9 @@ import junit.framework.TestCase;
 
 import org.junit.After;
 import org.junit.Before;
+import org.ops4j.pax.exam.Configuration;
 import org.ops4j.pax.exam.CoreOptions;
-import org.ops4j.pax.exam.Inject;
 import org.ops4j.pax.exam.Option;
-import org.ops4j.pax.exam.container.def.PaxRunnerOptions;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceRegistration;
 
@@ -58,11 +54,6 @@ public class IntegrationTestBase {
     // the JVM option to set to enable remote debugging
     protected static final String DEBUG_VM_OPTION = "-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=30303";
 
-    // the actual JVM option set, extensions may implement a static
-    // initializer overwriting this value to have the configuration()
-    // method include it when starting the OSGi framework JVM
-    protected static String paxRunnerVmOption = null;
-
     private static MBeanServer staticServer;
 
     private MBeanServer server;
@@ -81,7 +72,7 @@ public class IntegrationTestBase {
         theConfig.put(PROP_NAME, PROP_NAME);
     }
 
-    @org.ops4j.pax.exam.junit.Configuration
+    @Configuration
     public static Option[] configuration() {
         final String bundleFileName = System.getProperty(BUNDLE_JAR_SYS_PROP,
             BUNDLE_JAR_DEFAULT);
@@ -92,37 +83,19 @@ public class IntegrationTestBase {
                 + " system property");
         }
 
-        final Option[] base = options(
-            provision(
-                CoreOptions.bundle(bundleFile.toURI().toString()),
-                mavenBundle("org.ops4j.pax.swissbox",
-                    "pax-swissbox-tinybundles", "1.0.0"),
-                mavenBundle("org.apache.felix", "org.apache.felix.configadmin",
-                    "1.2.8"), mavenBundle("org.slf4j", "slf4j-api", "1.5.2"),
-                mavenBundle("org.slf4j", "slf4j-simple", "1.5.2")),
-            waitForFrameworkStartup());
-        final Option vmOption = (paxRunnerVmOption != null)
-                ? PaxRunnerOptions.vmOption(paxRunnerVmOption)
-                : null;
-        
-        Option[] options = combine(base, vmOption);
-        return updateOptions (options);
-    }
-    
-    // This method is copied from AbstractIntegrationTest 
-    // in org.apache.aries.jmx.itests
-    protected static Option[] updateOptions(Option[] options) {
-      // We need to add pax-exam-junit here when running with the ibm
-      // jdk to avoid the following exception during the test run:
-      // ClassNotFoundException: org.ops4j.pax.exam.junit.Configuration
-      if ("IBM Corporation".equals(System.getProperty("java.vendor"))) {
-          Option[] ibmOptions = options(
-              wrappedBundle(mavenBundle("org.ops4j.pax.exam", "pax-exam-junit"))
-          );
-          options = combine(ibmOptions, options);
-      }
-      return options;
-  }
+        final Option[] options = options(
+                systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("INFO"),
+
+                junitBundles(),
+
+                bundle(bundleFile.toURI().toString()),
+                mavenBundle("org.ops4j.pax.tinybundles", "tinybundles", "2.0.0"),
+                mavenBundle("org.apache.felix", "org.apache.felix.configadmin", "1.2.8"),
+                mavenBundle("org.ops4j.pax.logging", "pax-logging-api", "1.7.2"),
+                mavenBundle("org.ops4j.pax.logging", "pax-logging-service", "1.7.2"));
+
+        return options;
+    }
 
     @Before
     public void setUp() {



Mime
View raw message