[jboss-cvs] JBoss Messaging SVN: r1709 - in branches/Branch_Client_Failover_Experiment/tests: etc src/org/jboss/test/messaging/jms/clustering src/org/jboss/test/messaging/tools/jmx src/org/jboss/test/messaging/tools/jmx/rmi
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Dec 5 13:38:11 EST 2006
Author: clebert.suconic at jboss.com
Date: 2006-12-05 13:38:08 -0500 (Tue, 05 Dec 2006)
New Revision: 1709
Modified:
branches/Branch_Client_Failover_Experiment/tests/etc/container.xml
branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/jms/clustering/ClusteringBase.java
branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/tools/jmx/ServiceContainer.java
branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/tools/jmx/ServiceContainerConfiguration.java
branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/tools/jmx/rmi/LocalTestServer.java
Log:
Trying to fix problems on "ant clustering-tests"
Modified: branches/Branch_Client_Failover_Experiment/tests/etc/container.xml
===================================================================
--- branches/Branch_Client_Failover_Experiment/tests/etc/container.xml 2006-12-05 17:20:56 UTC (rev 1708)
+++ branches/Branch_Client_Failover_Experiment/tests/etc/container.xml 2006-12-05 18:38:08 UTC (rev 1709)
@@ -68,17 +68,6 @@
<serialization-type>jms</serialization-type>
-
- <!--
- Specifies whether to start a clustered messaging server or not. If "test.clustered" is set,
- the value of the system property takes precedence. Supported values are "true" or "false".
-
- Setting "clustered" to "true" doesn't guarantee that the test will be actually run in
- clustered mode, the test database must be also permitting sharing over a LAN. "mysql" allows
- this, "hsqldb" doesn't. The test will quickly fail in such a situation.
- -->
- <clustered>true</clustered>
-
</container>
Modified: branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/jms/clustering/ClusteringBase.java
===================================================================
--- branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/jms/clustering/ClusteringBase.java 2006-12-05 17:20:56 UTC (rev 1708)
+++ branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/jms/clustering/ClusteringBase.java 2006-12-05 18:38:08 UTC (rev 1709)
@@ -83,25 +83,20 @@
try
{
- ServerManagement.start("all", 0);
- ServerManagement.start("all", 1);
- ServerManagement.start("all", 2);
-
- ServerManagement.deployClusteredQueue("testDistributedQueue", 0);
- ServerManagement.deployClusteredTopic("testDistributedTopic", 0);
+ startServer(0);
+ startServer(1);
+ startServer(2);
- ServerManagement.deployClusteredQueue("testDistributedQueue", 1);
- ServerManagement.deployClusteredTopic("testDistributedTopic", 1);
-
- ServerManagement.deployClusteredQueue("testDistributedQueue", 2);
- ServerManagement.deployClusteredTopic("testDistributedTopic", 2);
-
ic1 = new InitialContext(ServerManagement.getJNDIEnvironment(0));
ic2 = new InitialContext(ServerManagement.getJNDIEnvironment(1));
ic3 = new InitialContext(ServerManagement.getJNDIEnvironment(2));
log.info("Deployed destinations ok");
+ cf1 = (ConnectionFactory)ic1.lookup("/ConnectionFactory");
+ cf2 = (ConnectionFactory)ic2.lookup("/ConnectionFactory");
+ cf3 = (ConnectionFactory)ic3.lookup("/ConnectionFactory");
+
queue1 = (Queue)ic1.lookup("queue/testDistributedQueue");
queue2 = (Queue)ic2.lookup("queue/testDistributedQueue");
queue3 = (Queue)ic3.lookup("queue/testDistributedQueue");
@@ -110,11 +105,7 @@
topic2 = (Topic)ic2.lookup("topic/testDistributedTopic");
topic3 = (Topic)ic3.lookup("topic/testDistributedTopic");
- cf1 = (ConnectionFactory)ic1.lookup("/ConnectionFactory");
- cf2 = (ConnectionFactory)ic2.lookup("/ConnectionFactory");
- cf3 = (ConnectionFactory)ic3.lookup("/ConnectionFactory");
-
- drainQueues();
+ drainQueues();
}
catch (Exception e)
{
@@ -123,6 +114,14 @@
}
}
+ private void startServer(int peer)
+ throws Exception
+ {
+ ServerManagement.start("all-cluster", peer);
+ ServerManagement.deployClusteredQueue("testDistributedQueue", peer);
+ ServerManagement.deployClusteredTopic("testDistributedTopic", peer);
+ }
+
protected void tearDown() throws Exception
{
try
Modified: branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/tools/jmx/ServiceContainer.java
===================================================================
--- branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/tools/jmx/ServiceContainer.java 2006-12-05 17:20:56 UTC (rev 1708)
+++ branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/tools/jmx/ServiceContainer.java 2006-12-05 18:38:08 UTC (rev 1709)
@@ -25,9 +25,26 @@
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.net.URL;
-import java.sql.*;
-import java.util.*;
-import javax.management.*;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.PreparedStatement;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Properties;
+import java.util.Set;
+import java.util.StringTokenizer;
+import javax.management.Attribute;
+import javax.management.MBeanAttributeInfo;
+import javax.management.MBeanException;
+import javax.management.MBeanInfo;
+import javax.management.MBeanServer;
+import javax.management.MBeanServerFactory;
+import javax.management.ObjectName;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NameNotFoundException;
@@ -49,7 +66,11 @@
import org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory;
import org.jboss.resource.adapter.jdbc.remote.WrapperDataSourceService;
import org.jboss.resource.adapter.jms.JmsManagedConnectionFactory;
-import org.jboss.resource.connectionmanager.*;
+import org.jboss.resource.connectionmanager.CachedConnectionManager;
+import org.jboss.resource.connectionmanager.CachedConnectionManagerMBean;
+import org.jboss.resource.connectionmanager.ConnectionFactoryBindingService;
+import org.jboss.resource.connectionmanager.JBossManagedConnectionPool;
+import org.jboss.resource.connectionmanager.TxConnectionManager;
import org.jboss.system.Registry;
import org.jboss.system.ServiceController;
import org.jboss.system.ServiceCreator;
@@ -158,6 +179,7 @@
private Server hsqldbServer;
private boolean transaction;
+ private boolean cluster;
private boolean database;
private boolean jca;
private boolean remotingSocket;
@@ -381,7 +403,7 @@
log.info("Serialization type: ...... " + config.getSerializationType());
log.info("Database: ................ " + config.getDatabaseType());
log.info("Clustering mode: ......... " +
- (config.isClustered() ? "CLUSTERED" : "NON-CLUSTERED"));
+ (this.isClustered() ? "CLUSTERED" : "NON-CLUSTERED"));
log.debug(this + " started");
}
@@ -480,7 +502,7 @@
public Properties getPersistenceManagerSQLProperties() throws Exception
{
String databaseType = getDatabaseType();
-
+
String persistenceConfigFile =
"server/default/deploy/" + databaseType + "-persistence-service.xml";
@@ -756,7 +778,7 @@
public boolean isClustered()
{
- return config.isClustered();
+ return cluster;
}
public String toString()
@@ -1283,6 +1305,16 @@
minus = true;
}
+ if ("all-cluster".equals(tok))
+ {
+ cluster = true;
+ transaction = true;
+ database = true;
+ jca = true;
+ remotingSocket = true;
+ security = true;
+ }
+ else
if ("all".equals(tok))
{
transaction = true;
Modified: branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/tools/jmx/ServiceContainerConfiguration.java
===================================================================
--- branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/tools/jmx/ServiceContainerConfiguration.java 2006-12-05 17:20:56 UTC (rev 1708)
+++ branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/tools/jmx/ServiceContainerConfiguration.java 2006-12-05 18:38:08 UTC (rev 1709)
@@ -29,8 +29,6 @@
{
// Constants -----------------------------------------------------
- public static final boolean DEFAULT_CLUSTERED_MODE = false;
-
// Static --------------------------------------------------------
public static String getHypersonicDatabase(String connectionURL)
@@ -76,7 +74,6 @@
private String database;
private Map dbConfigurations;
private String serializationType;
- private Boolean clusteredMode;
// Constructors --------------------------------------------------
@@ -102,7 +99,7 @@
{
databaseType="mssql";
}
- return databaseType;
+ return databaseType;
}
public String getDatabaseConnectionURL()
@@ -143,14 +140,6 @@
return serializationType;
}
- /**
- * @return the clustered mode in which the container should run an individual test.
- */
- public boolean isClustered()
- {
- return clusteredMode.booleanValue();
- }
-
// Package protected ---------------------------------------------
// Protected -----------------------------------------------------
@@ -162,7 +151,6 @@
Reader reader = new InputStreamReader(is);
String currentDatabase = null;
String currentSerializationType = null;
- boolean currentClusteredMode = DEFAULT_CLUSTERED_MODE;
try
{
@@ -201,10 +189,6 @@
{
currentSerializationType = XMLUtil.getTextContent(n);
}
- else if ("clustered".equals(name))
- {
- currentClusteredMode = Boolean.getBoolean(XMLUtil.getTextContent(n));
- }
else
{
throw new Exception("Unexpected child <" + name + "> of node " +
@@ -215,7 +199,6 @@
setCurrentDatabase(currentDatabase);
setCurrentSerializationType(currentSerializationType);
- setCurrentClusteredMode(currentClusteredMode);
}
finally
{
@@ -237,8 +220,8 @@
}
/**
- * Always the value of "test.serialization" system property takes precedence over the
- * configuration file value.
+ * Always the value of "test.serialization" system property takes precedence over the c
+ * onfiguration file value.
*/
private void setCurrentSerializationType(String xmlConfigSerializationType)
{
@@ -249,24 +232,6 @@
}
}
- /**
- * Always the value of "test.clustered" system property takes precedence over the configuration
- * file value.
- */
- private void setCurrentClusteredMode(boolean xmlClusteredMode) throws Exception
- {
- String s = System.getProperty("test.clustered");
- if (s != null)
- {
- clusteredMode = Boolean.valueOf(s);
- }
-
- if (clusteredMode == null)
- {
- clusteredMode = new Boolean(xmlClusteredMode);
- }
- }
-
private void validate() throws Exception
{
// make sure that I have a corresponding "database-configuration"
Modified: branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/tools/jmx/rmi/LocalTestServer.java
===================================================================
--- branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/tools/jmx/rmi/LocalTestServer.java 2006-12-05 17:20:56 UTC (rev 1708)
+++ branches/Branch_Client_Failover_Experiment/tests/src/org/jboss/test/messaging/tools/jmx/rmi/LocalTestServer.java 2006-12-05 18:38:08 UTC (rev 1709)
@@ -41,12 +41,12 @@
import org.jboss.messaging.core.plugin.postoffice.cluster.DefaultClusteredPostOffice;
import org.jboss.remoting.ServerInvocationHandler;
import org.jboss.test.messaging.tools.ServerManagement;
-import org.jboss.test.messaging.tools.jndi.Constants;
import org.jboss.test.messaging.tools.jboss.MBeanConfigurationElement;
import org.jboss.test.messaging.tools.jboss.ServiceDeploymentDescriptor;
import org.jboss.test.messaging.tools.jmx.MockJBossSecurityManager;
import org.jboss.test.messaging.tools.jmx.RemotingJMXWrapper;
import org.jboss.test.messaging.tools.jmx.ServiceContainer;
+import org.jboss.test.messaging.tools.jndi.Constants;
import org.w3c.dom.Element;
/**
@@ -255,7 +255,7 @@
boolean clustered) throws Exception
{
try
- {
+ {
log.info(" Server peer ID ........... " + serverPeerID);
log.debug("creating ServerPeer instance");
@@ -272,6 +272,9 @@
String databaseType = sc.getDatabaseType();
String persistenceConfigFile;
+
+ log.info("DatabaseType=" + databaseType);
+ log.info("Clustered:" + clustered);
if (clustered && !databaseType.equals("hsqldb"))
{
More information about the jboss-cvs-commits
mailing list