[jboss-cvs] JBossAS SVN: r81304 - in trunk/testsuite/src: main/org/jboss/test/profileservice/override/test and 1 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Nov 19 12:15:34 EST 2008
Author: emuckenhuber
Date: 2008-11-19 12:15:33 -0500 (Wed, 19 Nov 2008)
New Revision: 81304
Added:
trunk/testsuite/src/main/org/jboss/test/profileservice/override/restart/test/JmsDestinationRestartUnitTestCase.java
trunk/testsuite/src/main/org/jboss/test/profileservice/override/test/JmsDestinationOverrideTestCase.java
trunk/testsuite/src/resources/profileservice/override/testQueue-service.xml
trunk/testsuite/src/resources/profileservice/override/testTopic-service.xml
Log:
[JBAS-6036] jms destination persistence test.
Added: trunk/testsuite/src/main/org/jboss/test/profileservice/override/restart/test/JmsDestinationRestartUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/profileservice/override/restart/test/JmsDestinationRestartUnitTestCase.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/profileservice/override/restart/test/JmsDestinationRestartUnitTestCase.java 2008-11-19 17:15:33 UTC (rev 81304)
@@ -0,0 +1,115 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.profileservice.override.restart.test;
+
+import org.jboss.deployers.spi.management.ManagementView;
+import org.jboss.managed.api.ManagedComponent;
+import org.jboss.managed.api.ManagedDeployment;
+import org.jboss.managed.api.ManagedProperty;
+import org.jboss.managed.api.ManagedDeployment.DeploymentPhase;
+import org.jboss.metatype.api.values.SimpleValueSupport;
+import org.jboss.test.profileservice.override.test.AbstractProfileServiceTest;
+
+/**
+ * Test if the changes to the Queue and Topic are applied after restart.
+ *
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class JmsDestinationRestartUnitTestCase extends AbstractProfileServiceTest
+{
+
+ /** The profile name */
+ private static final String PROFILENAME = "profileservice";
+
+ public JmsDestinationRestartUnitTestCase(String name)
+ {
+ super(name);
+ }
+
+ public void testQueue() throws Exception
+ {
+ final String deploymentName = "profileservice-testQueue-service.xml";
+ try
+ {
+
+ ManagementView mgtView = getManagementView();
+ ManagedDeployment md = mgtView.getDeployment(deploymentName, DeploymentPhase.APPLICATION);
+ assertNotNull(md);
+
+ ManagedComponent component = md.getComponent("testQueue");
+ assertNotNull(component);
+
+ ManagedProperty property = component.getProperty("downCacheSize");
+ assertNotNull(property);
+ assertEquals(property.getValue(), SimpleValueSupport.wrap(3000));
+ }
+ catch(Exception e)
+ {
+ getLog().error("Caugt exception: ", e);
+ throw e;
+ }
+ finally
+ {
+ undeployPackage(new String[] { deploymentName });
+ }
+ }
+
+ public void testTopic() throws Exception
+ {
+ final String deploymentName = "profileservice-testTopic-service.xml";
+ try
+ {
+ ManagementView mgtView = getManagementView();
+ ManagedDeployment md = mgtView.getDeployment(deploymentName, DeploymentPhase.APPLICATION);
+ assertNotNull(md);
+
+ ManagedComponent component = md.getComponent("testTopic");
+ assertNotNull(component);
+
+ ManagedProperty property = component.getProperty("downCacheSize");
+ assertNotNull(property);
+
+ assertEquals(property.getValue(), SimpleValueSupport.wrap(3000));
+
+ }
+ catch(Exception e)
+ {
+ getLog().error("Caugt exception: ", e);
+ throw e;
+ }
+ finally
+ {
+ undeployPackage(new String[] { deploymentName });
+ }
+ }
+
+
+ @Override
+ protected String getProfileName()
+ {
+ return PROFILENAME;
+ }
+
+
+}
+
Added: trunk/testsuite/src/main/org/jboss/test/profileservice/override/test/JmsDestinationOverrideTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/profileservice/override/test/JmsDestinationOverrideTestCase.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/profileservice/override/test/JmsDestinationOverrideTestCase.java 2008-11-19 17:15:33 UTC (rev 81304)
@@ -0,0 +1,119 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.profileservice.override.test;
+
+import org.jboss.deployers.spi.management.ManagementView;
+import org.jboss.managed.api.ManagedComponent;
+import org.jboss.managed.api.ManagedDeployment;
+import org.jboss.managed.api.ManagedProperty;
+import org.jboss.managed.api.ManagedDeployment.DeploymentPhase;
+import org.jboss.metatype.api.values.SimpleValueSupport;
+
+/**
+ * Test updating a Queue and Topic.
+ *
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class JmsDestinationOverrideTestCase extends AbstractProfileServiceTest
+{
+
+ /** The profile name */
+ private static final String PROFILENAME = "profileservice";
+
+ public JmsDestinationOverrideTestCase(String name)
+ {
+ super(name);
+ }
+
+ public void testQueue() throws Exception
+ {
+ final String deploymentName = "profileservice-testQueue-service.xml";
+ try
+ {
+ deployPackage(deploymentName);
+
+ ManagementView mgtView = getManagementView();
+ ManagedDeployment md = mgtView.getDeployment(deploymentName, DeploymentPhase.APPLICATION);
+ assertNotNull(md);
+
+ ManagedComponent component = md.getComponent("testQueue");
+ assertNotNull(component);
+
+ ManagedProperty property = component.getProperty("downCacheSize");
+ assertNotNull(property);
+ assertEquals(property.getValue(), SimpleValueSupport.wrap(2000));
+
+ property.setValue(SimpleValueSupport.wrap(3000));
+
+ mgtView.updateComponent(component);
+ mgtView.process();
+
+ }
+ catch(Exception e)
+ {
+ getLog().error("Caugt exception: ", e);
+ throw e;
+ }
+ }
+
+ public void testTopic() throws Exception
+ {
+ final String deploymentName = "profileservice-testTopic-service.xml";
+ try
+ {
+ deployPackage(deploymentName);
+
+ ManagementView mgtView = getManagementView();
+ ManagedDeployment md = mgtView.getDeployment(deploymentName, DeploymentPhase.APPLICATION);
+ assertNotNull(md);
+
+ ManagedComponent component = md.getComponent("testTopic");
+ assertNotNull(component);
+
+ ManagedProperty property = component.getProperty("downCacheSize");
+ assertNotNull(property);
+ assertEquals(property.getValue(), SimpleValueSupport.wrap(2000));
+
+ property.setValue(SimpleValueSupport.wrap(3000));
+
+ mgtView.updateComponent(component);
+ mgtView.process();
+
+ }
+ catch(Exception e)
+ {
+ getLog().error("Caugt exception: ", e);
+ undeployPackage(new String[] {deploymentName});
+ throw e;
+ }
+ }
+
+
+ @Override
+ protected String getProfileName()
+ {
+ return PROFILENAME;
+ }
+
+}
+
Added: trunk/testsuite/src/resources/profileservice/override/testQueue-service.xml
===================================================================
--- trunk/testsuite/src/resources/profileservice/override/testQueue-service.xml (rev 0)
+++ trunk/testsuite/src/resources/profileservice/override/testQueue-service.xml 2008-11-19 17:15:33 UTC (rev 81304)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<server>
+ <mbean xmbean-dd="xmdesc/Queue-xmbean.xml"
+ name="jboss.messaging.destination:service=Queue,name=testQueue"
+ code="org.jboss.jms.server.destination.QueueService">
+ <annotation>@org.jboss.system.deployers.managed.ManagementObjectClass(code=org.jboss.jms.server.destination.QueueServiceMO)</annotation>
+ <attribute name="JNDIName">testQueue</attribute>
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+</server>
Added: trunk/testsuite/src/resources/profileservice/override/testTopic-service.xml
===================================================================
--- trunk/testsuite/src/resources/profileservice/override/testTopic-service.xml (rev 0)
+++ trunk/testsuite/src/resources/profileservice/override/testTopic-service.xml 2008-11-19 17:15:33 UTC (rev 81304)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<server>
+ <mbean xmbean-dd="xmdesc/Topic-xmbean.xml"
+ name="jboss.messaging.destination:service=Topic,name=testTopic"
+ code="org.jboss.jms.server.destination.TopicService">
+ <annotation>@org.jboss.system.deployers.managed.ManagementObjectClass(code=org.jboss.jms.server.destination.TopicServiceMO)</annotation>
+ <attribute name="JNDIName">testTopic</attribute>
+ <attribute name="MessageCounterHistoryDayLimit">1</attribute>
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+</server>
More information about the jboss-cvs-commits
mailing list