aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cschnei...@apache.org
Subject svn commit: r1695867 - in /aries/trunk/transaction: transaction-itests/ transaction-itests/src/test/java/org/apache/aries/transaction/itests/ transaction-manager/ transaction-manager/src/main/java/org/apache/aries/transaction/internal/
Date Fri, 14 Aug 2015 11:33:29 GMT
Author: cschneider
Date: Fri Aug 14 11:33:29 2015
New Revision: 1695867

URL: http://svn.apache.org/r1695867
Log:
Upgrade to osgi specs 4.3

Modified:
    aries/trunk/transaction/transaction-itests/pom.xml
    aries/trunk/transaction/transaction-itests/src/test/java/org/apache/aries/transaction/itests/AbstractIntegrationTest.java
    aries/trunk/transaction/transaction-manager/pom.xml
    aries/trunk/transaction/transaction-manager/src/main/java/org/apache/aries/transaction/internal/TransactionManagerService.java

Modified: aries/trunk/transaction/transaction-itests/pom.xml
URL: http://svn.apache.org/viewvc/aries/trunk/transaction/transaction-itests/pom.xml?rev=1695867&r1=1695866&r2=1695867&view=diff
==============================================================================
--- aries/trunk/transaction/transaction-itests/pom.xml (original)
+++ aries/trunk/transaction/transaction-itests/pom.xml Fri Aug 14 11:33:29 2015
@@ -47,14 +47,8 @@
     <dependencies>
         <dependency>
             <groupId>org.osgi</groupId>
-            <artifactId>org.osgi.compendium</artifactId>
-            <scope>provided</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.aries.blueprint</groupId>
-            <artifactId>org.apache.aries.blueprint.core</artifactId>
-            <scope>test</scope>
-            <version>1.4.0</version>
+            <artifactId>org.osgi.core</artifactId>
+            <version>4.3.1</version>
         </dependency>
         <dependency>
             <groupId>org.apache.aries.proxy</groupId>
@@ -68,9 +62,47 @@
             <version>1.0.0</version>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.configadmin</artifactId>
+            <version>1.8.4</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.aries.blueprint</groupId>
+            <artifactId>org.apache.aries.blueprint.api</artifactId>
+            <version>1.0.0</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.aries.blueprint</groupId>
+            <artifactId>org.apache.aries.blueprint.core</artifactId>
+            <version>1.4.4</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-j2ee-connector_1.6_spec</artifactId>
+            <version>1.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-validation_1.0_spec</artifactId>
+            <version>1.1</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.components</groupId>
+            <artifactId>geronimo-connector</artifactId>
+            <version>3.1.1</version>
+        </dependency>
         
         <!--  JTA 1.2 -->
         <dependency>
+            <groupId>javax.transaction</groupId>
+            <artifactId>javax.transaction-api</artifactId>
+            <version>1.2</version>
+        </dependency>
+        <dependency>
             <groupId>javax.interceptor</groupId>
             <artifactId>javax.interceptor-api</artifactId>
             <version>1.2</version>
@@ -90,11 +122,6 @@
             <artifactId>cdi-api</artifactId>
             <version>1.2</version>
         </dependency>
-        <dependency>
-            <groupId>javax.transaction</groupId>
-            <artifactId>javax.transaction-api</artifactId>
-            <version>1.2</version>
-        </dependency>
 
         <dependency>
             <groupId>org.apache.aries.transaction</groupId>
@@ -126,6 +153,7 @@
             <scope>test</scope>
             <version>1.0.1-SNAPSHOT</version>
         </dependency>
+
         <dependency>
             <groupId>org.eclipse</groupId>
             <artifactId>org.eclipse.osgi</artifactId>
@@ -185,27 +213,9 @@
             <scope>test</scope>
         </dependency>
         <dependency>
-            <groupId>ch.qos.logback</groupId>
-            <artifactId>logback-core</artifactId>
-            <version>0.9.29</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>ch.qos.logback</groupId>
-            <artifactId>logback-classic</artifactId>
-            <version>0.9.29</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
             <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>junit</groupId>

Modified: aries/trunk/transaction/transaction-itests/src/test/java/org/apache/aries/transaction/itests/AbstractIntegrationTest.java
URL: http://svn.apache.org/viewvc/aries/trunk/transaction/transaction-itests/src/test/java/org/apache/aries/transaction/itests/AbstractIntegrationTest.java?rev=1695867&r1=1695866&r2=1695867&view=diff
==============================================================================
--- aries/trunk/transaction/transaction-itests/src/test/java/org/apache/aries/transaction/itests/AbstractIntegrationTest.java
(original)
+++ aries/trunk/transaction/transaction-itests/src/test/java/org/apache/aries/transaction/itests/AbstractIntegrationTest.java
Fri Aug 14 11:33:29 2015
@@ -18,7 +18,7 @@
  */
 package org.apache.aries.transaction.itests;
 
-import static junit.framework.Assert.assertEquals;
+import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.fail;
 import static org.ops4j.pax.exam.CoreOptions.composite;
 import static org.ops4j.pax.exam.CoreOptions.frameworkProperty;
@@ -34,9 +34,8 @@ import javax.inject.Inject;
 import javax.transaction.RollbackException;
 import javax.transaction.UserTransaction;
 
-import junit.framework.Assert;
-
 import org.apache.aries.transaction.test.TestBean;
+import org.junit.Assert;
 import org.junit.runner.RunWith;
 import org.ops4j.pax.exam.Configuration;
 import org.ops4j.pax.exam.CoreOptions;
@@ -44,7 +43,9 @@ import org.ops4j.pax.exam.Option;
 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;
 import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
 
 @RunWith(PaxExam.class)
 @ExamReactorStrategy(PerClass.class)
@@ -80,19 +81,21 @@ public abstract class AbstractIntegratio
                 systemProperty("org.apache.aries.proxy.weaving.enabled").value("none"),
 
                 // Bundles
-                mavenBundle("org.ops4j.pax.logging", "pax-logging-api"),
-                mavenBundle("org.ops4j.pax.logging", "pax-logging-service"),
-                mavenBundle("org.apache.geronimo.specs", "geronimo-jta_1.1_spec"),
-                mavenBundle("org.apache.geronimo.specs", "geronimo-j2ee-connector_1.6_spec"),
-                mavenBundle("org.apache.geronimo.specs", "geronimo-validation_1.0_spec"),
-                mavenBundle("org.apache.felix", "org.apache.felix.coordinator"),
-                mavenBundle("org.apache.geronimo.components", "geronimo-connector"),
-                mavenBundle("org.apache.derby", "derby"),
-                mavenBundle("org.apache.aries", "org.apache.aries.util"),
-                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.api"),
-                mavenBundle("org.apache.aries.proxy", "org.apache.aries.proxy.impl"),
+                mavenBundle("org.ops4j.pax.logging", "pax-logging-api").versionAsInProject(),
+                mavenBundle("org.ops4j.pax.logging", "pax-logging-service").versionAsInProject(),
+                mavenBundle("org.apache.felix", "org.apache.felix.configadmin").versionAsInProject(),
+                mavenBundle("org.apache.felix", "org.apache.felix.coordinator").versionAsInProject(),
+                
+                mavenBundle("org.apache.geronimo.specs", "geronimo-j2ee-connector_1.6_spec").versionAsInProject(),
+                mavenBundle("org.apache.geronimo.specs", "geronimo-validation_1.0_spec").versionAsInProject(),
+                mavenBundle("org.apache.geronimo.components", "geronimo-connector").versionAsInProject(),
+
+                mavenBundle("org.apache.derby", "derby").versionAsInProject(),
+                mavenBundle("org.apache.aries", "org.apache.aries.util").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.api").versionAsInProject(),
+                mavenBundle("org.apache.aries.proxy", "org.apache.aries.proxy.impl").versionAsInProject(),
                 jta12Bundles(),
                 mavenBundle("org.apache.aries.transaction", "org.apache.aries.transaction.manager").versionAsInProject(),
                 mavenBundle("org.apache.aries.transaction", "org.apache.aries.transaction.blueprint").versionAsInProject(),
@@ -114,6 +117,23 @@ public abstract class AbstractIntegratio
                 mavenBundle("javax.transaction", "javax.transaction-api").versionAsInProject()
             );
     }
+    
+    /**
+     * Helps to diagnose bundles that are not resolved as it will throw a detailed exception
+     * 
+     * @throws BundleException
+     */
+    public void resolveBundles() throws BundleException {
+        System.out.println("Checking for bundles");
+        Bundle[] bundles = bundleContext.getBundles();
+        for (Bundle bundle : bundles) {
+            if (bundle.getState() == Bundle.INSTALLED) {
+                System.out.println("Found non resolved bundle " + bundle.getBundleId() +
":"
+                    + bundle.getSymbolicName() + ":" + bundle.getVersion());
+                bundle.start();
+            }
+        }
+    }
 
     // Test with client transaction and runtime exception - the user transaction is rolled
back
     protected void assertInsertWithRuntimeExceptionRolledBack() throws Exception {

Modified: aries/trunk/transaction/transaction-manager/pom.xml
URL: http://svn.apache.org/viewvc/aries/trunk/transaction/transaction-manager/pom.xml?rev=1695867&r1=1695866&r2=1695867&view=diff
==============================================================================
--- aries/trunk/transaction/transaction-manager/pom.xml (original)
+++ aries/trunk/transaction/transaction-manager/pom.xml Fri Aug 14 11:33:29 2015
@@ -82,13 +82,13 @@
         <dependency>
             <groupId>org.osgi</groupId>
             <artifactId>org.osgi.core</artifactId>
-            <version>4.1.0</version>
+            <version>4.3.1</version>
             <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.osgi</groupId>
             <artifactId>org.osgi.compendium</artifactId>
-            <version>4.1.0</version>
+            <version>4.3.1</version>
             <scope>provided</scope>
         </dependency>
         <dependency>

Modified: aries/trunk/transaction/transaction-manager/src/main/java/org/apache/aries/transaction/internal/TransactionManagerService.java
URL: http://svn.apache.org/viewvc/aries/trunk/transaction/transaction-manager/src/main/java/org/apache/aries/transaction/internal/TransactionManagerService.java?rev=1695867&r1=1695866&r2=1695867&view=diff
==============================================================================
--- aries/trunk/transaction/transaction-manager/src/main/java/org/apache/aries/transaction/internal/TransactionManagerService.java
(original)
+++ aries/trunk/transaction/transaction-manager/src/main/java/org/apache/aries/transaction/internal/TransactionManagerService.java
Fri Aug 14 11:33:29 2015
@@ -20,7 +20,6 @@ import java.io.File;
 import java.util.ArrayList;
 import java.util.Dictionary;
 import java.util.List;
-import java.util.Properties;
 
 import javax.transaction.TransactionManager;
 import javax.transaction.TransactionSynchronizationRegistry;
@@ -73,7 +72,7 @@ public class TransactionManagerService {
     private boolean useSpring;
     private AriesTransactionManagerImpl transactionManager;
     private TransactionLog transactionLog;
-    private ServiceRegistration serviceRegistration;
+    private ServiceRegistration<?> serviceRegistration;
 
     public TransactionManagerService(String pid, @SuppressWarnings("rawtypes") Dictionary
properties, BundleContext bundleContext) throws ConfigurationException {
         this.pid = pid;
@@ -164,7 +163,8 @@ public class TransactionManagerService {
         if (useSpring) {
             clazzes.add(PLATFORM_TRANSACTION_MANAGER_CLASS);
         }
-        serviceRegistration = bundleContext.registerService(clazzes.toArray(new String[clazzes.size()]),
transactionManager, new Properties());
+        String[] ifar = clazzes.toArray(new String[clazzes.size()]);
+        serviceRegistration = bundleContext.registerService(ifar, transactionManager, null);
     }
 
     public void close() throws Exception {



Mime
View raw message