[jboss-cvs] JBossAS SVN: r80179 - in branches/JBPAPP_4_2_0_GA_CP/testsuite: src/main/org/jboss/test/cluster/invokerha/ejb and 1 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Oct 29 07:01:13 EDT 2008
Author: galder.zamarreno at jboss.com
Date: 2008-10-29 07:01:13 -0400 (Wed, 29 Oct 2008)
New Revision: 80179
Added:
branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/cluster/invokerha/ejb/test/
branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/cluster/invokerha/ejb/test/UserTransactionStickyUnitTestCase.java
Removed:
branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/cluster/invokerha/ejb/UserTransactionStickyUnitTestCase.java
Modified:
branches/JBPAPP_4_2_0_GA_CP/testsuite/build.xml
Log:
[JBPAPP-1267] Added org/jboss/test/cluster/invokerha/ejb/test to cluster excludes in order to avoid being called like a standard unit test. Alos, moved user transaction sticky unit test case to a test/ folder as per other unit tests.
Modified: branches/JBPAPP_4_2_0_GA_CP/testsuite/build.xml
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/testsuite/build.xml 2008-10-29 10:59:57 UTC (rev 80178)
+++ branches/JBPAPP_4_2_0_GA_CP/testsuite/build.xml 2008-10-29 11:01:13 UTC (rev 80179)
@@ -582,7 +582,7 @@
<include name="org/jboss/test/cluster/partition/test/PartitionRestartUnitTestCase.class"/>
</patternset>
<patternset id="cluster.ustxsticky.includes">
- <include name="org/jboss/test/cluster/invokerha/ejb/UserTransactionStickyUnitTestCase.class"/>
+ <include name="org/jboss/test/cluster/invokerha/ejb/test/UserTransactionStickyUnitTestCase.class"/>
</patternset>
<patternset id="cluster.excludes">
<exclude name="org/jboss/test/cluster/test/*TestCase.class"/>
@@ -591,6 +591,7 @@
<exclude name="org/jboss/test/cluster/jmx/test/*TestCase.class"/>
<exclude name="org/jboss/test/testbeancluster/test/*TestCase.class"/>
<exclude name="org/jboss/test/ha/farm/test/*TestCase.class"/>
+ <exclude name="org/jboss/test/cluster/invokerha/ejb/test/*TestCase.class"/>
</patternset>
<patternset id="one.test.includes">
<include name="${test}"/>
Deleted: branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/cluster/invokerha/ejb/UserTransactionStickyUnitTestCase.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/cluster/invokerha/ejb/UserTransactionStickyUnitTestCase.java 2008-10-29 10:59:57 UTC (rev 80178)
+++ branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/cluster/invokerha/ejb/UserTransactionStickyUnitTestCase.java 2008-10-29 11:01:13 UTC (rev 80179)
@@ -1,120 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY 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 along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.cluster.invokerha.ejb;
-
-import java.util.Properties;
-
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.transaction.Status;
-import javax.transaction.UserTransaction;
-
-import junit.framework.Test;
-
-import org.jboss.logging.Logger;
-import org.jboss.test.JBossClusteredTestCase;
-import org.jnp.interfaces.NamingContext;
-
-/**
- * UserTransactionStickyTestCase.
- *
- * @author <a href="mailto:galder.zamarreno at jboss.com">Galder Zamarreno</a>
- */
-public class UserTransactionStickyUnitTestCase extends JBossClusteredTestCase
-{
- private static final String deployment = "cluster-invokerha-ejb.jar";
-
- private static final Logger log = Logger.getLogger(UserTransactionStickyUnitTestCase.class);
-
- private Context ctx;
-
- public UserTransactionStickyUnitTestCase(String name)
- {
- super(name);
- }
-
- public static Test suite() throws Exception
- {
- return getDeploySetup(UserTransactionStickyUnitTestCase.class, deployment);
- }
-
- public void testSeveralTransactionalStickyCalls() throws Exception
- {
- severalTransactionalCalls(3, 3, "ejb/UserTransactionStickyEjb");
- }
-
- private void severalTransactionalCalls(int numTxs, int numCallsPerTx, String jndiName) throws Exception
- {
- UserTransaction tx;
-
- ctx = createDefaultPartitionContext();
-
- for (int i = 1; i <= numTxs; i++)
- {
- tx = (UserTransaction)ctx.lookup("UserTransaction");
- tx.begin();
- try
- {
- UserTransactionStickyHome home = (UserTransactionStickyHome)ctx.lookup(jndiName);
- UserTransactionStickyRemote bean = home.create();
- for (int j = 1; j <= numCallsPerTx; j++)
- {
- String origin = "tx" + i + "-c" + j;
- log(origin + " " + bean.amISticky());
- }
- log("");
- }
- catch (Exception e)
- {
- tx.setRollbackOnly(); // Force a rollback for this error
- throw e;
- }
- finally
- {
- if (tx.getStatus() == Status.STATUS_ACTIVE)
- tx.commit();
- else
- tx.rollback();
- }
- }
- }
-
- private Properties getDefaultProperties()
- {
- Properties p = new Properties();
- p.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
- p.put(Context.URL_PKG_PREFIXES, "jboss.naming:org.jnp.interfaces");
- return p;
- }
-
- private Context createDefaultPartitionContext() throws Exception
- {
- Properties p = getDefaultProperties();
- p.put(NamingContext.JNP_PARTITION_NAME, "DefaultPartition"); // partition name.
- return new InitialContext(p);
- }
-
- private static void log(Object message)
- {
- log.info(message);
- }
-}
Copied: branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/cluster/invokerha/ejb/test/UserTransactionStickyUnitTestCase.java (from rev 80140, branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/cluster/invokerha/ejb/UserTransactionStickyUnitTestCase.java)
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/cluster/invokerha/ejb/test/UserTransactionStickyUnitTestCase.java (rev 0)
+++ branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/cluster/invokerha/ejb/test/UserTransactionStickyUnitTestCase.java 2008-10-29 11:01:13 UTC (rev 80179)
@@ -0,0 +1,122 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY 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 along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.cluster.invokerha.ejb.test;
+
+import java.util.Properties;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.transaction.Status;
+import javax.transaction.UserTransaction;
+
+import junit.framework.Test;
+
+import org.jboss.logging.Logger;
+import org.jboss.test.JBossClusteredTestCase;
+import org.jboss.test.cluster.invokerha.ejb.UserTransactionStickyHome;
+import org.jboss.test.cluster.invokerha.ejb.UserTransactionStickyRemote;
+import org.jnp.interfaces.NamingContext;
+
+/**
+ * UserTransactionStickyTestCase.
+ *
+ * @author <a href="mailto:galder.zamarreno at jboss.com">Galder Zamarreno</a>
+ */
+public class UserTransactionStickyUnitTestCase extends JBossClusteredTestCase
+{
+ private static final String deployment = "cluster-invokerha-ejb.jar";
+
+ private static final Logger log = Logger.getLogger(UserTransactionStickyUnitTestCase.class);
+
+ private Context ctx;
+
+ public UserTransactionStickyUnitTestCase(String name)
+ {
+ super(name);
+ }
+
+ public static Test suite() throws Exception
+ {
+ return getDeploySetup(UserTransactionStickyUnitTestCase.class, deployment);
+ }
+
+ public void testSeveralTransactionalStickyCalls() throws Exception
+ {
+ severalTransactionalCalls(3, 3, "ejb/UserTransactionStickyEjb");
+ }
+
+ private void severalTransactionalCalls(int numTxs, int numCallsPerTx, String jndiName) throws Exception
+ {
+ UserTransaction tx;
+
+ ctx = createDefaultPartitionContext();
+
+ for (int i = 1; i <= numTxs; i++)
+ {
+ tx = (UserTransaction)ctx.lookup("UserTransaction");
+ tx.begin();
+ try
+ {
+ UserTransactionStickyHome home = (UserTransactionStickyHome)ctx.lookup(jndiName);
+ UserTransactionStickyRemote bean = home.create();
+ for (int j = 1; j <= numCallsPerTx; j++)
+ {
+ String origin = "tx" + i + "-c" + j;
+ log(origin + " " + bean.amISticky());
+ }
+ log("");
+ }
+ catch (Exception e)
+ {
+ tx.setRollbackOnly(); // Force a rollback for this error
+ throw e;
+ }
+ finally
+ {
+ if (tx.getStatus() == Status.STATUS_ACTIVE)
+ tx.commit();
+ else
+ tx.rollback();
+ }
+ }
+ }
+
+ private Properties getDefaultProperties()
+ {
+ Properties p = new Properties();
+ p.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
+ p.put(Context.URL_PKG_PREFIXES, "jboss.naming:org.jnp.interfaces");
+ return p;
+ }
+
+ private Context createDefaultPartitionContext() throws Exception
+ {
+ Properties p = getDefaultProperties();
+ p.put(NamingContext.JNP_PARTITION_NAME, "DefaultPartition"); // partition name.
+ return new InitialContext(p);
+ }
+
+ private static void log(Object message)
+ {
+ log.info(message);
+ }
+}
Property changes on: branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/cluster/invokerha/ejb/test/UserTransactionStickyUnitTestCase.java
___________________________________________________________________
Name: svn:mergeinfo
+
More information about the jboss-cvs-commits
mailing list