[jboss-svn-commits] JBL Code SVN: r37123 - in labs/jbosstm/trunk/ArjunaJTA/examples/simple_maven_example: src/main/java and 1 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Thu Jun 23 10:01:51 EDT 2011
Author: tomjenkinson
Date: 2011-06-23 10:01:50 -0400 (Thu, 23 Jun 2011)
New Revision: 37123
Added:
labs/jbosstm/trunk/ArjunaJTA/examples/simple_maven_example/README
labs/jbosstm/trunk/ArjunaJTA/examples/simple_maven_example/src/main/java/TransactionManagerExample.java
labs/jbosstm/trunk/ArjunaJTA/examples/simple_maven_example/src/test/java/TransactionManagerExampleTest.java
Removed:
labs/jbosstm/trunk/ArjunaJTA/examples/simple_maven_example/src/test/java/TransactionManagerTest.java
Modified:
labs/jbosstm/trunk/ArjunaJTA/examples/simple_maven_example/pom.xml
Log:
JBTM-845 reorg
Added: labs/jbosstm/trunk/ArjunaJTA/examples/simple_maven_example/README
===================================================================
--- labs/jbosstm/trunk/ArjunaJTA/examples/simple_maven_example/README (rev 0)
+++ labs/jbosstm/trunk/ArjunaJTA/examples/simple_maven_example/README 2011-06-23 14:01:50 UTC (rev 37123)
@@ -0,0 +1,2 @@
+This shows an example of how to include the jbossjta artifact in your own projects:
+ mvn compile exec:java
Modified: labs/jbosstm/trunk/ArjunaJTA/examples/simple_maven_example/pom.xml
===================================================================
--- labs/jbosstm/trunk/ArjunaJTA/examples/simple_maven_example/pom.xml 2011-06-23 13:55:37 UTC (rev 37122)
+++ labs/jbosstm/trunk/ArjunaJTA/examples/simple_maven_example/pom.xml 2011-06-23 14:01:50 UTC (rev 37123)
@@ -27,6 +27,7 @@
<description>simple_maven_example</description>
<build>
<plugins>
+ <!-- This plugin allows our example to be tested -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
@@ -34,6 +35,7 @@
<workingDirectory>${build.directory}/surefire-working-directory</workingDirectory>
</configuration>
</plugin>
+ <!-- This plugin allows our example to be executed by maven by default -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
@@ -45,6 +47,7 @@
</execution>
</executions>
<configuration>
+ <mainClass>TransactionManagerExample</mainClass>
<workingDirectory>${build.directory}/exec-working-directory</workingDirectory>
</configuration>
</plugin>
Added: labs/jbosstm/trunk/ArjunaJTA/examples/simple_maven_example/src/main/java/TransactionManagerExample.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTA/examples/simple_maven_example/src/main/java/TransactionManagerExample.java (rev 0)
+++ labs/jbosstm/trunk/ArjunaJTA/examples/simple_maven_example/src/main/java/TransactionManagerExample.java 2011-06-23 14:01:50 UTC (rev 37123)
@@ -0,0 +1,48 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2011, Red Hat, Inc. and/or its affiliates,
+ * and individual contributors as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2011,
+ * @author JBoss, by Red Hat.
+ */
+import javax.transaction.TransactionManager;
+
+/**
+ * This example shows how you can access the transaction manager.
+ */
+public class TransactionManagerExample {
+
+ /**
+ * Get a reference to the transaction manager and call begin and rollback on
+ * it.
+ *
+ * @param args
+ * The command line arguments.
+ * @throws Exception
+ * In case of error.
+ */
+ public static void main(String[] args) throws Exception {
+ TransactionManager tm = com.arjuna.ats.jta.TransactionManager
+ .transactionManager();
+
+ tm.begin();
+ System.err.println(tm.getTransaction());
+
+ tm.rollback();
+ System.err.println(tm.getTransaction());
+ }
+
+}
Added: labs/jbosstm/trunk/ArjunaJTA/examples/simple_maven_example/src/test/java/TransactionManagerExampleTest.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTA/examples/simple_maven_example/src/test/java/TransactionManagerExampleTest.java (rev 0)
+++ labs/jbosstm/trunk/ArjunaJTA/examples/simple_maven_example/src/test/java/TransactionManagerExampleTest.java 2011-06-23 14:01:50 UTC (rev 37123)
@@ -0,0 +1,30 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2011, Red Hat, Inc. and/or its affiliates,
+ * and individual contributors as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2011,
+ * @author JBoss, by Red Hat.
+ */
+import org.junit.Test;
+
+public class TransactionManagerExampleTest {
+
+ @Test
+ public void testSettingUpTransactionManager() throws Exception {
+ TransactionManagerExample.main(null);
+ }
+
+}
Deleted: labs/jbosstm/trunk/ArjunaJTA/examples/simple_maven_example/src/test/java/TransactionManagerTest.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTA/examples/simple_maven_example/src/test/java/TransactionManagerTest.java 2011-06-23 13:55:37 UTC (rev 37122)
+++ labs/jbosstm/trunk/ArjunaJTA/examples/simple_maven_example/src/test/java/TransactionManagerTest.java 2011-06-23 14:01:50 UTC (rev 37123)
@@ -1,40 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2011, Red Hat, Inc. and/or its affiliates,
- * and individual contributors as indicated by the @author tags.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2011,
- * @author JBoss, by Red Hat.
- */
-import javax.transaction.TransactionManager;
-
-import org.junit.Test;
-
-public class TransactionManagerTest {
-
-
- @Test
- public void testSettingUpTransactionManager() throws Exception {
- TransactionManager tm = com.arjuna.ats.jta.TransactionManager.transactionManager();
-
- tm.begin();
-
- System.err.println( tm.getTransaction() );
-
- tm.rollback();
- System.err.println( tm.getTransaction() );
- }
-
-}
More information about the jboss-svn-commits
mailing list