[jboss-svn-commits] JBL Code SVN: r37713 - in labs/jbosstm/trunk/XTS/localjunit: WSTX and 18 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Wed Nov 9 09:44:32 EST 2011
Author: zhfeng
Date: 2011-11-09 09:44:32 -0500 (Wed, 09 Nov 2011)
New Revision: 37713
Added:
labs/jbosstm/trunk/XTS/localjunit/WSTX/
labs/jbosstm/trunk/XTS/localjunit/WSTX/pom.xml
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/junit/
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/junit/basic/
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/junit/basic/PrintTransaction.java
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/junit/
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/junit/basic/
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/junit/basic/PrintTransactionTest.java
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/resources/
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/resources/arquillian.xml
Log:
JBTM-954 update to add PrintTransaction in wstx to use arquillian
Property changes on: labs/jbosstm/trunk/XTS/localjunit/WSTX
___________________________________________________________________
Added: svn:ignore
+ target
.project
.classpath
.settings
Added: labs/jbosstm/trunk/XTS/localjunit/WSTX/pom.xml
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WSTX/pom.xml (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WSTX/pom.xml 2011-11-09 14:44:32 UTC (rev 37713)
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- JBoss, Home of Professional Open Source Copyright 2008, Red Hat Middleware LLC, and others contributors as indicated by the @authors tag. All rights reserved. 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. -->
+<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">
+ <groupId>org.jboss.narayana.xts</groupId>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>localjunit-wstx-tests</artifactId>
+ <packaging>jar</packaging>
+ <name>wstx unit tests</name>
+ <description>wstx unit tests</description>
+ <version>5.0.0.M2-SNAPSHOT</version>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.3.1</version>
+ <configuration>
+ <source>1.6</source>
+ <target>1.6</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.narayana.xts</groupId>
+ <artifactId>jbossxts</artifactId>
+ <version>5.0.0.M2-SNAPSHOT</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.inject</groupId>
+ <artifactId>javax.inject</artifactId>
+ <version>1</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.arquillian.junit</groupId>
+ <artifactId>arquillian-junit-container</artifactId>
+ <version>1.0.0.CR5</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <profiles>
+ <profile>
+ <!-- The default profile skips all tests, though you can tune it
+ to run just unit tests based on a custom pattern -->
+ <!-- Seperate profiles are provided for running all tests, including
+ Arquillian tests that execute in the specified container -->
+ <id>default</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.7.2</version>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.as</groupId>
+ <artifactId>jboss-as-arquillian-container-managed</artifactId>
+ <version>7.0.2.Final</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ </profile>
+ </profiles>
+</project>
Added: labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/junit/basic/PrintTransaction.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/junit/basic/PrintTransaction.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/junit/basic/PrintTransaction.java 2011-11-09 14:44:32 UTC (rev 37713)
@@ -0,0 +1,23 @@
+package com.arjuna.wst11.tests.junit.basic;
+
+import javax.inject.Named;
+
+import com.arjuna.mw.wst11.UserTransaction;
+
+ at Named
+public class PrintTransaction {
+ public void testPrintTransaction()
+ throws Exception
+ {
+ UserTransaction ut = UserTransaction.getUserTransaction();
+
+ ut.begin();
+
+ System.out.println("Started: "+ut);
+
+ ut.commit();
+
+ System.out.println("\nCurrent: "+ut);
+
+ }
+}
\ No newline at end of file
Added: labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/junit/basic/PrintTransactionTest.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/junit/basic/PrintTransactionTest.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/junit/basic/PrintTransactionTest.java 2011-11-09 14:44:32 UTC (rev 37713)
@@ -0,0 +1,79 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: PrintTransaction.java,v 1.1.24.1 2005/11/22 10:36:12 kconner Exp $
+ */
+package com.arjuna.wst11.tests.junit.basic;
+
+import javax.inject.Inject;
+
+import org.junit.Test;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.ArchivePaths;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.EmptyAsset;
+import org.jboss.shrinkwrap.api.asset.StringAsset;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.runner.RunWith;
+
+/**
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: PrintTransaction.java,v 1.1.24.1 2005/11/22 10:36:12 kconner Exp $
+ * @since 1.0.
+ */
+
+ at RunWith(Arquillian.class)
+public class PrintTransactionTest
+{
+ @Inject
+ PrintTransaction test;
+
+ @Deployment
+ public static WebArchive createDeployment() {
+ WebArchive archive = ShrinkWrap
+ .create(WebArchive.class, "test.war")
+ .addClass(PrintTransaction.class)
+ .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
+
+ archive.delete(ArchivePaths.create("META-INF/MANIFEST.MF"));
+
+ // Need to make sure we add the arquillian-service and msc as a
+ // dependency
+ final String ManifestMF = "Manifest-Version: 1.0\n"
+ + "Dependencies: org.jboss.modules,deployment.arquillian-service,org.jboss.msc,org.jboss.jts,org.jboss.xts\n";
+ archive.setManifest(new StringAsset(ManifestMF));
+
+ return archive;
+ }
+
+ @Test
+ public void test() throws Exception {
+ test.testPrintTransaction();
+ }
+}
Added: labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/resources/arquillian.xml
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/resources/arquillian.xml (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/resources/arquillian.xml 2011-11-09 14:44:32 UTC (rev 37713)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<arquillian xmlns="http://jboss.org/schema/arquillian" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jboss.org/schema/arquillian
+ http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
+ <!-- Example configuration for a remote JBoss AS 7 instance -->
+ <container qualifier="jboss-as" default="true">
+ <protocol type="jmx-as7">
+ <property name="executionType">REMOTE</property>
+ </protocol>
+ <configuration>
+ <property name="serverConfig">standalone-xts.xml</property>
+ </configuration>
+ </container>
+</arquillian>
More information about the jboss-svn-commits
mailing list