[jboss-cvs] JBoss Messaging SVN: r4548 - in trunk: tests/src/org/jboss/messaging/tests/unit/core/config/impl and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Jun 23 06:41:32 EDT 2008
Author: timfox
Date: 2008-06-23 06:41:32 -0400 (Mon, 23 Jun 2008)
New Revision: 4548
Modified:
trunk/src/main/org/jboss/messaging/microcontainer/JBMBootstrapServer.java
trunk/tests/src/org/jboss/messaging/tests/unit/core/config/impl/ConfigurationImplTest.java
trunk/tests/src/org/jboss/messaging/tests/unit/core/config/impl/FileConfigurationTest.java
Log:
More test stuff
Modified: trunk/src/main/org/jboss/messaging/microcontainer/JBMBootstrapServer.java
===================================================================
--- trunk/src/main/org/jboss/messaging/microcontainer/JBMBootstrapServer.java 2008-06-23 09:45:38 UTC (rev 4547)
+++ trunk/src/main/org/jboss/messaging/microcontainer/JBMBootstrapServer.java 2008-06-23 10:41:32 UTC (rev 4548)
@@ -50,11 +50,12 @@
/**
* The deployments
*/
- protected List deployments = new CopyOnWriteArrayList();
+ protected List<KernelDeployment> deployments = new CopyOnWriteArrayList<KernelDeployment>();
/**
* The arguments
*/
protected String[] args;
+
private Properties properties;
/**
@@ -63,9 +64,10 @@
* @param args the command line arguments
* @throws Exception for any error
*/
- public static void main(String[] args) throws Exception
+ public static void main(final String[] args) throws Exception
{
JBMBootstrapServer bootstrap = new JBMBootstrapServer(args);
+
bootstrap.run();
}
@@ -89,7 +91,7 @@
this.args = args;
}
- public JBMBootstrapServer(String[] args, KernelConfig kernelConfig) throws Exception
+ public JBMBootstrapServer(final String[] args, KernelConfig kernelConfig) throws Exception
{
super(kernelConfig);
//System.setProperty("java.naming.factory.initial", "org.jnp.interfaces.LocalOnlyContextFactory");
@@ -116,7 +118,7 @@
*
* @param deployment the deployment
*/
- public void undeploy(KernelDeployment deployment) throws Throwable
+ public void undeploy(final KernelDeployment deployment) throws Throwable
{
log.debug("Undeploying " + deployment.getName());
deployments.remove(deployment);
@@ -131,7 +133,7 @@
}
}
- public KernelDeployment deploy(String arg) throws Throwable
+ public KernelDeployment deploy(final String arg) throws Throwable
{
ClassLoader cl = Thread.currentThread().getContextClassLoader();
URL url = cl.getResource(arg);
@@ -155,7 +157,7 @@
* Deploys a XML on the container
*
*/
- public KernelDeployment deploy(String name, String xml) throws Throwable
+ public KernelDeployment deploy(final String name, final String xml) throws Throwable
{
ByteArrayOutputStream byteOut = new ByteArrayOutputStream();
PrintStream printOut = new PrintStream(byteOut);
@@ -178,7 +180,7 @@
* @param url the deployment url
* @throws Throwable for any error
*/
- protected KernelDeployment deploy(URL url) throws Throwable
+ protected KernelDeployment deploy(final URL url) throws Throwable
{
log.debug("Deploying " + url);
KernelDeployment deployment = deployer.deploy(url);
@@ -190,7 +192,7 @@
public void shutDown()
{
log.info("Shutting down");
- ListIterator iterator = deployments.listIterator(deployments.size());
+ ListIterator<KernelDeployment> iterator = deployments.listIterator(deployments.size());
while (iterator.hasPrevious())
{
KernelDeployment deployment = (KernelDeployment) iterator.previous();
@@ -207,6 +209,8 @@
{
properties = props;
}
+
+
protected class Shutdown extends Thread
{
public void run()
Modified: trunk/tests/src/org/jboss/messaging/tests/unit/core/config/impl/ConfigurationImplTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/unit/core/config/impl/ConfigurationImplTest.java 2008-06-23 09:45:38 UTC (rev 4547)
+++ trunk/tests/src/org/jboss/messaging/tests/unit/core/config/impl/ConfigurationImplTest.java 2008-06-23 10:41:32 UTC (rev 4548)
@@ -31,6 +31,8 @@
import junit.framework.TestCase;
+import org.jboss.messaging.core.client.ConnectionParams;
+import org.jboss.messaging.core.client.impl.ConnectionParamsImpl;
import org.jboss.messaging.core.config.Configuration;
import org.jboss.messaging.core.config.impl.ConfigurationImpl;
import org.jboss.messaging.core.remoting.TransportType;
@@ -186,6 +188,13 @@
l = randomLong();
conf.setJournalTaskPeriod(l);
assertEquals(l, conf.getJournalTaskPeriod());
+
+ i = randomInt();
+ conf.setServerID(i);
+ assertEquals(i, conf.getServerID());
+
+ ConnectionParams params = conf.getConnectionParams();
+ assertNotNull(params);
}
}
Modified: trunk/tests/src/org/jboss/messaging/tests/unit/core/config/impl/FileConfigurationTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/unit/core/config/impl/FileConfigurationTest.java 2008-06-23 09:45:38 UTC (rev 4547)
+++ trunk/tests/src/org/jboss/messaging/tests/unit/core/config/impl/FileConfigurationTest.java 2008-06-23 10:41:32 UTC (rev 4548)
@@ -61,6 +61,14 @@
assertEquals(56546, conf.getJournalMaxAIO());
assertEquals(432323, conf.getJournalAIOTimeout());
assertEquals(6544, conf.getJournalTaskPeriod());
+
+ assertEquals(false, conf.getConnectionParams().isInVMOptimisationEnabled());
+ assertEquals(7654, conf.getConnectionParams().getCallTimeout());
+ assertEquals(false, conf.getConnectionParams().isTcpNoDelay());
+ assertEquals(987654, conf.getConnectionParams().getTcpReceiveBufferSize());
+ assertEquals(2345676, conf.getConnectionParams().getTcpSendBufferSize());
+ assertEquals(123123, conf.getConnectionParams().getPingInterval());
+ assertEquals(321321, conf.getConnectionParams().getPingTimeout());
}
public void testSetGetConfigurationURL()
More information about the jboss-cvs-commits
mailing list