felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clem...@apache.org
Subject svn commit: r1455460 [1/3] - in /felix/trunk/ipojo/handler/transaction: ./ src/ transaction-handler-it/ transaction-handler-it/src/ transaction-handler-it/src/it/ transaction-handler-it/src/it/transaction-it/ transaction-handler-it/src/it/transaction-i...
Date Tue, 12 Mar 2013 09:12:31 GMT
Author: clement
Date: Tue Mar 12 09:12:28 2013
New Revision: 1455460

URL: http://svn.apache.org/r1455460
Log:
FELIX-3903 - Migrate the transaction handler tests to pax exam 3

Added:
    felix/trunk/ipojo/handler/transaction/transaction-handler/   (with props)
    felix/trunk/ipojo/handler/transaction/transaction-handler-it/   (with props)
    felix/trunk/ipojo/handler/transaction/transaction-handler-it/pom.xml
    felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/
    felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/
    felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/   (with props)
    felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/pom.xml
    felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/
    felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/
    felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/java/
    felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/java/org/
    felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/java/org/apache/
    felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/java/org/apache/felix/
    felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/java/org/apache/felix/ipojo/
    felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/java/org/apache/felix/ipojo/handler/
    felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/java/org/apache/felix/ipojo/handler/transaction/
    felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/java/org/apache/felix/ipojo/handler/transaction/components/
    felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/java/org/apache/felix/ipojo/handler/transaction/components/ComponentUsingAnnotations.java
    felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/java/org/apache/felix/ipojo/handler/transaction/components/FooDelegator.java
    felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/java/org/apache/felix/ipojo/handler/transaction/components/FooImpl.java
    felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/java/org/apache/felix/ipojo/handler/transaction/services/
    felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/java/org/apache/felix/ipojo/handler/transaction/services/CheckService.java
    felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/java/org/apache/felix/ipojo/handler/transaction/services/Foo.java
    felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/resources/
    felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/resources/annotation.xml
    felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/resources/foo.xml
    felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/resources/mandatory.xml
    felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/resources/never.xml
    felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/resources/notsupported.xml
    felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/resources/requires.xml
    felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/resources/requiresnew.xml
    felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/resources/supported.xml
    felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/test/
    felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/test/java/
    felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/test/java/org/
    felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/test/java/org/apache/
    felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/test/java/org/apache/felix/
    felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/test/java/org/apache/felix/ipojo/
    felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/test/java/org/apache/felix/ipojo/handler/
    felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/test/java/org/apache/felix/ipojo/handler/transaction/
    felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/test/java/org/apache/felix/ipojo/handler/transaction/test/
    felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/test/java/org/apache/felix/ipojo/handler/transaction/test/Common.java
    felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/test/java/org/apache/felix/ipojo/handler/transaction/test/TestAnnotations.java
    felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/test/java/org/apache/felix/ipojo/handler/transaction/test/TestInstallation.java
    felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/test/java/org/apache/felix/ipojo/handler/transaction/test/TestInvalidation.java
    felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/test/java/org/apache/felix/ipojo/handler/transaction/test/TestMandatory.java
    felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/test/java/org/apache/felix/ipojo/handler/transaction/test/TestNever.java
    felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/test/java/org/apache/felix/ipojo/handler/transaction/test/TestNotSupported.java
    felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/test/java/org/apache/felix/ipojo/handler/transaction/test/TestRequires.java
    felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/test/java/org/apache/felix/ipojo/handler/transaction/test/TestRequiresNew.java
    felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/test/java/org/apache/felix/ipojo/handler/transaction/test/TestSupported.java
    felix/trunk/ipojo/handler/transaction/transaction-handler/pom.xml
    felix/trunk/ipojo/handler/transaction/transaction-handler/src/
    felix/trunk/ipojo/handler/transaction/transaction-handler/src/main/
    felix/trunk/ipojo/handler/transaction/transaction-handler/src/main/java/
    felix/trunk/ipojo/handler/transaction/transaction-handler/src/main/java/org/
    felix/trunk/ipojo/handler/transaction/transaction-handler/src/main/java/org/apache/
    felix/trunk/ipojo/handler/transaction/transaction-handler/src/main/java/org/apache/felix/
    felix/trunk/ipojo/handler/transaction/transaction-handler/src/main/java/org/apache/felix/ipojo/
    felix/trunk/ipojo/handler/transaction/transaction-handler/src/main/java/org/apache/felix/ipojo/transaction/
    felix/trunk/ipojo/handler/transaction/transaction-handler/src/main/java/org/apache/felix/ipojo/transaction/TransactionHandler.java
    felix/trunk/ipojo/handler/transaction/transaction-handler/src/main/java/org/apache/felix/ipojo/transaction/TransactionalMethod.java
    felix/trunk/ipojo/handler/transaction/transaction-handler/src/main/resources/
    felix/trunk/ipojo/handler/transaction/transaction-handler/src/main/resources/metadata.xml
Removed:
    felix/trunk/ipojo/handler/transaction/src/
Modified:
    felix/trunk/ipojo/handler/transaction/pom.xml

Modified: felix/trunk/ipojo/handler/transaction/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/handler/transaction/pom.xml?rev=1455460&r1=1455459&r2=1455460&view=diff
==============================================================================
--- felix/trunk/ipojo/handler/transaction/pom.xml (original)
+++ felix/trunk/ipojo/handler/transaction/pom.xml Tue Mar 12 09:12:28 2013
@@ -16,101 +16,100 @@
   specific language governing permissions and limitations
   under the License.
 -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-  <parent>
-    <groupId>org.apache.felix</groupId>
-    <artifactId>felix-parent</artifactId>
-    <version>1.2.1</version>
-  </parent>
-  <modelVersion>4.0.0</modelVersion>
-  <packaging>bundle</packaging>
-  <groupId>org.apache.felix</groupId>
-  <artifactId>org.apache.felix.ipojo.handler.transaction
-  </artifactId>
-  <version>1.5.0-SNAPSHOT</version>
-  <name>Apache Felix iPOJO Transaction Handler</name>
-
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
-        <version>1.4.3</version>
-        <extensions>true</extensions>
-        <configuration>
-          <instructions>
-            <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
-            <Private-Package>org.apache.felix.ipojo.transaction</Private-Package>
-            <Import-Package>javax.transaction;version=1.1, *</Import-Package>
-          </instructions>
-        </configuration>
-      </plugin>
-      <plugin>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
         <groupId>org.apache.felix</groupId>
-        <artifactId>maven-ipojo-plugin</artifactId>
-        <version>1.8.4</version>
-        <executions>
-          <execution>
-            <goals>
-              <goal>ipojo-bundle</goal>
-            </goals>
-          </execution>
-        </executions>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-compiler-plugin</artifactId>
-        <configuration>
-          <source>1.5</source>
-          <target>1.5</target>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.codehaus.mojo</groupId>
-        <artifactId>rat-maven-plugin</artifactId>
-        <configuration>
-          <excludeSubProjects>false</excludeSubProjects>
-          <useEclipseDefaultExcludes>true</useEclipseDefaultExcludes>
-          <useMavenDefaultExcludes>true</useMavenDefaultExcludes>
-          <excludes>
-            <param>doc/**/*</param>
-            <param>maven-eclipse.xml</param>
-            <param>.checkstyle</param>
-            <param>.externalToolBuilders/*</param>
-            <param>LICENSE.asm</param>
-          </excludes>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-checkstyle-plugin</artifactId>
-        <configuration>
-          <enableRulesSummary>false</enableRulesSummary>
-          <violationSeverity>warning</violationSeverity>
-          <configLocation>
-            http://felix.apache.org/ipojo/dev/checkstyle_ipojo.xml
-                </configLocation>
-        </configuration>
-      </plugin>
-    </plugins>
-  </build>
+        <artifactId>felix-parent</artifactId>
+        <version>1.2.1</version>
+        <relativePath>../../../pom/pom.xml</relativePath>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>org.apache.felix.ipojo.handler.transaction-handler-project</artifactId>
+    <version>1.5.0-SNAPSHOT</version>
+    <name>Apache Felix iPOJO Transaction Handler Project</name>
+    <packaging>pom</packaging>
+
+    <modules>
+        <module>transaction-handler</module>
+        <module>transaction-handler-it</module>
+    </modules>
+
+    <build>
+        <resources>
+            <resource>
+                <directory>src/main/resources</directory>
+            </resource>
+            <resource>
+                <directory>.</directory>
+                <targetPath>META-INF</targetPath>
+                <includes>
+                    <include>LICENSE*</include>
+                    <include>NOTICE*</include>
+                    <include>DEPENDENCIES*</include>
+                </includes>
+            </resource>
+        </resources>
+    </build>
 
-  <dependencies>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo</artifactId>
-      <version>1.9.0-SNAPSHOT</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo.metadata</artifactId>
-      <version>1.4.0</version>
-    </dependency>
-    <dependency>
-      <groupId>geronimo-spec</groupId>
-      <artifactId>geronimo-spec-jta</artifactId>
-      <version>1.0-M1</version>
-    </dependency>
-  </dependencies>
+    <profiles>
+        <profile>
+            <id>release</id>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-assembly-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <id>make-assembly</id>
+                                <phase>package</phase>
+                                <goals>
+                                    <goal>single</goal>
+                                </goals>
+                                <configuration>
+                                    <descriptorRefs>
+                                        <descriptorRef>project</descriptorRef>
+                                    </descriptorRefs>
+                                    <!-- we don't want to attach all the assemblies, such as bz2 -->
+                                    <attach>false</attach>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                    <plugin>
+                        <!-- only attach the project and bin assemblies, in tar.gz and zip flavors -->
+                        <groupId>org.codehaus.mojo</groupId>
+                        <artifactId>build-helper-maven-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <id>attach-assemblies</id>
+                                <phase>package</phase>
+                                <goals>
+                                    <goal>attach-artifact</goal>
+                                </goals>
+                                <configuration>
+                                    <artifacts>
+                                        <artifact>
+                                            <file>
+                                                ${project.build.directory}/${project.artifactId}-${project.version}-project.tar.gz
+                                            </file>
+                                            <classifier>project</classifier>
+                                            <type>tar.gz</type>
+                                        </artifact>
+                                        <artifact>
+                                            <file>
+                                                ${project.build.directory}/${project.artifactId}-${project.version}-project.zip
+                                            </file>
+                                            <classifier>project</classifier>
+                                            <type>zip</type>
+                                        </artifact>
+                                    </artifacts>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
 </project>

Propchange: felix/trunk/ipojo/handler/transaction/transaction-handler/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Mar 12 09:12:28 2013
@@ -0,0 +1,5 @@
+target
+*.iml
+*.back
+*.out
+.idea

Propchange: felix/trunk/ipojo/handler/transaction/transaction-handler-it/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Mar 12 09:12:28 2013
@@ -0,0 +1,6 @@
+target
+.idea
+*.iml
+*.old
+*.back
+

Added: felix/trunk/ipojo/handler/transaction/transaction-handler-it/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/handler/transaction/transaction-handler-it/pom.xml?rev=1455460&view=auto
==============================================================================
--- felix/trunk/ipojo/handler/transaction/transaction-handler-it/pom.xml (added)
+++ felix/trunk/ipojo/handler/transaction/transaction-handler-it/pom.xml Tue Mar 12 09:12:28 2013
@@ -0,0 +1,384 @@
+<!--
+  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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <parent>
+        <groupId>org.apache.felix</groupId>
+        <artifactId>felix-parent</artifactId>
+        <version>1.2.1</version>
+        <relativePath>../../../../pom/pom.xml</relativePath>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <packaging>pom</packaging>
+    <name>Apache Felix iPOJO Transaction Handler - Integration Test</name>
+    <artifactId>org.apache.felix.ipojo.handler.transaction-it</artifactId>
+    <version>1.5.0-SNAPSHOT</version>
+
+    <properties>
+        <exam.version>3.0.0</exam.version>
+        <url.version>1.5.1</url.version>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.ow2.chameleon.transaction</groupId>
+            <artifactId>geronimo-transaction-service</artifactId>
+            <version>0.0.1-SNAPSHOT</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.osgi</groupId>
+                    <artifactId>org.osgi.compendium</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>org.osgi</groupId>
+                    <artifactId>org.osgi.core</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>org.apache.felix</groupId>
+                    <artifactId>org.apache.felix.ipojo</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.ipojo.handler.transaction</artifactId>
+            <version>${project.version}</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.osgi</groupId>
+                    <artifactId>org.osgi.compendium</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>org.osgi</groupId>
+                    <artifactId>org.osgi.core</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>org.apache.felix</groupId>
+                    <artifactId>org.apache.felix.ipojo</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.framework</artifactId>
+            <version>4.2.0</version>
+            <scope>test</scope>
+        </dependency>
+
+
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.ipojo</artifactId>
+            <version>1.8.6</version>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.ops4j.pax.exam</groupId>
+            <artifactId>pax-exam-container-native</artifactId>
+            <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-link-mvn</artifactId>
+            <version>${exam.version}</version>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.ops4j.pax.url</groupId>
+            <artifactId>pax-url-aether</artifactId>
+            <version>${url.version}</version>
+            <scope>test</scope>
+        </dependency>
+
+
+        <dependency>
+            <groupId>ch.qos.logback</groupId>
+            <artifactId>logback-core</artifactId>
+            <version>0.9.20</version>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>ch.qos.logback</groupId>
+            <artifactId>logback-classic</artifactId>
+            <version>0.9.20</version>
+            <scope>test</scope>
+        </dependency>
+
+
+        <dependency>
+            <groupId>org.ops4j.pax.tinybundles</groupId>
+            <artifactId>tinybundles</artifactId>
+            <version>1.0.0</version>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>commons-io</groupId>
+            <artifactId>commons-io</artifactId>
+            <version>2.4</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.ow2.chameleon.testing</groupId>
+            <artifactId>osgi-helpers</artifactId>
+            <version>0.6.0</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.ow2.chameleon.testing</groupId>
+            <artifactId>tinybundles-ipojo</artifactId>
+            <version>0.3.0</version>
+        </dependency>
+
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.9</version>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.ops4j.pax.url</groupId>
+            <artifactId>pax-url-wrap</artifactId>
+            <version>1.5.2</version>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.servicemix.tooling</groupId>
+                <artifactId>depends-maven-plugin</artifactId>
+                <version>1.2</version>
+                <executions>
+                    <execution>
+                        <id>generate-config</id>
+                        <goals>
+                            <goal>generate-depends-file</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <version>2.5.1</version>
+                <configuration>
+                    <source>1.6</source>
+                    <target>1.6</target>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+    <profiles>
+        <profile>
+            <id>test</id>
+            <activation>
+                <activeByDefault>true</activeByDefault>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-invoker-plugin</artifactId>
+                        <version>1.8</version>
+                        <configuration>
+                            <streamLogs>true</streamLogs>
+                            <goals>
+                                <goal>clean</goal>
+                                <goal>test</goal>
+                            </goals>
+                            <cloneClean>true</cloneClean>
+                        </configuration>
+                        <executions>
+                            <execution>
+                                <id>regular</id>
+                                <goals>
+                                    <goal>run</goal>
+                                </goals>
+                                <configuration>
+                                    <profiles>
+                                        <profile>felix</profile>
+                                    </profiles>
+                                    <cloneProjectsTo>${project.build.directory}/regular</cloneProjectsTo>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+
+        <!-- no test-all on transaction until we fix all issue on equinox and kf -->
+        <!--
+        <profile>
+            <id>test-all</id>
+            <activation>
+                <activeByDefault>false</activeByDefault>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-invoker-plugin</artifactId>
+                        <version>1.8</version>
+                        <configuration>
+                            <streamLogs>true</streamLogs>
+                            <goals>
+                                <goal>clean</goal>
+                                <goal>test</goal>
+                            </goals>
+                            <cloneClean>true</cloneClean>
+                        </configuration>
+                        <executions>
+                            <execution>
+                                <id>equinox-native</id>
+                                <goals>
+                                    <goal>run</goal>
+                                </goals>
+                                <configuration>
+                                    <profiles>
+                                        <profile>equinox</profile>
+                                    </profiles>
+                                    <cloneProjectsTo>${project.build.directory}/equinox-native</cloneProjectsTo>
+
+                                </configuration>
+                            </execution>
+                            <execution>
+                                <id>felix-native</id>
+                                <goals>
+                                    <goal>run</goal>
+                                </goals>
+                                <configuration>
+                                    <profiles>
+                                        <profile>felix</profile>
+                                    </profiles>
+                                    <cloneProjectsTo>${project.build.directory}/felix-native</cloneProjectsTo>
+                                </configuration>
+                            </execution>
+                            <execution>
+                                <id>knopflerfish-native</id>
+                                <goals>
+                                    <goal>run</goal>
+                                </goals>
+                                <configuration>
+                                    <profiles>
+                                        <profile>knopflerfish</profile>
+                                    </profiles>
+                                    <cloneProjectsTo>${project.build.directory}/knopflerfish-native</cloneProjectsTo>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+        -->
+
+        <profile>
+            <id>knopflerfish</id>
+            <activation>
+                <activeByDefault>false</activeByDefault>
+                <property>
+                    <name>pax.exam.framework</name>
+                    <value>knopflerfish</value>
+                </property>
+            </activation>
+            <properties>
+                <pax.exam.framework>knopflerfish</pax.exam.framework>
+            </properties>
+            <repositories>
+                <repository>
+                    <id>knopflerfish-releases</id>
+                    <url>http://www.knopflerfish.org/maven2</url>
+                </repository>
+            </repositories>
+            <dependencies>
+                <dependency>
+                    <groupId>org.knopflerfish</groupId>
+                    <artifactId>framework</artifactId>
+                    <version>5.2.0</version>
+                    <scope>test</scope>
+                </dependency>
+            </dependencies>
+        </profile>
+
+        <profile>
+            <id>equinox</id>
+            <activation>
+                <activeByDefault>false</activeByDefault>
+                <property>
+                    <name>pax.exam.framework</name>
+                    <value>equinox</value>
+                </property>
+            </activation>
+            <properties>
+                <pax.exam.framework>equinox</pax.exam.framework>
+            </properties>
+            <dependencies>
+                <dependency>
+                    <groupId>org.eclipse.tycho</groupId>
+                    <artifactId>org.eclipse.osgi</artifactId>
+                    <version>3.8.1.v20120830-144521</version>
+                    <scope>test</scope>
+                </dependency>
+            </dependencies>
+        </profile>
+
+        <profile>
+            <id>felix</id>
+            <activation>
+                <activeByDefault>false</activeByDefault>
+                <property>
+                    <name>pax.exam.framework</name>
+                    <value>felix</value>
+                </property>
+            </activation>
+            <properties>
+                <pax.exam.framework>felix</pax.exam.framework>
+            </properties>
+            <dependencies>
+                <dependency>
+                    <groupId>org.apache.felix</groupId>
+                    <artifactId>org.apache.felix.framework</artifactId>
+                    <version>4.2.0</version>
+                    <scope>test</scope>
+                </dependency>
+            </dependencies>
+        </profile>
+
+    </profiles>
+</project>

Propchange: felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Mar 12 09:12:28 2013
@@ -0,0 +1,4 @@
+target
+*.iml
+*.out
+*.back

Added: felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/pom.xml?rev=1455460&view=auto
==============================================================================
--- felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/pom.xml (added)
+++ felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/pom.xml Tue Mar 12 09:12:28 2013
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.felix</groupId>
+        <artifactId>org.apache.felix.ipojo.handler.transaction-it</artifactId>
+        <version>1.5.0-SNAPSHOT</version>
+        <relativePath>../../../pom.xml</relativePath>
+    </parent>
+
+
+    <artifactId>ipojo-transaction-integration-test</artifactId>
+    <name>${project.artifactId}</name>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.compendium</artifactId>
+            <version>4.2.0</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.ipojo.annotations</artifactId>
+            <version>1.8.6</version>
+        </dependency>
+    </dependencies>
+
+</project>
\ No newline at end of file

Added: felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/java/org/apache/felix/ipojo/handler/transaction/components/ComponentUsingAnnotations.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/java/org/apache/felix/ipojo/handler/transaction/components/ComponentUsingAnnotations.java?rev=1455460&view=auto
==============================================================================
--- felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/java/org/apache/felix/ipojo/handler/transaction/components/ComponentUsingAnnotations.java (added)
+++ felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/java/org/apache/felix/ipojo/handler/transaction/components/ComponentUsingAnnotations.java Tue Mar 12 09:12:28 2013
@@ -0,0 +1,34 @@
+package org.apache.felix.ipojo.handler.transaction.components;
+
+import org.apache.felix.ipojo.annotations.Component;
+
+import javax.transaction.Transaction;
+
+@Component
+@org.apache.felix.ipojo.transaction.Transaction(field="transaction")
+public class ComponentUsingAnnotations {
+
+    Transaction transaction;
+
+
+    @org.apache.felix.ipojo.transaction.Transactional
+    public void doSomethingBad() throws NullPointerException {
+    }
+
+    @org.apache.felix.ipojo.transaction.Transactional(propagation="required")
+    public void doSomethingBad2() throws UnsupportedOperationException {
+
+    }
+
+    @org.apache.felix.ipojo.transaction.Transactional(propagation="supported", norollbackfor= {"java.lang.Exception"})
+    public void doSomethingGood() {
+
+    }
+
+    @org.apache.felix.ipojo.transaction.Transactional(timeout=1000, exceptiononrollback=true)
+    public void doSomethingLong() {
+
+    }
+
+
+}

Added: felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/java/org/apache/felix/ipojo/handler/transaction/components/FooDelegator.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/java/org/apache/felix/ipojo/handler/transaction/components/FooDelegator.java?rev=1455460&view=auto
==============================================================================
--- felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/java/org/apache/felix/ipojo/handler/transaction/components/FooDelegator.java (added)
+++ felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/java/org/apache/felix/ipojo/handler/transaction/components/FooDelegator.java Tue Mar 12 09:12:28 2013
@@ -0,0 +1,77 @@
+package org.apache.felix.ipojo.handler.transaction.components;
+
+import org.apache.felix.ipojo.handler.transaction.services.CheckService;
+import org.apache.felix.ipojo.handler.transaction.services.Foo;
+
+import javax.transaction.Transaction;
+
+public class FooDelegator implements CheckService {
+
+    Transaction transaction;
+    Transaction lastCommitted;
+    Transaction lastRolledback;
+    Transaction current;
+    private Foo foo;
+    private int commit;
+    private int rollback;
+
+    public void onCommit(String method) {
+        commit++;
+    }
+
+    public void onRollback(String method, Exception e) {
+        rollback++;
+    }
+
+    public void doSomethingBad() throws NullPointerException {
+        current = transaction;
+        foo.doSomethingBad();
+    }
+
+    public void doSomethingBad2() throws UnsupportedOperationException {
+        current = transaction;
+        foo.doSomethingBad2();
+
+    }
+
+    public void doSomethingGood() {
+        current = transaction;
+        foo.doSomethingGood();
+    }
+
+    public void doSomethingLong() {
+        current = transaction;
+        foo.doSomethingLong();
+    }
+
+    public Transaction getCurrentTransaction() {
+        return current;
+    }
+
+    public int getNumberOfCommit() {
+        return commit;
+    }
+
+    public int getNumberOfRollback() {
+        return rollback;
+    }
+
+    public Transaction getLastRolledBack() {
+        return lastRolledback;
+    }
+
+    public Transaction getLastCommitted() {
+        return lastCommitted;
+    }
+
+    public void onRollback(Transaction t) {
+        lastRolledback = t;
+        rollback++;
+    }
+
+    public void onCommit(Transaction t) {
+        lastCommitted = t;
+        commit++;
+    }
+
+}

Added: felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/java/org/apache/felix/ipojo/handler/transaction/components/FooImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/java/org/apache/felix/ipojo/handler/transaction/components/FooImpl.java?rev=1455460&view=auto
==============================================================================
--- felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/java/org/apache/felix/ipojo/handler/transaction/components/FooImpl.java (added)
+++ felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/java/org/apache/felix/ipojo/handler/transaction/components/FooImpl.java Tue Mar 12 09:12:28 2013
@@ -0,0 +1,28 @@
+package org.apache.felix.ipojo.handler.transaction.components;
+
+import org.apache.felix.ipojo.handler.transaction.services.Foo;
+
+public class FooImpl implements Foo {
+
+    public void doSomethingBad() throws NullPointerException {
+        throw new NullPointerException("NULL");
+    }
+
+    public void doSomethingBad2() throws UnsupportedOperationException {
+        throw new UnsupportedOperationException("Expected exception");
+
+    }
+
+    public void doSomethingGood() {
+        // Good...
+    }
+
+    public void doSomethingLong() {
+        try {
+            Thread.sleep(5000);
+        } catch (InterruptedException e) {
+            e.printStackTrace();
+        }
+    }
+
+}

Added: felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/java/org/apache/felix/ipojo/handler/transaction/services/CheckService.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/java/org/apache/felix/ipojo/handler/transaction/services/CheckService.java?rev=1455460&view=auto
==============================================================================
--- felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/java/org/apache/felix/ipojo/handler/transaction/services/CheckService.java (added)
+++ felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/java/org/apache/felix/ipojo/handler/transaction/services/CheckService.java Tue Mar 12 09:12:28 2013
@@ -0,0 +1,25 @@
+package org.apache.felix.ipojo.handler.transaction.services;
+
+import javax.transaction.Transaction;
+
+public interface CheckService {
+    
+    public void doSomethingGood();
+    
+    public void doSomethingBad() throws NullPointerException;
+    
+    public void doSomethingBad2() throws UnsupportedOperationException;
+    
+    public void doSomethingLong();
+    
+    public int getNumberOfCommit();
+    
+    public int getNumberOfRollback();
+    
+    public Transaction getCurrentTransaction();
+    
+    public Transaction getLastRolledBack();
+    
+    public Transaction getLastCommitted();
+
+}

Added: felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/java/org/apache/felix/ipojo/handler/transaction/services/Foo.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/java/org/apache/felix/ipojo/handler/transaction/services/Foo.java?rev=1455460&view=auto
==============================================================================
--- felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/java/org/apache/felix/ipojo/handler/transaction/services/Foo.java (added)
+++ felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/java/org/apache/felix/ipojo/handler/transaction/services/Foo.java Tue Mar 12 09:12:28 2013
@@ -0,0 +1,13 @@
+package org.apache.felix.ipojo.handler.transaction.services;
+
+public interface Foo {
+    
+    public void doSomethingGood();
+    
+    public void doSomethingBad() throws NullPointerException;
+    
+    public void doSomethingBad2() throws UnsupportedOperationException;
+    
+    public void doSomethingLong();
+
+}

Added: felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/resources/annotation.xml
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/resources/annotation.xml?rev=1455460&view=auto
==============================================================================
--- felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/resources/annotation.xml (added)
+++ felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/resources/annotation.xml Tue Mar 12 09:12:28 2013
@@ -0,0 +1,3 @@
+<ipojo xmlns:tr="org.apache.felix.ipojo.transaction">
+
+</ipojo>
\ No newline at end of file

Added: felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/resources/foo.xml
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/resources/foo.xml?rev=1455460&view=auto
==============================================================================
--- felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/resources/foo.xml (added)
+++ felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/resources/foo.xml Tue Mar 12 09:12:28 2013
@@ -0,0 +1,5 @@
+<ipojo>
+	<component classname="org.apache.felix.ipojo.handler.transaction.components.FooImpl">
+		<provides/>
+	</component>
+</ipojo>
\ No newline at end of file

Added: felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/resources/mandatory.xml
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/resources/mandatory.xml?rev=1455460&view=auto
==============================================================================
--- felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/resources/mandatory.xml (added)
+++ felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/resources/mandatory.xml Tue Mar 12 09:12:28 2013
@@ -0,0 +1,25 @@
+<ipojo xmlns:tr="org.apache.felix.ipojo.transaction">
+	<component classname="org.apache.felix.ipojo.handler.transaction.components.FooDelegator" name="mandatory-ok">
+		<provides/>
+		<requires field="foo"/>
+		<tr:transaction field="transaction">
+			<transactional method="doSomethingGood" propagation="mandatory"/>
+			<transactional method="getCurrentTransaction" propagation="mandatory"/>
+			<transactional method="doSomethingBad" propagation="mandatory"/>
+			<transactional method="doSomethingBad2" norollbackfor="java.lang.UnsupportedOperationException" propagation="mandatory"/>
+			<transactional method="doSomethingLong" propagation="mandatory"/>
+		</tr:transaction>
+	</component>
+	
+	<component classname="org.apache.felix.ipojo.handler.transaction.components.FooDelegator" name="mandatory-cb">
+		<provides/>
+		<requires field="foo" />
+		<tr:transaction field="transaction" onCommit="onCommit" onRollback="onRollback">
+			<transactional method="doSomethingGood" propagation="mandatory"/>
+			<transactional method="getCurrentTransaction" propagation="mandatory"/>
+			<transactional method="doSomethingBad" propagation="mandatory"/>
+			<transactional method="doSomethingBad2" norollbackfor="java.lang.UnsupportedOperationException" propagation="mandatory"/>
+			<transactional method="doSomethingLong" propagation="mandatory"/>
+		</tr:transaction>
+	</component>
+</ipojo>
\ No newline at end of file

Added: felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/resources/never.xml
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/resources/never.xml?rev=1455460&view=auto
==============================================================================
--- felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/resources/never.xml (added)
+++ felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/resources/never.xml Tue Mar 12 09:12:28 2013
@@ -0,0 +1,25 @@
+<ipojo xmlns:tr="org.apache.felix.ipojo.transaction">
+	<component classname="org.apache.felix.ipojo.handler.transaction.components.FooDelegator" name="never-ok">
+		<provides/>
+		<requires field="foo"/>
+		<tr:transaction field="transaction">
+			<transactional method="doSomethingGood" propagation="never"/>
+			<transactional method="getCurrentTransaction" propagation="never"/>
+			<transactional method="doSomethingBad" propagation="never"/>
+			<transactional method="doSomethingBad2" norollbackfor="java.lang.UnsupportedOperationException" propagation="never"/>
+			<transactional method="doSomethingLong" propagation="never"/>
+		</tr:transaction>
+	</component>
+	
+	<component classname="org.apache.felix.ipojo.handler.transaction.components.FooDelegator" name="never-cb">
+		<provides/>
+		<requires field="foo" />
+		<tr:transaction field="transaction" onCommit="onCommit" onRollback="onRollback">
+			<transactional method="doSomethingGood" propagation="never"/>
+			<transactional method="getCurrentTransaction" propagation="never"/>
+			<transactional method="doSomethingBad" propagation="never"/>
+			<transactional method="doSomethingBad2" norollbackfor="java.lang.UnsupportedOperationException" propagation="never"/>
+			<transactional method="doSomethingLong" propagation="never"/>
+		</tr:transaction>
+	</component>
+</ipojo>
\ No newline at end of file

Added: felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/resources/notsupported.xml
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/resources/notsupported.xml?rev=1455460&view=auto
==============================================================================
--- felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/resources/notsupported.xml (added)
+++ felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/resources/notsupported.xml Tue Mar 12 09:12:28 2013
@@ -0,0 +1,25 @@
+<ipojo xmlns:tr="org.apache.felix.ipojo.transaction">
+	<component classname="org.apache.felix.ipojo.handler.transaction.components.FooDelegator" name="notsupported-ok">
+		<provides/>
+		<requires field="foo"/>
+		<tr:transaction field="transaction">
+			<transactional method="doSomethingGood" propagation="notsupported"/>
+			<transactional method="getCurrentTransaction" propagation="notsupported"/>
+			<transactional method="doSomethingBad" propagation="notsupported"/>
+			<transactional method="doSomethingBad2" norollbackfor="java.lang.UnsupportedOperationException" propagation="notsupported"/>
+			<transactional method="doSomethingLong" propagation="notsupported"/>
+		</tr:transaction>
+	</component>
+	
+	<component classname="org.apache.felix.ipojo.handler.transaction.components.FooDelegator" name="notsupported-cb">
+		<provides/>
+		<requires field="foo" />
+		<tr:transaction field="transaction" onCommit="onCommit" onRollback="onRollback">
+			<transactional method="doSomethingGood" propagation="notsupported"/>
+			<transactional method="getCurrentTransaction" propagation="notsupported"/>
+			<transactional method="doSomethingBad" propagation="notsupported"/>
+			<transactional method="doSomethingBad2" norollbackfor="java.lang.UnsupportedOperationException" propagation="notsupported"/>
+			<transactional method="doSomethingLong" propagation="notsupported"/>
+		</tr:transaction>
+	</component>
+</ipojo>
\ No newline at end of file

Added: felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/resources/requires.xml
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/resources/requires.xml?rev=1455460&view=auto
==============================================================================
--- felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/resources/requires.xml (added)
+++ felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/resources/requires.xml Tue Mar 12 09:12:28 2013
@@ -0,0 +1,25 @@
+<ipojo xmlns:tr="org.apache.felix.ipojo.transaction">
+	<component classname="org.apache.felix.ipojo.handler.transaction.components.FooDelegator" name="requires-ok">
+		<provides/>
+		<requires field="foo"/>
+		<tr:transaction field="transaction">
+			<transactional method="doSomethingGood"/>
+			<transactional method="getCurrentTransaction"/>
+			<transactional method="doSomethingBad"/>
+			<transactional method="doSomethingBad2" norollbackfor="java.lang.UnsupportedOperationException"/>
+			<transactional method="doSomethingLong"/>
+		</tr:transaction>
+	</component>
+	
+	<component classname="org.apache.felix.ipojo.handler.transaction.components.FooDelegator" name="requires-cb">
+		<provides/>
+		<requires field="foo" />
+		<tr:transaction field="transaction" onCommit="onCommit" onRollback="onRollback">
+			<transactional method="doSomethingGood"/>
+			<transactional method="getCurrentTransaction"/>
+			<transactional method="doSomethingBad"/>
+			<transactional method="doSomethingBad2" norollbackfor="java.lang.UnsupportedOperationException"/>
+			<transactional method="doSomethingLong"/>
+		</tr:transaction>
+	</component>
+</ipojo>
\ No newline at end of file

Added: felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/resources/requiresnew.xml
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/resources/requiresnew.xml?rev=1455460&view=auto
==============================================================================
--- felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/resources/requiresnew.xml (added)
+++ felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/resources/requiresnew.xml Tue Mar 12 09:12:28 2013
@@ -0,0 +1,25 @@
+<ipojo xmlns:tr="org.apache.felix.ipojo.transaction">
+	<component classname="org.apache.felix.ipojo.handler.transaction.components.FooDelegator" name="requiresnew-ok">
+		<provides/>
+		<requires field="foo"/>
+		<tr:transaction field="transaction">
+			<transactional method="doSomethingGood" propagation="requiresnew"/>
+			<transactional method="getCurrentTransaction" propagation="requiresnew"/>
+			<transactional method="doSomethingBad" propagation="requiresnew" exceptiononrollback="true"/>
+			<transactional method="doSomethingBad2" norollbackfor="java.lang.UnsupportedOperationException" propagation="requiresnew"/>
+			<transactional method="doSomethingLong" propagation="requiresnew"/>
+		</tr:transaction>
+	</component>
+	
+	<component classname="org.apache.felix.ipojo.handler.transaction.components.FooDelegator" name="requiresnew-cb">
+		<provides/>
+		<requires field="foo" />
+		<tr:transaction field="transaction" onCommit="onCommit" onRollback="onRollback">
+			<transactional method="doSomethingGood" propagation="requiresnew"/>
+			<transactional method="getCurrentTransaction" propagation="requiresnew"/>
+			<transactional method="doSomethingBad" propagation="requiresnew"/>
+			<transactional method="doSomethingBad2" norollbackfor="java.lang.UnsupportedOperationException" propagation="requiresnew"/>
+			<transactional method="doSomethingLong" propagation="requiresnew"/>
+		</tr:transaction>
+	</component>
+</ipojo>
\ No newline at end of file

Added: felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/resources/supported.xml
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/resources/supported.xml?rev=1455460&view=auto
==============================================================================
--- felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/resources/supported.xml (added)
+++ felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/main/resources/supported.xml Tue Mar 12 09:12:28 2013
@@ -0,0 +1,25 @@
+<ipojo xmlns:tr="org.apache.felix.ipojo.transaction">
+	<component classname="org.apache.felix.ipojo.handler.transaction.components.FooDelegator" name="supported-ok">
+		<provides/>
+		<requires field="foo"/>
+		<tr:transaction field="transaction">
+			<transactional method="doSomethingGood" propagation="supported"/>
+			<transactional method="getCurrentTransaction" propagation="supported"/>
+			<transactional method="doSomethingBad" propagation="supported"/>
+			<transactional method="doSomethingBad2" norollbackfor="java.lang.UnsupportedOperationException" propagation="supported"/>
+			<transactional method="doSomethingLong" propagation="supported"/>
+		</tr:transaction>
+	</component>
+	
+	<component classname="org.apache.felix.ipojo.handler.transaction.components.FooDelegator" name="supported-cb">
+		<provides/>
+		<requires field="foo" />
+		<tr:transaction field="transaction" onCommit="onCommit" onRollback="onRollback">
+			<transactional method="doSomethingGood" propagation="supported"/>
+			<transactional method="getCurrentTransaction" propagation="supported"/>
+			<transactional method="doSomethingBad" propagation="supported"/>
+			<transactional method="doSomethingBad2" norollbackfor="java.lang.UnsupportedOperationException" propagation="supported"/>
+			<transactional method="doSomethingLong" propagation="supported"/>
+		</tr:transaction>
+	</component>
+</ipojo>
\ No newline at end of file

Added: felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/test/java/org/apache/felix/ipojo/handler/transaction/test/Common.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/test/java/org/apache/felix/ipojo/handler/transaction/test/Common.java?rev=1455460&view=auto
==============================================================================
--- felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/test/java/org/apache/felix/ipojo/handler/transaction/test/Common.java (added)
+++ felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/test/java/org/apache/felix/ipojo/handler/transaction/test/Common.java Tue Mar 12 09:12:28 2013
@@ -0,0 +1,198 @@
+package org.apache.felix.ipojo.handler.transaction.test;
+
+import ch.qos.logback.classic.Level;
+import ch.qos.logback.classic.Logger;
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.filefilter.TrueFileFilter;
+import org.junit.After;
+import org.junit.Before;
+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.PaxExam;
+import org.ops4j.pax.exam.options.CompositeOption;
+import org.ops4j.pax.exam.options.DefaultCompositeOption;
+import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
+import org.ops4j.pax.exam.spi.reactors.PerMethod;
+import org.ops4j.pax.tinybundles.core.TinyBundle;
+import org.ops4j.pax.tinybundles.core.TinyBundles;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
+import org.ow2.chameleon.testing.helpers.IPOJOHelper;
+import org.ow2.chameleon.testing.helpers.OSGiHelper;
+import org.ow2.chameleon.testing.tinybundles.ipojo.IPOJOStrategy;
+import org.slf4j.LoggerFactory;
+
+import javax.inject.Inject;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import static junit.framework.Assert.fail;
+import static org.ops4j.pax.exam.CoreOptions.*;
+import static org.ops4j.pax.exam.MavenUtils.asInProject;
+
+/**
+ * Bootstrap the test from this project
+ */
+@RunWith(PaxExam.class)
+@ExamReactorStrategy(PerMethod.class)
+public class Common {
+
+    @Inject
+    BundleContext context;
+    OSGiHelper osgiHelper;
+    IPOJOHelper ipojoHelper;
+
+    public static Option junitAndMockitoBundles() {
+        return new DefaultCompositeOption(
+                // Repository required to load harmcrest (OSGi-fied version).
+                repository("http://repository.springsource.com/maven/bundles/external").id(
+                        "com.springsource.repository.bundles.external"),
+
+                // Hamcrest with a version matching the range expected by Mockito
+                mavenBundle("org.hamcrest", "com.springsource.org.hamcrest.core", "1.1.0"),
+
+                // Mockito core does not includes Hamcrest
+                mavenBundle("org.mockito", "mockito-core", "1.9.5"),
+
+                // Objenesis with a version matching the range expected by Mockito
+                wrappedBundle(mavenBundle("org.objenesis", "objenesis", "1.2"))
+                        .exports("*;version=1.2"),
+
+                // The default JUnit bundle also exports Hamcrest, but with an (incorrect) version of
+                // 4.9 which does not match the Mockito import. When deployed after the hamcrest bundles, it gets
+                // resolved correctly.
+                CoreOptions.junitBundles(),
+
+                /*
+                 * Felix has implicit boot delegation enabled by default. It conflicts with Mockito:
+                 * java.lang.LinkageError: loader constraint violation in interface itable initialization:
+                 * when resolving method "org.osgi.service.useradmin.User$$EnhancerByMockitoWithCGLIB$$dd2f81dc
+                 * .newInstance(Lorg/mockito/cglib/proxy/Callback;)Ljava/lang/Object;" the class loader
+                 * (instance of org/mockito/internal/creation/jmock/SearchingClassLoader) of the current class,
+                 * org/osgi/service/useradmin/User$$EnhancerByMockitoWithCGLIB$$dd2f81dc, and the class loader
+                 * (instance of org/apache/felix/framework/BundleWiringImpl$BundleClassLoaderJava5) for interface
+                 * org/mockito/cglib/proxy/Factory have different Class objects for the type org/mockito/cglib/
+                 * proxy/Callback used in the signature
+                 *
+                 * So we disable the bootdelegation. this property has no effect on the other OSGi implementation.
+                 */
+                frameworkProperty("felix.bootdelegation.implicit").value("false")
+        );
+    }
+
+    public static CompositeOption ipojoBundles() {
+        return new DefaultCompositeOption(
+                mavenBundle("org.apache.felix", "org.apache.felix.ipojo").versionAsInProject(),
+                mavenBundle("org.ow2.chameleon.testing", "osgi-helpers").versionAsInProject(),
+                // The tested handler
+                mavenBundle("org.apache.felix", "org.apache.felix.ipojo.handler.transaction").versionAsInProject()
+        );
+    }
+
+    @Configuration
+    public Option[] config() throws IOException {
+        Logger root = (Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
+        root.setLevel(Level.DEBUG);
+
+        return options(
+                cleanCaches(),
+                ipojoBundles(),
+                junitBundles(),
+                //testedBundle(), // Each test is doing its own deployment.
+                systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("WARN"),
+                provision(
+                        mavenBundle().groupId("org.ow2.chameleon.transaction").artifactId("geronimo-transaction-service").version(asInProject())
+                ),
+                systemPackage("javax.transaction;version>=1.1.0")
+        );
+    }
+
+    @Before
+    public void commonSetUp() {
+        osgiHelper = new OSGiHelper(context);
+        ipojoHelper = new IPOJOHelper(context);
+
+        // Dump OSGi Framework information
+        String vendor = (String) osgiHelper.getBundle(0).getHeaders().get(Constants.BUNDLE_VENDOR);
+        if (vendor == null) {
+            vendor = (String) osgiHelper.getBundle(0).getHeaders().get(Constants.BUNDLE_SYMBOLICNAME);
+        }
+        String version = (String) osgiHelper.getBundle(0).getHeaders().get(Constants.BUNDLE_VERSION);
+        System.out.println("OSGi Framework : " + vendor + " - " + version);
+    }
+
+    @After
+    public void commonTearDown() {
+        ipojoHelper.dispose();
+        osgiHelper.dispose();
+    }
+
+    public Option testedBundle() throws MalformedURLException {
+        File out = new File("target/tested/bundle.jar");
+
+        TinyBundle tested = TinyBundles.bundle();
+
+        // We look inside target/classes to find the class and resources
+        File classes = new File("target/classes");
+        Collection<File> files = FileUtils.listFilesAndDirs(classes, TrueFileFilter.INSTANCE, TrueFileFilter.INSTANCE);
+        List<File> services = new ArrayList<File>();
+        for (File file : files) {
+            if (file.isDirectory()) {
+                // By convention we export of .services and .service package
+                if (file.getName().endsWith("services") || file.getName().endsWith("service")) {
+                    services.add(file);
+                }
+            } else {
+                // We need to compute the path
+                String path = file.getAbsolutePath().substring(classes.getAbsolutePath().length() + 1);
+                tested.add(path, file.toURI().toURL());
+                System.out.println(file.getName() + " added to " + path);
+            }
+        }
+
+        String export = "";
+        for (File file : services) {
+            if (export.length() > 0) {
+                export += ", ";
+            }
+            String path = file.getAbsolutePath().substring(classes.getAbsolutePath().length() + 1);
+            String packageName = path.replace('/', '.');
+            export += packageName;
+        }
+
+        System.out.println("Exported packages : " + export);
+
+        InputStream inputStream = tested
+                .set(Constants.BUNDLE_SYMBOLICNAME, "test.bundle")
+                        //.set(Constants.IMPORT_PACKAGE, "*")
+                        //.set(Constants.EXPORT_PACKAGE, export) // No export...
+                .build(IPOJOStrategy.withiPOJO(new File("src/main/resources")));
+
+        try {
+            FileUtils.copyInputStreamToFile(inputStream, out);
+            return bundle(out.toURI().toURL().toExternalForm());
+        } catch (MalformedURLException e) {
+            throw new RuntimeException("Cannot compute the url of the manipulated bundle");
+        } catch (IOException e) {
+            throw new RuntimeException("Cannot write of the manipulated bundle");
+        }
+    }
+
+    public void assertContains(String s, String[] arrays, String object) {
+        for (String suspect : arrays) {
+            if (object.equals(suspect)) {
+                return;
+            }
+        }
+        fail("Assertion failed : " + s);
+    }
+
+
+}

Added: felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/test/java/org/apache/felix/ipojo/handler/transaction/test/TestAnnotations.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/test/java/org/apache/felix/ipojo/handler/transaction/test/TestAnnotations.java?rev=1455460&view=auto
==============================================================================
--- felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/test/java/org/apache/felix/ipojo/handler/transaction/test/TestAnnotations.java (added)
+++ felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/test/java/org/apache/felix/ipojo/handler/transaction/test/TestAnnotations.java Tue Mar 12 09:12:28 2013
@@ -0,0 +1,119 @@
+package org.apache.felix.ipojo.handler.transaction.test;
+
+import org.apache.felix.ipojo.handler.transaction.components.ComponentUsingAnnotations;
+import org.apache.felix.ipojo.handler.transaction.components.FooImpl;
+import org.apache.felix.ipojo.handler.transaction.services.CheckService;
+import org.apache.felix.ipojo.handler.transaction.services.Foo;
+import org.apache.felix.ipojo.metadata.Element;
+import org.junit.Assert;
+import org.junit.Test;
+import org.ops4j.pax.exam.Configuration;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.OptionUtils;
+import org.ops4j.pax.tinybundles.core.TinyBundles;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.Constants;
+import org.ow2.chameleon.testing.helpers.IPOJOHelper;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+
+import static org.ops4j.pax.exam.CoreOptions.*;
+import static org.ops4j.pax.exam.MavenUtils.asInProject;
+import static org.ow2.chameleon.testing.tinybundles.ipojo.IPOJOStrategy.withiPOJO;
+
+public class TestAnnotations extends Common {
+
+    public static final File TEST = new File("src/main/resources");
+
+    @Configuration
+    public Option[] config() throws IOException {
+        Option[] options = super.config();
+
+        InputStream service = TinyBundles.bundle()
+                .add(CheckService.class)
+                .add(Foo.class)
+                .set(Constants.BUNDLE_SYMBOLICNAME, "Service")
+                .set(Constants.EXPORT_PACKAGE, "org.apache.felix.ipojo.handler.transaction.services")
+                .build(TinyBundles.withBnd());
+
+        InputStream fooimpl = TinyBundles.bundle()
+                .add(FooImpl.class)
+                .set(Constants.BUNDLE_SYMBOLICNAME, "Foo Provider")
+                .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.handler.transaction.services")
+                .build(withiPOJO(new File(TEST, "foo.xml")));
+
+        InputStream test = TinyBundles.bundle()
+                .add(ComponentUsingAnnotations.class)
+                .set(Constants.BUNDLE_SYMBOLICNAME, "TransactionAnnotationTest")
+                .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.handler.transaction.services, javax.transaction;version=1.1")
+                .build(withiPOJO(new File(TEST, "annotation.xml")));
+
+
+        return OptionUtils.combine(
+                options,
+                provision(
+                        service,
+                        fooimpl,
+                        test
+                ),
+                repository("http://maven.ow2.org/maven2-snapshot/")
+        );
+    }
+
+    @Test
+    public void annotations() {
+        Element elem = IPOJOHelper.getMetadata(getBundle(), "org.apache.felix.ipojo.handler.transaction.components.ComponentUsingAnnotations");
+        Assert.assertNotNull(elem);
+
+        Element tr = elem.getElements("transaction", "org.apache.felix.ipojo.transaction")[0];
+        Assert.assertEquals("transaction", tr.getAttribute("field"));
+
+        Assert.assertNull(tr.getAttribute("oncommit"));
+        Assert.assertNull(tr.getAttribute("onrollback"));
+
+        Element[] methods = tr.getElements();
+        Assert.assertEquals(4, methods.length);
+
+        Element m1 = getElementByMethod(methods, "doSomethingBad");
+        Assert.assertNotNull(m1);
+
+        Element m2 = getElementByMethod(methods, "doSomethingBad2");
+        Assert.assertNotNull(m2);
+        Assert.assertEquals("required", m2.getAttribute("propagation"));
+
+        Element m3 = getElementByMethod(methods, "doSomethingGood");
+        Assert.assertNotNull(m3);
+        Assert.assertEquals("supported", m3.getAttribute("propagation"));
+        Assert.assertEquals("{java.lang.Exception}", m3.getAttribute("norollbackfor"));
+
+        Element m4 = getElementByMethod(methods, "doSomethingLong");
+        Assert.assertNotNull(m4);
+        Assert.assertEquals("1000", m4.getAttribute("timeout"));
+        Assert.assertEquals("true", m4.getAttribute("exceptiononrollback"));
+    }
+
+    private Element getElementByMethod(Element[] e, String m) {
+        for (Element elem : e) {
+            if (m.equals(elem.getAttribute("method"))) {
+                return elem;
+            }
+        }
+        Assert.fail("Method " + m + " not found");
+        return null;
+    }
+
+    private Bundle getBundle() {
+        for (Bundle b : context.getBundles()) {
+            System.out.println(b.getSymbolicName());
+            if ("TransactionAnnotationTest".equals(b.getSymbolicName())) {
+                return b;
+            }
+        }
+        Assert.fail("Cannot find the tested bundle");
+        return null;
+    }
+
+
+}

Added: felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/test/java/org/apache/felix/ipojo/handler/transaction/test/TestInstallation.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/test/java/org/apache/felix/ipojo/handler/transaction/test/TestInstallation.java?rev=1455460&view=auto
==============================================================================
--- felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/test/java/org/apache/felix/ipojo/handler/transaction/test/TestInstallation.java (added)
+++ felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/test/java/org/apache/felix/ipojo/handler/transaction/test/TestInstallation.java Tue Mar 12 09:12:28 2013
@@ -0,0 +1,109 @@
+package org.apache.felix.ipojo.handler.transaction.test;
+
+import org.apache.felix.ipojo.ComponentInstance;
+import org.apache.felix.ipojo.HandlerFactory;
+import org.apache.felix.ipojo.handler.transaction.components.FooDelegator;
+import org.apache.felix.ipojo.handler.transaction.components.FooImpl;
+import org.apache.felix.ipojo.handler.transaction.services.CheckService;
+import org.apache.felix.ipojo.handler.transaction.services.Foo;
+import org.junit.Assert;
+import org.junit.Test;
+import org.ops4j.pax.exam.Configuration;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.OptionUtils;
+import org.ops4j.pax.tinybundles.core.TinyBundles;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.Constants;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceReference;
+
+import javax.transaction.*;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+
+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.MavenUtils.asInProject;
+import static org.ow2.chameleon.testing.tinybundles.ipojo.IPOJOStrategy.withiPOJO;
+
+public class TestInstallation extends Common {
+
+    public static final File TEST = new File("src/main/resources");
+
+
+    @Configuration
+    public Option[] config() throws IOException {
+        Option[] options = super.config();
+
+        InputStream service = TinyBundles.bundle()
+                .add(CheckService.class)
+                .add(Foo.class)
+                .set(Constants.BUNDLE_SYMBOLICNAME, "Service")
+                .set(Constants.EXPORT_PACKAGE, "org.apache.felix.ipojo.handler.transaction.services")
+                .build();
+
+        InputStream fooimpl = TinyBundles.bundle()
+                .add(FooImpl.class)
+                .set(Constants.BUNDLE_SYMBOLICNAME, "Foo Provider")
+                .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.handler.transaction.services")
+                .build(withiPOJO(new File(TEST, "foo.xml")));
+
+        InputStream test = TinyBundles.bundle()
+                .add(FooDelegator.class)
+                .set(Constants.BUNDLE_SYMBOLICNAME, "RequiredTransactionPropagation")
+                .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.handler.transaction.services, javax.transaction;version=1.1")
+                .build(withiPOJO(new File(TEST, "requires.xml")));
+
+
+        return OptionUtils.combine(
+                options,
+                provision(
+                        service,
+                        fooimpl,
+                        test
+                ));
+    }
+
+    @Test
+    public void install() throws NotSupportedException, SystemException, IllegalStateException,
+            SecurityException, HeuristicMixedException, HeuristicRollbackException, RollbackException, InvalidSyntaxException {
+        Bundle[] bundles = context.getBundles();
+        for (Bundle b : bundles) {
+            System.out.println("Bundle : " + b.getSymbolicName() + " - " + b.getState());
+            Assert.assertTrue(b.getSymbolicName(), b.getState() == Bundle.ACTIVE);
+        }
+
+        osgiHelper.waitForService(TransactionManager.class.getName(), null, 5000);
+        // Transaction Service available
+        osgiHelper.isServiceAvailable(TransactionManager.class.getName());
+        TransactionManager tm = (TransactionManager) osgiHelper.getServiceObject(TransactionManager.class.getName(), null);
+        tm.begin();
+        Assert.assertNotNull(tm.getTransaction());
+        tm.commit();
+
+        tm.begin();
+        Assert.assertNotNull(tm.getTransaction());
+        tm.rollback();
+
+        // Handler exposed
+        ServiceReference ref = osgiHelper.getServiceReference(HandlerFactory.class.getName(), "(&(handler.name=transaction)(handler.namespace=org.apache.felix.ipojo.transaction))");
+        Assert.assertNotNull(ref);
+
+        // Create an install of the components
+        ComponentInstance prov = ipojoHelper.createComponentInstance("org.apache.felix.ipojo.handler.transaction.components.FooImpl");
+        ComponentInstance under = ipojoHelper.createComponentInstance("requires-ok");
+
+        Assert.assertEquals(ComponentInstance.VALID, prov.getState());
+        Assert.assertEquals(ComponentInstance.VALID, under.getState());
+
+        ServiceReference[] refs = context.getAllServiceReferences(CheckService.class.getName(), "(instance.name=" + under.getInstanceName() + ")");
+
+//        ref = ipojoHelper.getServiceReferenceByName(CheckService.class.getName(), under.getInstanceName());
+        Assert.assertNotNull(refs);
+
+        ((CheckService) osgiHelper.getServiceObject(refs[0])).doSomethingGood();
+    }
+
+}

Added: felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/test/java/org/apache/felix/ipojo/handler/transaction/test/TestInvalidation.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/test/java/org/apache/felix/ipojo/handler/transaction/test/TestInvalidation.java?rev=1455460&view=auto
==============================================================================
--- felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/test/java/org/apache/felix/ipojo/handler/transaction/test/TestInvalidation.java (added)
+++ felix/trunk/ipojo/handler/transaction/transaction-handler-it/src/it/transaction-it/src/test/java/org/apache/felix/ipojo/handler/transaction/test/TestInvalidation.java Tue Mar 12 09:12:28 2013
@@ -0,0 +1,102 @@
+package org.apache.felix.ipojo.handler.transaction.test;
+
+import org.apache.felix.ipojo.ComponentInstance;
+import org.apache.felix.ipojo.handler.transaction.components.FooDelegator;
+import org.apache.felix.ipojo.handler.transaction.components.FooImpl;
+import org.apache.felix.ipojo.handler.transaction.services.CheckService;
+import org.apache.felix.ipojo.handler.transaction.services.Foo;
+import org.junit.Assert;
+import org.junit.Test;
+import org.ops4j.pax.exam.Configuration;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.OptionUtils;
+import org.ops4j.pax.tinybundles.core.TinyBundles;
+import org.osgi.framework.Constants;
+import org.osgi.framework.ServiceReference;
+
+import javax.transaction.*;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+
+import static org.ops4j.pax.exam.CoreOptions.provision;
+import static org.ow2.chameleon.testing.tinybundles.ipojo.IPOJOStrategy.withiPOJO;
+
+public class TestInvalidation extends Common {
+
+    public static final File TEST = new File("src/main/resources");
+
+    @Configuration
+    public Option[] config() throws IOException {
+        Option[] options = super.config();
+
+        InputStream service = TinyBundles.bundle()
+                .add(CheckService.class)
+                .add(Foo.class)
+                .set(Constants.BUNDLE_SYMBOLICNAME, "Service")
+                .set(Constants.EXPORT_PACKAGE, "org.apache.felix.ipojo.handler.transaction.services")
+                .build();
+
+        InputStream fooimpl = TinyBundles.bundle()
+                .add(FooImpl.class)
+                .set(Constants.BUNDLE_SYMBOLICNAME, "Foo Provider")
+                .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.handler.transaction.services")
+                .build(withiPOJO(new File(TEST, "foo.xml")));
+
+        InputStream test = TinyBundles.bundle()
+                .add(FooDelegator.class)
+                .set(Constants.BUNDLE_SYMBOLICNAME, "RequiredTransactionPropagation")
+                .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.handler.transaction.services, javax.transaction;version=1.1")
+                .build(withiPOJO(new File(TEST, "requires.xml")));
+
+
+        return OptionUtils.combine(
+                options,
+                provision(
+                        service,
+                        fooimpl,
+                        test
+                ));
+    }
+
+    @Test
+    public void testInvalidation() throws NotSupportedException, SystemException, SecurityException, HeuristicMixedException, HeuristicRollbackException, RollbackException {
+        final ComponentInstance prov = ipojoHelper.createComponentInstance("org.apache.felix.ipojo.handler.transaction.components.FooImpl");
+        ComponentInstance under = ipojoHelper.createComponentInstance("requires-ok");
+
+        Assert.assertEquals(ComponentInstance.VALID, prov.getState());
+        Assert.assertEquals(ComponentInstance.VALID, under.getState());
+
+        ServiceReference ref = ipojoHelper.getServiceReferenceByName(CheckService.class.getName(), under.getInstanceName());
+        Assert.assertNotNull(ref);
+
+        osgiHelper.waitForService(TransactionManager.class.getName(), null, 5000);
+        CheckService cs = (CheckService) osgiHelper.getServiceObject(ref);
+        TransactionManager tm = (TransactionManager) osgiHelper.getServiceObject(TransactionManager.class.getName(), null);
+
+        Thread thread = new Thread(new Runnable() {
+            public void run() {
+                try {
+                    Thread.sleep(2000);
+                } catch (InterruptedException e) {
+                    e.printStackTrace();
+                }
+                prov.dispose();
+            }
+        });
+
+        thread.start();
+
+        tm.begin();
+        Transaction t = tm.getTransaction();
+        cs.doSomethingLong(); // 5s, so prov should be disposed during this time and under becomes invalid
+
+        Assert.assertEquals(ComponentInstance.INVALID, under.getState());
+
+        Assert.assertEquals(Status.STATUS_MARKED_ROLLBACK, t.getStatus());
+
+        t.rollback();
+    }
+
+
+}



Mime
View raw message