[jboss-cvs] JBossAS SVN: r110335 - in branches/JBPAPP_5_1: 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 Jan 12 10:24:46 EST 2011
Author: emuckenhuber
Date: 2011-01-12 10:24:45 -0500 (Wed, 12 Jan 2011)
New Revision: 110335
Modified:
branches/JBPAPP_5_1/profileservice/src/main/org/jboss/profileservice/management/AbstractTemplateCreator.java
branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/profileservice/test/JmsDestinationUnitTestCase.java
Log:
[JBPAPP-4791] fail when trying to override a template with the same name.
Modified: branches/JBPAPP_5_1/profileservice/src/main/org/jboss/profileservice/management/AbstractTemplateCreator.java
===================================================================
--- branches/JBPAPP_5_1/profileservice/src/main/org/jboss/profileservice/management/AbstractTemplateCreator.java 2011-01-12 13:06:34 UTC (rev 110334)
+++ branches/JBPAPP_5_1/profileservice/src/main/org/jboss/profileservice/management/AbstractTemplateCreator.java 2011-01-12 15:24:45 UTC (rev 110335)
@@ -27,6 +27,7 @@
import org.jboss.deployers.spi.management.deploy.DeploymentManager;
import org.jboss.deployers.spi.management.deploy.DeploymentProgress;
import org.jboss.managed.api.DeploymentTemplateInfo;
+import org.jboss.profileservice.spi.DeploymentOption;
import org.jboss.profileservice.spi.ProfileKey;
import org.jboss.virtual.VirtualFile;
@@ -169,7 +170,8 @@
protected String[] distribute(String name, URL url) throws Exception
{
- DeploymentProgress progress = this.deploymentMgr.distribute(name, url, true);
+ // Distribute deployment content, Fail if the deployment already exists.
+ DeploymentProgress progress = this.deploymentMgr.distribute(name, url, DeploymentOption.FailIfExists);
progress.run();
//
Modified: branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/profileservice/test/JmsDestinationUnitTestCase.java
===================================================================
--- branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/profileservice/test/JmsDestinationUnitTestCase.java 2011-01-12 13:06:34 UTC (rev 110334)
+++ branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/profileservice/test/JmsDestinationUnitTestCase.java 2011-01-12 15:24:45 UTC (rev 110335)
@@ -117,6 +117,7 @@
suite.addTest(new JmsDestinationUnitTestCase("testTopicTemplate"));
suite.addTest(new JmsDestinationUnitTestCase("testDLQ"));
suite.addTest(new JmsDestinationUnitTestCase("testCreateQueue"));
+ suite.addTest(new JmsDestinationUnitTestCase("testCreateDuplicateQueue"));
suite.addTest(new JmsDestinationUnitTestCase("testQueueMetrics"));
suite.addTest(new JmsDestinationUnitTestCase("testQueueOperations"));
suite.addTest(new JmsDestinationUnitTestCase("testQueueRestart"));
@@ -217,6 +218,20 @@
assertEquals(SimpleMetaType.STRING, expiryQueueType);
}
+ public void testCreateDuplicateQueue() throws Exception
+ {
+ Map<String, MetaValue> propValues = new HashMap<String, MetaValue>();
+ String jndiName = "testCreateQueue";
+
+ ComponentType type = KnownComponentTypes.JMSDestination.Queue.getType();
+ try {
+ createComponentTest("QueueTemplate", propValues, getName(), type, jndiName);
+ fail();
+ } catch (Exception e) {
+ // ok;
+ }
+ }
+
public void testQueueMetrics() throws Exception
{
// Get the managed component
More information about the jboss-cvs-commits
mailing list