Author: ataylor
Date: 2010-07-07 10:06:50 -0400 (Wed, 07 Jul 2010)
New Revision: 9383
Added:
trunk/tests/src/org/hornetq/tests/integration/ra/OutgoingConnectionTest.java
trunk/tests/src/org/hornetq/tests/integration/ra/ResourceAdapterTest.java
Modified:
trunk/src/main/org/hornetq/ra/HornetQResourceAdapter.java
trunk/tests/src/org/hornetq/tests/integration/ra/HornetQMessageHandlerTest.java
Log:
HORNETQ-140 - JCA Integration more tests and a couple of tweaks
Modified: trunk/src/main/org/hornetq/ra/HornetQResourceAdapter.java
===================================================================
--- trunk/src/main/org/hornetq/ra/HornetQResourceAdapter.java 2010-07-07 12:50:27 UTC (rev
9382)
+++ trunk/src/main/org/hornetq/ra/HornetQResourceAdapter.java 2010-07-07 14:06:50 UTC (rev
9383)
@@ -411,36 +411,6 @@
}
/**
- * Get load balancing policy class name
- *
- * @return The value
- */
- public String getLoadBalancingPolicyClassName()
- {
- if (HornetQResourceAdapter.trace)
- {
-
HornetQResourceAdapter.log.trace("getLoadBalancingPolicyClassName()");
- }
-
- return raProperties.getConnectionLoadBalancingPolicyClassName();
- }
-
- /**
- * Set load balancing policy class name
- *
- * @param loadBalancingPolicyClassName The value
- */
- public void setLoadBalancingPolicyClassName(final String
loadBalancingPolicyClassName)
- {
- if (HornetQResourceAdapter.trace)
- {
- HornetQResourceAdapter.log.trace("setLoadBalancingPolicyClassName(" +
loadBalancingPolicyClassName + ")");
- }
-
-
raProperties.setConnectionLoadBalancingPolicyClassName(loadBalancingPolicyClassName);
- }
-
- /**
* Get client failure check period
*
* @return The value
Modified: trunk/tests/src/org/hornetq/tests/integration/ra/HornetQMessageHandlerTest.java
===================================================================
---
trunk/tests/src/org/hornetq/tests/integration/ra/HornetQMessageHandlerTest.java 2010-07-07
12:50:27 UTC (rev 9382)
+++
trunk/tests/src/org/hornetq/tests/integration/ra/HornetQMessageHandlerTest.java 2010-07-07
14:06:50 UTC (rev 9383)
@@ -19,6 +19,8 @@
import org.hornetq.core.postoffice.impl.LocalQueueBinding;
import org.hornetq.ra.HornetQResourceAdapter;
import org.hornetq.ra.inflow.HornetQActivationSpec;
+
+import javax.jms.Message;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
@@ -63,6 +65,58 @@
qResourceAdapter.endpointDeactivation(endpointFactory, spec);
}
+ public void testInvalidAckMode() throws Exception
+ {
+ HornetQResourceAdapter qResourceAdapter = new HornetQResourceAdapter();
+ MyBootstrapContext ctx = new MyBootstrapContext();
+ qResourceAdapter.start(ctx);
+ HornetQActivationSpec spec = new HornetQActivationSpec();
+ try
+ {
+ spec.setAcknowledgeMode("CLIENT_ACKNOWLEDGE");
+ fail("should throw exception");
+ }
+ catch (java.lang.IllegalArgumentException e)
+ {
+ //pass
+ }
+ }
+
+ public void testSimpleMessageReceivedOnQueueInLocalTX() throws Exception
+ {
+ HornetQResourceAdapter qResourceAdapter = new HornetQResourceAdapter();
+ qResourceAdapter.setUseLocalTx(true);
+ MyBootstrapContext ctx = new MyBootstrapContext();
+ qResourceAdapter.start(ctx);
+ HornetQActivationSpec spec = new HornetQActivationSpec();
+ spec.setResourceAdapter(qResourceAdapter);
+ spec.setUseJNDI(false);
+ spec.setDestinationType("javax.jms.Queue");
+ spec.setDestination(MDBQUEUE);
+ qResourceAdapter.setConnectorClassName(INVM_CONNECTOR_FACTORY);
+ CountDownLatch latch = new CountDownLatch(1);
+ ExceptionDummyMessageEndpoint endpoint = new ExceptionDummyMessageEndpoint(latch);
+ DummyMessageEndpointFactory endpointFactory = new
DummyMessageEndpointFactory(endpoint, false);
+ qResourceAdapter.endpointActivation(endpointFactory, spec);
+ ClientSession session = createFactory(false).createSession();
+ ClientProducer clientProducer = session.createProducer(MDBQUEUEPREFIXED);
+ ClientMessage message = session.createMessage(true);
+ message.getBodyBuffer().writeString("teststring");
+ clientProducer.send(message);
+ session.close();
+ latch.await(5, TimeUnit.SECONDS);
+
+ assertNull(endpoint.lastMessage);
+ latch = new CountDownLatch(1);
+ endpoint.reset(latch);
+ latch.await(5, TimeUnit.SECONDS);
+
+ assertNotNull(endpoint.lastMessage);
+ assertEquals(endpoint.lastMessage.getCoreMessage().getBodyBuffer().readString(),
"teststring");
+
+ qResourceAdapter.endpointDeactivation(endpointFactory, spec);
+ }
+
public void testSimpleMessageReceivedOnQueueWithSelector() throws Exception
{
HornetQResourceAdapter qResourceAdapter = new HornetQResourceAdapter();
@@ -376,5 +430,24 @@
}
+ class ExceptionDummyMessageEndpoint extends DummyMessageEndpoint
+ {
+ boolean throwException = true;
+ public ExceptionDummyMessageEndpoint(CountDownLatch latch)
+ {
+ super(latch);
+ }
+
+ @Override
+ public void onMessage(Message message)
+ {
+ if(throwException)
+ {
+ throwException = false;
+ throw new IllegalStateException("boo!");
+ }
+ super.onMessage(message);
+ }
+ }
}
Added: trunk/tests/src/org/hornetq/tests/integration/ra/OutgoingConnectionTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/ra/OutgoingConnectionTest.java
(rev 0)
+++
trunk/tests/src/org/hornetq/tests/integration/ra/OutgoingConnectionTest.java 2010-07-07
14:06:50 UTC (rev 9383)
@@ -0,0 +1,212 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.hornetq.tests.integration.ra;
+
+import org.hornetq.api.core.client.HornetQClient;
+import org.hornetq.api.jms.HornetQJMSClient;
+import org.hornetq.core.remoting.impl.invm.InVMConnectorFactory;
+import org.hornetq.core.security.Role;
+import org.hornetq.core.transaction.impl.XidImpl;
+import org.hornetq.ra.*;
+import org.hornetq.utils.UUIDGenerator;
+
+import javax.jms.*;
+import javax.jms.IllegalStateException;
+import javax.transaction.xa.XAResource;
+import javax.transaction.xa.Xid;
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
+ * Created Jul 7, 2010
+ */
+public class OutgoingConnectionTest extends HornetQRATestBase
+{
+ @Override
+ public boolean isSecure()
+ {
+ return true;
+ }
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+ server.getSecurityManager().addUser("testuser",
"testpassword");
+ server.getSecurityManager().addUser("guest", "guest");
+ server.getSecurityManager().setDefaultUser("guest");
+ server.getSecurityManager().addRole("testuser", "arole");
+ server.getSecurityManager().addRole("guest", "arole");
+ Role role = new Role("arole", true, true, true, true, true, true, true);
+ Set<Role> roles = new HashSet<Role>();
+ roles.add(role);
+ server.getSecurityRepository().addMatch(MDBQUEUEPREFIXED, roles);
+ }
+
+ public void testSimpleMessageSendAndReceive() throws Exception
+ {
+ HornetQResourceAdapter qResourceAdapter = new HornetQResourceAdapter();
+ qResourceAdapter.setConnectorClassName(InVMConnectorFactory.class.getName());
+ MyBootstrapContext ctx = new MyBootstrapContext();
+ qResourceAdapter.start(ctx);
+ HornetQRAConnectionManager qraConnectionManager = new
HornetQRAConnectionManager();
+ HornetQRAManagedConnectionFactory mcf = new HornetQRAManagedConnectionFactory();
+ mcf.setResourceAdapter(qResourceAdapter);
+ HornetQRAConnectionFactory qraConnectionFactory = new
HornetQRAConnectionFactoryImpl(mcf, qraConnectionManager);
+ QueueConnection queueConnection = qraConnectionFactory.createQueueConnection();
+ Session s = queueConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+ Queue q = HornetQJMSClient.createQueue(MDBQUEUE);
+ MessageProducer mp = s.createProducer(q);
+ MessageConsumer consumer = s.createConsumer(q);
+ Message message = s.createTextMessage("test");
+ mp.send(message);
+ queueConnection.start();
+ TextMessage textMessage = (TextMessage) consumer.receive(1000);
+ assertNotNull(textMessage);
+ assertEquals(textMessage.getText(), "test");
+ s.close();
+ }
+
+ public void testSimpleMessageSendAndReceiveXA() throws Exception
+ {
+ Xid xid = new XidImpl("xa1".getBytes(), 1,
UUIDGenerator.getInstance().generateStringUUID().getBytes());
+ HornetQResourceAdapter qResourceAdapter = new HornetQResourceAdapter();
+ qResourceAdapter.setConnectorClassName(InVMConnectorFactory.class.getName());
+ MyBootstrapContext ctx = new MyBootstrapContext();
+ qResourceAdapter.start(ctx);
+ HornetQRAConnectionManager qraConnectionManager = new
HornetQRAConnectionManager();
+ HornetQRAManagedConnectionFactory mcf = new HornetQRAManagedConnectionFactory();
+ mcf.setResourceAdapter(qResourceAdapter);
+ HornetQRAConnectionFactory qraConnectionFactory = new
HornetQRAConnectionFactoryImpl(mcf, qraConnectionManager);
+ XAQueueConnection queueConnection =
qraConnectionFactory.createXAQueueConnection();
+ XASession s = queueConnection.createXASession();
+
+ XAResource resource = s.getXAResource();
+ resource.start(xid, XAResource.TMNOFLAGS);
+ Queue q = HornetQJMSClient.createQueue(MDBQUEUE);
+ MessageProducer mp = s.createProducer(q);
+ MessageConsumer consumer = s.createConsumer(q);
+ Message message = s.createTextMessage("test");
+ mp.send(message);
+ queueConnection.start();
+ TextMessage textMessage = (TextMessage) consumer.receiveNoWait();
+ assertNull(textMessage);
+ resource.end(xid, XAResource.TMSUCCESS);
+ resource.commit(xid, true);
+ resource.start(xid, XAResource.TMNOFLAGS);
+ textMessage = (TextMessage) consumer.receiveNoWait();
+ resource.end(xid, XAResource.TMSUCCESS);
+ resource.commit(xid, true);
+ assertNotNull(textMessage);
+ assertEquals(textMessage.getText(), "test");
+ s.close();
+ }
+
+ public void testSimpleMessageSendAndReceiveTransacted() throws Exception
+ {
+ HornetQResourceAdapter qResourceAdapter = new HornetQResourceAdapter();
+ qResourceAdapter.setConnectorClassName(InVMConnectorFactory.class.getName());
+ qResourceAdapter.setUseLocalTx(true);
+ MyBootstrapContext ctx = new MyBootstrapContext();
+ qResourceAdapter.start(ctx);
+ HornetQRAConnectionManager qraConnectionManager = new
HornetQRAConnectionManager();
+ HornetQRAManagedConnectionFactory mcf = new HornetQRAManagedConnectionFactory();
+ mcf.setResourceAdapter(qResourceAdapter);
+ HornetQRAConnectionFactory qraConnectionFactory = new
HornetQRAConnectionFactoryImpl(mcf, qraConnectionManager);
+ QueueConnection queueConnection = qraConnectionFactory.createQueueConnection();
+ Session s = queueConnection.createSession(true, Session.AUTO_ACKNOWLEDGE);
+ Queue q = HornetQJMSClient.createQueue(MDBQUEUE);
+ MessageProducer mp = s.createProducer(q);
+ MessageConsumer consumer = s.createConsumer(q);
+ Message message = s.createTextMessage("test");
+ mp.send(message);
+ s.commit();
+ queueConnection.start();
+ TextMessage textMessage = (TextMessage) consumer.receive(1000);
+ assertNotNull(textMessage);
+ assertEquals(textMessage.getText(), "test");
+ s.rollback();
+ textMessage = (TextMessage) consumer.receive(1000);
+ assertNotNull(textMessage);
+ assertEquals(textMessage.getText(), "test");
+ s.commit();
+ s.close();
+ }
+
+ public void testMultipleSessionsThrowsException() throws Exception
+ {
+ HornetQResourceAdapter qResourceAdapter = new HornetQResourceAdapter();
+ qResourceAdapter.setConnectorClassName(InVMConnectorFactory.class.getName());
+ MyBootstrapContext ctx = new MyBootstrapContext();
+ qResourceAdapter.start(ctx);
+ HornetQRAConnectionManager qraConnectionManager = new
HornetQRAConnectionManager();
+ HornetQRAManagedConnectionFactory mcf = new HornetQRAManagedConnectionFactory();
+ mcf.setResourceAdapter(qResourceAdapter);
+ HornetQRAConnectionFactory qraConnectionFactory = new
HornetQRAConnectionFactoryImpl(mcf, qraConnectionManager);
+ QueueConnection queueConnection = qraConnectionFactory.createQueueConnection();
+ Session s = queueConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+ try
+ {
+ Session s2 = queueConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+ fail("should throw javax,jms.IllegalStateException: Only allowed one
session per connection. See the J2EE spec, e.g. J2EE1.4 Section 6.6");
+ }
+ catch (JMSException e)
+ {
+ assertTrue(e.getLinkedException() instanceof IllegalStateException);
+ }
+ s.close();
+ }
+
+ public void testConnectionCredentials() throws Exception
+ {
+ HornetQResourceAdapter qResourceAdapter = new HornetQResourceAdapter();
+ qResourceAdapter.setConnectorClassName(InVMConnectorFactory.class.getName());
+ MyBootstrapContext ctx = new MyBootstrapContext();
+ qResourceAdapter.start(ctx);
+ HornetQRAConnectionManager qraConnectionManager = new
HornetQRAConnectionManager();
+ HornetQRAManagedConnectionFactory mcf = new HornetQRAManagedConnectionFactory();
+ mcf.setResourceAdapter(qResourceAdapter);
+ HornetQRAConnectionFactory qraConnectionFactory = new
HornetQRAConnectionFactoryImpl(mcf, qraConnectionManager);
+ QueueConnection queueConnection = qraConnectionFactory.createQueueConnection();
+ queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE).close();
+ queueConnection.close();
+ queueConnection = qraConnectionFactory.createQueueConnection("testuser",
"testpassword");
+ queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE).close();
+ }
+
+ public void testConnectionCredentialsFail() throws Exception
+ {
+ HornetQResourceAdapter qResourceAdapter = new HornetQResourceAdapter();
+ qResourceAdapter.setConnectorClassName(InVMConnectorFactory.class.getName());
+ MyBootstrapContext ctx = new MyBootstrapContext();
+ qResourceAdapter.start(ctx);
+ HornetQRAConnectionManager qraConnectionManager = new
HornetQRAConnectionManager();
+ HornetQRAManagedConnectionFactory mcf = new HornetQRAManagedConnectionFactory();
+ mcf.setResourceAdapter(qResourceAdapter);
+ HornetQRAConnectionFactory qraConnectionFactory = new
HornetQRAConnectionFactoryImpl(mcf, qraConnectionManager);
+ QueueConnection queueConnection = qraConnectionFactory.createQueueConnection();
+ queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE).close();
+ queueConnection.close();
+ queueConnection = qraConnectionFactory.createQueueConnection("testuser",
"testwrongpassword");
+ try
+ {
+ queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE).close();
+ fail("should throw esxception");
+ }
+ catch (JMSException e)
+ {
+ //pass
+ }
+ }
+}
Added: trunk/tests/src/org/hornetq/tests/integration/ra/ResourceAdapterTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/ra/ResourceAdapterTest.java
(rev 0)
+++ trunk/tests/src/org/hornetq/tests/integration/ra/ResourceAdapterTest.java 2010-07-07
14:06:50 UTC (rev 9383)
@@ -0,0 +1,198 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.hornetq.tests.integration.ra;
+
+import org.hornetq.ra.HornetQResourceAdapter;
+import org.hornetq.ra.inflow.HornetQActivationSpec;
+import org.hornetq.tests.util.ServiceTestBase;
+
+import javax.resource.ResourceException;
+import javax.resource.spi.BootstrapContext;
+import javax.resource.spi.ResourceAdapterInternalException;
+import javax.resource.spi.UnavailableException;
+import javax.resource.spi.XATerminator;
+import javax.resource.spi.endpoint.MessageEndpoint;
+import javax.resource.spi.endpoint.MessageEndpointFactory;
+import javax.resource.spi.work.WorkManager;
+import javax.transaction.xa.XAResource;
+import java.lang.reflect.Method;
+import java.util.Timer;
+import java.util.concurrent.CountDownLatch;
+
+/**
+ * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
+ * Created Jul 7, 2010
+ */
+public class ResourceAdapterTest extends HornetQRATestBase
+{
+ public void testStartStop() throws Exception
+ {
+ HornetQResourceAdapter qResourceAdapter = new HornetQResourceAdapter();
+ HornetQRATestBase.MyBootstrapContext ctx = new
HornetQRATestBase.MyBootstrapContext();
+ qResourceAdapter.start(ctx);
+ HornetQActivationSpec spec = new HornetQActivationSpec();
+ spec.setResourceAdapter(qResourceAdapter);
+ spec.setUseJNDI(false);
+ spec.setDestinationType("javax.jms.Queue");
+ spec.setDestination(MDBQUEUE);
+ qResourceAdapter.setConnectorClassName(INVM_CONNECTOR_FACTORY);
+ CountDownLatch latch = new CountDownLatch(1);
+ DummyMessageEndpoint endpoint = new DummyMessageEndpoint(latch);
+ DummyMessageEndpointFactory endpointFactory = new
DummyMessageEndpointFactory(endpoint, false);
+ qResourceAdapter.endpointActivation(endpointFactory, spec);
+ qResourceAdapter.stop();
+ assertTrue(endpoint.released);
+ }
+
+ public void testSetters() throws Exception
+ {
+ Boolean b = Boolean.TRUE;
+ Long l = (long) 1000;
+ Integer i = 1000;
+ Double d = (double) 1000;
+ String className = "testConnector";
+ String backupConn = "testBackupConnector";
+ String testConfig = "key=val";
+ String testid = "testid";
+ String testBalancer = "testBalancer";
+ String testParams = "key=val";
+ String testaddress = "testaddress";
+ String loadbalancer = "loadbalancer";
+ String testpass = "testpass";
+ String testuser = "testuser";
+ HornetQResourceAdapter qResourceAdapter = new HornetQResourceAdapter();
+ testParams(b, l, i, d, className, backupConn, testConfig, testid, testBalancer,
testParams, testaddress, testpass, testuser, qResourceAdapter);
+ }
+
+ public void testSetters2() throws Exception
+ {
+ Boolean b = Boolean.FALSE;
+ Long l = (long) 2000;
+ Integer i = 2000;
+ Double d = (double) 2000;
+ String className = "testConnector2";
+ String backupConn = "testBackupConnector2";
+ String testConfig = "key2=val2";
+ String testid = "testid2";
+ String testBalancer = "testBalancer2";
+ String testParams = "key=val2";
+ String testaddress = "testaddress2";
+ String loadbalancer = "loadbalancer2";
+ String testpass = "testpass2";
+ String testuser = "testuser2";
+ HornetQResourceAdapter qResourceAdapter = new HornetQResourceAdapter();
+ testParams(b, l, i, d, className, backupConn, testConfig, testid, testBalancer,
testParams, testaddress, testpass, testuser, qResourceAdapter);
+ }
+
+
+ private void testParams(Boolean b, Long l, Integer i, Double d, String className,
String backupConn, String testConfig, String testid, String testBalancer, String
testParams, String testaddress, String testpass, String testuser, HornetQResourceAdapter
qResourceAdapter)
+ {
+ qResourceAdapter.setUseLocalTx(b);
+ qResourceAdapter.setConnectorClassName(className);
+ qResourceAdapter.setAutoGroup(b);
+ qResourceAdapter.setBackupConnectorClassName(backupConn);
+ qResourceAdapter.setBackupTransportConfiguration(testConfig);
+ qResourceAdapter.setBlockOnAcknowledge(b);
+ qResourceAdapter.setBlockOnDurableSend(b);
+ qResourceAdapter.setBlockOnNonDurableSend(b);
+ qResourceAdapter.setCallTimeout(l);
+ qResourceAdapter.setClientFailureCheckPeriod(l);
+ qResourceAdapter.setClientID(testid);
+ qResourceAdapter.setConfirmationWindowSize(i);
+ qResourceAdapter.setConnectionLoadBalancingPolicyClassName(testBalancer);
+ qResourceAdapter.setConnectionParameters(testParams);
+ qResourceAdapter.setConnectionTTL(l);
+ qResourceAdapter.setConsumerMaxRate(i);
+ qResourceAdapter.setConsumerWindowSize(i);
+ qResourceAdapter.setDiscoveryAddress(testaddress);
+ qResourceAdapter.setDiscoveryInitialWaitTimeout(l);
+ qResourceAdapter.setDiscoveryPort(i);
+ qResourceAdapter.setDiscoveryRefreshTimeout(l);
+ qResourceAdapter.setDupsOKBatchSize(i);
+ qResourceAdapter.setFailoverOnServerShutdown(b);
+ qResourceAdapter.setMinLargeMessageSize(i);
+ qResourceAdapter.setPassword(testpass);
+ qResourceAdapter.setPreAcknowledge(b);
+ qResourceAdapter.setProducerMaxRate(i);
+ qResourceAdapter.setReconnectAttempts(i);
+ qResourceAdapter.setRetryInterval(l);
+ qResourceAdapter.setRetryIntervalMultiplier(d);
+ qResourceAdapter.setScheduledThreadPoolMaxSize(i);
+ qResourceAdapter.setThreadPoolMaxSize(i);
+ qResourceAdapter.setTransactionBatchSize(i);
+ qResourceAdapter.setUseGlobalPools(b);
+ qResourceAdapter.setUseLocalTx(b);
+ qResourceAdapter.setUserName(testuser);
+
+ assertEquals(qResourceAdapter.getUseLocalTx(), b);
+ assertEquals(qResourceAdapter.getConnectorClassName(), className);
+ assertEquals(qResourceAdapter.getAutoGroup(), b);
+ assertEquals(qResourceAdapter.getBackupConnectorClassName(), backupConn);
+
//assertEquals(qResourceAdapter.getBackupTransportConfiguration(),"testConfig");
+ assertEquals(qResourceAdapter.getBlockOnAcknowledge(), b);
+ assertEquals(qResourceAdapter.getBlockOnDurableSend(), b);
+ assertEquals(qResourceAdapter.getBlockOnNonDurableSend(), b);
+ assertEquals(qResourceAdapter.getCallTimeout(), l);
+ assertEquals(qResourceAdapter.getClientFailureCheckPeriod(), l);
+ assertEquals(qResourceAdapter.getClientID(), testid);
+ assertEquals(qResourceAdapter.getConfirmationWindowSize(), i);
+ assertEquals(qResourceAdapter.getConnectionLoadBalancingPolicyClassName(),
testBalancer);
+ assertEquals(qResourceAdapter.getConnectionParameters(), testParams);
+ assertEquals(qResourceAdapter.getConnectionTTL(), l);
+ assertEquals(qResourceAdapter.getConsumerMaxRate(), i);
+ assertEquals(qResourceAdapter.getConsumerWindowSize(), i);
+ assertEquals(qResourceAdapter.getDiscoveryAddress(), testaddress);
+ assertEquals(qResourceAdapter.getDiscoveryInitialWaitTimeout(), l);
+ assertEquals(qResourceAdapter.getDiscoveryPort(), i);
+ assertEquals(qResourceAdapter.getDiscoveryRefreshTimeout(), l);
+ assertEquals(qResourceAdapter.getDupsOKBatchSize(), i);
+ assertEquals(qResourceAdapter.getFailoverOnServerShutdown(), b);
+ assertEquals(qResourceAdapter.getMinLargeMessageSize(), i);
+ assertEquals(qResourceAdapter.getPassword(), testpass);
+ assertEquals(qResourceAdapter.getPreAcknowledge(), b);
+ assertEquals(qResourceAdapter.getProducerMaxRate(), i);
+ assertEquals(qResourceAdapter.getReconnectAttempts(), i);
+ assertEquals(qResourceAdapter.getRetryInterval(), l);
+ assertEquals(qResourceAdapter.getRetryIntervalMultiplier(), d);
+ assertEquals(qResourceAdapter.getScheduledThreadPoolMaxSize(), i);
+ assertEquals(qResourceAdapter.getThreadPoolMaxSize(), i);
+ assertEquals(qResourceAdapter.getTransactionBatchSize(), i);
+ assertEquals(qResourceAdapter.getUseGlobalPools(), b);
+ assertEquals(qResourceAdapter.getUseLocalTx(), b);
+ assertEquals(qResourceAdapter.getUserName(), testuser);
+ }
+
+ @Override
+ public boolean isSecure()
+ {
+ return false;
+ }
+
+ class DummyEndpoint implements MessageEndpoint
+ {
+ public void beforeDelivery(Method method) throws NoSuchMethodException,
ResourceException
+ {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public void afterDelivery() throws ResourceException
+ {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public void release()
+ {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+ }
+}