aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cschnei...@apache.org
Subject svn commit: r1597767 - in /aries/trunk/jndi/jndi-url-itest: pom.xml src/test/java/org/apache/aries/jndi/itests/JndiUrlIntegrationTest.java
Date Tue, 27 May 2014 12:46:50 GMT
Author: cschneider
Date: Tue May 27 12:46:50 2014
New Revision: 1597767

URL: http://svn.apache.org/r1597767
Log:
ARIES-1195 Update jndi integration tests to pax exam 3.4.0

Modified:
    aries/trunk/jndi/jndi-url-itest/pom.xml
    aries/trunk/jndi/jndi-url-itest/src/test/java/org/apache/aries/jndi/itests/JndiUrlIntegrationTest.java

Modified: aries/trunk/jndi/jndi-url-itest/pom.xml
URL: http://svn.apache.org/viewvc/aries/trunk/jndi/jndi-url-itest/pom.xml?rev=1597767&r1=1597766&r2=1597767&view=diff
==============================================================================
--- aries/trunk/jndi/jndi-url-itest/pom.xml (original)
+++ aries/trunk/jndi/jndi-url-itest/pom.xml Tue May 27 12:46:50 2014
@@ -38,24 +38,24 @@
          <developerConnection>scm:svn:https://svn.apache.org/repos/asf/aries/trunk/jndi/jndi-url-itest</developerConnection>
          <url>http://svn.apache.org/viewvc/aries/trunk/jndi/jndi-url-itest</url>
      </scm>
+     
+     <properties>
+        <exam.version>3.4.0</exam.version>
+        <url.version>1.6.0</url.version>
+    </properties>
 
     <dependencies>
         <dependency>
             <groupId>org.osgi</groupId>
-            <artifactId>org.osgi.core</artifactId>
-            <scope>provided</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>org.osgi</groupId>
             <artifactId>org.osgi.compendium</artifactId>
+            <version>4.3.1</version>
             <scope>provided</scope>
         </dependency>
-
         <dependency>
-            <groupId>org.eclipse</groupId>
-            <artifactId>osgi</artifactId>
-            <scope>provided</scope>
+          <groupId>org.apache.aries.testsupport</groupId>
+          <artifactId>org.apache.aries.testsupport.unit</artifactId>
+          <version>2.0.0-SNAPSHOT</version>
+          <scope>test</scope>
         </dependency>
 
         <dependency>
@@ -99,62 +99,74 @@
             <version>1.0.0</version>
         </dependency>
         
+		<!-- pax exam -->
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <version>1.7.7</version>
+        </dependency>
         <dependency>
             <groupId>org.ops4j.pax.exam</groupId>
             <artifactId>pax-exam</artifactId>
+            <version>${exam.version}</version>
             <scope>test</scope>
         </dependency>
-
         <dependency>
             <groupId>org.ops4j.pax.exam</groupId>
-            <artifactId>pax-exam-junit</artifactId>
+            <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>
+            <artifactId>pax-exam-junit4</artifactId>
+            <version>${exam.version}</version>
             <scope>test</scope>
         </dependency>
-
         <dependency>
             <groupId>org.ops4j.pax.exam</groupId>
-            <artifactId>pax-exam-junit-extender-impl</artifactId>
+            <artifactId>pax-exam-link-mvn</artifactId>
+            <version>${exam.version}</version>
             <scope>test</scope>
         </dependency>
-
         <dependency>
-            <groupId>org.ops4j.pax.runner</groupId>
-            <artifactId>pax-runner-no-jcl</artifactId>
+            <groupId>org.ops4j.pax.url</groupId>
+            <artifactId>pax-url-aether</artifactId>
+            <version>${url.version}</version>
+            <scope>test</scope>
         </dependency>
-
         <dependency>
-            <groupId>org.ops4j.pax.swissbox</groupId>
-            <artifactId>pax-swissbox-tinybundles</artifactId>
+            <groupId>ch.qos.logback</groupId>
+            <artifactId>logback-core</artifactId>
+            <version>0.9.29</version>
+            <scope>test</scope>
         </dependency>
-
         <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
+            <groupId>ch.qos.logback</groupId>
+            <artifactId>logback-classic</artifactId>
+            <version>0.9.29</version>
             <scope>test</scope>
         </dependency>
-
         <dependency>
-            <groupId>org.ops4j.pax.logging</groupId>
-            <artifactId>pax-logging-api</artifactId>
-            <scope>test</scope>
+            <groupId>org.ops4j.pax.tinybundles</groupId>
+            <artifactId>tinybundles</artifactId>
+            <version>2.0.0</version>
+            <exclusions>
+            	<exclusion>
+            		<artifactId>org.osgi.core</artifactId>
+            		<groupId>org.osgi</groupId>
+            	</exclusion>
+            </exclusions>
         </dependency>
-
         <dependency>
-            <groupId>org.ops4j.pax.logging</groupId>
-            <artifactId>pax-logging-service</artifactId>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
             <scope>test</scope>
         </dependency>
-
         <dependency>
-            <groupId>org.ops4j.pax.url</groupId>
-            <artifactId>pax-url-mvn</artifactId>
-            <scope>test</scope>
+            <groupId>org.eclipse</groupId>
+            <artifactId>org.eclipse.osgi</artifactId>
+            <version>3.8.0.v20120529-1548</version>
         </dependency>
 
         <dependency>
@@ -193,44 +205,35 @@
 		<dependency>
 			<groupId>org.ops4j.pax.web</groupId>
 			<artifactId>pax-web-extender-war</artifactId>
-            <scope>test</scope>
-            <version>0.8.1</version>
+            <version>1.1.17</version>
 		</dependency>
 		<dependency>
 			<groupId>org.ops4j.pax.web</groupId>
 			<artifactId>pax-web-jetty-bundle</artifactId>
             <scope>test</scope>
-            <version>0.8.1</version>
+            <version>1.1.17</version>
 		</dependency>
 
 		<dependency>
 			<groupId>org.apache.felix</groupId>
 			<artifactId>org.apache.felix.fileinstall</artifactId>
             <scope>test</scope>
-            <version>2.0.8</version>
+            <version>3.4.0</version>
 		</dependency>
         
 		<dependency>
 			<groupId>org.apache.aries.jndi</groupId>
 			<artifactId>org.apache.aries.jndi</artifactId>
             <scope>test</scope>
-            <version>1.0.0</version>
+            <version>1.0.1-SNAPSHOT</version>
 		</dependency>
 
         <dependency>
             <groupId>org.apache.aries.jndi</groupId>
             <artifactId>org.apache.aries.jndi.url</artifactId>
             <scope>test</scope>
-            <version>1.0.0</version>
+            <version>1.1.0-SNAPSHOT</version>
         </dependency>
-        
-        <dependency>
-          <groupId>org.apache.aries.testsupport</groupId>
-          <artifactId>org.apache.aries.testsupport.unit</artifactId>
-          <version>1.0.0</version>
-          <scope>test</scope>
-        </dependency>
-
     </dependencies>
 
      <build>
@@ -240,28 +243,19 @@
                 <artifactId>maven-surefire-plugin</artifactId>
                 <configuration>
                     <forkMode>pertest</forkMode>
-                    <excludes>
-                        <exclude>**/*$*</exclude>
-                        <exclude>**/Abstract*.java</exclude>
-                    </excludes>
-                    <includes>
-                        <include>**/Test*.java</include>
-                        <include>**/*Test.java</include>
-                    </includes>
                 </configuration>
             </plugin>
             <plugin>
-                <groupId>org.ops4j.pax.exam</groupId>
-                <artifactId>maven-paxexam-plugin</artifactId>
+                <groupId>org.apache.servicemix.tooling</groupId>
+                <artifactId>depends-maven-plugin</artifactId>
+                <version>1.2</version>
                 <executions>
                     <execution>
-                        <id>generate-config</id>
+                    	<phase>generate-resources</phase>
+                        <id>generate-depends-file</id>
                         <goals>
                             <goal>generate-depends-file</goal>
                         </goals>
-                        <configuration>
-                            <outputFile>${project.build.directory}/test-classes/META-INF/maven/dependencies.properties</outputFile>
-                        </configuration>
                     </execution>
                 </executions>
             </plugin>

Modified: aries/trunk/jndi/jndi-url-itest/src/test/java/org/apache/aries/jndi/itests/JndiUrlIntegrationTest.java
URL: http://svn.apache.org/viewvc/aries/trunk/jndi/jndi-url-itest/src/test/java/org/apache/aries/jndi/itests/JndiUrlIntegrationTest.java?rev=1597767&r1=1597766&r2=1597767&view=diff
==============================================================================
--- aries/trunk/jndi/jndi-url-itest/src/test/java/org/apache/aries/jndi/itests/JndiUrlIntegrationTest.java
(original)
+++ aries/trunk/jndi/jndi-url-itest/src/test/java/org/apache/aries/jndi/itests/JndiUrlIntegrationTest.java
Tue May 27 12:46:50 2014
@@ -21,8 +21,12 @@ package org.apache.aries.jndi.itests;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
-import static org.ops4j.pax.exam.CoreOptions.equinox;
-import static org.apache.aries.itest.ExtraOptions.*;
+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.systemProperty;
+import static org.ops4j.pax.exam.CoreOptions.vmOption;
+import static org.ops4j.pax.exam.CoreOptions.when;
 
 import java.io.BufferedReader;
 import java.io.IOException;
@@ -33,14 +37,21 @@ import java.net.URL;
 import org.apache.aries.itest.AbstractIntegrationTest;
 import org.junit.Test;
 import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.Configuration;
+import org.ops4j.pax.exam.CoreOptions;
 import org.ops4j.pax.exam.Option;
-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.Bundle;
 
-@RunWith(JUnit4TestRunner.class)
+@RunWith(PaxExam.class)
+@ExamReactorStrategy(PerClass.class)
 public class JndiUrlIntegrationTest extends AbstractIntegrationTest {
 
   private static final int CONNECTION_TIMEOUT = 10000;
+  
+
     
   /**
    * This test exercises the blueprint:comp/ jndi namespace by driving
@@ -57,7 +68,7 @@ public class JndiUrlIntegrationTest exte
     
     Bundle bweb = context().getBundleByName("org.apache.aries.jndi.url.itest.web");
     assertNotNull(bweb);
-    
+    context().getBundleByName("org.ops4j.pax.web.pax-web-extender-war").start();
     printBundleStatus ("Before making web request");
     try { 
       Thread.sleep(5000);
@@ -71,7 +82,7 @@ public class JndiUrlIntegrationTest exte
   
   private void printBundleStatus (String msg) { 
     System.out.println("-----\nprintBundleStatus: " + msg + "\n-----");
-    for (Bundle b : bundleContext.getBundles()) { 
+    for (Bundle b : bundleContext.getBundles()) {
       System.out.println (b.getSymbolicName() + " " + "state=" + formatState(b.getState()));
     }
     System.out.println();
@@ -125,34 +136,47 @@ public class JndiUrlIntegrationTest exte
     return response.toString();
   }
   
-  @org.ops4j.pax.exam.junit.Configuration
-  public static Option[] configuration()
+  public Option baseOptions() {
+      String localRepo = System.getProperty("maven.repo.local");
+      if (localRepo == null) {
+          localRepo = System.getProperty("org.ops4j.pax.url.mvn.localRepository");
+      }
+      return composite(
+              junitBundles(),
+              // this is how you set the default log level when using pax
+              // logging (logProfile)
+              systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("INFO"),
+              when(localRepo != null).useOptions(vmOption("-Dorg.ops4j.pax.url.mvn.localRepository="
+ localRepo))
+       );
+  }
+  
+  @Configuration
+  public Option[] configuration()
   {
-    return testOptions(
-        paxLogging("DEBUG"),
-        transactionBootDelegation(), 
+    return CoreOptions.options(
+    	baseOptions(),
         
         // Bundles
-        mavenBundle("org.eclipse.equinox", "cm"),
-        mavenBundle("org.eclipse.osgi", "services"),
-        mavenBundle("org.apache.geronimo.specs", "geronimo-servlet_2.5_spec"),
+        mavenBundle("org.eclipse.equinox", "cm").versionAsInProject(),
+        mavenBundle("org.eclipse.osgi", "services").versionAsInProject(),
+        mavenBundle("org.apache.geronimo.specs", "geronimo-servlet_2.5_spec").versionAsInProject(),
 
-        mavenBundle("org.ops4j.pax.web", "pax-web-extender-war"),
-        mavenBundle("org.ops4j.pax.web", "pax-web-jetty-bundle"),
+        mavenBundle("org.ops4j.pax.web", "pax-web-extender-war").versionAsInProject(),
+        mavenBundle("org.ops4j.pax.web", "pax-web-jetty-bundle").versionAsInProject(),
+        
+        mavenBundle("org.apache.aries.blueprint", "org.apache.aries.blueprint.api").versionAsInProject(),
+        mavenBundle("org.apache.aries.blueprint", "org.apache.aries.blueprint.core").versionAsInProject(),
+        mavenBundle("org.apache.aries.proxy", "org.apache.aries.proxy").versionAsInProject(),
+        mavenBundle("org.apache.aries", "org.apache.aries.util").versionAsInProject(),
+        mavenBundle("org.apache.aries.jndi", "org.apache.aries.jndi").versionAsInProject(),
         
-        mavenBundle("org.apache.aries.blueprint", "org.apache.aries.blueprint.api"),
-        mavenBundle("org.apache.aries.blueprint", "org.apache.aries.blueprint.core"),
-        mavenBundle("org.apache.aries.proxy", "org.apache.aries.proxy"),
-        mavenBundle("org.apache.aries", "org.apache.aries.util"),
-        mavenBundle("org.apache.aries.jndi", "org.apache.aries.jndi"),
-      
-        mavenBundle("org.apache.aries.jndi", "org.apache.aries.jndi.url.itest.web"),
-        mavenBundle("org.apache.aries.jndi", "org.apache.aries.jndi.url.itest.biz"),
-        mavenBundle("org.ow2.asm", "asm-all"),
+        mavenBundle("org.apache.aries.jndi", "org.apache.aries.jndi.url.itest.web").versionAsInProject(),
+        mavenBundle("org.apache.aries.jndi", "org.apache.aries.jndi.url.itest.biz").versionAsInProject(),
+        mavenBundle("org.ow2.asm", "asm-all").versionAsInProject(),
+        mavenBundle("org.apache.aries.testsupport", "org.apache.aries.testsupport.unit").versionAsInProject()
+        );
 
-        /* For debugging, uncomment the next two lines */
         // org.ops4j.pax.exam.container.def.PaxRunnerOptions.vmOption("-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=7777"),
         // org.ops4j.pax.exam.CoreOptions.waitForFrameworkStartup(),
-        equinox().version("3.5.0"));
   }
 }



Mime
View raw message