@Override public String toString() { return "ActiveMQConnectionFactory [serverLocator=" + serverLocator + ", clientID=" + clientID + ", consumerWindowSize = " + getConsumerWindowSize() + ", dupsOKBatchSize=" + dupsOKBatchSize + ", transactionBatchSize=" + transactionBatchSize + ", readOnly=" + readOnly + "EnableSharedClientID=" + enableSharedClientID + "]"; }
@Override public String toString() { return "ActiveMQConnectionFactory [serverLocator=" + serverLocator + ", clientID=" + clientID + ", consumerWindowSize = " + getConsumerWindowSize() + ", dupsOKBatchSize=" + dupsOKBatchSize + ", transactionBatchSize=" + transactionBatchSize + ", readOnly=" + readOnly + "EnableSharedClientID=" + enableSharedClientID + "]"; }
@Override public String toString() { return "ActiveMQConnectionFactory [serverLocator=" + serverLocator + ", clientID=" + clientID + ", consumerWindowSize = " + getConsumerWindowSize() + ", dupsOKBatchSize=" + dupsOKBatchSize + ", transactionBatchSize=" + transactionBatchSize + ", readOnly=" + readOnly + "EnableSharedClientID=" + enableSharedClientID + "]"; }
@Override public String toString() { return "ActiveMQConnectionFactory [serverLocator=" + serverLocator + ", clientID=" + clientID + ", consumerWindowSize = " + getConsumerWindowSize() + ", dupsOKBatchSize=" + dupsOKBatchSize + ", transactionBatchSize=" + transactionBatchSize + ", readOnly=" + readOnly + "EnableSharedClientID=" + enableSharedClientID + "]"; }
@Override public String toString() { return "ActiveMQConnectionFactory [serverLocator=" + serverLocator + ", clientID=" + clientID + ", consumerWindowSize = " + getConsumerWindowSize() + ", dupsOKBatchSize=" + dupsOKBatchSize + ", transactionBatchSize=" + transactionBatchSize + ", readOnly=" + readOnly + "EnableSharedClientID=" + enableSharedClientID + "]"; }
@Test public void testDefaultConnectionFactory() throws Exception { ActiveMQResourceAdapter ra = new ActiveMQResourceAdapter(); ra.setConnectorClassName(InVMConnectorFactory.class.getName()); ActiveMQConnectionFactory factory = ra.getDefaultActiveMQConnectionFactory(); Assert.assertEquals(factory.getCallTimeout(), ActiveMQClient.DEFAULT_CALL_TIMEOUT); Assert.assertEquals(factory.getClientFailureCheckPeriod(), ActiveMQClient.DEFAULT_CLIENT_FAILURE_CHECK_PERIOD); Assert.assertEquals(factory.getClientID(), null); Assert.assertEquals(factory.getConnectionLoadBalancingPolicyClassName(), ActiveMQClient.DEFAULT_CONNECTION_LOAD_BALANCING_POLICY_CLASS_NAME); Assert.assertEquals(factory.getConnectionTTL(), ActiveMQClient.DEFAULT_CONNECTION_TTL); Assert.assertEquals(factory.getConsumerMaxRate(), ActiveMQClient.DEFAULT_CONSUMER_MAX_RATE); Assert.assertEquals(factory.getConsumerWindowSize(), ActiveMQClient.DEFAULT_CONSUMER_WINDOW_SIZE); Assert.assertEquals(factory.getDupsOKBatchSize(), ActiveMQClient.DEFAULT_ACK_BATCH_SIZE); Assert.assertEquals(factory.getMinLargeMessageSize(), ActiveMQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE); Assert.assertEquals(factory.getProducerMaxRate(), ActiveMQClient.DEFAULT_PRODUCER_MAX_RATE); Assert.assertEquals(factory.getConfirmationWindowSize(), ActiveMQClient.DEFAULT_CONFIRMATION_WINDOW_SIZE); // by default, reconnect attempts is set to -1 Assert.assertEquals(-1, factory.getReconnectAttempts()); Assert.assertEquals(factory.getRetryInterval(), ActiveMQClient.DEFAULT_RETRY_INTERVAL); Assert.assertEquals(factory.getRetryIntervalMultiplier(), ActiveMQClient.DEFAULT_RETRY_INTERVAL_MULTIPLIER, 0.00001); Assert.assertEquals(factory.getScheduledThreadPoolMaxSize(), ActiveMQClient.DEFAULT_SCHEDULED_THREAD_POOL_MAX_SIZE); Assert.assertEquals(factory.getThreadPoolMaxSize(), ActiveMQClient.DEFAULT_THREAD_POOL_MAX_SIZE); Assert.assertEquals(factory.getTransactionBatchSize(), ActiveMQClient.DEFAULT_ACK_BATCH_SIZE); Assert.assertEquals(factory.isAutoGroup(), ActiveMQClient.DEFAULT_AUTO_GROUP); Assert.assertEquals(factory.isBlockOnAcknowledge(), ActiveMQClient.DEFAULT_BLOCK_ON_ACKNOWLEDGE); Assert.assertEquals(factory.isBlockOnNonDurableSend(), ActiveMQClient.DEFAULT_BLOCK_ON_NON_DURABLE_SEND); Assert.assertEquals(factory.isBlockOnDurableSend(), ActiveMQClient.DEFAULT_BLOCK_ON_DURABLE_SEND); Assert.assertEquals(factory.isPreAcknowledge(), ActiveMQClient.DEFAULT_PRE_ACKNOWLEDGE); Assert.assertEquals(factory.isUseGlobalPools(), ActiveMQClient.DEFAULT_USE_GLOBAL_POOLS); }
@Test public void testCreateConnectionFactoryNoOverrides() throws Exception { ActiveMQResourceAdapter ra = new ActiveMQResourceAdapter(); ra.setConnectorClassName(InVMConnectorFactory.class.getName()); ActiveMQConnectionFactory factory = ra.getConnectionFactory(new ConnectionFactoryProperties()); Assert.assertEquals(factory.getCallTimeout(), ActiveMQClient.DEFAULT_CALL_TIMEOUT); Assert.assertEquals(factory.getClientFailureCheckPeriod(), ActiveMQClient.DEFAULT_CLIENT_FAILURE_CHECK_PERIOD); Assert.assertEquals(factory.getClientID(), null); Assert.assertEquals(factory.getConnectionLoadBalancingPolicyClassName(), ActiveMQClient.DEFAULT_CONNECTION_LOAD_BALANCING_POLICY_CLASS_NAME); Assert.assertEquals(factory.getConnectionTTL(), ActiveMQClient.DEFAULT_CONNECTION_TTL); Assert.assertEquals(factory.getConsumerMaxRate(), ActiveMQClient.DEFAULT_CONSUMER_MAX_RATE); Assert.assertEquals(factory.getConsumerWindowSize(), ActiveMQClient.DEFAULT_CONSUMER_WINDOW_SIZE); Assert.assertEquals(factory.getDupsOKBatchSize(), ActiveMQClient.DEFAULT_ACK_BATCH_SIZE); Assert.assertEquals(factory.getMinLargeMessageSize(), ActiveMQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE); Assert.assertEquals(factory.getProducerMaxRate(), ActiveMQClient.DEFAULT_PRODUCER_MAX_RATE); Assert.assertEquals(factory.getConfirmationWindowSize(), ActiveMQClient.DEFAULT_CONFIRMATION_WINDOW_SIZE); // by default, reconnect attempts is set to -1 Assert.assertEquals(-1, factory.getReconnectAttempts()); Assert.assertEquals(factory.getRetryInterval(), ActiveMQClient.DEFAULT_RETRY_INTERVAL); Assert.assertEquals(factory.getRetryIntervalMultiplier(), ActiveMQClient.DEFAULT_RETRY_INTERVAL_MULTIPLIER, 0.000001); Assert.assertEquals(factory.getScheduledThreadPoolMaxSize(), ActiveMQClient.DEFAULT_SCHEDULED_THREAD_POOL_MAX_SIZE); Assert.assertEquals(factory.getThreadPoolMaxSize(), ActiveMQClient.DEFAULT_THREAD_POOL_MAX_SIZE); Assert.assertEquals(factory.getTransactionBatchSize(), ActiveMQClient.DEFAULT_ACK_BATCH_SIZE); Assert.assertEquals(factory.isAutoGroup(), ActiveMQClient.DEFAULT_AUTO_GROUP); Assert.assertEquals(factory.isBlockOnAcknowledge(), ActiveMQClient.DEFAULT_BLOCK_ON_ACKNOWLEDGE); Assert.assertEquals(factory.isBlockOnNonDurableSend(), ActiveMQClient.DEFAULT_BLOCK_ON_NON_DURABLE_SEND); Assert.assertEquals(factory.isBlockOnDurableSend(), ActiveMQClient.DEFAULT_BLOCK_ON_DURABLE_SEND); Assert.assertEquals(factory.isPreAcknowledge(), ActiveMQClient.DEFAULT_PRE_ACKNOWLEDGE); Assert.assertEquals(factory.isUseGlobalPools(), ActiveMQClient.DEFAULT_USE_GLOBAL_POOLS); }
Assert.assertEquals(factory.getConnectionTTL(), 3); Assert.assertEquals(factory.getConsumerMaxRate(), 4); Assert.assertEquals(factory.getConsumerWindowSize(), 5); Assert.assertEquals(factory.getDupsOKBatchSize(), 8); Assert.assertEquals(factory.getMinLargeMessageSize(), 10);
Assert.assertEquals(cf.getCallFailoverTimeout(), callFailoverTimeout); Assert.assertEquals(cf.getMinLargeMessageSize(), minLargeMessageSize); Assert.assertEquals(cf.getConsumerWindowSize(), consumerWindowSize); Assert.assertEquals(cf.getConsumerMaxRate(), consumerMaxRate); Assert.assertEquals(cf.getConfirmationWindowSize(), confirmationWindowSize);
Assert.assertEquals(factory.getConnectionTTL(), 3); Assert.assertEquals(factory.getConsumerMaxRate(), 4); Assert.assertEquals(factory.getConsumerWindowSize(), 5); Assert.assertEquals(factory.getDupsOKBatchSize(), 8); Assert.assertEquals(factory.getMinLargeMessageSize(), 10);
Assert.assertEquals(callTimeout, temp.getCallTimeout()); Assert.assertEquals(minLargeMessageSize, temp.getMinLargeMessageSize()); Assert.assertEquals(consumerWindowSize, temp.getConsumerWindowSize()); Assert.assertEquals(consumerMaxRate, temp.getConsumerMaxRate()); Assert.assertEquals(confirmationWindowSize, temp.getConfirmationWindowSize());
Assert.assertEquals(callTimeout, cf.getCallTimeout()); Assert.assertEquals(minLargeMessageSize, cf.getMinLargeMessageSize()); Assert.assertEquals(consumerWindowSize, cf.getConsumerWindowSize()); Assert.assertEquals(consumerMaxRate, cf.getConsumerMaxRate()); Assert.assertEquals(confirmationWindowSize, cf.getConfirmationWindowSize());
cf.getCallTimeout(); cf.getMinLargeMessageSize(); cf.getConsumerWindowSize(); cf.getConsumerMaxRate(); cf.getConfirmationWindowSize();