User: d_jencks
Date: 01/11/10 14:28:28
Added: src/main/org/jboss/test/jbossmq/test
ConnectionUnitTestCase.java
Removed: src/main/org/jboss/test/jbossmq/test ConnectionTestCase.java
Log:
renamed Connection(Unit)TestCase so it can participate in auto-tests
Revision Changes Path
1.1
jbosstest/src/main/org/jboss/test/jbossmq/test/ConnectionUnitTestCase.java
Index: ConnectionUnitTestCase.java
===================================================================
/*
* JBoss, the OpenSource J2EE webOS
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
package org.jboss.test.jbossmq.test;
import junit.framework.Test;
import junit.framework.TestCase;
import javax.jms.*;
import org.jboss.mq.SpyConnectionFactory;
import org.jboss.test.JBossTestCase;
import java.util.Properties;
import org.jboss.mq.il.oil.OILServerILFactory;
import org.jboss.mq.il.uil.UILServerILFactory;
import org.jboss.mq.SpyXAConnectionFactory;
import javax.naming.*;
/**
* Test all the verious ways that a connection can be
* established with JBossMQ
*
* @author [EMAIL PROTECTED]
* @version $Revision: 1.1 $
*/
public class ConnectionUnitTestCase extends JBossTestCase {
public ConnectionUnitTestCase(String name) {
super(name);
}
protected void setUp() throws Exception {
}
public void testOILConnectViaJNDI() throws Exception {
InitialContext ctx = new InitialContext();
QueueConnectionFactory cf =
(QueueConnectionFactory)ctx.lookup("ConnectionFactory");
QueueConnection c = cf.createQueueConnection();
c.close();
XAQueueConnectionFactory xacf =
(XAQueueConnectionFactory)ctx.lookup("XAConnectionFactory");
XAQueueConnection xac = xacf.createXAQueueConnection();
xac.close();
}
public void testOILConnectNoJNDI() throws Exception {
Properties props = new Properties();
props.setProperty(OILServerILFactory.SERVER_IL_FACTORY_KEY,
OILServerILFactory.SERVER_IL_FACTORY);
props.setProperty(OILServerILFactory.CLIENT_IL_SERVICE_KEY,
OILServerILFactory.CLIENT_IL_SERVICE);
props.setProperty(OILServerILFactory.PING_PERIOD_KEY, "1000");
props.setProperty(OILServerILFactory.OIL_ADDRESS_KEY, "localhost");
props.setProperty(OILServerILFactory.OIL_PORT_KEY, "8090");
QueueConnectionFactory cf = new SpyConnectionFactory(props);
QueueConnection c = cf.createQueueConnection();
c.close();
XAQueueConnectionFactory xacf = new SpyXAConnectionFactory(props);
XAQueueConnection xac = xacf.createXAQueueConnection();
xac.close();
}
public void testUILConnectViaJNDI() throws Exception {
InitialContext ctx = new InitialContext();
QueueConnectionFactory cf =
(QueueConnectionFactory)ctx.lookup("UILConnectionFactory");
QueueConnection c = cf.createQueueConnection();
c.close();
XAQueueConnectionFactory xacf =
(XAQueueConnectionFactory)ctx.lookup("UILXAConnectionFactory");
XAQueueConnection xac = xacf.createXAQueueConnection();
xac.close();
}
public void testUILConnectNoJNDI() throws Exception {
Properties props = new Properties();
props.setProperty(UILServerILFactory.SERVER_IL_FACTORY_KEY,
UILServerILFactory.SERVER_IL_FACTORY);
props.setProperty(UILServerILFactory.CLIENT_IL_SERVICE_KEY,
UILServerILFactory.CLIENT_IL_SERVICE);
props.setProperty(UILServerILFactory.PING_PERIOD_KEY, "1000");
props.setProperty(UILServerILFactory.UIL_ADDRESS_KEY, "localhost");
props.setProperty(UILServerILFactory.UIL_PORT_KEY, "8091");
QueueConnectionFactory cf = new SpyConnectionFactory(props);
QueueConnection c = cf.createQueueConnection();
c.close();
XAQueueConnectionFactory xacf = new SpyXAConnectionFactory(props);
XAQueueConnection xac = xacf.createXAQueueConnection();
xac.close();
}
public static void main(java.lang.String[] args) {
junit.textui.TestRunner.run(ConnectionTestCase.class);
}
}
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development