[jboss-cvs] JBossAS SVN: r93533 - in projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager: unit and 2 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Sep 15 09:45:22 EDT 2009
Author: gurkanerdogdu
Date: 2009-09-15 09:45:21 -0400 (Tue, 15 Sep 2009)
New Revision: 93533
Added:
projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/common/MockLocalTransaction.java
projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/common/MockXAResource.java
projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/ConnectionRecordTestCase.java
projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/ConnectionValidatorTestCase.java
projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/IdleRemoverTestCase.java
projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/pool/
projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/pool/PoolParamsTestCase.java
projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/pool/PoolingTestCase.java
projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/pool/PreFillPoolingTestCase.java
projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/pool/package.html
projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/tx/
projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/tx/TxConnectionManagerTestCase.java
projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/tx/XATxConnectionManagerTestCase.java
projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/tx/package.html
Removed:
projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/PoolParamsTestCase.java
Modified:
projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/common/MockManagedConnection.java
projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/AbstractConnectionManagerTestCase.java
Log:
[JBJCA-165] Connection Pooling JUnit & Integration Tests
Added: projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/common/MockLocalTransaction.java
===================================================================
--- projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/common/MockLocalTransaction.java (rev 0)
+++ projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/common/MockLocalTransaction.java 2009-09-15 13:45:21 UTC (rev 93533)
@@ -0,0 +1,60 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008-2009, 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.jca.test.core.connectionmanager.common;
+
+import javax.resource.ResourceException;
+import javax.resource.spi.LocalTransaction;
+
+/**
+ * Mock local transaction.
+ * @author <a href="mailto:gurkanerdogdu at yahoo.com">Gurkan Erdogdu</a>
+ * @version $Rev$ $Date$
+ *
+ */
+public class MockLocalTransaction implements LocalTransaction
+{
+
+ /**
+ * {@inheritDoc}
+ */
+ public void begin() throws ResourceException
+ {
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void commit() throws ResourceException
+ {
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void rollback() throws ResourceException
+ {
+
+ }
+
+}
Property changes on: projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/common/MockLocalTransaction.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Modified: projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/common/MockManagedConnection.java
===================================================================
--- projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/common/MockManagedConnection.java 2009-09-15 13:41:06 UTC (rev 93532)
+++ projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/common/MockManagedConnection.java 2009-09-15 13:45:21 UTC (rev 93533)
@@ -104,7 +104,7 @@
public LocalTransaction getLocalTransaction() throws ResourceException
{
- return null;
+ return new MockLocalTransaction();
}
/**
@@ -134,7 +134,7 @@
public XAResource getXAResource() throws ResourceException
{
- return null;
+ return new MockXAResource();
}
/**
Added: projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/common/MockXAResource.java
===================================================================
--- projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/common/MockXAResource.java (rev 0)
+++ projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/common/MockXAResource.java 2009-09-15 13:45:21 UTC (rev 93533)
@@ -0,0 +1,126 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008-2009, 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.jca.test.core.connectionmanager.common;
+
+import javax.transaction.xa.XAException;
+import javax.transaction.xa.XAResource;
+import javax.transaction.xa.Xid;
+
+/**
+ * Mock XAResource.
+ * @author <a href="mailto:gurkanerdogdu at yahoo.com">Gurkan Erdogdu</a>
+ * @version $Rev$ $Date$
+ *
+ */
+public class MockXAResource implements XAResource
+{
+ /**
+ * {@inheritDoc}
+ */
+ public void commit(Xid xid, boolean onePhase) throws XAException
+ {
+
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void end(Xid xid, int flags) throws XAException
+ {
+
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void forget(Xid xid) throws XAException
+ {
+
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int getTransactionTimeout() throws XAException
+ {
+
+ return 0;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isSameRM(XAResource xares) throws XAException
+ {
+
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int prepare(Xid xid) throws XAException
+ {
+
+ return 0;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Xid[] recover(int flag) throws XAException
+ {
+
+ return new Xid[0];
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void rollback(Xid xid) throws XAException
+ {
+
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean setTransactionTimeout(int seconds) throws XAException
+ {
+
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void start(Xid xid, int flags) throws XAException
+ {
+
+
+ }
+
+}
Property changes on: projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/common/MockXAResource.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Modified: projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/AbstractConnectionManagerTestCase.java
===================================================================
--- projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/AbstractConnectionManagerTestCase.java 2009-09-15 13:41:06 UTC (rev 93532)
+++ projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/AbstractConnectionManagerTestCase.java 2009-09-15 13:45:21 UTC (rev 93533)
@@ -151,7 +151,7 @@
* testAllocationRetry.
*/
@Test
- public void testAllocationRetry()
+ public void testGetAllocationRetry()
{
assertEquals(0, connectionManager.getAllocationRetry());
connectionManager.setAllocationRetry(5);
@@ -177,7 +177,7 @@
@Test
public void testGetTransactionManagerInstance()
{
- assertNull(connectionManager.getTransactionManagerInstance());
+ assertNull(connectionManager.getTransactionManager());
}
/**
@@ -266,8 +266,115 @@
connectionManager.allocateConnection(new MockManagedConnectionFactory(), null);
}
+ /**
+ * testGetManagedConnections.
+ */
+ @Test
+ public void testGetManagedConnections()
+ {
+
+ }
/**
+ * testIdleTimeout.
+ * @throws Exception for exception
+ */
+ @Test
+ public void testIdleTimeout() throws Exception
+ {
+
+ }
+
+ /**
+ * testPartialIdleTimeout.
+ * @throws Exception for exception.
+ */
+ @Test
+ public void testPartialIdleTimeout() throws Exception
+ {
+
+ }
+
+ /**
+ * testFillToMin.
+ * @throws Exception for exception
+ */
+ @Test
+ public void testFillToMin() throws Exception
+ {
+
+ }
+
+ /**
+ * testPrefillPool.
+ * @throws Exception for exception
+ */
+ @Test
+ public void testPrefillPool() throws Exception
+ {
+
+
+ }
+
+ /**
+ * testNonStrictMinPool.
+ * @throws Exception for exception
+ */
+ @Test
+ public void testNonStrictMinPool() throws Exception
+ {
+
+ }
+
+ /**
+ * testStrictMinPool.
+ * @throws Exception for exception
+ */
+ @Test
+ public void testStrictMinPool() throws Exception
+ {
+
+ }
+
+ /**
+ * testMisConfiguredFillToMin.
+ * @throws Exception for exception
+ */
+ public void testMisConfiguredFillToMin() throws Exception
+ {
+
+ }
+
+ /**
+ * testChangedMaximum.
+ * @throws Exception for exception.
+ */
+ @Test
+ public void testChangedMaximum() throws Exception
+ {
+
+ }
+
+ /**
+ * testAllocationRetry.
+ * @throws Exception for exception.
+ */
+ @Test
+ public void testAllocationRetry() throws Exception
+ {
+
+ }
+
+ /**
+ * testAllocationRetryMultiThread.
+ * @throws Exception for exception
+ */
+ public void testAllocationRetryMultiThread() throws Exception
+ {
+
+ }
+
+ /**
* Destroy.
*/
@AfterClass
Added: projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/ConnectionRecordTestCase.java
===================================================================
--- projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/ConnectionRecordTestCase.java (rev 0)
+++ projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/ConnectionRecordTestCase.java 2009-09-15 13:45:21 UTC (rev 93533)
@@ -0,0 +1,92 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008-2009, 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.jca.test.core.connectionmanager.unit;
+
+import org.jboss.jca.core.connectionmanager.ConnectionRecord;
+import org.jboss.jca.core.connectionmanager.listener.NoTxConnectionListener;
+import org.jboss.jca.test.core.connectionmanager.common.MockConnectionRequestInfo;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * ConnectionRecordTestCase.
+ * @author <a href="mailto:gurkanerdogdu at yahoo.com">Gurkan Erdogdu</a>
+ * @version $Rev$ $Date$
+ *
+ */
+public class ConnectionRecordTestCase
+{
+ private static ConnectionRecord cr = null;
+ private static Object connection = new Object();
+ private static MockConnectionRequestInfo cri = new MockConnectionRequestInfo();
+
+ /**
+ * init.
+ */
+ @BeforeClass
+ public static void init()
+ {
+ cr = new ConnectionRecord(null, connection, cri);
+ }
+
+ /**
+ * testConnectionListenerIsNull.
+ */
+ @Test
+ public void testConnectionListenerIsNull()
+ {
+ assertNull(cr.getConnectionListener());
+ }
+
+ /**
+ * testConnectionListenerIsNotNull.
+ */
+ @Test
+ public void testConnectionListenerIsNotNull()
+ {
+ ConnectionRecord other = new ConnectionRecord(new NoTxConnectionListener(null, null, null, null),
+ connection, cri);
+ assertNotNull(other.getConnectionListener());
+ }
+
+ /**
+ * testConnectionIsNotNull.
+ */
+ @Test
+ public void testConnectionIsNotNull()
+ {
+ assertNotNull(cr.getConnection());
+ }
+
+ /**
+ * testCriIsNotNull.
+ */
+ @Test
+ public void testCriIsNotNull()
+ {
+ assertNotNull(cr.getCri());
+ }
+
+}
Property changes on: projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/ConnectionRecordTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/ConnectionValidatorTestCase.java
===================================================================
--- projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/ConnectionValidatorTestCase.java (rev 0)
+++ projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/ConnectionValidatorTestCase.java 2009-09-15 13:45:21 UTC (rev 93533)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008-2009, 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.jca.test.core.connectionmanager.unit;
+
+import org.junit.Test;
+
+/**
+ * Connection Validator Tests.
+ * @author <a href="mailto:gurkanerdogdu at yahoo.com">Gurkan Erdogdu</a>
+ * @version $Rev$ $Date$
+ *
+ */
+public class ConnectionValidatorTestCase
+{
+ /**
+ * testValidateConnections.
+ */
+ @Test
+ public void testValidateConnections()
+ {
+
+ }
+}
Property changes on: projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/ConnectionValidatorTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/IdleRemoverTestCase.java
===================================================================
--- projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/IdleRemoverTestCase.java (rev 0)
+++ projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/IdleRemoverTestCase.java 2009-09-15 13:45:21 UTC (rev 93533)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008-2009, 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.jca.test.core.connectionmanager.unit;
+
+import org.junit.Test;
+
+/**
+ * IdleRemoverTestCase.
+ * @author <a href="mailto:gurkanerdogdu at yahoo.com">Gurkan Erdogdu</a>
+ * @version $Rev$ $Date$
+ *
+ */
+public class IdleRemoverTestCase
+{
+ /**
+ * testIdleRemoveConnections.
+ */
+ @Test
+ public void testIdleRemoveConnections()
+ {
+
+ }
+
+}
Property changes on: projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/IdleRemoverTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Deleted: projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/PoolParamsTestCase.java
===================================================================
--- projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/PoolParamsTestCase.java 2009-09-15 13:41:06 UTC (rev 93532)
+++ projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/PoolParamsTestCase.java 2009-09-15 13:45:21 UTC (rev 93533)
@@ -1,136 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008-2009, 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.jca.test.core.connectionmanager.unit;
-
-import org.jboss.jca.core.connectionmanager.pool.PoolParams;
-
-import org.junit.Test;
-
-import static org.junit.Assert.*;
-
-/**
- * <code>PoolParams</code> unit test.
- *
- * @author gurkanerdogdu
- * @version $Rev$ $Date$
- *
- */
-public class PoolParamsTestCase
-{
- /**
- * Test {@link PoolParams#getMinSize()}
- */
- @Test
- public void testMinSize()
- {
- PoolParams params = new PoolParams();
- assertEquals(0, params.getMinSize());
- params.setMinSize(10);
- assertEquals(10, params.getMinSize());
- }
-
- /**
- * Test {@link PoolParams#getMaxSize()}
- */
- @Test
- public void testMaxSize()
- {
- PoolParams params = new PoolParams();
- assertEquals(10, params.getMaxSize());
- params.setMaxSize(20);
- assertEquals(20, params.getMaxSize());
- }
-
- /**
- * Test {@link PoolParams#getBlockingTimeout()}
- */
- @Test
- public void testBlockingTimeout()
- {
- PoolParams params = new PoolParams();
- assertEquals(30000, params.getBlockingTimeout());
- params.setBlockingTimeout(60000);
- assertEquals(60000, params.getBlockingTimeout());
- }
-
- /**
- * Test {@link PoolParams#getIdleTimeout()}
- */
- @Test
- public void testIdleTimeout()
- {
- PoolParams params = new PoolParams();
- assertEquals(1000 * 60 * 30, params.getIdleTimeout());
- params.setIdleTimeout(1000 * 60 * 20);
- assertEquals(1000 * 60 * 20, params.getIdleTimeout());
- }
-
- /**
- * Test {@link PoolParams#getBackgroundValidationInterval()}
- */
- @Test
- public void testBackgroundValidationInterval()
- {
- PoolParams params = new PoolParams();
- assertEquals(0L, params.getBackgroundValidationInterval());
- params.setBackgroundValidationInterval(50000L);
- assertEquals(50000L, params.getBackgroundValidationInterval());
- }
-
- /**
- * Test {@link PoolParams#isPrefill()}
- */
- @Test
- public void testIsPrefill()
- {
- PoolParams params = new PoolParams();
- assertFalse("Prefill must be false", params.isPrefill());
- params.setPrefill(true);
- assertTrue("Prefill must be true", params.isPrefill());
- }
-
- /**
- * Test {@link PoolParams#isStrictMin()}
- */
- @Test
- public void testIsStrictMin()
- {
- PoolParams params = new PoolParams();
- assertFalse("StrictMin must be false", params.isStrictMin());
- params.setStrictMin(true);
- assertTrue("StrictMin must be true", params.isStrictMin());
- }
-
- /**
- * Test {@link PoolParams#isUseFastFail()}
- */
- @Test
- public void testIsUseFastFail()
- {
- PoolParams params = new PoolParams();
- assertFalse("UseFastFail must be false", params.isUseFastFail());
- params.setUseFastFail(true);
- assertTrue("UseFastFail must be true", params.isUseFastFail());
- }
-
-}
Copied: projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/pool/PoolParamsTestCase.java (from rev 93515, projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/PoolParamsTestCase.java)
===================================================================
--- projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/pool/PoolParamsTestCase.java (rev 0)
+++ projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/pool/PoolParamsTestCase.java 2009-09-15 13:45:21 UTC (rev 93533)
@@ -0,0 +1,136 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008-2009, 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.jca.test.core.connectionmanager.unit.pool;
+
+import org.jboss.jca.core.connectionmanager.pool.PoolParams;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * <code>PoolParams</code> unit test.
+ *
+ * @author gurkanerdogdu
+ * @version $Rev$ $Date$
+ *
+ */
+public class PoolParamsTestCase
+{
+ /**
+ * Test {@link PoolParams#getMinSize()}
+ */
+ @Test
+ public void testMinSize()
+ {
+ PoolParams params = new PoolParams();
+ assertEquals(0, params.getMinSize());
+ params.setMinSize(10);
+ assertEquals(10, params.getMinSize());
+ }
+
+ /**
+ * Test {@link PoolParams#getMaxSize()}
+ */
+ @Test
+ public void testMaxSize()
+ {
+ PoolParams params = new PoolParams();
+ assertEquals(10, params.getMaxSize());
+ params.setMaxSize(20);
+ assertEquals(20, params.getMaxSize());
+ }
+
+ /**
+ * Test {@link PoolParams#getBlockingTimeout()}
+ */
+ @Test
+ public void testBlockingTimeout()
+ {
+ PoolParams params = new PoolParams();
+ assertEquals(30000, params.getBlockingTimeout());
+ params.setBlockingTimeout(60000);
+ assertEquals(60000, params.getBlockingTimeout());
+ }
+
+ /**
+ * Test {@link PoolParams#getIdleTimeout()}
+ */
+ @Test
+ public void testIdleTimeout()
+ {
+ PoolParams params = new PoolParams();
+ assertEquals(1000 * 60 * 30, params.getIdleTimeout());
+ params.setIdleTimeout(1000 * 60 * 20);
+ assertEquals(1000 * 60 * 20, params.getIdleTimeout());
+ }
+
+ /**
+ * Test {@link PoolParams#getBackgroundValidationInterval()}
+ */
+ @Test
+ public void testBackgroundValidationInterval()
+ {
+ PoolParams params = new PoolParams();
+ assertEquals(0L, params.getBackgroundValidationInterval());
+ params.setBackgroundValidationInterval(50000L);
+ assertEquals(50000L, params.getBackgroundValidationInterval());
+ }
+
+ /**
+ * Test {@link PoolParams#isPrefill()}
+ */
+ @Test
+ public void testIsPrefill()
+ {
+ PoolParams params = new PoolParams();
+ assertFalse("Prefill must be false", params.isPrefill());
+ params.setPrefill(true);
+ assertTrue("Prefill must be true", params.isPrefill());
+ }
+
+ /**
+ * Test {@link PoolParams#isStrictMin()}
+ */
+ @Test
+ public void testIsStrictMin()
+ {
+ PoolParams params = new PoolParams();
+ assertFalse("StrictMin must be false", params.isStrictMin());
+ params.setStrictMin(true);
+ assertTrue("StrictMin must be true", params.isStrictMin());
+ }
+
+ /**
+ * Test {@link PoolParams#isUseFastFail()}
+ */
+ @Test
+ public void testIsUseFastFail()
+ {
+ PoolParams params = new PoolParams();
+ assertFalse("UseFastFail must be false", params.isUseFastFail());
+ params.setUseFastFail(true);
+ assertTrue("UseFastFail must be true", params.isUseFastFail());
+ }
+
+}
Added: projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/pool/PoolingTestCase.java
===================================================================
--- projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/pool/PoolingTestCase.java (rev 0)
+++ projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/pool/PoolingTestCase.java 2009-09-15 13:45:21 UTC (rev 93533)
@@ -0,0 +1,97 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008-2009, 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.jca.test.core.connectionmanager.unit.pool;
+
+import org.junit.Test;
+
+/**
+ * PoolingTestCase.
+ * @author <a href="mailto:gurkanerdogdu at yahoo.com">Gurkan Erdogdu</a>
+ * @version $Rev$ $Date$
+ *
+ */
+public class PoolingTestCase
+{
+ /**
+ * testOnePoolNoTx.
+ * @throws Exception for exception
+ */
+ @Test
+ public void testOnePoolNoTx() throws Exception
+ {
+
+ }
+
+ /**
+ * testOnePoolTx.
+ * @throws Exception for exception
+ */
+ @Test
+
+ public void testOnePoolTx() throws Exception
+ {
+
+ }
+
+ /**
+ * testOnePoolTxTrack.
+ * @throws Exception for exception
+ */
+ @Test
+
+ public void testOnePoolTxTrack() throws Exception
+ {
+
+ }
+
+ /**
+ * testTrackConnectionByTx.
+ * @throws Exception for exception
+ */
+ @Test
+
+ public void testTrackConnectionByTx() throws Exception
+ {
+
+ }
+
+ /**
+ * testTrackConnectionByTxAndCRI.
+ * @throws Exception for exception
+ */
+ @Test
+
+ public void testTrackConnectionByTxAndCRI() throws Exception
+ {
+
+ }
+
+ /**
+ * doOnePool.
+ * @throws Exception for exception
+ */
+ @Test
+ public void doOnePool() throws Exception
+ {
+
+ }
+}
Property changes on: projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/pool/PoolingTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/pool/PreFillPoolingTestCase.java
===================================================================
--- projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/pool/PreFillPoolingTestCase.java (rev 0)
+++ projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/pool/PreFillPoolingTestCase.java 2009-09-15 13:45:21 UTC (rev 93533)
@@ -0,0 +1,124 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008-2009, 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.jca.test.core.connectionmanager.unit.pool;
+
+import org.junit.Test;
+
+/**
+ * PreFillPoolingTestCase.
+ * @author <a href="mailto:gurkanerdogdu at yahoo.com">Gurkan Erdogdu</a>
+ * @version $Rev$ $Date$
+ *
+ */
+public class PreFillPoolingTestCase
+{
+
+ /**
+ * testDeployPreFillPool.
+ * @throws Exception for exception.
+ */
+ @Test
+ public void testDeployPreFillPool() throws Exception
+ {
+
+ }
+
+ /**
+ * testPreFillFlush.
+ * @throws Exception for exception.
+ */
+ @Test
+ public void testPreFillFlush() throws Exception
+ {
+
+ }
+
+ /**
+ * testDeployNoPreFillPool.
+ * @throws Exception for exception.
+ */
+ @Test
+ public void testDeployNoPreFillPool() throws Exception
+ {
+
+ }
+
+ /**
+ * testDeployElementNoPreFillPool.
+ * @throws Exception for exception.
+ */
+ @Test
+ public void testDeployElementNoPreFillPool() throws Exception
+ {
+
+ }
+
+ /**
+ * testInvalidPreFillPool.
+ * @throws Exception for exception.
+ */
+ @Test
+ public void testInvalidPreFillPool() throws Exception
+ {
+
+ }
+
+ /**
+ * testPoolByCriPreFill.
+ * @throws Exception for exception.
+ */
+ @Test
+ public void testPoolByCriPreFill() throws Exception
+ {
+
+ }
+
+ /**
+ * testNonPreFillSupportingPoolPreFill.
+ * @throws Exception for exception.
+ */
+ @Test
+ public void testNonPreFillSupportingPoolPreFill() throws Exception
+ {
+
+ }
+
+ /**
+ * testNoPreFillSupportingPool.
+ * @throws Exception for exception.
+ */
+ @Test
+ public void testNoPreFillSupportingPool() throws Exception
+ {
+
+ }
+
+ /**
+ * testPreFillSupportingPool.
+ * @throws Exception for exception.
+ */
+ @Test
+ public void testPreFillSupportingPool() throws Exception
+ {
+
+ }
+}
Property changes on: projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/pool/PreFillPoolingTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/pool/package.html
===================================================================
--- projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/pool/package.html (rev 0)
+++ projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/pool/package.html 2009-09-15 13:45:21 UTC (rev 93533)
@@ -0,0 +1,3 @@
+<body>
+Unit Test cases covering the Pooling implementation.
+</body>
Property changes on: projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/pool/package.html
___________________________________________________________________
Name: svn:eol-style
+ native
Added: projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/tx/TxConnectionManagerTestCase.java
===================================================================
--- projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/tx/TxConnectionManagerTestCase.java (rev 0)
+++ projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/tx/TxConnectionManagerTestCase.java 2009-09-15 13:45:21 UTC (rev 93533)
@@ -0,0 +1,245 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008-2009, 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.jca.test.core.connectionmanager.unit.tx;
+
+import org.jboss.jca.core.api.ConnectionManager;
+import org.jboss.jca.core.connectionmanager.pool.PoolParams;
+import org.jboss.jca.core.connectionmanager.pool.strategy.OnePool;
+import org.jboss.jca.core.connectionmanager.transaction.TransactionSynchronizer;
+import org.jboss.jca.core.connectionmanager.tx.TxConnectionManager;
+import org.jboss.jca.embedded.EmbeddedJCA;
+import org.jboss.jca.test.core.connectionmanager.common.MockConnectionRequestInfo;
+import org.jboss.jca.test.core.connectionmanager.common.MockHandle;
+import org.jboss.jca.test.core.connectionmanager.common.MockManagedConnectionFactory;
+import org.jboss.jca.test.core.workmanager.unit.WorkManagerTestCase;
+
+import javax.resource.spi.ManagedConnectionFactory;
+import javax.transaction.TransactionManager;
+
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+
+import static org.junit.Assert.*;
+
+/**
+ * TxConnectionManagerTestCase.
+ * @author <a href="mailto:gurkanerdogdu at yahoo.com">Gurkan Erdogdu</a>
+ * @version $Rev$ $Date$
+ *
+ */
+public class TxConnectionManagerTestCase
+{
+ /**Embedded JCA*/
+ private static EmbeddedJCA embedded = null;
+
+ /**
+ * testTxAllocateConnection.
+ * @throws Throwable for exception
+ */
+ @Test
+ public void testAllocateConnection() throws Throwable
+ {
+ ConnectionManager connectionManager = embedded.lookup("ConnectionManagerTx", ConnectionManager.class);
+ assertNotNull(connectionManager);
+
+ assertTrue(connectionManager.getRealConnectionManager() instanceof TxConnectionManager);
+
+ TxConnectionManager txConnectionManager = (TxConnectionManager)connectionManager.getRealConnectionManager();
+ txConnectionManager.setLocalTransactions(true);
+
+ assertNotNull(txConnectionManager.getCachedConnectionManager());
+
+ TransactionManager transactionManager = txConnectionManager.getTransactionManager();
+ TransactionSynchronizer.setTransactionManager(transactionManager);
+
+ assertNotNull(transactionManager);
+
+ transactionManager.begin();
+
+ ManagedConnectionFactory mcf = new MockManagedConnectionFactory();
+ PoolParams params = new PoolParams();
+
+ OnePool onePool = new OnePool(mcf, params, true);
+ onePool.setConnectionListenerFactory(txConnectionManager);
+
+ txConnectionManager.setPoolingStrategy(onePool);
+
+ Object handle = connectionManager.allocateConnection(mcf, new MockConnectionRequestInfo());
+ assertNotNull(handle);
+
+ assertTrue(handle instanceof MockHandle);
+
+ transactionManager.commit();
+
+ }
+
+ /**
+ * testConnectionEventListenerConnectionClosed.
+ * @throws Exception for exception
+ */
+ @Test
+ public void testConnectionEventListenerConnectionClosed() throws Exception
+ {
+
+ }
+
+ /**
+ * testSynchronizationAfterCompletion.
+ * @throws Exception for exception
+ */
+ @Test
+ public void testSynchronizationAfterCompletion() throws Exception
+ {
+
+ }
+
+ /**
+ * testSynchronizationAfterCompletionTxTimeout.
+ * @throws Exception for exception
+ */
+ @Test
+ public void testSynchronizationAfterCompletionTxTimeout() throws Exception
+ {
+
+ }
+
+ /**
+ * testGetManagedConnection.
+ * @throws Exception for exception
+ */
+ @Test
+ public void testGetManagedConnection() throws Exception
+ {
+
+ }
+
+ /**
+ * testGetManagedConnectionTimeout.
+ * @throws Exception for exception
+ */
+ @Test
+ public void testGetManagedConnectionTimeout() throws Exception
+ {
+
+ }
+
+ /**
+ * testGetManagedConnectionTrackByTx.
+ * @throws Exception for exception
+ */
+ @Test
+ public void testGetManagedConnectionTrackByTx() throws Exception
+ {
+
+ }
+
+ /**
+ * testGetManagedConnectionTimeoutTrackByTx.
+ * @throws Exception for exception
+ */
+ @Test
+ public void testGetManagedConnectionTimeoutTrackByTx() throws Exception
+ {
+
+ }
+
+ /**
+ * testConnectionError.
+ * @throws Exception for exception.
+ */
+ @Test
+ public void testConnectionError() throws Exception
+ {
+
+ }
+
+ /**
+ * testConnectionErrorTrackByTx.
+ * @throws Exception for exception
+ */
+ @Test
+ public void testConnectionErrorTrackByTx() throws Exception
+ {
+
+ }
+
+ /**
+ * testSimulateConnectionError.
+ * @throws Exception for exception.
+ */
+ @Test
+ public void testSimulateConnectionError() throws Exception
+ {
+
+ }
+
+ /**
+ * testSimulateConnectionErrorTrackByTx.
+ * @throws Exception for exception
+ */
+ @Test
+ public void testSimulateConnectionErrorTrackByTx() throws Exception
+ {
+
+ }
+
+ /**
+ * Lifecycle start, before the suite is executed
+ * @throws Throwable throwable exception
+ */
+ @BeforeClass
+ public static void beforeClass() throws Throwable
+ {
+ // Create and set an embedded JCA instance
+ embedded = new EmbeddedJCA(false);
+
+ // Startup
+ embedded.startup();
+
+ // Deploy Naming, Transaction and WorkManager
+ embedded.deploy(WorkManagerTestCase.class.getClassLoader(), "naming-jboss-beans.xml");
+ embedded.deploy(WorkManagerTestCase.class.getClassLoader(), "transaction-jboss-beans.xml");
+ embedded.deploy(WorkManagerTestCase.class.getClassLoader(), "connectionmanager-jboss-beans.xml");
+ }
+
+ /**
+ * Lifecycle stop, after the suite is executed
+ * @throws Throwable throwable exception
+ */
+ @AfterClass
+ public static void afterClass() throws Throwable
+ {
+ // Undeploy WorkManager, Transaction and Naming
+ embedded.undeploy(WorkManagerTestCase.class.getClassLoader(), "connectionmanager-jboss-beans.xml");
+ embedded.undeploy(WorkManagerTestCase.class.getClassLoader(), "transaction-jboss-beans.xml");
+ embedded.undeploy(WorkManagerTestCase.class.getClassLoader(), "naming-jboss-beans.xml");
+
+ // Shutdown embedded
+ embedded.shutdown();
+
+ // Set embedded to null
+ embedded = null;
+ }
+
+}
Property changes on: projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/tx/TxConnectionManagerTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/tx/XATxConnectionManagerTestCase.java
===================================================================
--- projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/tx/XATxConnectionManagerTestCase.java (rev 0)
+++ projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/tx/XATxConnectionManagerTestCase.java 2009-09-15 13:45:21 UTC (rev 93533)
@@ -0,0 +1,204 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008-2009, 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.jca.test.core.connectionmanager.unit.tx;
+
+import org.jboss.jca.core.api.ConnectionManager;
+import org.jboss.jca.core.connectionmanager.pool.PoolParams;
+import org.jboss.jca.core.connectionmanager.pool.strategy.OnePool;
+import org.jboss.jca.core.connectionmanager.transaction.TransactionSynchronizer;
+import org.jboss.jca.core.connectionmanager.tx.TxConnectionManager;
+import org.jboss.jca.embedded.EmbeddedJCA;
+import org.jboss.jca.test.core.connectionmanager.common.MockConnectionRequestInfo;
+import org.jboss.jca.test.core.connectionmanager.common.MockHandle;
+import org.jboss.jca.test.core.connectionmanager.common.MockManagedConnectionFactory;
+import org.jboss.jca.test.core.workmanager.unit.WorkManagerTestCase;
+
+import javax.resource.spi.ManagedConnectionFactory;
+import javax.transaction.TransactionManager;
+
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+
+import static org.junit.Assert.*;
+
+/**
+ * XATxConnectionManagerTestCase.
+ * @author <a href="mailto:gurkanerdogdu at yahoo.com">Gurkan Erdogdu</a>
+ * @version $Rev$ $Date$
+ *
+ */
+public class XATxConnectionManagerTestCase
+{
+ /**Embedded JCA*/
+ private static EmbeddedJCA embedded = null;
+
+ /**
+ * testTxAllocateConnection.
+ * @throws Throwable for exception
+ */
+ @Test
+ public void testAllocateConnection() throws Throwable
+ {
+ ConnectionManager connectionManager = embedded.lookup("ConnectionManagerTx", ConnectionManager.class);
+ assertNotNull(connectionManager);
+
+ assertTrue(connectionManager.getRealConnectionManager() instanceof TxConnectionManager);
+
+ TxConnectionManager txConnectionManager = (TxConnectionManager)connectionManager.getRealConnectionManager();
+ txConnectionManager.setLocalTransactions(false);
+
+ TransactionManager transactionManager = txConnectionManager.getTransactionManager();
+ assertNotNull(transactionManager);
+
+ TransactionSynchronizer.setTransactionManager(transactionManager);
+
+ transactionManager.begin();
+
+ ManagedConnectionFactory mcf = new MockManagedConnectionFactory();
+ PoolParams params = new PoolParams();
+
+ OnePool onePool = new OnePool(mcf, params, true);
+ onePool.setConnectionListenerFactory(txConnectionManager);
+
+ txConnectionManager.setPoolingStrategy(onePool);
+
+ Object handle = connectionManager.allocateConnection(mcf, new MockConnectionRequestInfo());
+ assertNotNull(handle);
+
+ assertTrue(handle instanceof MockHandle);
+
+ transactionManager.commit();
+
+ }
+
+ /**
+ * testEnlistInExistingTx.
+ * @throws Exception for exception
+ */
+ @Test
+ public void testEnlistInExistingTx() throws Exception
+ {
+
+ }
+
+ /**
+ * testEnlistCheckedOutConnectionInNewTx.
+ * @throws Exception for exception
+ */
+ @Test
+ public void testEnlistCheckedOutConnectionInNewTx() throws Exception
+ {
+
+ }
+
+ /**
+ * testReconnectConnectionHandlesOnNotification.
+ * @throws Exception for exception.
+ */
+ @Test
+ public void testReconnectConnectionHandlesOnNotification() throws Exception
+ {
+
+ }
+
+ /**
+ * testEnlistAfterMarkRollback.
+ * @throws Exception for exception
+ */
+ @Test
+ public void testEnlistAfterMarkRollback() throws Exception
+ {
+
+ }
+
+ /**
+ * testBrokenConnectionAndTrackByTx.
+ * @throws Exception for exception.
+ */
+ @Test
+ public void testBrokenConnectionAndTrackByTx() throws Exception
+ {
+
+ }
+
+ /**
+ * testFailedStartTx.
+ * @throws Exception for exception.
+ */
+ @Test
+ public void testFailedStartTx() throws Exception
+ {
+
+ }
+
+ /**
+ * testFailedEndTx.
+ * @throws Exception for exception.
+ */
+ @Test
+ public void testFailedEndTx() throws Exception
+ {
+
+ }
+
+
+ /**
+ * Lifecycle start, before the suite is executed
+ * @throws Throwable throwable exception
+ */
+ @BeforeClass
+ public static void beforeClass() throws Throwable
+ {
+ // Create and set an embedded JCA instance
+ embedded = new EmbeddedJCA(false);
+
+ // Startup
+ embedded.startup();
+
+ // Deploy Naming, Transaction and WorkManager
+ embedded.deploy(WorkManagerTestCase.class.getClassLoader(), "naming-jboss-beans.xml");
+ embedded.deploy(WorkManagerTestCase.class.getClassLoader(), "transaction-jboss-beans.xml");
+ embedded.deploy(WorkManagerTestCase.class.getClassLoader(), "connectionmanager-jboss-beans.xml");
+ }
+
+ /**
+ * Lifecycle stop, after the suite is executed
+ * @throws Throwable throwable exception
+ */
+ @AfterClass
+ public static void afterClass() throws Throwable
+ {
+ // Undeploy WorkManager, Transaction and Naming
+ embedded.undeploy(WorkManagerTestCase.class.getClassLoader(), "connectionmanager-jboss-beans.xml");
+ embedded.undeploy(WorkManagerTestCase.class.getClassLoader(), "transaction-jboss-beans.xml");
+ embedded.undeploy(WorkManagerTestCase.class.getClassLoader(), "naming-jboss-beans.xml");
+
+ // Shutdown embedded
+ embedded.shutdown();
+
+ // Set embedded to null
+ embedded = null;
+ }
+
+}
Property changes on: projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/tx/XATxConnectionManagerTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/tx/package.html
===================================================================
--- projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/tx/package.html (rev 0)
+++ projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/tx/package.html 2009-09-15 13:45:21 UTC (rev 93533)
@@ -0,0 +1,3 @@
+<body>
+Unit Test cases covering the Tx Connection Manager implementation.
+</body>
Property changes on: projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/connectionmanager/unit/tx/package.html
___________________________________________________________________
Name: svn:eol-style
+ native
More information about the jboss-cvs-commits
mailing list