[jboss-cvs] JBossAS SVN: r82039 - 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
Thu Dec 4 07:05:02 EST 2008
Author: emuckenhuber
Date: 2008-12-04 07:05:02 -0500 (Thu, 04 Dec 2008)
New Revision: 82039
Added:
trunk/testsuite/src/main/org/jboss/test/profileservice/test/ManagementViewUnitTestCase.java
Modified:
trunk/profileservice/src/main/org/jboss/profileservice/management/ManagementViewImpl.java
Log:
[JBAS-5640] resolve deploymentNames.
Modified: trunk/profileservice/src/main/org/jboss/profileservice/management/ManagementViewImpl.java
===================================================================
--- trunk/profileservice/src/main/org/jboss/profileservice/management/ManagementViewImpl.java 2008-12-04 10:58:12 UTC (rev 82038)
+++ trunk/profileservice/src/main/org/jboss/profileservice/management/ManagementViewImpl.java 2008-12-04 12:05:02 UTC (rev 82039)
@@ -634,34 +634,28 @@
* @param name
* @return
*/
- public ManagedDeployment getDeployment(String name, DeploymentPhase phase)
- throws NoSuchDeploymentException, Exception
+ public ManagedDeployment getDeployment(String name, DeploymentPhase phase) throws NoSuchDeploymentException,
+ Exception
{
- NoSuchDeploymentException profileEX = null;
- ManagedDeployment md = null;
- try
+ // Resolve internally.
+ ManagedDeployment md = this.managedDeployments.get(name);
+ if (md == null)
{
- Deployment ctx = activeProfile.getDeployment(name, phase);
- md = this.managedDeployments.get(ctx.getName());
- }
- catch(NoSuchDeploymentException e)
- {
- profileEX = e;
- }
-
- if(md == null)
- {
// Check the bootstrap deployments
md = this.bootstrapManagedDeployments.get(name);
}
- // Do not return null
+
+ // Let the DeploymentRepository try to resolve the deployment (simpleName)
if(md == null)
{
- if(profileEX == null)
- profileEX = new NoSuchDeploymentException("Managed deployment: "+ name + " not found.");
- throw profileEX;
+ Deployment ctx = activeProfile.getDeployment(name, phase);
+ md = this.managedDeployments.get(ctx.getName());
}
+ // Do not return null
+ if (md == null)
+ throw new NoSuchDeploymentException("Managed deployment: " + name + " not found.");
+
return md;
}
Added: trunk/testsuite/src/main/org/jboss/test/profileservice/test/ManagementViewUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/profileservice/test/ManagementViewUnitTestCase.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/profileservice/test/ManagementViewUnitTestCase.java 2008-12-04 12:05:02 UTC (rev 82039)
@@ -0,0 +1,75 @@
+/*
+ * 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.test;
+
+import java.util.Set;
+
+import org.jboss.deployers.spi.management.KnownDeploymentTypes;
+import org.jboss.deployers.spi.management.ManagementView;
+
+/**
+ * Test ManagementView operations.
+ *
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class ManagementViewUnitTestCase extends AbstractProfileServiceTest
+{
+
+ /** The profile name */
+ private static final String PROFILENAME = "profileservice";
+
+ public ManagementViewUnitTestCase(String name)
+ {
+ super(name);
+ }
+
+ /**
+ * Test that all for deploymentNames of a KnownDeploymentType
+ * can be resolved by the ManagementView.
+ *
+ */
+ public void testKnownDeploymentTypes() throws Exception
+ {
+ ManagementView mgtView = getManagementView();
+
+ for(KnownDeploymentTypes type : KnownDeploymentTypes.values())
+ {
+ Set<String> deploymentNames = mgtView.getDeploymentNamesForType(type.getType());
+
+ if(deploymentNames != null)
+ {
+ for(String deploymentName : deploymentNames)
+ {
+ mgtView.getDeployment(deploymentName, null);
+ }
+ }
+ }
+ }
+
+ @Override
+ protected String getProfileName()
+ {
+ return PROFILENAME;
+ }
+
+}
More information about the jboss-cvs-commits
mailing list