RA connection factory - test prefetch is being set

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1374958 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Bosanac Dejan 2012-08-20 09:49:16 +00:00
parent e49f5d9ff8
commit 2027c87791
1 changed files with 4 additions and 0 deletions

View File

@ -23,6 +23,7 @@ import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import javax.jms.Connection;
import junit.framework.TestCase;
import org.apache.activemq.ActiveMQConnection;
/**
*
@ -48,6 +49,7 @@ public class ActiveMQConnectionFactoryTest extends TestCase {
info.setServerUrl(url);
info.setUserName(user);
info.setPassword(pwd);
info.setAllPrefetchValues(new Integer(100));
}
@Override
@ -70,6 +72,8 @@ public class ActiveMQConnectionFactoryTest extends TestCase {
ois.close();
Connection con = deserializedFactory.createConnection("defaultUser", "defaultPassword");
ActiveMQConnection connection = ((ActiveMQConnection)((ManagedConnectionProxy)con).getManagedConnection().getPhysicalConnection());
assertEquals(100, connection.getPrefetchPolicy().getQueuePrefetch());
assertNotNull("Connection object returned by ActiveMQConnectionFactory.createConnection() is null", con);
}