Skip to content
Browse files

fixed server control and test

  • Loading branch information...
1 parent aa4a568 commit 5338c31d09891950389c585db7207c06778e90fd @andytaylor andytaylor committed Dec 10, 2010
View
15 build-hornetq.xml
@@ -1654,6 +1654,19 @@
</antcall>
</target>
+ <target name="management-tests" depends="jar, compile-unit-tests">
+ <antcall inheritall="true" inheritrefs="true" target="tests">
+ <param name="tests.param" value="**/org/hornetq/tests/integration/management/**/*${test-mask}.class"/>
+ </antcall>
+ </target>
+
+
+ <target name="jms-management-tests" depends="jar, compile-unit-tests">
+ <antcall inheritall="true" inheritrefs="true" target="tests">
+ <param name="tests.param" value="**/org/hornetq/tests/integration/jms/server/management/**/*${test-mask}.class"/>
+ </antcall>
+ </target>
+
<target name="spring-tests" depends="jar, compile-unit-tests">
<antcall inheritall="true" inheritrefs="true" target="tests">
<param name="tests.param" value="**/org/hornetq/tests/integration/spring/*${test-mask}.class"/>
@@ -1743,7 +1756,7 @@
<!--exclude any replication tests for now-->
<exclude name="**/cluster/failover/*ClusterWithBackupFailoverTestBase.class"/>
-
+ <exclude name="**/cluster/**/*/class"/>
<exclude name="**/cluster/failover/*DiscoveryClusterWithBackupFailoverTest.class"/>
<exclude name="**/cluster/failover/*GroupingFailoverReplicationTest.class"/>
<exclude name="**/cluster/failover/*Replicated*.class"/>
View
9 build.xml
@@ -250,6 +250,15 @@ Copyright 2009 Red Hat, Inc.
<ant antfile="build-hornetq.xml" target="compile-reports"/>
</target>
+ <target name="management-tests" depends="createthirdparty">
+ <ant antfile="build-hornetq.xml" target="management-tests"/>
+ <ant antfile="build-hornetq.xml" target="compile-reports"/>
+ </target>
+
+ <target name="jms-management-tests" depends="createthirdparty">
+ <ant antfile="build-hornetq.xml" target="jms-management-tests"/>
+ <ant antfile="build-hornetq.xml" target="compile-reports"/>
+ </target>
<target name="cluster-tests" depends="createthirdparty">
<ant antfile="build-hornetq.xml" target="cluster-tests"/>
View
21 src/main/org/hornetq/api/core/management/HornetQServerControl.java
@@ -553,7 +553,7 @@ void createDivert(@Parameter(name="name", desc="Name of the divert") String name
String[] getBridgeNames();
- @Operation(desc= "Create a Bridge using a pair of connectors", impact = MBeanOperationInfo.ACTION)
+ @Operation(desc= "Create a Bridge", impact = MBeanOperationInfo.ACTION)
void createBridge(@Parameter(name="name", desc="Name of the bridge") String name,
@Parameter(name="queueName", desc="Name of the source queue") String queueName,
@Parameter(name="forwardingAddress", desc="Forwarding address") String forwardingAddress,
@@ -565,27 +565,12 @@ void createBridge(@Parameter(name="name", desc="Name of the bridge") String name
@Parameter(name="useDuplicateDetection", desc="Use duplicate detection") boolean useDuplicateDetection,
@Parameter(name="confirmationWindowSize", desc="Confirmation window size") int confirmationWindowSize,
@Parameter(name="clientFailureCheckPeriod", desc="Period to check client failure") long clientFailureCheckPeriod,
- @Parameter(name="liveConnector", desc="Name of the connector to the live server") List<String> staticConnectors,
+ @Parameter(name="staticConnectorNames", desc="comma separated list of connector names or name of discovery group if 'useDiscoveryGroup' is set to true") String connectorNames,
+ @Parameter(name="useDiscoveryGroup", desc="use discovery group")boolean useDiscoveryGroup,
@Parameter(name="ha", desc="Is it using HA") boolean ha,
@Parameter(name="user", desc="User name") String user,
@Parameter(name="password", desc="User password") String password) throws Exception;
- @Operation(desc= "Create a Bridge using a discovery group", impact = MBeanOperationInfo.ACTION)
- void createBridge(@Parameter(name="name", desc="Name of the bridge") String name,
- @Parameter(name="queueName", desc="Name of the source queue") String queueName,
- @Parameter(name="forwardingAddress", desc="Forwarding address") String forwardingAddress,
- @Parameter(name="filterString", desc="Filter of the brdige") String filterString,
- @Parameter(name="transformerClassName", desc="Class name of the bridge transformer") String transformerClassName,
- @Parameter(name="retryInterval", desc="Connection retry interval") long retryInterval,
- @Parameter(name="retryIntervalMultiplier", desc="Connection retry interval multiplier") double retryIntervalMultiplier,
- @Parameter(name="reconnectAttempts", desc="Number of reconnection attempts") int reconnectAttempts,
- @Parameter(name="useDuplicateDetection", desc="Use duplicate detection") boolean useDuplicateDetection,
- @Parameter(name="confirmationWindowSize", desc="Confirmation window size") int confirmationWindowSize,
- @Parameter(name="clientFailureCheckPeriod", desc="Period to check client failure") long clientFailureCheckPeriod,
- @Parameter(name="name", desc="Name of the discovery group") String discoveryGroupName,
- @Parameter(name="ha", desc="Is it using HA") boolean ha,
- @Parameter(name="user", desc="User name") String user,
- @Parameter(name="password", desc="User password") String password) throws Exception;
@Operation(desc= "Destroy a bridge", impact = MBeanOperationInfo.ACTION)
void destroyBridge(@Parameter(name="name", desc="Name of the bridge") String name) throws Exception;
View
114 src/main/org/hornetq/core/management/impl/HornetQServerControlImpl.java
@@ -1623,75 +1623,57 @@ public void createBridge(final String name,
final boolean useDuplicateDetection,
final int confirmationWindowSize,
final long clientFailureCheckPeriod,
- final List<String> staticConnectors,
+ final String connectorNames,
+ boolean useDiscoveryGroup,
final boolean ha,
final String user,
final String password) throws Exception
{
checkStarted();
clearIO();
- try
- {
- BridgeConfiguration config = new BridgeConfiguration(name,
- queueName,
- forwardingAddress,
- filterString,
- transformerClassName,
- retryInterval,
- retryIntervalMultiplier,
- reconnectAttempts,
- useDuplicateDetection,
- confirmationWindowSize,
- clientFailureCheckPeriod,
- staticConnectors,
- ha,
- user,
- password);
- server.deployBridge(config);
- }
- finally
- {
- blockOnIO();
- }
- }
- public void createBridge(final String name,
- final String queueName,
- final String forwardingAddress,
- final String filterString,
- final String transformerClassName,
- final long retryInterval,
- final double retryIntervalMultiplier,
- final int reconnectAttempts,
- final boolean useDuplicateDetection,
- final int confirmationWindowSize,
- final long clientFailureCheckPeriod,
- final String discoveryGroupName,
- final boolean ha,
- final String user,
- final String password) throws Exception
- {
- checkStarted();
- clearIO();
try
{
- BridgeConfiguration config = new BridgeConfiguration(name,
- queueName,
- forwardingAddress,
- filterString,
- transformerClassName,
- retryInterval,
- retryIntervalMultiplier,
- reconnectAttempts,
- useDuplicateDetection,
- confirmationWindowSize,
- clientFailureCheckPeriod,
- discoveryGroupName,
- ha,
- user,
- password);
+ BridgeConfiguration config = null;
+ if (useDiscoveryGroup)
+ {
+ config = new BridgeConfiguration(name,
+ queueName,
+ forwardingAddress,
+ filterString,
+ transformerClassName,
+ retryInterval,
+ retryIntervalMultiplier,
+ reconnectAttempts,
+ useDuplicateDetection,
+ confirmationWindowSize,
+ clientFailureCheckPeriod,
+ connectorNames,
+ ha,
+ user,
+ password);
+ }
+ else
+ {
+ List<String> connectors = toList(connectorNames);
+ config = new BridgeConfiguration(name,
+ queueName,
+ forwardingAddress,
+ filterString,
+ transformerClassName,
+ retryInterval,
+ retryIntervalMultiplier,
+ reconnectAttempts,
+ useDuplicateDetection,
+ confirmationWindowSize,
+ clientFailureCheckPeriod,
+ connectors,
+ ha,
+ user,
+ password);
+ }
server.deployBridge(config);
}
finally
@@ -1700,6 +1682,7 @@ public void createBridge(final String name,
}
}
+
public void destroyBridge(final String name) throws Exception
{
checkStarted();
@@ -1908,4 +1891,19 @@ private void checkStarted()
return new String[0];
}
+ private static List<String> toList(final String commaSeparatedString)
+ {
+ List<String> list = new ArrayList<String>();
+ if (commaSeparatedString == null || commaSeparatedString.trim().length() == 0)
+ {
+ return list;
+ }
+ String[] values = commaSeparatedString.split(",");
+ for (int i = 0; i < values.length; i++)
+ {
+ list.add(values[i].trim());
+ }
+ return list;
+ }
+
}
View
6 tests/src/org/hornetq/tests/integration/management/HornetQServerControlTest.java
@@ -614,9 +614,6 @@ public void testCreateAndDestroyBridge() throws Exception
session.createQueue(sourceAddress, sourceQueue);
session.createQueue(targetAddress, targetQueue);
-
- List<String> listName = new ArrayList<String>();
- listName.add(connectorConfig.getName());
serverControl.createBridge(name,
sourceQueue,
@@ -629,7 +626,8 @@ public void testCreateAndDestroyBridge() throws Exception
false, // duplicateDetection
1, // confirmationWindowSize
HornetQClient.DEFAULT_CLIENT_FAILURE_CHECK_PERIOD,
- listName, // liveConnector
+ connectorConfig.getName(), // liveConnector
+ false,
false,
null,
null);
View
6 tests/src/org/hornetq/tests/integration/management/HornetQServerControlUsingCoreTest.java
@@ -593,7 +593,8 @@ public void createBridge(String name,
boolean useDuplicateDetection,
int confirmationWindowSize,
long clientFailureCheckPeriod,
- List<String> staticConnectors,
+ String connectorNames,
+ boolean useDiscovery,
boolean ha,
String user,
String password) throws Exception
@@ -610,7 +611,8 @@ public void createBridge(String name,
useDuplicateDetection,
confirmationWindowSize,
clientFailureCheckPeriod,
- staticConnectors,
+ connectorNames,
+ useDiscovery,
ha,
user,
password);

0 comments on commit 5338c31

Please sign in to comment.
Something went wrong with that request. Please try again.