[jboss-cvs] JBossAS SVN: r86928 - branches/Branch_5_x/testsuite/src/main/org/jboss/test/profileservice/test.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Apr 7 11:20:17 EDT 2009
Author: emuckenhuber
Date: 2009-04-07 11:20:17 -0400 (Tue, 07 Apr 2009)
New Revision: 86928
Modified:
branches/Branch_5_x/testsuite/src/main/org/jboss/test/profileservice/test/JmsDestinationUnitTestCase.java
Log:
cleanup
Modified: branches/Branch_5_x/testsuite/src/main/org/jboss/test/profileservice/test/JmsDestinationUnitTestCase.java
===================================================================
--- branches/Branch_5_x/testsuite/src/main/org/jboss/test/profileservice/test/JmsDestinationUnitTestCase.java 2009-04-07 14:13:27 UTC (rev 86927)
+++ branches/Branch_5_x/testsuite/src/main/org/jboss/test/profileservice/test/JmsDestinationUnitTestCase.java 2009-04-07 15:20:17 UTC (rev 86928)
@@ -32,6 +32,8 @@
import javax.jms.QueueSender;
import javax.jms.QueueSession;
import javax.jms.Session;
+import javax.jms.Topic;
+import javax.jms.TopicConnectionFactory;
import junit.framework.Test;
import junit.framework.TestSuite;
@@ -62,6 +64,11 @@
public class JmsDestinationUnitTestCase extends AbstractProfileServiceTest
{
+ /** The queue type. */
+ public static final ComponentType QueueType = KnownComponentTypes.JMSDestination.Queue.getType();
+ /** The topic type. */
+ public static final ComponentType TopicType = KnownComponentTypes.JMSDestination.Topic.getType();
+
/** The meta type. */
protected static final MapCompositeMetaType securityConfType;
@@ -145,8 +152,7 @@
public void testDLQ() throws Exception
{
ManagementView mgtView = getManagementView();
- ComponentType type = KnownComponentTypes.JMSDestination.Queue.getType();
- ManagedComponent queue = mgtView.getComponent("/queue/DLQ", type);
+ ManagedComponent queue = mgtView.getComponent("/queue/DLQ", QueueType);
assertNotNull(queue);
assertEquals("/queue/DLQ", queue.getName());
// Validate some of the expected properties
@@ -162,9 +168,8 @@
String jndiName = getName();
propValues.put("JNDIName", SimpleValueSupport.wrap(jndiName));
propValues.put("downCacheSize", SimpleValueSupport.wrap(1999));
- ComponentType type = KnownComponentTypes.JMSDestination.Queue.getType();
- createComponentTest("QueueTemplate", propValues, getName(), type, jndiName);
- ManagedComponent queue = activeView.getComponent("testCreateQueue", type);
+ createComponentTest("QueueTemplate", propValues, getName(), QueueType, jndiName);
+ ManagedComponent queue = activeView.getComponent("testCreateQueue", QueueType);
assertNotNull(queue);
assertEquals("testCreateQueue", queue.getName());
log.info(queue.getProperties().keySet());
@@ -174,8 +179,7 @@
public void testQueueMetrics() throws Exception
{
// Get the managed component
- ComponentType type = KnownComponentTypes.JMSDestination.Queue.getType();
- ManagedComponent component = getManagementView().getComponent("testCreateQueue", type);
+ ManagedComponent component = getManagementView().getComponent("testCreateQueue", QueueType);
// The message count property
ManagedProperty property = component.getProperty("messageCount");
@@ -212,8 +216,7 @@
public void testQueueOperations() throws Exception
{
- ComponentType type = KnownComponentTypes.JMSDestination.Queue.getType();
- ManagedComponent component = getManagementView().getComponent("testCreateQueue", type);
+ ManagedComponent component = getManagementView().getComponent("testCreateQueue", QueueType);
ManagedOperation o = getOperation(component, "listMessageCounterAsHTML", new String[0]);
MetaValue v = o.invoke(new MetaValue[0]);
assertNotNull("null operation return value", v);
@@ -230,7 +233,6 @@
String templateName = "QueueTemplate";
MetaValue jndiName1MV = SimpleValueSupport.wrap(jndiName);
propValues.put("JNDIName", jndiName1MV);
- ComponentType type = KnownComponentTypes.JMSDestination.Queue.getType();
DeploymentTemplateInfo queue1Info = managementView.getTemplate(templateName);
Map<String, ManagedProperty> testCreateQueue1Props = queue1Info.getProperties();
log.debug("QueueTemplate#1: "+testCreateQueue1Props);
@@ -270,11 +272,11 @@
// Validate the components
// managementView.reload();
- ManagedComponent queue1 = managementView.getComponent("testCreateQueue1", type);
+ ManagedComponent queue1 = managementView.getComponent("testCreateQueue1", QueueType);
assertNotNull(queue1);
assertEquals("testCreateQueue1", queue1.getName());
- ManagedComponent queue2 = managementView.getComponent("testCreateQueue2", type);
+ ManagedComponent queue2 = managementView.getComponent("testCreateQueue2", QueueType);
assertNotNull(queue2);
assertEquals("testCreateQueue2", queue2.getName());
@@ -283,8 +285,7 @@
public void testRemoveQueue() throws Exception
{
removeDeployment("testCreateQueue-service.xml");
- ComponentType type = KnownComponentTypes.JMSDestination.Queue.getType();
- ManagedComponent queue = getManagementView().getComponent("testCreateQueue", type);
+ ManagedComponent queue = getManagementView().getComponent("testCreateQueue", QueueType);
assertNull("queue should be removed" + queue, queue);
}
@@ -293,17 +294,15 @@
Map<String, MetaValue> propValues = new HashMap<String, MetaValue>();
String jndiName = getName();
propValues.put("JNDIName", SimpleValueSupport.wrap(jndiName));
- ComponentType type = KnownComponentTypes.JMSDestination.Topic.getType();
- createComponentTest("TopicTemplate", propValues, getName(), type, jndiName);
- ManagedComponent topic = activeView.getComponent("testCreateTopic", type);
+ createComponentTest("TopicTemplate", propValues, getName(), TopicType, jndiName);
+ ManagedComponent topic = activeView.getComponent("testCreateTopic", TopicType);
assertNotNull(topic);
assertEquals("testCreateTopic", topic.getName());
}
-
+
public void testTopicOperations() throws Exception
{
- ComponentType type = KnownComponentTypes.JMSDestination.Topic.getType();
- ManagedComponent component = getManagementView().getComponent("testCreateTopic", type);
+ ManagedComponent component = getManagementView().getComponent("testCreateTopic", TopicType);
ManagedOperation o = getOperation(component, "listAllSubscriptionsAsHTML", new String[0]);
MetaValue v = o.invoke(new MetaValue[0]);
assertNotNull("null operation return value", v);
@@ -313,8 +312,7 @@
public void testRemoveTopic() throws Exception
{
removeDeployment("testCreateTopic-service.xml");
- ComponentType type = KnownComponentTypes.JMSDestination.Topic.getType();
- ManagedComponent topic = getManagementView().getComponent("testCreateTopic", type);
+ ManagedComponent topic = getManagementView().getComponent("testCreateTopic", TopicType);
assertNull("topic should be removed " + topic, topic);
}
@@ -332,9 +330,8 @@
CompositeValue map = new MapCompositeValueSupport(values, securityConfType);
propValues.put("securityConfig", map);
- ComponentType type = KnownComponentTypes.JMSDestination.Queue.getType();
- createComponentTest("QueueTemplate", propValues, getName(), type, jndiName);
- ManagedComponent queue = activeView.getComponent("testCreateSecureQueue", type);
+ createComponentTest("QueueTemplate", propValues, getName(), QueueType, jndiName);
+ ManagedComponent queue = activeView.getComponent("testCreateSecureQueue", QueueType);
assertNotNull(queue);
assertEquals("testCreateSecureQueue", queue.getName());
log.info(queue.getProperties().keySet());
@@ -345,8 +342,7 @@
public void testRemoveSecureQueue() throws Exception
{
removeDeployment("testCreateSecureQueue-service.xml");
- ComponentType type = KnownComponentTypes.JMSDestination.Queue.getType();
- ManagedComponent queue = getManagementView().getComponent("testCreateSecureQueue", type);
+ ManagedComponent queue = getManagementView().getComponent("testCreateSecureQueue", QueueType);
assertNull("queue should be removed" + queue, queue);
}
More information about the jboss-cvs-commits
mailing list