[jboss-cvs] JBossAS SVN: r87334 - in trunk: testsuite/src/main/org/jboss/test/profileservice/test and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Apr 15 07:05:55 EDT 2009


Author: emuckenhuber
Date: 2009-04-15 07:05:54 -0400 (Wed, 15 Apr 2009)
New Revision: 87334

Modified:
   trunk/messaging/src/main/org/jboss/jms/server/destination/QueueServiceMO.java
   trunk/messaging/src/main/org/jboss/jms/server/destination/StringObjectNameMetaMapper.java
   trunk/messaging/src/main/org/jboss/jms/server/destination/TopicServiceMO.java
   trunk/testsuite/src/main/org/jboss/test/profileservice/test/JmsDestinationUnitTestCase.java
Log:
update jms destinations

Modified: trunk/messaging/src/main/org/jboss/jms/server/destination/QueueServiceMO.java
===================================================================
--- trunk/messaging/src/main/org/jboss/jms/server/destination/QueueServiceMO.java	2009-04-15 11:05:27 UTC (rev 87333)
+++ trunk/messaging/src/main/org/jboss/jms/server/destination/QueueServiceMO.java	2009-04-15 11:05:54 UTC (rev 87334)
@@ -74,14 +74,16 @@
    
    @ManagementProperty(use={ViewUse.CONFIGURATION},
          description="The ObjectName of the server peer this destination was deployed on",
-         includeInTemplate=true)
+         includeInTemplate=true,
+         activationPolicy=ActivationPolicy.DEPLOYMENT_RESTART)
    @MetaMapping(StringObjectNameMetaMapper.class)
    public ObjectName getServerPeer() { return null; }
    public void setServerPeer(ObjectName arg0) { }
    
    @ManagementProperty(use={ViewUse.CONFIGURATION},
          description="The DLQ for this queue, overrides the default DLQ on the server peer",
-         includeInTemplate=true)
+         includeInTemplate=true,
+         activationPolicy=ActivationPolicy.DEPLOYMENT_RESTART)
    @MetaMapping(StringObjectNameMetaMapper.class)
    public ObjectName getDLQ() { return null; }
    public void setDLQ(ObjectName arg0) { }

Modified: trunk/messaging/src/main/org/jboss/jms/server/destination/StringObjectNameMetaMapper.java
===================================================================
--- trunk/messaging/src/main/org/jboss/jms/server/destination/StringObjectNameMetaMapper.java	2009-04-15 11:05:27 UTC (rev 87333)
+++ trunk/messaging/src/main/org/jboss/jms/server/destination/StringObjectNameMetaMapper.java	2009-04-15 11:05:54 UTC (rev 87334)
@@ -65,6 +65,9 @@
    @Override
    public ObjectName unwrapMetaValue(MetaValue metaValue)
    {
+      if(metaValue == null)
+         return null;
+
       SimpleValue sv = (SimpleValue) metaValue;
       String str = sv.getValue().toString();
       try

Modified: trunk/messaging/src/main/org/jboss/jms/server/destination/TopicServiceMO.java
===================================================================
--- trunk/messaging/src/main/org/jboss/jms/server/destination/TopicServiceMO.java	2009-04-15 11:05:27 UTC (rev 87333)
+++ trunk/messaging/src/main/org/jboss/jms/server/destination/TopicServiceMO.java	2009-04-15 11:05:54 UTC (rev 87334)
@@ -72,7 +72,8 @@
 
    @ManagementProperty(use={ViewUse.CONFIGURATION},
          description="The ObjectName of the server peer this destination was deployed on",
-         includeInTemplate=true)
+         includeInTemplate=true,
+         activationPolicy=ActivationPolicy.DEPLOYMENT_RESTART)
    @MetaMapping(StringObjectNameMetaMapper.class)
    public ObjectName getServerPeer() { return null; }
    public void setServerPeer(ObjectName arg0) { }

Modified: trunk/testsuite/src/main/org/jboss/test/profileservice/test/JmsDestinationUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/profileservice/test/JmsDestinationUnitTestCase.java	2009-04-15 11:05:27 UTC (rev 87333)
+++ trunk/testsuite/src/main/org/jboss/test/profileservice/test/JmsDestinationUnitTestCase.java	2009-04-15 11:05:54 UTC (rev 87334)
@@ -31,13 +31,6 @@
 import javax.jms.Message;
 import javax.jms.MessageConsumer;
 import javax.jms.MessageProducer;
-import javax.jms.Session;
-import javax.jms.Topic;
-import javax.jms.TopicConnection;
-import javax.jms.TopicConnectionFactory;
-import javax.jms.TopicSession;
-import javax.naming.InitialContext;
-
 import javax.jms.Queue;
 import javax.jms.QueueConnection;
 import javax.jms.QueueConnectionFactory;
@@ -49,6 +42,7 @@
 import javax.jms.TopicConnectionFactory;
 import javax.jms.TopicPublisher;
 import javax.jms.TopicSession;
+import javax.naming.InitialContext;
 
 import junit.framework.Test;
 import junit.framework.TestSuite;
@@ -121,6 +115,7 @@
       suite.addTest(new JmsDestinationUnitTestCase("testRemoveQueue"));
       suite.addTest(new JmsDestinationUnitTestCase("testCreateTopic"));
       suite.addTest(new JmsDestinationUnitTestCase("testTopicMetrics"));
+      suite.addTest(new JmsDestinationUnitTestCase("testTopicSubscriptions"));
       suite.addTest(new JmsDestinationUnitTestCase("testTopicOperations"));
       suite.addTest(new JmsDestinationUnitTestCase("testRemoveTopic"));
       suite.addTest(new JmsDestinationUnitTestCase("testCreateSecureQueue"));
@@ -294,7 +289,7 @@
    public void testRemoveQueue() throws Exception
    {
       removeDeployment("testCreateQueue-service.xml");
-	   ManagedComponent queue = getManagementView().getComponent("testCreateQueue", QueueType);
+       ManagedComponent queue = getManagementView().getComponent("testCreateQueue", QueueType);
       assertNull("queue should be removed" + queue, queue);
    }
 
@@ -312,7 +307,7 @@
    }
 
    /**
-    * Run after testCreateTopic to validate the 
+    * Run after testCreateTopic to validate the topic subscriptions, list msgs.
     */
    public void testTopicSubscriptions()
       throws Exception
@@ -355,6 +350,28 @@
       assertNotNull(listNonDurableSubscriptions);
       MetaValue subscriptions = listNonDurableSubscriptions.invoke();
       log.info(subscriptions);
+      assertTrue(subscriptions instanceof CollectionValue);
+      CollectionValue subscriptionsCV = (CollectionValue) subscriptions;
+      assertTrue("subscriptions.size > 0", subscriptionsCV.getSize() > 0);
+      MetaValue[] subscriptionsMVs = subscriptionsCV.getElements();
+      for(MetaValue mv : subscriptionsMVs)
+      {
+         CompositeValue cv = (CompositeValue) mv;
+         MetaValue name = cv.get("name");
+         log.info(name);
+         MetaValue clientID = cv.get("clientID");
+         log.info(clientID);
+         MetaValue durable = cv.get("durable");
+         log.info(durable);
+         MetaValue selector = cv.get("selector");
+         log.info(selector);
+         MetaValue id = cv.get("id");
+         log.info(id);
+         MetaValue maxSize = cv.get("maxSize");
+         log.info(maxSize);
+         MetaValue messageCount = cv.get("messageCount");
+         log.info(messageCount);
+      }
    }
    
 




More information about the jboss-cvs-commits mailing list