[jboss-cvs] JBossAS SVN: r85120 - in trunk/system-jmx/src: main/org/jboss/system/metadata and 9 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Mar 2 10:18:46 EST 2009
Author: adrian at jboss.org
Date: 2009-03-02 10:18:46 -0500 (Mon, 02 Mar 2009)
New Revision: 85120
Added:
trunk/system-jmx/src/tests/org/jboss/test/system/controller/IncompleteDeploymentException.java
trunk/system-jmx/src/tests/org/jboss/test/system/controller/legacy/DeploymentException.java
Modified:
trunk/system-jmx/src/main/org/jboss/system/ConfigurationException.java
trunk/system-jmx/src/main/org/jboss/system/metadata/ServiceAttributeMetaData.java
trunk/system-jmx/src/main/org/jboss/system/metadata/ServiceDependencyValueMetaData.java
trunk/system-jmx/src/main/org/jboss/system/metadata/ServiceDeploymentClasspathAdapter.java
trunk/system-jmx/src/main/org/jboss/system/metadata/ServiceDeploymentParser.java
trunk/system-jmx/src/main/org/jboss/system/metadata/ServiceJavaBeanValueMetaData.java
trunk/system-jmx/src/main/org/jboss/system/metadata/ServiceTextValueMetaData.java
trunk/system-jmx/src/tests/org/jboss/test/system/controller/ControllerTestDelegate.java
trunk/system-jmx/src/tests/org/jboss/test/system/controller/SimpleSARDeployer.java
trunk/system-jmx/src/tests/org/jboss/test/system/controller/basic/test/DoubleInstallOldUnitTestCase.java
trunk/system-jmx/src/tests/org/jboss/test/system/controller/configure/attribute/test/AttributeOldUnitTestCase.java
trunk/system-jmx/src/tests/org/jboss/test/system/controller/configure/attribute/test/DependsAttributeOldUnitTestCase.java
trunk/system-jmx/src/tests/org/jboss/test/system/controller/configure/attribute/test/DependsListAttributeOldUnitTestCase.java
trunk/system-jmx/src/tests/org/jboss/test/system/controller/configure/value/depends/test/DependencyValueOldUnitTestCase.java
trunk/system-jmx/src/tests/org/jboss/test/system/controller/configure/value/depends/test/DependencyValueTest.java
trunk/system-jmx/src/tests/org/jboss/test/system/controller/configure/value/dependslist/test/DependencyListValueOldUnitTestCase.java
trunk/system-jmx/src/tests/org/jboss/test/system/controller/configure/value/javabean/test/JavaBeanValueTest.java
trunk/system-jmx/src/tests/org/jboss/test/system/controller/configure/value/text/test/TextValueOldUnitTestCase.java
trunk/system-jmx/src/tests/org/jboss/test/system/controller/configure/value/text/test/TextValueTest.java
trunk/system-jmx/src/tests/org/jboss/test/system/controller/legacy/OldServiceConfigurator.java
trunk/system-jmx/src/tests/org/jboss/test/system/controller/legacy/OldServiceController.java
trunk/system-jmx/src/tests/org/jboss/test/system/controller/legacy/OldServiceCreator.java
trunk/system-jmx/src/tests/org/jboss/test/system/controller/parse/test/ErrorInParseOldUnitTestCase.java
Log:
[JBAS-6559] - Remove legacy DeploymentException from the internals of the ServiceController and the tests
Modified: trunk/system-jmx/src/main/org/jboss/system/ConfigurationException.java
===================================================================
--- trunk/system-jmx/src/main/org/jboss/system/ConfigurationException.java 2009-03-02 15:02:54 UTC (rev 85119)
+++ trunk/system-jmx/src/main/org/jboss/system/ConfigurationException.java 2009-03-02 15:18:46 UTC (rev 85120)
@@ -26,15 +26,33 @@
/**
* Thrown to indicate a non-fatal configuration related problem.
*
- * @see ConfigurationService
- *
* @author <a href="mailto:jason at planet57.com">Jason Dillon</a>
* @version <tt>$Revision$</tt>
*/
public class ConfigurationException
extends NestedException
{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -1841403351768037738L;
+
/**
+ * Rethrow a throwable as a configuration exception if it isn't already.
+ *
+ * @param message the message
+ * @param t the throwable
+ * @return never
+ * @throws ConfigurationException always
+ */
+ public static ConfigurationException rethrowAsConfigurationException(String message, Throwable t)
+ throws ConfigurationException
+ {
+ if (t instanceof ConfigurationException)
+ throw (ConfigurationException) t;
+ else
+ throw new ConfigurationException(message, t);
+ }
+
+ /**
* Construct a <tt>ConfigurationException</tt> with the specified detail
* message.
*
Modified: trunk/system-jmx/src/main/org/jboss/system/metadata/ServiceAttributeMetaData.java
===================================================================
--- trunk/system-jmx/src/main/org/jboss/system/metadata/ServiceAttributeMetaData.java 2009-03-02 15:02:54 UTC (rev 85119)
+++ trunk/system-jmx/src/main/org/jboss/system/metadata/ServiceAttributeMetaData.java 2009-03-02 15:18:46 UTC (rev 85120)
@@ -25,8 +25,7 @@
import java.util.Set;
import org.jboss.dependency.spi.ControllerState;
-import org.jboss.deployment.DeploymentException;
-import org.jboss.util.UnreachableStatementException;
+import org.jboss.system.ConfigurationException;
/**
* ServiceAttributeMetaData.
@@ -152,8 +151,7 @@
}
catch (Throwable t)
{
- DeploymentException.rethrowAsDeploymentException("Error configuring attribute " + name, t);
- throw new UnreachableStatementException();
+ throw ConfigurationException.rethrowAsConfigurationException("Error configuring attribute " + name, t);
}
}
Modified: trunk/system-jmx/src/main/org/jboss/system/metadata/ServiceDependencyValueMetaData.java
===================================================================
--- trunk/system-jmx/src/main/org/jboss/system/metadata/ServiceDependencyValueMetaData.java 2009-03-02 15:02:54 UTC (rev 85119)
+++ trunk/system-jmx/src/main/org/jboss/system/metadata/ServiceDependencyValueMetaData.java 2009-03-02 15:18:46 UTC (rev 85120)
@@ -29,8 +29,8 @@
import javax.management.ObjectName;
import org.jboss.dependency.spi.ControllerState;
-import org.jboss.deployment.DeploymentException;
import org.jboss.mx.util.MBeanProxyExt;
+import org.jboss.system.ConfigurationException;
import org.jboss.system.microcontainer.LifecycleDependencyItem;
import org.jboss.system.microcontainer.ServiceControllerContext;
@@ -182,10 +182,10 @@
{
proxyType = attributeInfo.getType();
if (proxyType == null)
- throw new DeploymentException("AttributeInfo for " + attributeInfo.getName() + " has no type");
+ throw new ConfigurationException("AttributeInfo for " + attributeInfo.getName() + " has no type");
}
- Class proxyClass = cl.loadClass(proxyType);
+ Class<?> proxyClass = cl.loadClass(proxyType);
return MBeanProxyExt.create(proxyClass, objectName, server, true);
}
Modified: trunk/system-jmx/src/main/org/jboss/system/metadata/ServiceDeploymentClasspathAdapter.java
===================================================================
--- trunk/system-jmx/src/main/org/jboss/system/metadata/ServiceDeploymentClasspathAdapter.java 2009-03-02 15:02:54 UTC (rev 85119)
+++ trunk/system-jmx/src/main/org/jboss/system/metadata/ServiceDeploymentClasspathAdapter.java 2009-03-02 15:18:46 UTC (rev 85120)
@@ -24,7 +24,7 @@
import javax.xml.bind.annotation.adapters.XmlAdapter;
import javax.xml.parsers.DocumentBuilderFactory;
-import org.jboss.deployment.DeploymentException;
+import org.jboss.system.ConfigurationException;
import org.jboss.util.StringPropertyReplacer;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -41,7 +41,7 @@
{
Element classpathElement = (Element) e;
if (classpathElement.hasAttribute("codebase") == false)
- throw new DeploymentException("Invalid classpath element missing codebase: " + classpathElement);
+ throw new ConfigurationException("Invalid classpath element missing codebase: " + classpathElement);
String codebase = classpathElement.getAttribute("codebase").trim();
codebase = StringPropertyReplacer.replaceProperties(codebase);
Modified: trunk/system-jmx/src/main/org/jboss/system/metadata/ServiceDeploymentParser.java
===================================================================
--- trunk/system-jmx/src/main/org/jboss/system/metadata/ServiceDeploymentParser.java 2009-03-02 15:02:54 UTC (rev 85119)
+++ trunk/system-jmx/src/main/org/jboss/system/metadata/ServiceDeploymentParser.java 2009-03-02 15:18:46 UTC (rev 85120)
@@ -24,10 +24,10 @@
import java.util.ArrayList;
import java.util.List;
-import org.jboss.deployment.DeploymentException;
import org.jboss.logging.Logger;
import org.jboss.mx.loading.LoaderRepositoryFactory;
import org.jboss.mx.loading.LoaderRepositoryFactory.LoaderRepositoryConfig;
+import org.jboss.system.ConfigurationException;
import org.jboss.util.StringPropertyReplacer;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -64,9 +64,9 @@
* Parse the xml
*
* @return the service deployment
- * @throws DeploymentException for any error
+ * @throws ConfigurationException for any error
*/
- public ServiceDeployment parse() throws DeploymentException
+ public ServiceDeployment parse() throws ConfigurationException
{
ServiceDeployment parsed = new ServiceDeployment();
@@ -87,9 +87,9 @@
*
* @param document the document
* @return the list of classpaths
- * @throws DeploymentException for any error
+ * @throws ConfigurationException for any error
*/
- private List<ServiceDeploymentClassPath> parseXMLClasspath(Document document) throws DeploymentException
+ private List<ServiceDeploymentClassPath> parseXMLClasspath(Document document) throws ConfigurationException
{
ArrayList<ServiceDeploymentClassPath> classPaths = null;
@@ -103,7 +103,7 @@
{
log.debug("Found classpath element: " + classpathElement);
if (classpathElement.hasAttribute("codebase") == false)
- throw new DeploymentException("Invalid classpath element missing codebase: " + classpathElement);
+ throw new ConfigurationException("Invalid classpath element missing codebase: " + classpathElement);
String codebase = classpathElement.getAttribute("codebase").trim();
codebase = StringPropertyReplacer.replaceProperties(codebase);
@@ -133,16 +133,16 @@
*
* @param document the document
* @return the config
- * @throws DeploymentException for any error
+ * @throws ConfigurationException for any error
*/
- private LoaderRepositoryConfig parseLoaderRepositoryConfig(Document document) throws DeploymentException
+ private LoaderRepositoryConfig parseLoaderRepositoryConfig(Document document) throws ConfigurationException
{
// Check for a custom loader-repository for scoping
NodeList loaders = document.getElementsByTagName("loader-repository");
if( loaders.getLength() > 0 )
{
if(loaders.getLength() > 1)
- throw new DeploymentException("SAR Deployment cannot have more than one loader-repository entry.");
+ throw new ConfigurationException("SAR Deployment cannot have more than one loader-repository entry.");
Element loader = (Element) loaders.item(0);
try
{
@@ -150,7 +150,7 @@
}
catch (Exception e)
{
- throw DeploymentException.rethrowAsDeploymentException("Unable to parse loader repository config", e);
+ ConfigurationException.rethrowAsConfigurationException("Unable to parse loader repository config", e);
}
}
return null;
Modified: trunk/system-jmx/src/main/org/jboss/system/metadata/ServiceJavaBeanValueMetaData.java
===================================================================
--- trunk/system-jmx/src/main/org/jboss/system/metadata/ServiceJavaBeanValueMetaData.java 2009-03-02 15:02:54 UTC (rev 85119)
+++ trunk/system-jmx/src/main/org/jboss/system/metadata/ServiceJavaBeanValueMetaData.java 2009-03-02 15:18:46 UTC (rev 85120)
@@ -25,7 +25,7 @@
import javax.management.MBeanAttributeInfo;
-import org.jboss.deployment.DeploymentException;
+import org.jboss.system.ConfigurationException;
import org.jboss.util.propertyeditor.PropertyEditors;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -79,8 +79,8 @@
if( attributeClassName == null || attributeClassName.length() == 0 )
attributeClassName = attributeInfo.getType();
if (attributeClassName == null)
- throw new DeploymentException("AttributeInfo for " + attributeInfo.getName() + " has no type");
- Class attributeClass = cl.loadClass(attributeClassName);
+ throw new ConfigurationException("AttributeInfo for " + attributeInfo.getName() + " has no type");
+ Class<?> attributeClass = cl.loadClass(attributeClassName);
// Create the bean instance
Object bean = attributeClass.newInstance();
// Get the JavaBean properties
Modified: trunk/system-jmx/src/main/org/jboss/system/metadata/ServiceTextValueMetaData.java
===================================================================
--- trunk/system-jmx/src/main/org/jboss/system/metadata/ServiceTextValueMetaData.java 2009-03-02 15:02:54 UTC (rev 85119)
+++ trunk/system-jmx/src/main/org/jboss/system/metadata/ServiceTextValueMetaData.java 2009-03-02 15:18:46 UTC (rev 85120)
@@ -27,7 +27,7 @@
import javax.management.MBeanAttributeInfo;
-import org.jboss.deployment.DeploymentException;
+import org.jboss.system.ConfigurationException;
import org.jboss.util.Classes;
import org.jboss.util.propertyeditor.PropertyEditors;
@@ -102,10 +102,10 @@
String typeName = attributeInfo.getType();
if (typeName == null)
- throw new DeploymentException("AttributeInfo for " + attributeInfo.getName() + " has no type");
+ throw new ConfigurationException("AttributeInfo for " + attributeInfo.getName() + " has no type");
// see if it is a primitive type first
- Class typeClass = Classes.getPrimitiveTypeForName(typeName);
+ Class<?> typeClass = Classes.getPrimitiveTypeForName(typeName);
if (typeClass == null)
{
// nope try look up
@@ -115,13 +115,13 @@
}
catch (ClassNotFoundException e)
{
- throw new DeploymentException("Class not found for attribute: " + attributeInfo.getName(), e);
+ throw new ConfigurationException("Class not found for attribute: " + attributeInfo.getName(), e);
}
}
PropertyEditor editor = PropertyEditorManager.findEditor(typeClass);
if (editor == null)
- throw new DeploymentException("No property editor for attribute: " + attributeInfo.getName() + "; type=" + typeClass.getName());
+ throw new ConfigurationException("No property editor for attribute: " + attributeInfo.getName() + "; type=" + typeClass.getName());
// JBAS-1709, temporarily switch the TCL so that property
// editors have access to the actual deployment ClassLoader.
Modified: trunk/system-jmx/src/tests/org/jboss/test/system/controller/ControllerTestDelegate.java
===================================================================
--- trunk/system-jmx/src/tests/org/jboss/test/system/controller/ControllerTestDelegate.java 2009-03-02 15:02:54 UTC (rev 85119)
+++ trunk/system-jmx/src/tests/org/jboss/test/system/controller/ControllerTestDelegate.java 2009-03-02 15:18:46 UTC (rev 85120)
@@ -35,7 +35,6 @@
import junit.framework.AssertionFailedError;
-import org.jboss.deployment.IncompleteDeploymentException;
import org.jboss.mx.server.ServerConstants;
import org.jboss.system.ServiceContext;
import org.jboss.system.ServiceControllerMBean;
@@ -57,7 +56,7 @@
private SimpleSARDeployer deployer;
- public ControllerTestDelegate(Class clazz)
+ public ControllerTestDelegate(Class<?> clazz)
{
super(clazz);
}
Added: trunk/system-jmx/src/tests/org/jboss/test/system/controller/IncompleteDeploymentException.java
===================================================================
--- trunk/system-jmx/src/tests/org/jboss/test/system/controller/IncompleteDeploymentException.java (rev 0)
+++ trunk/system-jmx/src/tests/org/jboss/test/system/controller/IncompleteDeploymentException.java 2009-03-02 15:18:46 UTC (rev 85120)
@@ -0,0 +1,199 @@
+/*
+ * 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.system.controller;
+
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.util.Collection;
+import java.util.Iterator;
+
+/**
+ * IncompleteDeploymentException
+ *
+ * @author <a href="mailto:d_jencks at users.sourceforge.net">David Jencks</a>
+ * @author <a href="mailto:dimitris at jboss.org">Dimitris Andreadis</a>
+ * @version $Revision: 81033 $
+ */
+public class IncompleteDeploymentException extends Exception
+{
+ /** @since 4.0.2 */
+ private static final long serialVersionUID = 1428860525880893167L;
+
+ /** non-serializable info */
+ private transient final Collection mbeansWaitingForClasses;
+ private transient final Collection mbeansWaitingForDepends;
+ private transient final Collection rootCause;
+ private transient final Collection incompletePackages;
+ private transient final Collection waitingForDeployer;
+
+ /** only serializable info */
+ private String string;
+
+ /**
+ * CTOR
+ *
+ * @param mbeansWaitingForClasses
+ * @param mbeansWaitingForDepends
+ * @param rootCause
+ * @param incompletePackages
+ * @param waitingForDeployer
+ */
+ public IncompleteDeploymentException(final Collection mbeansWaitingForClasses,
+ final Collection mbeansWaitingForDepends,
+ final Collection rootCause,
+ final Collection incompletePackages,
+ final Collection waitingForDeployer)
+ {
+ if (mbeansWaitingForClasses == null
+ || mbeansWaitingForDepends == null
+ || rootCause == null
+ ||incompletePackages == null
+ || waitingForDeployer == null)
+ {
+ throw new IllegalArgumentException("All lists in IncompleteDeploymentException constructor must be supplied");
+ } // end of if ()
+
+ this.mbeansWaitingForClasses = mbeansWaitingForClasses;
+ this.mbeansWaitingForDepends = mbeansWaitingForDepends;
+ this.rootCause = rootCause;
+ this.incompletePackages = incompletePackages;
+ this.waitingForDeployer = waitingForDeployer;
+ }
+
+ /**
+ * Get the MbeansWaitingForClasses value.
+ * @return the MbeansWaitingForClasses value.
+ */
+ public Collection getMbeansWaitingForClasses()
+ {
+ return mbeansWaitingForClasses;
+ }
+
+ /**
+ * Get the MbeansWaitingForDepends value.
+ * @return the MbeansWaitingForDepends value.
+ */
+ public Collection getMbeansWaitingForDepends()
+ {
+ return mbeansWaitingForDepends;
+ }
+
+ /**
+ * Get the IncompletePackages value.
+ * @return the IncompletePackages value.
+ */
+ public Collection getIncompletePackages()
+ {
+ return incompletePackages;
+ }
+
+ /**
+ * Get the WaitingForDeployer value.
+ * @return the WaitingForDeployer value.
+ */
+ public Collection getWaitingForDeployer()
+ {
+ return waitingForDeployer;
+ }
+
+ /**
+ * @return true is no information is contained at all
+ */
+ public boolean isEmpty()
+ {
+ return mbeansWaitingForClasses.size() == 0
+ && mbeansWaitingForDepends.size() == 0
+ && rootCause.size() == 0
+ && incompletePackages.size() == 0
+ && waitingForDeployer.size() == 0;
+ }
+
+ /**
+ * Convert to String and cache the deployment information
+ */
+ public String toString()
+ {
+ if (string != null)
+ {
+ return string;
+ }
+
+ StringBuffer result = new StringBuffer("Incomplete Deployment listing:\n\n");
+ if (waitingForDeployer.size() != 0)
+ {
+ result.append("--- Packages waiting for a deployer ---\n");
+ appendCollection(result, waitingForDeployer);
+ }
+
+ if (incompletePackages.size() != 0)
+ {
+ result.append("--- Incompletely deployed packages ---\n");
+ appendCollection(result, incompletePackages);
+ }
+
+ if (mbeansWaitingForClasses.size() != 0)
+ {
+ result.append("--- MBeans waiting for classes ---\n");
+ appendCollection(result, mbeansWaitingForClasses);
+ }
+
+ if (mbeansWaitingForDepends.size() != 0)
+ {
+ result.append("--- MBeans waiting for other MBeans ---\n");
+ appendCollection(result, mbeansWaitingForDepends);
+ }
+
+ if (rootCause.size() != 0)
+ {
+ result.append("--- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---\n");
+ appendCollection(result, rootCause);
+ }
+
+ string = result.toString();
+ return string;
+ }
+
+ private void appendCollection(StringBuffer result, Collection c)
+ {
+ for (Iterator i = c.iterator(); i.hasNext();)
+ result.append(i.next().toString()).append('\n');
+ }
+
+ /**
+ * Read-in the string-fied information produced by writeObject()
+ */
+ private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException
+ {
+ s.defaultReadObject();
+ }
+
+ /**
+ * String-ify the contained information when serializing
+ */
+ private void writeObject(ObjectOutputStream s) throws IOException
+ {
+ toString();
+ s.defaultWriteObject();
+ }
+
+}
Modified: trunk/system-jmx/src/tests/org/jboss/test/system/controller/SimpleSARDeployer.java
===================================================================
--- trunk/system-jmx/src/tests/org/jboss/test/system/controller/SimpleSARDeployer.java 2009-03-02 15:02:54 UTC (rev 85119)
+++ trunk/system-jmx/src/tests/org/jboss/test/system/controller/SimpleSARDeployer.java 2009-03-02 15:18:46 UTC (rev 85120)
@@ -32,10 +32,10 @@
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
-import org.jboss.deployment.DeploymentException;
import org.jboss.logging.Logger;
import org.jboss.mx.util.ObjectNameFactory;
import org.jboss.system.ServiceControllerMBean;
+import org.jboss.test.system.controller.legacy.DeploymentException;
import org.jboss.util.xml.JBossEntityResolver;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -95,7 +95,7 @@
{
destroy(result);
remove(result);
- DeploymentException.rethrowAsDeploymentException("Error", t);
+ throw DeploymentException.rethrowAsDeploymentException("Error", t);
}
log.debug("Deployed " + url + " took " + (System.currentTimeMillis() - start) + "ms");
Modified: trunk/system-jmx/src/tests/org/jboss/test/system/controller/basic/test/DoubleInstallOldUnitTestCase.java
===================================================================
--- trunk/system-jmx/src/tests/org/jboss/test/system/controller/basic/test/DoubleInstallOldUnitTestCase.java 2009-03-02 15:02:54 UTC (rev 85119)
+++ trunk/system-jmx/src/tests/org/jboss/test/system/controller/basic/test/DoubleInstallOldUnitTestCase.java 2009-03-02 15:18:46 UTC (rev 85120)
@@ -23,8 +23,8 @@
import junit.framework.Test;
-import org.jboss.deployment.DeploymentException;
import org.jboss.test.AbstractTestDelegate;
+import org.jboss.test.system.controller.legacy.DeploymentException;
import org.jboss.test.system.controller.support.SimpleMBean;
/**
Modified: trunk/system-jmx/src/tests/org/jboss/test/system/controller/configure/attribute/test/AttributeOldUnitTestCase.java
===================================================================
--- trunk/system-jmx/src/tests/org/jboss/test/system/controller/configure/attribute/test/AttributeOldUnitTestCase.java 2009-03-02 15:02:54 UTC (rev 85119)
+++ trunk/system-jmx/src/tests/org/jboss/test/system/controller/configure/attribute/test/AttributeOldUnitTestCase.java 2009-03-02 15:18:46 UTC (rev 85120)
@@ -23,8 +23,8 @@
import junit.framework.Test;
-import org.jboss.deployment.DeploymentException;
import org.jboss.test.AbstractTestDelegate;
+import org.jboss.test.system.controller.legacy.DeploymentException;
import org.jboss.test.system.controller.support.SimpleMBean;
/**
Modified: trunk/system-jmx/src/tests/org/jboss/test/system/controller/configure/attribute/test/DependsAttributeOldUnitTestCase.java
===================================================================
--- trunk/system-jmx/src/tests/org/jboss/test/system/controller/configure/attribute/test/DependsAttributeOldUnitTestCase.java 2009-03-02 15:02:54 UTC (rev 85119)
+++ trunk/system-jmx/src/tests/org/jboss/test/system/controller/configure/attribute/test/DependsAttributeOldUnitTestCase.java 2009-03-02 15:18:46 UTC (rev 85120)
@@ -25,8 +25,8 @@
import junit.framework.Test;
-import org.jboss.deployment.DeploymentException;
import org.jboss.test.AbstractTestDelegate;
+import org.jboss.test.system.controller.legacy.DeploymentException;
import org.jboss.test.system.controller.support.SimpleMBean;
/**
Modified: trunk/system-jmx/src/tests/org/jboss/test/system/controller/configure/attribute/test/DependsListAttributeOldUnitTestCase.java
===================================================================
--- trunk/system-jmx/src/tests/org/jboss/test/system/controller/configure/attribute/test/DependsListAttributeOldUnitTestCase.java 2009-03-02 15:02:54 UTC (rev 85119)
+++ trunk/system-jmx/src/tests/org/jboss/test/system/controller/configure/attribute/test/DependsListAttributeOldUnitTestCase.java 2009-03-02 15:18:46 UTC (rev 85120)
@@ -25,8 +25,8 @@
import junit.framework.Test;
-import org.jboss.deployment.DeploymentException;
import org.jboss.test.AbstractTestDelegate;
+import org.jboss.test.system.controller.legacy.DeploymentException;
import org.jboss.test.system.controller.support.SimpleMBean;
/**
Modified: trunk/system-jmx/src/tests/org/jboss/test/system/controller/configure/value/depends/test/DependencyValueOldUnitTestCase.java
===================================================================
--- trunk/system-jmx/src/tests/org/jboss/test/system/controller/configure/value/depends/test/DependencyValueOldUnitTestCase.java 2009-03-02 15:02:54 UTC (rev 85119)
+++ trunk/system-jmx/src/tests/org/jboss/test/system/controller/configure/value/depends/test/DependencyValueOldUnitTestCase.java 2009-03-02 15:18:46 UTC (rev 85120)
@@ -23,8 +23,8 @@
import junit.framework.Test;
-import org.jboss.deployment.DeploymentException;
import org.jboss.test.AbstractTestDelegate;
+import org.jboss.test.system.controller.legacy.DeploymentException;
import org.jboss.test.system.controller.support.SimpleMBean;
/**
Modified: trunk/system-jmx/src/tests/org/jboss/test/system/controller/configure/value/depends/test/DependencyValueTest.java
===================================================================
--- trunk/system-jmx/src/tests/org/jboss/test/system/controller/configure/value/depends/test/DependencyValueTest.java 2009-03-02 15:02:54 UTC (rev 85119)
+++ trunk/system-jmx/src/tests/org/jboss/test/system/controller/configure/value/depends/test/DependencyValueTest.java 2009-03-02 15:18:46 UTC (rev 85120)
@@ -24,8 +24,8 @@
import javax.management.MalformedObjectNameException;
import javax.management.ObjectName;
-import org.jboss.deployment.DeploymentException;
import org.jboss.mx.util.ObjectNameFactory;
+import org.jboss.system.ConfigurationException;
import org.jboss.test.system.controller.AbstractControllerTest;
import org.jboss.test.system.controller.support.Simple;
import org.jboss.test.system.controller.support.SimpleMBean;
@@ -117,7 +117,7 @@
public void testNoAttributeInfoType() throws Exception
{
- assertDeployFailure(SimpleMBean.OBJECT_NAME, DeploymentException.class);
+ assertDeployFailure(SimpleMBean.OBJECT_NAME, ConfigurationException.class);
}
public void testAttributeInfoTypeNotFound() throws Exception
Modified: trunk/system-jmx/src/tests/org/jboss/test/system/controller/configure/value/dependslist/test/DependencyListValueOldUnitTestCase.java
===================================================================
--- trunk/system-jmx/src/tests/org/jboss/test/system/controller/configure/value/dependslist/test/DependencyListValueOldUnitTestCase.java 2009-03-02 15:02:54 UTC (rev 85119)
+++ trunk/system-jmx/src/tests/org/jboss/test/system/controller/configure/value/dependslist/test/DependencyListValueOldUnitTestCase.java 2009-03-02 15:18:46 UTC (rev 85120)
@@ -23,8 +23,8 @@
import junit.framework.Test;
-import org.jboss.deployment.DeploymentException;
import org.jboss.test.AbstractTestDelegate;
+import org.jboss.test.system.controller.legacy.DeploymentException;
import org.jboss.test.system.controller.support.SimpleMBean;
/**
Modified: trunk/system-jmx/src/tests/org/jboss/test/system/controller/configure/value/javabean/test/JavaBeanValueTest.java
===================================================================
--- trunk/system-jmx/src/tests/org/jboss/test/system/controller/configure/value/javabean/test/JavaBeanValueTest.java 2009-03-02 15:02:54 UTC (rev 85119)
+++ trunk/system-jmx/src/tests/org/jboss/test/system/controller/configure/value/javabean/test/JavaBeanValueTest.java 2009-03-02 15:18:46 UTC (rev 85120)
@@ -25,7 +25,7 @@
import javax.management.ObjectName;
-import org.jboss.deployment.DeploymentException;
+import org.jboss.system.ConfigurationException;
import org.jboss.test.system.controller.AbstractControllerTest;
import org.jboss.test.system.controller.support.BrokenDynamicMBeanAttributeInfoTypeNotFound;
import org.jboss.test.system.controller.support.BrokenDynamicMBeanNoAttributeInfoType;
@@ -73,7 +73,7 @@
public void testNoAttributeInfoType() throws Exception
{
- assertDeployFailure(BrokenDynamicMBeanNoAttributeInfoType.OBJECT_NAME, DeploymentException.class);
+ assertDeployFailure(BrokenDynamicMBeanNoAttributeInfoType.OBJECT_NAME, ConfigurationException.class);
}
public void testAttributeInfoTypeNotFound() throws Exception
Modified: trunk/system-jmx/src/tests/org/jboss/test/system/controller/configure/value/text/test/TextValueOldUnitTestCase.java
===================================================================
--- trunk/system-jmx/src/tests/org/jboss/test/system/controller/configure/value/text/test/TextValueOldUnitTestCase.java 2009-03-02 15:02:54 UTC (rev 85119)
+++ trunk/system-jmx/src/tests/org/jboss/test/system/controller/configure/value/text/test/TextValueOldUnitTestCase.java 2009-03-02 15:18:46 UTC (rev 85120)
@@ -24,6 +24,8 @@
import junit.framework.Test;
import org.jboss.test.AbstractTestDelegate;
+import org.jboss.test.system.controller.legacy.DeploymentException;
+import org.jboss.test.system.controller.support.SimpleMBean;
/**
* TextValueOldUnitTestCase.
@@ -43,7 +45,7 @@
super(name);
}
- public static AbstractTestDelegate getDelegate(Class clazz) throws Exception
+ public static AbstractTestDelegate getDelegate(Class<?> clazz) throws Exception
{
return getOldControllerDelegate(clazz);
}
@@ -52,4 +54,9 @@
{
FAILS_IN_OLD();
}
+
+ public void testNoPropertyEditor() throws Exception
+ {
+ assertDeployFailure(SimpleMBean.OBJECT_NAME, DeploymentException.class);
+ }
}
Modified: trunk/system-jmx/src/tests/org/jboss/test/system/controller/configure/value/text/test/TextValueTest.java
===================================================================
--- trunk/system-jmx/src/tests/org/jboss/test/system/controller/configure/value/text/test/TextValueTest.java 2009-03-02 15:02:54 UTC (rev 85119)
+++ trunk/system-jmx/src/tests/org/jboss/test/system/controller/configure/value/text/test/TextValueTest.java 2009-03-02 15:18:46 UTC (rev 85120)
@@ -28,7 +28,7 @@
import javax.management.ObjectName;
-import org.jboss.deployment.DeploymentException;
+import org.jboss.system.ConfigurationException;
import org.jboss.test.system.controller.AbstractControllerTest;
import org.jboss.test.system.controller.support.BrokenDynamicMBeanAttributeInfoTypeNotFound;
import org.jboss.test.system.controller.support.BrokenDynamicMBeanNoAttributeInfoType;
@@ -106,12 +106,12 @@
public void testNoPropertyEditor() throws Exception
{
- assertDeployFailure(SimpleMBean.OBJECT_NAME, DeploymentException.class);
+ assertDeployFailure(SimpleMBean.OBJECT_NAME, ConfigurationException.class);
}
public void testNoAttributeInfoType() throws Exception
{
- assertDeployFailure(BrokenDynamicMBeanNoAttributeInfoType.OBJECT_NAME, DeploymentException.class);
+ assertDeployFailure(BrokenDynamicMBeanNoAttributeInfoType.OBJECT_NAME, ConfigurationException.class);
}
public void testAttributeInfoTypeNotFound() throws Exception
Added: trunk/system-jmx/src/tests/org/jboss/test/system/controller/legacy/DeploymentException.java
===================================================================
--- trunk/system-jmx/src/tests/org/jboss/test/system/controller/legacy/DeploymentException.java (rev 0)
+++ trunk/system-jmx/src/tests/org/jboss/test/system/controller/legacy/DeploymentException.java 2009-03-02 15:18:46 UTC (rev 85120)
@@ -0,0 +1,94 @@
+/*
+ * 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.system.controller.legacy;
+
+/**
+ * Thrown by a deployer if an application component could not be
+ * deployed.
+ *
+ * @author <a href="mailto:toby.allsopp at peace.com">Toby Allsopp</a>
+ * @version $Revision: 81033 $
+ */
+public class DeploymentException extends Exception
+{
+ /** @since 4.0.2 */
+ private static final long serialVersionUID = 1416258464473965574L;
+
+ /**
+ * Rethrow a throwable as a deployment exception if it isn't already.
+ *
+ * @param message the message
+ * @param t the throwable
+ * @return never
+ * @throws DeploymentException always
+ */
+ public static DeploymentException rethrowAsDeploymentException(String message, Throwable t)
+ throws DeploymentException
+ {
+ if (t instanceof DeploymentException)
+ throw (DeploymentException) t;
+ else
+ throw new DeploymentException(message, t);
+ }
+
+ /**
+ * Construct a <tt>DeploymentException</tt> with the specified detail
+ * message.
+ *
+ * @param msg Detail message.
+ */
+ public DeploymentException(String msg)
+ {
+ super(msg);
+ }
+
+ /**
+ * Construct a <tt>DeploymentException</tt> with the specified detail
+ * message and nested <tt>Throwable</tt>.
+ *
+ * @param msg Detail message.
+ * @param nested Nested <tt>Throwable</tt>.
+ */
+ public DeploymentException(String msg, Throwable nested)
+ {
+ super(msg, nested);
+ }
+
+ /**
+ * Construct a <tt>DeploymentException</tt> with the specified
+ * nested <tt>Throwable</tt>.
+ *
+ * @param nested Nested <tt>Throwable</tt>.
+ */
+ public DeploymentException(Throwable nested)
+ {
+ super(nested);
+ }
+
+ /**
+ * Construct a <tt>DeploymentException</tt> with no detail.
+ */
+ public DeploymentException()
+ {
+ super();
+ }
+}
Modified: trunk/system-jmx/src/tests/org/jboss/test/system/controller/legacy/OldServiceConfigurator.java
===================================================================
--- trunk/system-jmx/src/tests/org/jboss/test/system/controller/legacy/OldServiceConfigurator.java 2009-03-02 15:02:54 UTC (rev 85119)
+++ trunk/system-jmx/src/tests/org/jboss/test/system/controller/legacy/OldServiceConfigurator.java 2009-03-02 15:18:46 UTC (rev 85120)
@@ -49,7 +49,6 @@
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
-import org.jboss.deployment.DeploymentException;
import org.jboss.logging.Logger;
import org.jboss.mx.util.JMXExceptionDecoder;
import org.jboss.mx.util.MBeanProxyExt;
Modified: trunk/system-jmx/src/tests/org/jboss/test/system/controller/legacy/OldServiceController.java
===================================================================
--- trunk/system-jmx/src/tests/org/jboss/test/system/controller/legacy/OldServiceController.java 2009-03-02 15:02:54 UTC (rev 85119)
+++ trunk/system-jmx/src/tests/org/jboss/test/system/controller/legacy/OldServiceController.java 2009-03-02 15:18:46 UTC (rev 85120)
@@ -42,7 +42,6 @@
import javax.management.Notification;
import javax.management.ObjectName;
-import org.jboss.deployment.DeploymentException;
import org.jboss.logging.Logger;
import org.jboss.mx.server.ServerConstants;
import org.jboss.mx.util.JBossNotificationBroadcasterSupport;
Modified: trunk/system-jmx/src/tests/org/jboss/test/system/controller/legacy/OldServiceCreator.java
===================================================================
--- trunk/system-jmx/src/tests/org/jboss/test/system/controller/legacy/OldServiceCreator.java 2009-03-02 15:02:54 UTC (rev 85119)
+++ trunk/system-jmx/src/tests/org/jboss/test/system/controller/legacy/OldServiceCreator.java 2009-03-02 15:18:46 UTC (rev 85120)
@@ -31,7 +31,6 @@
import javax.management.ObjectInstance;
import javax.management.ObjectName;
-import org.jboss.deployment.DeploymentException;
import org.jboss.logging.Logger;
import org.jboss.mx.service.ServiceConstants;
import org.jboss.mx.util.JMXExceptionDecoder;
Modified: trunk/system-jmx/src/tests/org/jboss/test/system/controller/parse/test/ErrorInParseOldUnitTestCase.java
===================================================================
--- trunk/system-jmx/src/tests/org/jboss/test/system/controller/parse/test/ErrorInParseOldUnitTestCase.java 2009-03-02 15:02:54 UTC (rev 85119)
+++ trunk/system-jmx/src/tests/org/jboss/test/system/controller/parse/test/ErrorInParseOldUnitTestCase.java 2009-03-02 15:18:46 UTC (rev 85120)
@@ -23,8 +23,8 @@
import junit.framework.Test;
-import org.jboss.deployment.DeploymentException;
import org.jboss.test.AbstractTestDelegate;
+import org.jboss.test.system.controller.legacy.DeploymentException;
/**
* ErrorInParseOldUnitTestCase.
More information about the jboss-cvs-commits
mailing list