Copy transaction handler test suite to the trunk

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@786967 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/ipojo/tests/handler/transaction/src/test/resources/foo.xml b/ipojo/tests/handler/transaction/src/test/resources/foo.xml
new file mode 100644
index 0000000..19f1ed8
--- /dev/null
+++ b/ipojo/tests/handler/transaction/src/test/resources/foo.xml
@@ -0,0 +1,5 @@
+<ipojo>
+	<component classname="org.apache.felix.ipojo.transaction.test.component.FooImpl">
+		<provides/>
+	</component>
+</ipojo>
\ No newline at end of file
diff --git a/ipojo/tests/handler/transaction/src/test/resources/mandatory.xml b/ipojo/tests/handler/transaction/src/test/resources/mandatory.xml
new file mode 100644
index 0000000..bb977ba
--- /dev/null
+++ b/ipojo/tests/handler/transaction/src/test/resources/mandatory.xml
@@ -0,0 +1,25 @@
+<ipojo xmlns:tr="org.apache.felix.ipojo.transaction">
+	<component classname="org.apache.felix.ipojo.transaction.test.component.FooDelegator" name="mandatory-ok">
+		<provides/>
+		<requires field="foo"/>
+		<tr:transaction field="transaction">
+			<transactionnal method="doSomethingGood" propagation="mandatory"/>
+			<transactionnal method="getCurrentTransaction" propagation="mandatory"/>
+			<transactionnal method="doSomethingBad" propagation="mandatory"/>
+			<transactionnal method="doSomethingBad2" norollbackfor="java.lang.UnsupportedOperationException" propagation="mandatory"/>
+			<transactionnal method="doSomethingLong" propagation="mandatory"/>
+		</tr:transaction>
+	</component>
+	
+	<component classname="org.apache.felix.ipojo.transaction.test.component.FooDelegator" name="mandatory-cb">
+		<provides/>
+		<requires field="foo" />
+		<tr:transaction field="transaction" onCommit="onCommit" onRollback="onRollback">
+			<transactionnal method="doSomethingGood" propagation="mandatory"/>
+			<transactionnal method="getCurrentTransaction" propagation="mandatory"/>
+			<transactionnal method="doSomethingBad" propagation="mandatory"/>
+			<transactionnal method="doSomethingBad2" norollbackfor="java.lang.UnsupportedOperationException" propagation="mandatory"/>
+			<transactionnal method="doSomethingLong" propagation="mandatory"/>
+		</tr:transaction>
+	</component>
+</ipojo>
\ No newline at end of file
diff --git a/ipojo/tests/handler/transaction/src/test/resources/never.xml b/ipojo/tests/handler/transaction/src/test/resources/never.xml
new file mode 100644
index 0000000..0a58abc
--- /dev/null
+++ b/ipojo/tests/handler/transaction/src/test/resources/never.xml
@@ -0,0 +1,25 @@
+<ipojo xmlns:tr="org.apache.felix.ipojo.transaction">
+	<component classname="org.apache.felix.ipojo.transaction.test.component.FooDelegator" name="never-ok">
+		<provides/>
+		<requires field="foo"/>
+		<tr:transaction field="transaction">
+			<transactionnal method="doSomethingGood" propagation="never"/>
+			<transactionnal method="getCurrentTransaction" propagation="never"/>
+			<transactionnal method="doSomethingBad" propagation="never"/>
+			<transactionnal method="doSomethingBad2" norollbackfor="java.lang.UnsupportedOperationException" propagation="never"/>
+			<transactionnal method="doSomethingLong" propagation="never"/>
+		</tr:transaction>
+	</component>
+	
+	<component classname="org.apache.felix.ipojo.transaction.test.component.FooDelegator" name="never-cb">
+		<provides/>
+		<requires field="foo" />
+		<tr:transaction field="transaction" onCommit="onCommit" onRollback="onRollback">
+			<transactionnal method="doSomethingGood" propagation="never"/>
+			<transactionnal method="getCurrentTransaction" propagation="never"/>
+			<transactionnal method="doSomethingBad" propagation="never"/>
+			<transactionnal method="doSomethingBad2" norollbackfor="java.lang.UnsupportedOperationException" propagation="never"/>
+			<transactionnal method="doSomethingLong" propagation="never"/>
+		</tr:transaction>
+	</component>
+</ipojo>
\ No newline at end of file
diff --git a/ipojo/tests/handler/transaction/src/test/resources/notsupported.xml b/ipojo/tests/handler/transaction/src/test/resources/notsupported.xml
new file mode 100644
index 0000000..fb44c93
--- /dev/null
+++ b/ipojo/tests/handler/transaction/src/test/resources/notsupported.xml
@@ -0,0 +1,25 @@
+<ipojo xmlns:tr="org.apache.felix.ipojo.transaction">
+	<component classname="org.apache.felix.ipojo.transaction.test.component.FooDelegator" name="notsupported-ok">
+		<provides/>
+		<requires field="foo"/>
+		<tr:transaction field="transaction">
+			<transactionnal method="doSomethingGood" propagation="notsupported"/>
+			<transactionnal method="getCurrentTransaction" propagation="notsupported"/>
+			<transactionnal method="doSomethingBad" propagation="notsupported"/>
+			<transactionnal method="doSomethingBad2" norollbackfor="java.lang.UnsupportedOperationException" propagation="notsupported"/>
+			<transactionnal method="doSomethingLong" propagation="notsupported"/>
+		</tr:transaction>
+	</component>
+	
+	<component classname="org.apache.felix.ipojo.transaction.test.component.FooDelegator" name="notsupported-cb">
+		<provides/>
+		<requires field="foo" />
+		<tr:transaction field="transaction" onCommit="onCommit" onRollback="onRollback">
+			<transactionnal method="doSomethingGood" propagation="notsupported"/>
+			<transactionnal method="getCurrentTransaction" propagation="notsupported"/>
+			<transactionnal method="doSomethingBad" propagation="notsupported"/>
+			<transactionnal method="doSomethingBad2" norollbackfor="java.lang.UnsupportedOperationException" propagation="notsupported"/>
+			<transactionnal method="doSomethingLong" propagation="notsupported"/>
+		</tr:transaction>
+	</component>
+</ipojo>
\ No newline at end of file
diff --git a/ipojo/tests/handler/transaction/src/test/resources/requires.xml b/ipojo/tests/handler/transaction/src/test/resources/requires.xml
new file mode 100644
index 0000000..ccd3221
--- /dev/null
+++ b/ipojo/tests/handler/transaction/src/test/resources/requires.xml
@@ -0,0 +1,25 @@
+<ipojo xmlns:tr="org.apache.felix.ipojo.transaction">
+	<component classname="org.apache.felix.ipojo.transaction.test.component.FooDelegator" name="requires-ok">
+		<provides/>
+		<requires field="foo"/>
+		<tr:transaction field="transaction">
+			<transactionnal method="doSomethingGood"/>
+			<transactionnal method="getCurrentTransaction"/>
+			<transactionnal method="doSomethingBad"/>
+			<transactionnal method="doSomethingBad2" norollbackfor="java.lang.UnsupportedOperationException"/>
+			<transactionnal method="doSomethingLong"/>
+		</tr:transaction>
+	</component>
+	
+	<component classname="org.apache.felix.ipojo.transaction.test.component.FooDelegator" name="requires-cb">
+		<provides/>
+		<requires field="foo" />
+		<tr:transaction field="transaction" onCommit="onCommit" onRollback="onRollback">
+			<transactionnal method="doSomethingGood"/>
+			<transactionnal method="getCurrentTransaction"/>
+			<transactionnal method="doSomethingBad"/>
+			<transactionnal method="doSomethingBad2" norollbackfor="java.lang.UnsupportedOperationException"/>
+			<transactionnal method="doSomethingLong"/>
+		</tr:transaction>
+	</component>
+</ipojo>
\ No newline at end of file
diff --git a/ipojo/tests/handler/transaction/src/test/resources/requiresnew.xml b/ipojo/tests/handler/transaction/src/test/resources/requiresnew.xml
new file mode 100644
index 0000000..d91aa58
--- /dev/null
+++ b/ipojo/tests/handler/transaction/src/test/resources/requiresnew.xml
@@ -0,0 +1,25 @@
+<ipojo xmlns:tr="org.apache.felix.ipojo.transaction">
+	<component classname="org.apache.felix.ipojo.transaction.test.component.FooDelegator" name="requiresnew-ok">
+		<provides/>
+		<requires field="foo"/>
+		<tr:transaction field="transaction">
+			<transactionnal method="doSomethingGood" propagation="requiresnew"/>
+			<transactionnal method="getCurrentTransaction" propagation="requiresnew"/>
+			<transactionnal method="doSomethingBad" propagation="requiresnew" exceptiononrollback="true"/>
+			<transactionnal method="doSomethingBad2" norollbackfor="java.lang.UnsupportedOperationException" propagation="requiresnew"/>
+			<transactionnal method="doSomethingLong" propagation="requiresnew"/>
+		</tr:transaction>
+	</component>
+	
+	<component classname="org.apache.felix.ipojo.transaction.test.component.FooDelegator" name="requiresnew-cb">
+		<provides/>
+		<requires field="foo" />
+		<tr:transaction field="transaction" onCommit="onCommit" onRollback="onRollback">
+			<transactionnal method="doSomethingGood" propagation="requiresnew"/>
+			<transactionnal method="getCurrentTransaction" propagation="requiresnew"/>
+			<transactionnal method="doSomethingBad" propagation="requiresnew"/>
+			<transactionnal method="doSomethingBad2" norollbackfor="java.lang.UnsupportedOperationException" propagation="requiresnew"/>
+			<transactionnal method="doSomethingLong" propagation="requiresnew"/>
+		</tr:transaction>
+	</component>
+</ipojo>
\ No newline at end of file
diff --git a/ipojo/tests/handler/transaction/src/test/resources/supported.xml b/ipojo/tests/handler/transaction/src/test/resources/supported.xml
new file mode 100644
index 0000000..d4fc6b5
--- /dev/null
+++ b/ipojo/tests/handler/transaction/src/test/resources/supported.xml
@@ -0,0 +1,25 @@
+<ipojo xmlns:tr="org.apache.felix.ipojo.transaction">
+	<component classname="org.apache.felix.ipojo.transaction.test.component.FooDelegator" name="supported-ok">
+		<provides/>
+		<requires field="foo"/>
+		<tr:transaction field="transaction">
+			<transactionnal method="doSomethingGood" propagation="supported"/>
+			<transactionnal method="getCurrentTransaction" propagation="supported"/>
+			<transactionnal method="doSomethingBad" propagation="supported"/>
+			<transactionnal method="doSomethingBad2" norollbackfor="java.lang.UnsupportedOperationException" propagation="supported"/>
+			<transactionnal method="doSomethingLong" propagation="supported"/>
+		</tr:transaction>
+	</component>
+	
+	<component classname="org.apache.felix.ipojo.transaction.test.component.FooDelegator" name="supported-cb">
+		<provides/>
+		<requires field="foo" />
+		<tr:transaction field="transaction" onCommit="onCommit" onRollback="onRollback">
+			<transactionnal method="doSomethingGood" propagation="supported"/>
+			<transactionnal method="getCurrentTransaction" propagation="supported"/>
+			<transactionnal method="doSomethingBad" propagation="supported"/>
+			<transactionnal method="doSomethingBad2" norollbackfor="java.lang.UnsupportedOperationException" propagation="supported"/>
+			<transactionnal method="doSomethingLong" propagation="supported"/>
+		</tr:transaction>
+	</component>
+</ipojo>
\ No newline at end of file