[Jboss-cvs] JBossAS SVN: r55494 - in branches/MC_VDF_WORK: system system/src/resources/dtd system-jmx/src/main/org/jboss/system system-jmx/src/main/org/jboss/system/metadata system-jmx/src/main/org/jboss/system/microcontainer system-jmx/src/resources/tests/org/jboss/test/system/controller/configure/value system-jmx/src/resources/tests/org/jboss/test/system/controller/configure/value/inject system-jmx/src/resources/tests/org/jboss/test/system/controller/configure/value/inject/test system-jmx/src/resources/tests/org/jboss/test/system/controller/integration/test system-jmx/src/resources/tests/org/jboss/test/system/controller/lifecycle/seperated/test system-jmx/src/resources/tests/org/jboss/test/system/metadata/attributes/test system-jmx/src/resources/tests/org/jboss/test/system/metadata/basic/test system-jmx/src/resources/tests/org/jboss/test/system/metadata/value system-jmx/src/resources/tests/org/jboss/test/system/metadata/value/inject system-jmx/src/resources/tests/org/jboss/t! est/system/metadata/value/inject/test system-jmx/src/tests/org/jboss/test/system/controller system-jmx/src/tests/org/jboss/test/system/controller/configure/value system-jmx/src/tests/org/jboss/test/system/controller/configure/value/inject system-jmx/src/tests/org/jboss/test/system/controller/configure/value/inject/test system-jmx/src/tests/org/jboss/test/system/controller/integration/test system-jmx/src/tests/org/jboss/test/system/controller/lifecycle/seperated/test system-jmx/src/tests/org/jboss/test/system/controller/support system-jmx/src/tests/org/jboss/test/system/metadata/attributes/test system-jmx/src/tests/org/jboss/test/system/metadata/basic/test system-jmx/src/tests/org/jboss/test/system/metadata/test system-jmx/src/tests/org/jboss/test/system/metadata/value system-jmx/src/tests/org/jboss/test/system/metadata/value/inject system-jmx/src/tests/org/jboss/test/system/metadata/value/inject/test

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Aug 10 14:05:53 EDT 2006


Author: adrian at jboss.org
Date: 2006-08-10 14:05:14 -0400 (Thu, 10 Aug 2006)
New Revision: 55494

Added:
   branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/metadata/ServiceInjectionValueMetaData.java
   branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/controller/configure/value/inject/
   branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/controller/configure/value/inject/test/
   branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/controller/configure/value/inject/test/InjectionBeanEmpty_bad.xml
   branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/controller/configure/value/inject/test/InjectionNoBean_bad.xml
   branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/controller/configure/value/inject/test/InjectionNotFound_bad.xml
   branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/controller/configure/value/inject/test/InjectionPropertyNotFound_bad.xml
   branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/controller/configure/value/inject/test/InjectionPropertyState_install.xml
   branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/controller/configure/value/inject/test/InjectionPropertyWrongType_bad.xml
   branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/controller/configure/value/inject/test/InjectionProperty_install.xml
   branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/controller/configure/value/inject/test/InjectionWrongType_bad.xml
   branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/controller/configure/value/inject/test/Injection_install.xml
   branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/controller/integration/test/ConfigureJMXFromMCUnitTestCase-mc.xml
   branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/controller/integration/test/ConfigureJMXFromMCUnitTestCase.xml
   branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/controller/lifecycle/seperated/test/NewOnDemandDependency_1.xml
   branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/controller/lifecycle/seperated/test/NewOnDemandDependency_2.xml
   branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/controller/lifecycle/seperated/test/NewOnDemandServerDependency_1.xml
   branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/controller/lifecycle/seperated/test/NewOnDemandServerDependency_2.xml
   branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/metadata/attributes/test/AttributeValueInject.xml
   branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/metadata/basic/test/BasicMBeanMode.xml
   branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/metadata/value/inject/
   branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/metadata/value/inject/test/
   branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/metadata/value/inject/test/Injection.xml
   branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/metadata/value/inject/test/InjectionEmpty.xml
   branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/metadata/value/inject/test/InjectionProperty.xml
   branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/metadata/value/inject/test/InjectionPropertyState.xml
   branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/metadata/value/inject/test/InjectionState.xml
   branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/controller/configure/value/inject/
   branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/controller/configure/value/inject/test/
   branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/controller/configure/value/inject/test/NewInjectionValueUnitTestCase.java
   branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/controller/integration/test/ConfigureJMXFromMCUnitTestCase.java
   branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/controller/integration/test/InjectJMXFromMCTest.java
   branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/controller/lifecycle/seperated/test/NewOnDemandDependencyTest.java
   branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/controller/lifecycle/seperated/test/NewOnDemandDependencyUnitTestCase.java
   branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/controller/lifecycle/seperated/test/NewOnDemandServerDependencyUnitTestCase.java
   branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/metadata/value/inject/
   branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/metadata/value/inject/test/
   branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/metadata/value/inject/test/InjectionValueUnitTestCase.java
   branches/MC_VDF_WORK/system/src/resources/dtd/jboss-service_5_0.dtd
Modified:
   branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/ServiceConfigurator.java
   branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/ServiceController.java
   branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/metadata/ServiceAttributeMetaData.java
   branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/metadata/ServiceDependencyListValueMetaData.java
   branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/metadata/ServiceDependencyValueMetaData.java
   branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/metadata/ServiceMetaData.java
   branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/metadata/ServiceValueContext.java
   branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/metadata/ServiceValueMetaData.java
   branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/microcontainer/ConfigureAction.java
   branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/microcontainer/ServiceControllerContext.java
   branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/controller/AbstractControllerTest.java
   branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/controller/ControllerTestDelegate.java
   branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/controller/configure/value/ControllerConfigureValueTestSuite.java
   branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/controller/integration/test/InjectMCFromJMXTest.java
   branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/controller/integration/test/IntegrationTestSuite.java
   branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/controller/lifecycle/seperated/test/ControllerLifecycleSeperatedTestSuite.java
   branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/controller/support/Simple.java
   branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/controller/support/SimpleMBean.java
   branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/metadata/attributes/test/AttributeValueUnitTestCase.java
   branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/metadata/basic/test/BasicMBeanUnitTestCase.java
   branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/metadata/test/AbstractMetaDataTest.java
   branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/metadata/value/MetaDataValueTestSuite.java
   branches/MC_VDF_WORK/system/.classpath
Log:
[JBAS-1841] - "On Demand" and <inject/> for JMX.

Modified: branches/MC_VDF_WORK/system/.classpath
===================================================================
--- branches/MC_VDF_WORK/system/.classpath	2006-08-10 17:14:01 UTC (rev 55493)
+++ branches/MC_VDF_WORK/system/.classpath	2006-08-10 18:05:14 UTC (rev 55494)
@@ -10,9 +10,9 @@
 	<classpathentry kind="lib" path="/thirdparty/apache-log4j/lib/log4j.jar"/>
 	<classpathentry kind="lib" path="/thirdparty/oswego-concurrent/lib/concurrent.jar"/>
 	<classpathentry kind="lib" path="/thirdparty/jboss/jbossxb/lib/jboss-xml-binding.jar"/>
-	<classpathentry sourcepath="C:/svn/JBossMC/workspace/container/src/main" kind="lib" path="/thirdparty/jboss/microcontainer/lib/jboss-container.jar"/>
+	<classpathentry kind="lib" path="/thirdparty/jboss/microcontainer/lib/jboss-container.jar"/>
 	<classpathentry kind="lib" path="/thirdparty/jboss/microcontainer/lib/jboss-dependency.jar"/>
-	<classpathentry sourcepath="C:/svn/JBossMC/workspace/kernel/src/main" kind="lib" path="/thirdparty/jboss/microcontainer/lib/jboss-microcontainer.jar"/>
+	<classpathentry kind="lib" path="/thirdparty/jboss/microcontainer/lib/jboss-microcontainer.jar"/>
 	<classpathentry kind="lib" path="/thirdparty/junit/lib/junit.jar"/>
 	<classpathentry kind="lib" path="/thirdparty/jboss/test/lib/jboss-test.jar"/>
 	<classpathentry kind="output" path="output/eclipse-classes"/>

Added: branches/MC_VDF_WORK/system/src/resources/dtd/jboss-service_5_0.dtd
===================================================================
--- branches/MC_VDF_WORK/system/src/resources/dtd/jboss-service_5_0.dtd	2006-08-10 17:14:01 UTC (rev 55493)
+++ branches/MC_VDF_WORK/system/src/resources/dtd/jboss-service_5_0.dtd	2006-08-10 18:05:14 UTC (rev 55494)
@@ -0,0 +1,304 @@
+<?xml version='1.0' encoding='UTF-8' ?>
+
+<!-- A skeleton JBoss MBean service descriptor DTD. This cannot be used in
+general to validate a jboss-service.xml descriptor due to the fact that the
+'attribute' element allows ANY content.
+
+$Id: jboss-service_4_0.dtd 33890 2005-07-24 23:58:11 +0000 (Sun, 24 Jul 2005) starksm $
+
+DOCTYPE server
+    PUBLIC "-//JBoss//DTD MBean Service 4.0//EN"
+    "http://www.jboss.org/j2ee/dtd/jboss-service_4_0.dtd"
+-->
+<!-- The server element is the root element.
+-->
+<!ELEMENT server (loader-repository? , local-directory* , classpath* , mbean*)>
+
+<!-- The loader-repository specifies the name of the UnifiedLoaderRepository
+   MBean to use for the ear to provide ear level scoping of classes deployed
+   in the ear. It is a unique JMX ObjectName string. It may also specify
+   an arbitrary configuration by including a loader-repository-config element.
+
+Examples:
+   <loader-repository>jboss.test:loader=cts-cmp2v1-sar.ear</loader-repository>
+
+   <loader-repository loaderRepositoryClass='dot.com.LoaderRepository'>
+      dot.com:loader=unique-archive-name
+      <loader-repository-config configParserClass='dot.com.LoaderParser'>
+         java2ParentDelegaton=true
+      </loader-repository-config>
+   </loader-repository>
+-->
+
+<!--
+The mode of the deployments. (optional)
+
+Valid Values:
+'On Demand' - Don't start the service unless something depends on it.
+-->
+<!ATTLIST server mode CDATA  #IMPLIED>
+
+<!ELEMENT loader-repository (#PCDATA | loader-repository-config)*>
+
+<!-- The loaderRepositoryClass attribute gives the classname of the
+org.jboss.mx.loading.LoaderRepository implementation.
+-->
+<!ATTLIST loader-repository loaderRepositoryClass CDATA  #IMPLIED>
+
+<!-- The loader-repository-config element specifies any arbitrary configuration
+fragment for use in configuring the loader-repository instance. The actual
+content of this element is specific to the loaderRepositoryClass and the
+code parsing the element.
+-->
+<!ELEMENT loader-repository-config (#PCDATA)>
+
+<!-- The configParserClass attribute gives the classname of the
+org.jboss.mx.loading.LoaderRepositoryFactory.LoaderRepositoryConfigParser
+implementation to use to parse the loader-repository-config content.
+-->
+<!ATTLIST loader-repository-config configParserClass CDATA  #IMPLIED>
+
+<!-- A local-directory element specifies that portions of the sar are to be unjard into the data
+directory of the server configuration.
+-->
+<!ELEMENT local-directory EMPTY>
+
+<!-- The optional path attribute gives the prefix of the sar entries that should be copied
+into the data directory. If it is not specified the entire sar contents will be placed into
+the data directory.
+-->
+<!ATTLIST local-directory path CDATA  #IMPLIED>
+
+<!-- A classpath element specifies a location which will be included in the services
+deployment classpath.
+-->
+<!ELEMENT classpath EMPTY>
+
+<!-- The codebase attribute specifies the base URL from which the jars or classes
+are loaded from. If the codebase is '.' then it is equal to the mbean deployment URL.
+Otherwise, it is resolved as a path spec relative to the serverHomeURL (e.g., file:/jboss-3.2.0)
+using the URL ctor URL(serverHomeURL, codebase)
+
+Examples:
+
+   <classpath codebase='.' archives='util.jar' />
+   <classpath codebase='http://classloader.dot.com' archives='*' />
+   <classpath codebase="lib" archives="*"/>
+-->
+<!ATTLIST classpath codebase CDATA  #REQUIRED>
+
+<!-- The archives attribute specifies either the '*' wildcard to indicate all contents of the
+codebase should be included, or a comma seperated list of the jars to include.
+-->
+<!ATTLIST classpath archives CDATA  #IMPLIED>
+
+<!-- The mbean element defines a JBoss MBean service. This includes the
+mbean class, attributes and dependencies.
+-->
+<!ELEMENT mbean (constructor? , xmbean? , attribute* , depends* , depends-list*)>
+
+<!-- The code attributes gives the fully qualified name of the MBean
+implementation class.
+-->
+<!ATTLIST mbean code      CDATA  #REQUIRED>
+
+<!-- The name attribute gives the JMX ObjectName string to use when registering
+the MBean. This must be a unique and valid JMX name.
+-->
+<!ATTLIST mbean name      CDATA  #REQUIRED>
+
+<!-- The optional interface attribute gives the full qualified name of the class
+uses to construct the management interface of the mbean. In absence of it an interface
+with the name ending by MBean will be looked in the implementation class. When used
+this interface is defined explicitely.
+-->
+<!ATTLIST mbean interface CDATA  #IMPLIED>
+
+<!--
+The mode of the mbean. (optional)
+
+Valid Values:
+'On Demand' - Don't start the service unless something depends on it.
+-->
+<!ATTLIST mbean mode CDATA  #IMPLIED>
+
+<!-- The xmbean-dd attribute defines the path to the JBoss XMBean descriptor. This
+is an xml document conforming to:
+
+<!DOCTYPE mbean PUBLIC
+      "-//JBoss//DTD JBOSS XMBEAN 1.0//EN"
+      "http://www.jboss.org/j2ee/dtd/jboss_xmbean_1_0.dtd">
+
+If the descriptor is embedded via a nested xmbean element, the xmbean-dd attribute
+must be given as an empty string.
+
+Example:
+	<mbean code="org.jboss.test.jmx.xmbean.User"
+		name="jboss.test:service=xmbean-user"
+		xmbean-dd="META-INF/org/jboss/test/jmx/xmbean/User.xml" />
+-->
+<!ATTLIST mbean xmbean-dd CDATA  #IMPLIED>
+
+<!-- The optional xmbean-code attribute specifies the ModelMBean implementation class
+to use. This defaults to org.jboss.mx.modelmbean.XMBean.
+-->
+<!ATTLIST mbean xmbean-code CDATA  #IMPLIED>
+
+<!-- The xmbean element specifies a nested JBoss XMBean descriptor fragment. Its
+supported content model is the same as the mbean element of the jboss_xmbean_1_0.dtd
+
+Example:
+	<mbean code="org.jboss.test.jmx.xmbean.User"
+		name="jboss.test:service=xmbean-user"
+		xmbean-dd="">
+		<xmbean>
+			...
+		</xmbean>
+	</mbean>
+-->
+<!ELEMENT xmbean ANY>
+
+<!-- The constructor element defines a non-default constructor to use when
+instantiating the mbean.
+-->
+<!ELEMENT constructor (arg*)>
+
+<!-- The arg element specify the constructor arguments in the order of the
+ctor signature. Each arg has a type and value attribute.
+-->
+<!ELEMENT arg EMPTY>
+
+<!-- The type attribute gives the type of the argument as defined in the
+ctor signature. If not defined java.lang.String is assumed.
+-->
+<!ATTLIST arg type  CDATA  #IMPLIED>
+
+<!-- The value attribute provides the string representation of the ctor
+argument. It is converted from a string to type using Java PropertyEditor or a
+ctor taking a single string as its argument.
+-->
+<!ATTLIST arg value CDATA  #REQUIRED>
+
+<!-- The attribute element specifies the initial value for a management attribute of
+the enclosing mbean. Typically the value of the attribute element is the string
+representation of the attribute, but it can be an arbitrary xml fragment that is
+parsed by the mbean.
+-->
+<!ELEMENT attribute ANY>
+
+<!-- The required name attribute gives the name of the attribute. This is the
+name exposed by the mbean to the MBeanServer for the attribute.
+-->
+<!ATTLIST attribute name CDATA  #REQUIRED>
+
+<!-- The optional replace attribute indicates whether references of the form ${x}
+in the attribute element content should be replaced with the corresponding
+System.getProperty(x) value.
+-->
+<!ATTLIST attribute replace (true | false) 'true'>
+<!-- The optional trim attribute specifies whether the attribute element content should
+be trimmed of whitespace.
+-->
+<!ATTLIST attribute trim (true | false) 'true'>
+
+<!-- The attributeClass attribute specifies that type of object that
+should be created. This is needed for non-concreate attribute types
+like interfaces and abstract classes.
+-->
+<!ATTLIST attribute attributeClass CDATA  #IMPLIED>
+
+<!-- The serialDataType defines the how the content of the attribute
+element is interpretted by the ServiceConfigurator. The possible values
+are:
+   + text: the content is treated as the string representation of the
+   attribute value. It will be mapped to the attribute using the PropertyEditor
+   registered for the attribute type.
+   + javaBean: the content is a collection of property elements.
+   + jbxb: the content is an xml element from a namespace with an associated
+      xml schema that can be unmarshalled using the JBossXB framework.
+-->
+<!ATTLIST attribute serialDataType (text | javaBean | jbxb) 'text'>
+
+<!-- The property element is used to describe the JavaBean properties of
+an attribute when the attribute element serialDataType is javaBean.
+-->
+<!ELEMENT property (#PCDATA)>
+<!-- The required name attribute gives the name of the property. This is the
+name of a JavaBean property for the attribute type.
+-->
+<!ATTLIST property name CDATA #REQUIRED>
+
+<!-- The depends element specifies a JMX ObjectName string for an mbean
+on which the enclosing mbean depends.
+
+Example:
+   <mbean code="myBean" name="domain:name=x">
+      <depends optional-attribute-name="yName">domain:name=y</depends>
+   </mbean>
+
+   <mbean code="myBean" name="domain:name=x">
+      <depends optional-attribute-name="anonName">
+         <mbean code="nestedBean" name="domain:name=x.y">
+         ...
+         </mbean>
+      </depends>
+   </mbean>
+-->
+<!ELEMENT depends (#PCDATA | mbean)*>
+
+<!-- The optional-attribute-name attribute specifies the attribute name
+which should be populated with the JMX ObjectName of the depends element.
+This allows an mbean to have access to the name of the mbean on which
+it depends.
+-->
+<!ATTLIST depends optional-attribute-name CDATA  #IMPLIED>
+
+<!-- The proxy-type attribute specifies the interface name
+that should be exposed on an MBeanProxy pointing at the dependent
+MBean, specified by the JMX ObjectName.
+
+The special value proxy-type="attribute" will use the
+class declared in the MBeanAttributeInfo as the interface
+for the MBeanProxy.
+
+Example:
+   <mbean code="org.jboss.example.Helper" name="domain:name=helper"/>
+
+   <mbean code="myBean" name="domain:name=x">
+      <depends optional-attribute-name="Helper"
+               proxy-type="org.jboss.example.HelperMBean"
+      >domain:name=helper</depends>
+   </mbean>
+
+   <mbean code="myBean" name="domain:name=x">
+      <depends optional-attribute-name="Helper"
+               proxy-type="attribute"
+      >domain:name=helper</depends>
+   </mbean>
+-->
+<!ATTLIST depends proxy-type CDATA  #IMPLIED>
+
+<!-- The depends-list element specifies a series of JMX ObjectName
+strings of mbeans on which the enclosing mbean depends.
+
+Example:
+   <mbean code="myBean" name="domain:name=x">
+      <depends-list optional-attribute-name="myObjectNameList">
+         <depends-list-element>domain:name=y</depends-list-element>
+         <depends-list-element>domain:name=z</depends-list-element>
+      </depends-list>
+   </mbean>
+-->
+<!ELEMENT depends-list (depends-list-element)+>
+
+<!-- The optional-attribute-name attribute specifies the attribute name
+which should be populated with a java.util.List that contains the JMX
+ObjectName(s) of the depends-list elements. This allows an mbean to have
+access to the names of the mbeans on which it depends.
+-->
+<!ATTLIST depends-list optional-attribute-name CDATA  #IMPLIED>
+
+<!-- The depends-list-element element specifies a JMX ObjectName string
+for an mbean on which the enclosing mbean depends.
+-->
+<!ELEMENT depends-list-element (#PCDATA | mbean)*>

Modified: branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/ServiceConfigurator.java
===================================================================
--- branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/ServiceConfigurator.java	2006-08-10 17:14:01 UTC (rev 55493)
+++ branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/ServiceConfigurator.java	2006-08-10 18:05:14 UTC (rev 55494)
@@ -89,29 +89,33 @@
     * Configure an MBean
     * 
     * @param server the server
+    * @param controller the service controller
     * @param objectName the object name
     * @param classLoaderName the classloader object name
     * @param attrs the attributes
     * @throws Exception for any error
     */
-   public static void configure(MBeanServer server, ObjectName objectName, ObjectName classLoaderName, Collection<ServiceAttributeMetaData> attrs) throws Exception
+   public static void configure(MBeanServer server, ServiceController controller, ObjectName objectName, ObjectName classLoaderName, Collection<ServiceAttributeMetaData> attrs) throws Exception
    {
+      server = checkMBeanServer(server, controller);
       ClassLoader cl = server.getClassLoader(classLoaderName);
-      configure(server, objectName, cl, attrs);
+      configure(server, controller, objectName, cl, attrs);
    }
-
+   
    /**
     * Configure an MBean
     * 
     * @param server the server
+    * @param controller the service controller
     * @param objectName the object name
     * @param cl the classloader
     * @param attrs the attributes
     * @throws Exception for any error
     */
-   public static void configure(MBeanServer server, ObjectName objectName, ClassLoader cl, Collection<ServiceAttributeMetaData> attrs) throws Exception
+   public static void configure(MBeanServer server, ServiceController controller, ObjectName objectName, ClassLoader cl, Collection<ServiceAttributeMetaData> attrs) throws Exception
    {
-      ServiceValueContext valueContext = new ServiceValueContext(server, cl);
+      ServiceValueContext valueContext = new ServiceValueContext(server, controller, cl);
+      server = checkMBeanServer(server, controller);
       
       HashMap<String, MBeanAttributeInfo> attributeMap = getAttributeMap(server, objectName);
 
@@ -137,6 +141,24 @@
          }
       }
    }
+
+   /**
+    * Check the server/controller parameters
+    * 
+    * @param server the server
+    * @param controller the controller
+    * @return the server
+    */
+   private static MBeanServer checkMBeanServer(MBeanServer server, ServiceController controller)
+   {
+      if (server != null)
+         return server;
+      
+      if (controller != null)
+         return controller.getMBeanServer();
+      
+      throw new IllegalArgumentException("Either the server or controller must be passed");
+   }
    
    /**
     * Apply any service binding overrides
@@ -262,7 +284,7 @@
          {
             ServiceCreator.install(server, objectName, metaData, null);
             result.add(objectName);
-            configure(server, objectName, loaderName, attrs);
+            configure(server, null, objectName, loaderName, attrs);
             if (serviceBinding != null)
                applyServiceConfig(server, objectName, serviceBinding);
          }

Modified: branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/ServiceController.java
===================================================================
--- branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/ServiceController.java	2006-08-10 17:14:01 UTC (rev 55493)
+++ branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/ServiceController.java	2006-08-10 18:05:14 UTC (rev 55494)
@@ -109,16 +109,33 @@
    {
       return server;
    }
-   public void setMBeanServer(final MBeanServer server)
+
+   /**
+    * Set the server.
+    * 
+    * @param server the server.
+    */
+   public void setMBeanServer(MBeanServer server)
    {
       this.server = server;
    }
 
+   /**
+    * Get the kernel.
+    * 
+    * @return the kernel.
+    */
    public Kernel getKernel()
    {
       return kernel;
    }
-   public void setKernel(final Kernel kernel)
+
+   /**
+    * Set the kernel.
+    * 
+    * @param kernel the kernel.
+    */
+   public void setKernel(Kernel kernel)
    {
       this.kernel = kernel;
    }
@@ -223,10 +240,9 @@
          ServiceControllerContext context = new ServiceControllerContext(this, metaData);
          try
          {
-            controller.install(context);
+            doInstall(controller, context);
             contexts.add(context);
-            controller.change(context, ControllerState.CONFIGURED);
-            installed.put(context.getObjectName(), context);
+            doChange(controller, context, ControllerState.CONFIGURED, "configure");
             result.add(context.getObjectName());
          }
          catch (Throwable t)
@@ -260,9 +276,8 @@
       ServiceControllerContext context = new ServiceControllerContext(this, name, object); 
       try
       {
-         controller.install(context);
-         controller.change(context, ControllerState.CONFIGURED);
-         installed.put(context.getObjectName(), context);
+         doInstall(controller, context);
+         doChange(controller, context, ControllerState.CONFIGURED, "configure");
       }
       catch (Throwable t)
       {
@@ -297,14 +312,14 @@
       // Install the context to the configured level
       try
       {
-         controller.install(context);
-         installed.put(serviceName, context);
-         controller.change(context, ControllerState.CONFIGURED);
+         doInstall(controller, context);
+         doChange(controller, context, ControllerState.CONFIGURED, "configure");
       }
       catch (Throwable t)
       {
          // Something went wrong
          safelyRemoveAnyRegisteredContext(context);
+         
          DeploymentException.rethrowAsDeploymentException("Error during register: " + serviceName, t);
       }
    }
@@ -346,9 +361,7 @@
       KernelController controller = kernel.getController();
       try
       {
-         controller.change(context, ControllerState.CREATE);
-         if (ctx.state != ServiceContext.CREATED)
-            log.debug("Waiting in create of " + serviceName + " on " + getUnresolvedDependencies(context, ControllerState.CREATE));
+         doChange(controller, context, ControllerState.CREATE, "create");
       }
       catch (Throwable t)
       {
@@ -386,9 +399,7 @@
       KernelController controller = kernel.getController();
       try
       {
-         controller.change(context, ControllerState.INSTALLED);
-         if (ctx.state != ServiceContext.RUNNING)
-            log.debug("Waiting in start of " + serviceName + " on " + getUnresolvedDependencies(context, ControllerState.START));
+         doChange(controller, context, ControllerState.INSTALLED, "start");
       }
       catch (Throwable t)
       {
@@ -438,7 +449,7 @@
       KernelController controller = kernel.getController();
       try
       {
-         controller.change(context, ControllerState.CREATE);
+         doChange(controller, context, ControllerState.CREATE, null);
       }
       catch (Throwable t)
       {
@@ -475,7 +486,7 @@
       KernelController controller = kernel.getController();
       try
       {
-         controller.change(context, ControllerState.CONFIGURED);
+         doChange(controller, context, ControllerState.CONFIGURED, null);
       }
       catch (Throwable t)
       {
@@ -581,6 +592,39 @@
       installed.clear();
       server = null;
    }
+   
+   /**
+    * Install a context
+    * 
+    * @param controller the controller
+    * @param context the context
+    * @throws Throwable for any error
+    */
+   private void doInstall(KernelController controller, ServiceControllerContext context) throws Throwable
+   {
+      controller.install(context);
+      installed.put(context.getObjectName(), context);
+   }
+   
+   /**
+    * Change a context
+    * 
+    * @param controller the controller
+    * @param context the context
+    * @param requiredState the require state
+    * @param logWait log the waiting dependencies
+    * @throws Throwable for any error
+    */
+   private void doChange(KernelController controller, ServiceControllerContext context, ControllerState requiredState, String logWait) throws Throwable
+   {
+      if (ControllerMode.ON_DEMAND.equals(context.getMode()) == false)
+      {
+         controller.change(context, requiredState);
+         ControllerState state = context.getState();
+         if (logWait != null && requiredState.equals(state) == false && state != ControllerState.ERROR)
+            log.debug("Waiting in " + logWait + " of " + context.getObjectName() + " on " + getUnresolvedDependencies(context, requiredState));
+      }
+   }
 
    /**
     * Sends outs controller notifications about service lifecycle events

Modified: branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/metadata/ServiceAttributeMetaData.java
===================================================================
--- branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/metadata/ServiceAttributeMetaData.java	2006-08-10 17:14:01 UTC (rev 55493)
+++ branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/metadata/ServiceAttributeMetaData.java	2006-08-10 18:05:14 UTC (rev 55494)
@@ -23,6 +23,7 @@
 
 import java.util.Set;
 
+import org.jboss.dependency.spi.ControllerState;
 import org.jboss.deployment.DeploymentException;
 import org.jboss.util.UnreachableStatementException;
 
@@ -151,6 +152,12 @@
          throw new UnreachableStatementException();
       }
    }
+   
+   public void visit(ServiceMetaDataVisitor visitor)
+   {
+      visitor.setContextState(ControllerState.CONFIGURED);
+      visitor.visit(this);
+   }
 
    protected void addChildren(Set<ServiceMetaDataVisitorNode> children)
    {

Modified: branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/metadata/ServiceDependencyListValueMetaData.java
===================================================================
--- branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/metadata/ServiceDependencyListValueMetaData.java	2006-08-10 17:14:01 UTC (rev 55493)
+++ branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/metadata/ServiceDependencyListValueMetaData.java	2006-08-10 18:05:14 UTC (rev 55494)
@@ -164,6 +164,7 @@
       }
       for (String other : list)
       {
+         // TODO visitor.addDependency(new LifecycleDependencyItem(name, other, ControllerState.CONFIGURED));
          visitor.addDependency(new LifecycleDependencyItem(name, other, ControllerState.CREATE));
          visitor.addDependency(new LifecycleDependencyItem(name, other, ControllerState.START));
       }

Modified: branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/metadata/ServiceDependencyValueMetaData.java
===================================================================
--- branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/metadata/ServiceDependencyValueMetaData.java	2006-08-10 17:14:01 UTC (rev 55493)
+++ branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/metadata/ServiceDependencyValueMetaData.java	2006-08-10 18:05:14 UTC (rev 55494)
@@ -199,6 +199,7 @@
       catch (MalformedObjectNameException ignored)
       {
       }
+      // TODO visitor.addDependency(new LifecycleDependencyItem(name, other, ControllerState.CONFIGURED));
       visitor.addDependency(new LifecycleDependencyItem(name, other, ControllerState.CREATE));
       visitor.addDependency(new LifecycleDependencyItem(name, other, ControllerState.START));
       visitor.visit(this);

Added: branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/metadata/ServiceInjectionValueMetaData.java
===================================================================
--- branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/metadata/ServiceInjectionValueMetaData.java	2006-08-10 17:14:01 UTC (rev 55493)
+++ branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/metadata/ServiceInjectionValueMetaData.java	2006-08-10 18:05:14 UTC (rev 55494)
@@ -0,0 +1,189 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt 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.system.metadata;
+
+import org.jboss.beans.info.spi.BeanInfo;
+import org.jboss.dependency.plugins.AbstractDependencyItem;
+import org.jboss.dependency.spi.ControllerContext;
+import org.jboss.dependency.spi.ControllerState;
+import org.jboss.dependency.spi.DependencyItem;
+import org.jboss.joinpoint.spi.TargettedJoinpoint;
+import org.jboss.kernel.spi.config.KernelConfigurator;
+import org.jboss.kernel.spi.dependency.KernelController;
+import org.jboss.system.microcontainer.ServiceControllerContext;
+
+/**
+ * ServiceInjectionValueMetaData.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class ServiceInjectionValueMetaData extends AbstractMetaDataVisitorNode implements ServiceValueMetaData
+{
+   /** The dependency */
+   private Object dependency;
+
+   /** The property */
+   private String property;
+
+   /** The required state of the dependency */
+   private ControllerState dependentState = ControllerState.INSTALLED;
+
+   /**
+    * Create a new ServiceInjectionValueMetaData.
+    */
+   public ServiceInjectionValueMetaData()
+   {
+   }
+
+   /**
+    * Create a new ServiceInjectionValueMetaData.
+    * 
+    * @param dependency the dependency
+    */
+   public ServiceInjectionValueMetaData(Object dependency)
+   {
+      this(dependency, null);
+   }
+   
+   /**
+    * Create a new ServiceInjectionValueMetaData.
+    * 
+    * @param dependency the dependency
+    * @param property the property name
+    */
+   public ServiceInjectionValueMetaData(Object dependency, String property)
+   {
+      this(dependency, property, ControllerState.INSTALLED);
+   }
+   
+   /**
+    * Create a new ServiceInjectionValueMetaData.
+    * 
+    * @param dependency the dependency
+    * @param property the property name
+    * @param dependentState the dependent state
+    */
+   public ServiceInjectionValueMetaData(Object dependency, String property, ControllerState dependentState)
+   {
+      setDependency(dependency);
+      setProperty(property);
+      setDependentState(dependentState);
+   }
+
+   /**
+    * Get the dependency.
+    * 
+    * @return the dependency.
+    */
+   public Object getDependency()
+   {
+      return dependency;
+   }
+
+   /**
+    * Set the dependency.
+    * 
+    * @param dependency the dependency.
+    */
+   public void setDependency(Object dependency)
+   {
+      if (dependency == null)
+         throw new IllegalArgumentException("Null dependency");
+      this.dependency = dependency;
+   }
+
+   /**
+    * Get the property.
+    * 
+    * @return the property.
+    */
+   public String getProperty()
+   {
+      return property;
+   }
+
+   /**
+    * Set the property.
+    * 
+    * @param property the property.
+    */
+   public void setProperty(String property)
+   {
+      this.property = property;
+   }
+
+   /**
+    * Get the dependentState.
+    * 
+    * @return the dependentState.
+    */
+   public ControllerState getDependentState()
+   {
+      return dependentState;
+   }
+
+   /**
+    * Set the dependentState.
+    * 
+    * @param dependentState the dependentState.
+    */
+   public void setDependentState(ControllerState dependentState)
+   {
+      this.dependentState = dependentState;
+   }
+
+   public Object getValue(ServiceValueContext valueContext) throws Throwable
+   {
+      KernelController controller = valueContext.getController();
+      
+      ControllerState state = dependentState;
+      if (state == null)
+         state = ControllerState.INSTALLED;
+
+      ControllerContext context = controller.getContext(dependency, dependentState);
+      if (context == null)
+         throw new Error("Should not be here - dependency failed! " + this);
+      Object result = context.getTarget();
+      if (result != null && property != null)
+      {
+         KernelConfigurator configurator = controller.getKernel().getConfigurator();
+         BeanInfo beanInfo = configurator.getBeanInfo(result.getClass());
+         TargettedJoinpoint joinpoint = configurator.getPropertyGetterJoinPoint(beanInfo, property);
+         joinpoint.setTarget(result);
+         return joinpoint.dispatch();
+      }
+      return result;
+   }
+
+   public void visit(ServiceMetaDataVisitor visitor)
+   {
+      ServiceControllerContext context = visitor.getControllerContext();
+      Object name = context.getName();
+      ControllerState whenRequired = visitor.getContextState();
+
+      DependencyItem item = new AbstractDependencyItem(name, dependency, whenRequired, dependentState);
+      visitor.addDependency(item);
+
+      visitor.visit(this);
+   }
+}

Modified: branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/metadata/ServiceMetaData.java
===================================================================
--- branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/metadata/ServiceMetaData.java	2006-08-10 17:14:01 UTC (rev 55493)
+++ branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/metadata/ServiceMetaData.java	2006-08-10 18:05:14 UTC (rev 55494)
@@ -27,6 +27,7 @@
 
 import javax.management.ObjectName;
 
+import org.jboss.dependency.spi.ControllerMode;
 import org.w3c.dom.Element;
 
 /**
@@ -45,6 +46,9 @@
    
    /** The code */
    private String code;
+
+   /** The mode */
+   private ControllerMode mode;
    
    /** The interface name */
    private String interfaceName;
@@ -115,6 +119,26 @@
    }
 
    /**
+    * Get the mode.
+    * 
+    * @return the mode.
+    */
+   public ControllerMode getMode()
+   {
+      return mode;
+   }
+
+   /**
+    * Set the mode.
+    * 
+    * @param mode the mode.
+    */
+   public void setMode(ControllerMode mode)
+   {
+      this.mode = mode;
+   }
+
+   /**
     * Get the constructor.
     * 
     * @return the constructor.

Modified: branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/metadata/ServiceValueContext.java
===================================================================
--- branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/metadata/ServiceValueContext.java	2006-08-10 17:14:01 UTC (rev 55493)
+++ branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/metadata/ServiceValueContext.java	2006-08-10 18:05:14 UTC (rev 55494)
@@ -24,6 +24,10 @@
 import javax.management.MBeanAttributeInfo;
 import javax.management.MBeanServer;
 
+import org.jboss.kernel.Kernel;
+import org.jboss.kernel.spi.dependency.KernelController;
+import org.jboss.system.ServiceController;
+
 /**
  * ServiceValueContext.
  * 
@@ -35,6 +39,9 @@
    /** The MBeanServer */ 
    private MBeanServer server;
    
+   /** The service controller */
+   private ServiceController controller;
+   
    /** The MBeanAttributeInfo */
    private MBeanAttributeInfo attributeInfo;
    
@@ -58,11 +65,13 @@
     * Create a new ServiceValueContext.
     * 
     * @param server the server
+    * @param controller the service controller
     * @param classloader the classloader
     */
-   public ServiceValueContext(MBeanServer server, ClassLoader classloader)
+   public ServiceValueContext(MBeanServer server, ServiceController controller, ClassLoader classloader)
    {
       this.server = server;
+      this.controller = controller;
       this.classloader = classloader;
    }
 
@@ -70,12 +79,14 @@
     * Create a new ServiceValueContext.
     * 
     * @param server the server
+    * @param controller the service controller
     * @param attributeInfo the attribute info
     * @param classloader the classloader
     */
-   public ServiceValueContext(MBeanServer server, MBeanAttributeInfo attributeInfo, ClassLoader classloader)
+   public ServiceValueContext(MBeanServer server, ServiceController controller, MBeanAttributeInfo attributeInfo, ClassLoader classloader)
    {
       this.server = server;
+      this.controller = controller;
       this.attributeInfo = attributeInfo;
       this.classloader = classloader;
    }
@@ -147,6 +158,13 @@
     */
    public MBeanServer getServer()
    {
+      if (server == null)
+      {
+         if (controller == null)
+            throw new IllegalStateException("No MBeanServer");
+         else
+            return controller.getMBeanServer();
+      }
       return server;
    }
 
@@ -161,6 +179,28 @@
    }
 
    /**
+    * Get the service controller.
+    * 
+    * @return the controller.
+    */
+   public ServiceController getServiceController()
+   {
+      if (controller == null)
+         throw new IllegalStateException("No ServiceController");
+      return controller;
+   }
+
+   /**
+    * Set the service controller.
+    * 
+    * @param controller the controller.
+    */
+   public void setServiceController(ServiceController controller)
+   {
+      this.controller = controller;
+   }
+
+   /**
     * Get the trim.
     * 
     * @return the trim.
@@ -179,4 +219,24 @@
    {
       this.trim = trim;
    }
+   
+   /**
+    * Get the kernel
+    * 
+    * @return the kernel
+    */
+   public Kernel getKernel()
+   {
+      return getServiceController().getKernel();
+   }
+   
+   /**
+    * Get the controller
+    * 
+    * @return the controller
+    */
+   public KernelController getController()
+   {
+      return getKernel().getController();
+   }
 }

Modified: branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/metadata/ServiceValueMetaData.java
===================================================================
--- branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/metadata/ServiceValueMetaData.java	2006-08-10 17:14:01 UTC (rev 55493)
+++ branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/metadata/ServiceValueMetaData.java	2006-08-10 18:05:14 UTC (rev 55494)
@@ -34,7 +34,7 @@
     * 
     * @param valueContext the value context
     * @return the value
-    * @throws Exception for any error
+    * @throws Throwable for any error
     */
-   Object getValue(ServiceValueContext valueContext) throws Exception;
+   Object getValue(ServiceValueContext valueContext) throws Throwable;
 }

Modified: branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/microcontainer/ConfigureAction.java
===================================================================
--- branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/microcontainer/ConfigureAction.java	2006-08-10 17:14:01 UTC (rev 55493)
+++ branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/microcontainer/ConfigureAction.java	2006-08-10 18:05:14 UTC (rev 55494)
@@ -29,6 +29,7 @@
 import org.jboss.system.ServiceBinding;
 import org.jboss.system.ServiceConfigurator;
 import org.jboss.system.ServiceContext;
+import org.jboss.system.ServiceController;
 import org.jboss.system.metadata.ServiceAttributeMetaData;
 import org.jboss.system.metadata.ServiceMetaData;
 
@@ -42,7 +43,8 @@
 {
    public void installAction(ServiceControllerContext context) throws Throwable
    {
-      MBeanServer server = context.getServiceController().getMBeanServer();
+      ServiceController controller = context.getServiceController();
+      MBeanServer server = controller.getMBeanServer();
       ObjectName objectName = context.getObjectName();
 
       // Configure any attributes
@@ -53,7 +55,7 @@
          if (attrs.size() > 0)
          {
             ObjectName classLoaderName = metaData.getClassLoaderName(); 
-            ServiceConfigurator.configure(server, objectName, classLoaderName, attrs);
+            ServiceConfigurator.configure(null, controller, objectName, classLoaderName, attrs);
          }
       }
 

Modified: branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/microcontainer/ServiceControllerContext.java
===================================================================
--- branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/microcontainer/ServiceControllerContext.java	2006-08-10 17:14:01 UTC (rev 55493)
+++ branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/microcontainer/ServiceControllerContext.java	2006-08-10 18:05:14 UTC (rev 55494)
@@ -87,8 +87,12 @@
       this.objectName = metaData.getObjectName();
       serviceContext.objectName = objectName;
       this.serviceController = serviceController;
-      setMode(ControllerMode.MANUAL);
+      ControllerMode mode = metaData.getMode();
       this.serviceMetaData = metaData;
+      if (mode == null)
+         setMode(ControllerMode.MANUAL);
+      else
+         setMode(mode);
    }
    
    /**

Added: branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/controller/configure/value/inject/test/InjectionBeanEmpty_bad.xml
===================================================================
--- branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/controller/configure/value/inject/test/InjectionBeanEmpty_bad.xml	2006-08-10 17:14:01 UTC (rev 55493)
+++ branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/controller/configure/value/inject/test/InjectionBeanEmpty_bad.xml	2006-08-10 18:05:14 UTC (rev 55494)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<server>
+   <mbean name="jboss.test:type=test" code="org.jboss.test.system.controller.support.Simple">
+      <attribute name="Simple"><inject bean=""/></attribute>
+   </mbean>
+</server>
\ No newline at end of file

Added: branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/controller/configure/value/inject/test/InjectionNoBean_bad.xml
===================================================================
--- branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/controller/configure/value/inject/test/InjectionNoBean_bad.xml	2006-08-10 17:14:01 UTC (rev 55493)
+++ branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/controller/configure/value/inject/test/InjectionNoBean_bad.xml	2006-08-10 18:05:14 UTC (rev 55494)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+
+<server>
+   <mbean name="jboss.test:type=test" code="org.jboss.test.system.controller.support.Simple">
+      <attribute name="Simple"><inject/></attribute>
+   </mbean>
+</server>
\ No newline at end of file

Added: branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/controller/configure/value/inject/test/InjectionNotFound_bad.xml
===================================================================
--- branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/controller/configure/value/inject/test/InjectionNotFound_bad.xml	2006-08-10 17:14:01 UTC (rev 55493)
+++ branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/controller/configure/value/inject/test/InjectionNotFound_bad.xml	2006-08-10 18:05:14 UTC (rev 55494)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<server>
+   <mbean name="jboss.test:type=test" code="org.jboss.test.system.controller.support.Simple">
+      <attribute name="Simple"><inject bean="DOESNOTEXIST"/></attribute>
+   </mbean>
+</server>
\ No newline at end of file

Added: branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/controller/configure/value/inject/test/InjectionPropertyNotFound_bad.xml
===================================================================
--- branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/controller/configure/value/inject/test/InjectionPropertyNotFound_bad.xml	2006-08-10 17:14:01 UTC (rev 55493)
+++ branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/controller/configure/value/inject/test/InjectionPropertyNotFound_bad.xml	2006-08-10 18:05:14 UTC (rev 55494)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<server>
+   <mbean name="jboss.test:type=test" code="org.jboss.test.system.controller.support.Simple">
+      <attribute name="Simple"><inject bean="jboss.test:type=depends" property="DOESNOTEXIST"/></attribute>
+   </mbean>
+   
+   <mbean name="jboss.test:type=depends" code="org.jboss.test.system.controller.support.Simple"/>
+</server>
\ No newline at end of file

Added: branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/controller/configure/value/inject/test/InjectionPropertyState_install.xml
===================================================================
--- branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/controller/configure/value/inject/test/InjectionPropertyState_install.xml	2006-08-10 17:14:01 UTC (rev 55493)
+++ branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/controller/configure/value/inject/test/InjectionPropertyState_install.xml	2006-08-10 18:05:14 UTC (rev 55494)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<server>
+   <mbean name="jboss.test:type=test" code="org.jboss.test.system.controller.support.Simple">
+      <attribute name="AString"><inject bean="jboss.test:type=depends" property="AString" state="Instantiated"/></attribute>
+   </mbean>
+   
+   <mbean name="jboss.test:type=depends" code="org.jboss.test.system.controller.support.Simple">
+      <constructor>
+         <arg type="java.lang.String" value="Instantiated"/>
+      </constructor>
+      
+      <!-- Used to stop the dependency moving to the configured state -->
+      <attribute name="AString"><inject bean="DOESNOTEXIST"/></attribute>
+   </mbean>
+</server>
\ No newline at end of file

Added: branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/controller/configure/value/inject/test/InjectionPropertyWrongType_bad.xml
===================================================================
--- branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/controller/configure/value/inject/test/InjectionPropertyWrongType_bad.xml	2006-08-10 17:14:01 UTC (rev 55493)
+++ branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/controller/configure/value/inject/test/InjectionPropertyWrongType_bad.xml	2006-08-10 18:05:14 UTC (rev 55494)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<server>
+   <mbean name="jboss.test:type=test" code="org.jboss.test.system.controller.support.Simple">
+      <attribute name="Simple"><inject bean="jboss.test:type=depends" property="AString"/></attribute>
+   </mbean>
+   
+   <mbean name="jboss.test:type=depends" code="org.jboss.test.system.controller.support.Simple">
+      <attribute name="AString">Wrong</attribute>
+   </mbean>
+</server>
\ No newline at end of file

Added: branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/controller/configure/value/inject/test/InjectionProperty_install.xml
===================================================================
--- branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/controller/configure/value/inject/test/InjectionProperty_install.xml	2006-08-10 17:14:01 UTC (rev 55493)
+++ branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/controller/configure/value/inject/test/InjectionProperty_install.xml	2006-08-10 18:05:14 UTC (rev 55494)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<server>
+   <mbean name="jboss.test:type=test" code="org.jboss.test.system.controller.support.Simple">
+      <attribute name="AString"><inject bean="jboss.test:type=depends" property="AString"/></attribute>
+   </mbean>
+   
+   <mbean name="jboss.test:type=depends" code="org.jboss.test.system.controller.support.Simple">
+      <attribute name="AString">PropertyInjection</attribute>
+   </mbean>
+</server>
\ No newline at end of file

Added: branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/controller/configure/value/inject/test/InjectionWrongType_bad.xml
===================================================================
--- branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/controller/configure/value/inject/test/InjectionWrongType_bad.xml	2006-08-10 17:14:01 UTC (rev 55493)
+++ branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/controller/configure/value/inject/test/InjectionWrongType_bad.xml	2006-08-10 18:05:14 UTC (rev 55494)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<server>
+   <mbean name="jboss.test:type=test" code="org.jboss.test.system.controller.support.Simple">
+      <attribute name="AString"><inject bean="jboss.test:type=depends"/></attribute>
+   </mbean>
+   
+   <mbean name="jboss.test:type=depends" code="org.jboss.test.system.controller.support.Simple"/>
+</server>
\ No newline at end of file

Added: branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/controller/configure/value/inject/test/Injection_install.xml
===================================================================
--- branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/controller/configure/value/inject/test/Injection_install.xml	2006-08-10 17:14:01 UTC (rev 55493)
+++ branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/controller/configure/value/inject/test/Injection_install.xml	2006-08-10 18:05:14 UTC (rev 55494)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<server>
+   <mbean name="jboss.test:type=test" code="org.jboss.test.system.controller.support.Simple">
+      <attribute name="Simple"><inject bean="jboss.test:type=depends"/></attribute>
+   </mbean>
+   
+   <mbean name="jboss.test:type=depends" code="org.jboss.test.system.controller.support.Simple"/>
+</server>
\ No newline at end of file

Added: branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/controller/integration/test/ConfigureJMXFromMCUnitTestCase-mc.xml
===================================================================
--- branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/controller/integration/test/ConfigureJMXFromMCUnitTestCase-mc.xml	2006-08-10 17:14:01 UTC (rev 55493)
+++ branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/controller/integration/test/ConfigureJMXFromMCUnitTestCase-mc.xml	2006-08-10 18:05:14 UTC (rev 55494)
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+   <bean name="Test" class="org.jboss.test.system.controller.integration.support.SimpleBean"/>
+</deployment>

Added: branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/controller/integration/test/ConfigureJMXFromMCUnitTestCase.xml
===================================================================
--- branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/controller/integration/test/ConfigureJMXFromMCUnitTestCase.xml	2006-08-10 17:14:01 UTC (rev 55493)
+++ branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/controller/integration/test/ConfigureJMXFromMCUnitTestCase.xml	2006-08-10 18:05:14 UTC (rev 55494)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<server>
+   <mbean name="jboss.test:type=test" code="org.jboss.test.system.controller.support.Simple">
+      <attribute name="SimpleBean"><inject bean="Test"/></attribute>
+   </mbean>
+</server>
\ No newline at end of file

Added: branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/controller/lifecycle/seperated/test/NewOnDemandDependency_1.xml
===================================================================
--- branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/controller/lifecycle/seperated/test/NewOnDemandDependency_1.xml	2006-08-10 17:14:01 UTC (rev 55493)
+++ branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/controller/lifecycle/seperated/test/NewOnDemandDependency_1.xml	2006-08-10 18:05:14 UTC (rev 55494)
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<server>
+   <mbean name="test:name=1" code="org.jboss.test.system.controller.support.Simple" mode="On Demand"/>
+</server>
\ No newline at end of file

Added: branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/controller/lifecycle/seperated/test/NewOnDemandDependency_2.xml
===================================================================
--- branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/controller/lifecycle/seperated/test/NewOnDemandDependency_2.xml	2006-08-10 17:14:01 UTC (rev 55493)
+++ branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/controller/lifecycle/seperated/test/NewOnDemandDependency_2.xml	2006-08-10 18:05:14 UTC (rev 55494)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<server>
+   <mbean name="test:name=2" code="org.jboss.test.system.controller.support.Simple">
+      <depends>test:name=1</depends>
+   </mbean>
+</server>
\ No newline at end of file

Added: branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/controller/lifecycle/seperated/test/NewOnDemandServerDependency_1.xml
===================================================================
--- branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/controller/lifecycle/seperated/test/NewOnDemandServerDependency_1.xml	2006-08-10 17:14:01 UTC (rev 55493)
+++ branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/controller/lifecycle/seperated/test/NewOnDemandServerDependency_1.xml	2006-08-10 18:05:14 UTC (rev 55494)
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<server mode="On Demand">
+   <mbean name="test:name=1" code="org.jboss.test.system.controller.support.Simple"/>
+</server>
\ No newline at end of file

Added: branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/controller/lifecycle/seperated/test/NewOnDemandServerDependency_2.xml
===================================================================
--- branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/controller/lifecycle/seperated/test/NewOnDemandServerDependency_2.xml	2006-08-10 17:14:01 UTC (rev 55493)
+++ branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/controller/lifecycle/seperated/test/NewOnDemandServerDependency_2.xml	2006-08-10 18:05:14 UTC (rev 55494)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<server>
+   <mbean name="test:name=2" code="org.jboss.test.system.controller.support.Simple">
+      <depends>test:name=1</depends>
+   </mbean>
+</server>
\ No newline at end of file

Added: branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/metadata/attributes/test/AttributeValueInject.xml
===================================================================
--- branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/metadata/attributes/test/AttributeValueInject.xml	2006-08-10 17:14:01 UTC (rev 55493)
+++ branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/metadata/attributes/test/AttributeValueInject.xml	2006-08-10 18:05:14 UTC (rev 55494)
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<mbean name="jboss.test:type=BasicMBeanName" code="BasicMBeanCode">
+   <attribute name="Attribute"><inject bean="bean" property="property"/></attribute>
+</mbean>
\ No newline at end of file

Added: branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/metadata/basic/test/BasicMBeanMode.xml
===================================================================
--- branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/metadata/basic/test/BasicMBeanMode.xml	2006-08-10 17:14:01 UTC (rev 55493)
+++ branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/metadata/basic/test/BasicMBeanMode.xml	2006-08-10 18:05:14 UTC (rev 55494)
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<mbean name="jboss.test:type=BasicMBeanName" code="BasicMBeanCode" mode="On Demand"/>
\ No newline at end of file

Added: branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/metadata/value/inject/test/Injection.xml
===================================================================
--- branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/metadata/value/inject/test/Injection.xml	2006-08-10 17:14:01 UTC (rev 55493)
+++ branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/metadata/value/inject/test/Injection.xml	2006-08-10 18:05:14 UTC (rev 55494)
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<mbean name="jboss.test:type=BasicMBeanName" code="BasicMBeanCode">
+   <attribute name="Attribute"><inject bean="bean"/></attribute>
+</mbean>
\ No newline at end of file

Added: branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/metadata/value/inject/test/InjectionEmpty.xml
===================================================================
--- branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/metadata/value/inject/test/InjectionEmpty.xml	2006-08-10 17:14:01 UTC (rev 55493)
+++ branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/metadata/value/inject/test/InjectionEmpty.xml	2006-08-10 18:05:14 UTC (rev 55494)
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<mbean name="jboss.test:type=BasicMBeanName" code="BasicMBeanCode">
+   <attribute name="Attribute"><inject bean=""/></attribute>
+</mbean>
\ No newline at end of file

Added: branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/metadata/value/inject/test/InjectionProperty.xml
===================================================================
--- branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/metadata/value/inject/test/InjectionProperty.xml	2006-08-10 17:14:01 UTC (rev 55493)
+++ branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/metadata/value/inject/test/InjectionProperty.xml	2006-08-10 18:05:14 UTC (rev 55494)
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<mbean name="jboss.test:type=BasicMBeanName" code="BasicMBeanCode">
+   <attribute name="Attribute"><inject bean="bean" property="property"/></attribute>
+</mbean>
\ No newline at end of file

Added: branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/metadata/value/inject/test/InjectionPropertyState.xml
===================================================================
--- branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/metadata/value/inject/test/InjectionPropertyState.xml	2006-08-10 17:14:01 UTC (rev 55493)
+++ branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/metadata/value/inject/test/InjectionPropertyState.xml	2006-08-10 18:05:14 UTC (rev 55494)
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<mbean name="jboss.test:type=BasicMBeanName" code="BasicMBeanCode">
+   <attribute name="Attribute"><inject bean="bean" property="property" state="Instantiated"/></attribute>
+</mbean>
\ No newline at end of file

Added: branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/metadata/value/inject/test/InjectionState.xml
===================================================================
--- branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/metadata/value/inject/test/InjectionState.xml	2006-08-10 17:14:01 UTC (rev 55493)
+++ branches/MC_VDF_WORK/system-jmx/src/resources/tests/org/jboss/test/system/metadata/value/inject/test/InjectionState.xml	2006-08-10 18:05:14 UTC (rev 55494)
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<mbean name="jboss.test:type=BasicMBeanName" code="BasicMBeanCode">
+   <attribute name="Attribute"><inject bean="bean" state="Instantiated"/></attribute>
+</mbean>
\ No newline at end of file

Modified: branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/controller/AbstractControllerTest.java
===================================================================
--- branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/controller/AbstractControllerTest.java	2006-08-10 17:14:01 UTC (rev 55493)
+++ branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/controller/AbstractControllerTest.java	2006-08-10 18:05:14 UTC (rev 55494)
@@ -148,6 +148,31 @@
       assertNoService(name);
       assertNotRegistered(name);
    }
+
+   protected List<ObjectName> assertDeploy(ObjectName name) throws Exception
+   {
+      
+      String resource = getName();
+      resource = resource.substring(4) + "_install.xml";
+      List<ObjectName> result = deploy(resource);
+      
+      assertServiceRunning(name);
+      assertRegistered(name);
+      
+      return result;
+   }
+
+   protected void assertUndeploy(ObjectName name) throws Exception
+   {
+      assertUndeploy(name, Collections.singletonList(name));
+   }
+
+   protected void assertUndeploy(ObjectName name, List<ObjectName> names) throws Exception
+   {
+      uninstall(names);
+      assertNoService(name);
+      assertNotRegistered(name);
+   }
    
    protected void validate() throws Exception
    {
@@ -167,16 +192,29 @@
    
    protected List<ObjectName> assertDeployFailure(ObjectName name, Class<? extends Throwable> expected) throws Exception
    {
+      return assertDeployFailure(name, ServiceContext.FAILED, expected);
+   }
+   
+   protected List<ObjectName> assertDeployFailure(ObjectName name, int expectedState, Class<? extends Throwable> expected) throws Exception
+   {
       String resource = getName();
       resource = resource.substring(4) + "_bad.xml";
-      return assertDeployFailure(resource, name, expected);
+      return assertDeployFailure(resource, name, expectedState, expected);
    }
    
    protected List<ObjectName> assertDeployFailure(String resource, ObjectName name, Class<? extends Throwable> expected) throws Exception
    {
+      return assertDeployFailure(resource, name, ServiceContext.FAILED, expected);
+   }
+   
+   protected List<ObjectName> assertDeployFailure(String resource, ObjectName name, int expectedState, Class<? extends Throwable> expected) throws Exception
+   {
       URL url = getResourceURL(resource);
       List<ObjectName> result = getControllerDelegate().assertDeployFailure(url, name, expected);
-      assertServiceFailed(name, OLD_REGISTERED);
+      if (expectedState == ServiceContext.FAILED)
+         assertServiceFailed(name, OLD_REGISTERED);
+      else
+         assertServiceState(name, expectedState);
       return result;
    }
 
@@ -259,6 +297,11 @@
       getControllerDelegate().assertServiceFailed(name, registered);
    }
    
+   protected void assertServiceInstalled(ObjectName name) throws Exception
+   {
+      assertServiceState(name, ServiceContext.INSTALLED, true);
+   }
+   
    protected void assertServiceConfigured(ObjectName name) throws Exception
    {
       assertServiceState(name, ServiceContext.CONFIGURED, true);

Modified: branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/controller/ControllerTestDelegate.java
===================================================================
--- branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/controller/ControllerTestDelegate.java	2006-08-10 17:14:01 UTC (rev 55493)
+++ branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/controller/ControllerTestDelegate.java	2006-08-10 18:05:14 UTC (rev 55494)
@@ -21,6 +21,7 @@
 */
 package org.jboss.test.system.controller;
 
+import java.lang.reflect.UndeclaredThrowableException;
 import java.net.URL;
 import java.util.Collection;
 import java.util.Collections;
@@ -248,9 +249,21 @@
          ServiceContext ctx = (ServiceContext) i.next();
          if (name.equals(ctx.objectName))
          {
-            if (ctx.problem == null)
-               throw new AssertionFailedError("Did not get expected " + expected.getName() + " for " + ctx);
-            AbstractSystemTest.checkThrowableDeep(expected, ctx.problem);
+            if (e != null || expected != null)
+            {
+               if (expected != null && ctx.problem == null)
+                  throw new AssertionFailedError("Did not get expected " + expected.getName() + " for " + ctx);
+               if (expected == null && ctx.problem != null)
+               {
+                  if (ctx.problem instanceof Exception)
+                     throw (Exception) ctx.problem;
+                  if (ctx.problem instanceof Error)
+                     throw (Error) ctx.problem;
+                  throw new UndeclaredThrowableException(ctx.problem);
+               }
+               if (expected != null)
+                  AbstractSystemTest.checkThrowableDeep(expected, ctx.problem);
+            }
             return;
          }
       }

Modified: branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/controller/configure/value/ControllerConfigureValueTestSuite.java
===================================================================
--- branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/controller/configure/value/ControllerConfigureValueTestSuite.java	2006-08-10 17:14:01 UTC (rev 55493)
+++ branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/controller/configure/value/ControllerConfigureValueTestSuite.java	2006-08-10 18:05:14 UTC (rev 55494)
@@ -27,6 +27,7 @@
 import org.jboss.test.system.controller.configure.value.dependslist.test.DependencyListValueOldUnitTestCase;
 import org.jboss.test.system.controller.configure.value.element.test.ElementValueNewUnitTestCase;
 import org.jboss.test.system.controller.configure.value.element.test.ElementValueOldUnitTestCase;
+import org.jboss.test.system.controller.configure.value.inject.test.NewInjectionValueUnitTestCase;
 import org.jboss.test.system.controller.configure.value.javabean.test.JavaBeanValueNewUnitTestCase;
 import org.jboss.test.system.controller.configure.value.javabean.test.JavaBeanValueOldUnitTestCase;
 import org.jboss.test.system.controller.configure.value.jbxb.test.JBXBValueNewUnitTestCase;
@@ -67,6 +68,7 @@
       suite.addTest(JavaBeanValueNewUnitTestCase.suite());
       suite.addTest(JBXBValueOldUnitTestCase.suite());
       suite.addTest(JBXBValueNewUnitTestCase.suite());
+      suite.addTest(NewInjectionValueUnitTestCase.suite());
       
       return suite;
    }

Added: branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/controller/configure/value/inject/test/NewInjectionValueUnitTestCase.java
===================================================================
--- branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/controller/configure/value/inject/test/NewInjectionValueUnitTestCase.java	2006-08-10 17:14:01 UTC (rev 55493)
+++ branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/controller/configure/value/inject/test/NewInjectionValueUnitTestCase.java	2006-08-10 18:05:14 UTC (rev 55494)
@@ -0,0 +1,145 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt 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.configure.value.inject.test;
+
+import java.util.List;
+
+import javax.management.InvalidAttributeValueException;
+import javax.management.ObjectName;
+
+import junit.framework.Test;
+
+import org.jboss.joinpoint.spi.JoinpointException;
+import org.jboss.mx.util.ObjectNameFactory;
+import org.jboss.system.ServiceContext;
+import org.jboss.test.AbstractTestDelegate;
+import org.jboss.test.system.controller.AbstractControllerTest;
+import org.jboss.test.system.controller.support.Simple;
+import org.jboss.test.system.controller.support.SimpleMBean;
+
+/**
+ * NewInjectionValueUnitTestCase.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class NewInjectionValueUnitTestCase extends AbstractControllerTest
+{
+   private static ObjectName OTHER = ObjectNameFactory.create("jboss.test:type=depends");
+   
+   public static Test suite()
+   {
+      return suite(NewInjectionValueUnitTestCase.class);
+   }
+
+   public static AbstractTestDelegate getDelegate(Class clazz) throws Exception
+   {
+      return getNewControllerDelegate(clazz);
+   }
+
+   public NewInjectionValueUnitTestCase(String name)
+   {
+      super(name);
+   }
+
+   public void testInjection() throws Exception
+   {
+      ObjectName name = SimpleMBean.OBJECT_NAME;
+      
+      List<ObjectName> names = assertDeploy(name);
+      try
+      {
+         Simple test = getSimple();
+         Simple other = getMBean(Simple.class, OTHER, "Instance");
+         
+         assertEquals(other, test.getSimple());
+      }
+      finally
+      {
+         assertUndeploy(name, names);
+      }
+   }
+
+   public void testInjectionNoBean() throws Exception
+   {
+      assertDeployFailure(SimpleMBean.OBJECT_NAME, ServiceContext.INSTALLED, null);
+   }
+
+   public void testInjectionBeanEmpty() throws Exception
+   {
+      assertDeployFailure(SimpleMBean.OBJECT_NAME, ServiceContext.INSTALLED, null);
+   }
+
+   public void testInjectionNotFound() throws Exception
+   {
+      assertDeployFailure(SimpleMBean.OBJECT_NAME, ServiceContext.INSTALLED, null);
+   }
+
+   public void testInjectionWrongType() throws Exception
+   {
+      assertDeployFailure(SimpleMBean.OBJECT_NAME, InvalidAttributeValueException.class);
+   }
+
+   public void testInjectionProperty() throws Exception
+   {
+      ObjectName name = SimpleMBean.OBJECT_NAME;
+      
+      List<ObjectName> names = assertDeploy(name);
+      try
+      {
+         Simple test = getSimple();
+         
+         assertEquals("PropertyInjection", test.getAString());
+      }
+      finally
+      {
+         assertUndeploy(name, names);
+      }
+   }
+
+   public void testInjectionPropertyState() throws Exception
+   {
+      ObjectName name = SimpleMBean.OBJECT_NAME;
+      
+      List<ObjectName> names = assertDeploy(name);
+      try
+      {
+         Simple test = getSimple();
+         
+         assertEquals("Instantiated", test.getAString());
+      }
+      finally
+      {
+         assertUndeploy(name, names);
+      }
+   }
+
+   public void testInjectionPropertyNotFound() throws Exception
+   {
+      assertDeployFailure(SimpleMBean.OBJECT_NAME, JoinpointException.class);
+   }
+
+   public void testInjectionPropertyWrongType() throws Exception
+   {
+      assertDeployFailure(SimpleMBean.OBJECT_NAME, InvalidAttributeValueException.class);
+   }
+}

Added: branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/controller/integration/test/ConfigureJMXFromMCUnitTestCase.java
===================================================================
--- branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/controller/integration/test/ConfigureJMXFromMCUnitTestCase.java	2006-08-10 17:14:01 UTC (rev 55493)
+++ branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/controller/integration/test/ConfigureJMXFromMCUnitTestCase.java	2006-08-10 18:05:14 UTC (rev 55494)
@@ -0,0 +1,48 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt 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.integration.test;
+
+import junit.framework.Test;
+
+/**
+ * ConfigureJMXFromMCUnitTestCase.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class ConfigureJMXFromMCUnitTestCase extends InjectJMXFromMCTest
+{
+   public static Test suite()
+   {
+      return suite(ConfigureJMXFromMCUnitTestCase.class);
+   }
+
+   public ConfigureJMXFromMCUnitTestCase(String name)
+   {
+      super(name);
+   }
+   
+   public void testConfigureJMXFromMC() throws Throwable
+   {
+      checkInject();
+   }
+}

Added: branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/controller/integration/test/InjectJMXFromMCTest.java
===================================================================
--- branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/controller/integration/test/InjectJMXFromMCTest.java	2006-08-10 17:14:01 UTC (rev 55493)
+++ branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/controller/integration/test/InjectJMXFromMCTest.java	2006-08-10 18:05:14 UTC (rev 55494)
@@ -0,0 +1,55 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt 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.integration.test;
+
+import org.jboss.dependency.spi.ControllerContext;
+import org.jboss.test.system.controller.integration.support.SimpleBean;
+import org.jboss.test.system.controller.support.Simple;
+
+/**
+ * InjectJMXFromMCTest.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class InjectJMXFromMCTest extends AbstractIntegrationTest
+{
+   public InjectJMXFromMCTest(String name)
+   {
+      super(name);
+   }
+   
+   public void checkInject() throws Throwable
+   {
+      Simple simple = getSimple();
+
+      ControllerContext beanContext = getControllerContext("Test");
+      assertNotNull(beanContext);
+      Object bean = beanContext.getTarget();
+      assertNotNull(bean);
+      assertTrue(bean instanceof SimpleBean);
+      
+      Object injected = simple.getSimpleBean();
+      
+      assertTrue("Bean was not injected: ", bean == injected);
+   }
+}

Modified: branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/controller/integration/test/InjectMCFromJMXTest.java
===================================================================
--- branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/controller/integration/test/InjectMCFromJMXTest.java	2006-08-10 17:14:01 UTC (rev 55493)
+++ branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/controller/integration/test/InjectMCFromJMXTest.java	2006-08-10 18:05:14 UTC (rev 55494)
@@ -24,8 +24,6 @@
 import org.jboss.dependency.spi.ControllerContext;
 import org.jboss.test.system.controller.integration.support.SimpleBean;
 
-import junit.framework.Test;
-
 /**
  * InjectMCFromJMXTest.
  * 
@@ -34,11 +32,6 @@
  */
 public abstract class InjectMCFromJMXTest extends AbstractIntegrationTest
 {
-   public static Test suite()
-   {
-      return suite(InjectMCFromJMXTest.class);
-   }
-
    public InjectMCFromJMXTest(String name)
    {
       super(name);

Modified: branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/controller/integration/test/IntegrationTestSuite.java
===================================================================
--- branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/controller/integration/test/IntegrationTestSuite.java	2006-08-10 17:14:01 UTC (rev 55493)
+++ branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/controller/integration/test/IntegrationTestSuite.java	2006-08-10 18:05:14 UTC (rev 55494)
@@ -47,6 +47,7 @@
       suite.addTest(CreateMCFromJMXUnitTestCase.suite());
       suite.addTest(StartMCFromJMXUnitTestCase.suite());
       suite.addTest(InstallMCFromJMXUnitTestCase.suite());
+      suite.addTest(ConfigureJMXFromMCUnitTestCase.suite());
       
       return suite;
    }

Modified: branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/controller/lifecycle/seperated/test/ControllerLifecycleSeperatedTestSuite.java
===================================================================
--- branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/controller/lifecycle/seperated/test/ControllerLifecycleSeperatedTestSuite.java	2006-08-10 17:14:01 UTC (rev 55493)
+++ branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/controller/lifecycle/seperated/test/ControllerLifecycleSeperatedTestSuite.java	2006-08-10 18:05:14 UTC (rev 55494)
@@ -52,6 +52,8 @@
       suite.addTest(DependsBrokenCreateNewUnitTestCase.suite());
       suite.addTest(DependsBrokenStartOldUnitTestCase.suite());
       suite.addTest(DependsBrokenStartNewUnitTestCase.suite());
+      suite.addTest(NewOnDemandDependencyUnitTestCase.suite());
+      suite.addTest(NewOnDemandServerDependencyUnitTestCase.suite());
       
       return suite;
    }

Added: branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/controller/lifecycle/seperated/test/NewOnDemandDependencyTest.java
===================================================================
--- branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/controller/lifecycle/seperated/test/NewOnDemandDependencyTest.java	2006-08-10 17:14:01 UTC (rev 55493)
+++ branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/controller/lifecycle/seperated/test/NewOnDemandDependencyTest.java	2006-08-10 18:05:14 UTC (rev 55494)
@@ -0,0 +1,501 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt 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.lifecycle.seperated.test;
+
+import java.util.List;
+
+import javax.management.ObjectName;
+
+import org.jboss.mx.util.ObjectNameFactory;
+import org.jboss.test.AbstractTestDelegate;
+import org.jboss.test.system.controller.AbstractControllerTest;
+import org.jboss.test.system.controller.support.Simple;
+
+/**
+ * NewOnDemandDependencyTest.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class NewOnDemandDependencyTest extends AbstractControllerTest
+{
+   private static ObjectName NAME_ONE = ObjectNameFactory.create("test:name=1"); 
+   private static ObjectName NAME_TWO = ObjectNameFactory.create("test:name=2"); 
+   
+   protected String resourceName1;
+   protected String resourceName2;
+   
+   public NewOnDemandDependencyTest(String name)
+   {
+      super(name);
+   }
+
+   public static AbstractTestDelegate getDelegate(Class clazz) throws Exception
+   {
+      return getNewControllerDelegate(clazz);
+   }
+   
+   public void testDeployCorrectOrder() throws Exception
+   {
+      Simple test1 = null;
+      Simple test2 = null;
+      
+      boolean error = false;
+      
+      List<ObjectName> mbeans1 = deploy(resourceName1);
+      try
+      {
+         assertServiceInstalled(NAME_ONE);
+         assertNotRegistered(NAME_ONE);
+         assertNoService(NAME_TWO);
+
+         List<ObjectName> mbeans2 = deploy(resourceName2);
+         try
+         {
+            assertServiceRunning(NAME_ONE);
+            assertServiceRunning(NAME_TWO);
+            
+            test1 = getMBean(Simple.class, NAME_ONE, "Instance");
+            assertEquals(1, test1.createOrder);
+            assertEquals(3, test1.startOrder);
+            assertEquals(0, test1.stopOrder);
+            assertEquals(0, test1.destroyOrder);
+            test2 = getMBean(Simple.class, NAME_TWO, "Instance");
+            assertEquals("()", test2.constructorUsed);
+            assertEquals(2, test2.createOrder);
+            assertEquals(4, test2.startOrder);
+            assertEquals(0, test2.stopOrder);
+            assertEquals(0, test2.destroyOrder);
+         }
+         catch (Exception e)
+         {
+            error = true;
+            throw e;
+         }
+         catch (Error e)
+         {
+            error = true;
+            throw e;
+         }
+         finally
+         {
+            undeploy(mbeans2);
+
+            if (error == false)
+            {
+               assertServiceRunning(NAME_ONE);
+               assertEquals(1, test1.createOrder);
+               assertEquals(3, test1.startOrder);
+               assertEquals(0, test1.stopOrder);
+               assertEquals(0, test1.destroyOrder);
+               assertNoService(NAME_TWO);
+               assertNotRegistered(NAME_TWO);
+               assertEquals(2, test2.createOrder);
+               assertEquals(4, test2.startOrder);
+               assertEquals(5, test2.stopOrder);
+               assertEquals(6, test2.destroyOrder);
+            }
+         }
+      }
+      catch (Exception e)
+      {
+         error = true;
+         throw e;
+      }
+      catch (Error e)
+      {
+         error = true;
+         throw e;
+      }
+      finally
+      {
+         undeploy(mbeans1);
+
+         if (error == false)
+         {
+            assertNoService(NAME_ONE);
+            assertNotRegistered(NAME_ONE);
+            assertEquals(1, test1.createOrder);
+            assertEquals(3, test1.startOrder);
+            assertEquals(7, test1.stopOrder);
+            assertEquals(8, test1.destroyOrder);
+            assertNoService(NAME_TWO);
+            assertNotRegistered(NAME_TWO);
+            if (test2 != null)
+            {
+               assertEquals(2, test2.createOrder);
+               assertEquals(4, test2.startOrder);
+               assertEquals(5, test2.stopOrder);
+               assertEquals(6, test2.destroyOrder);
+            }
+         }
+      }
+   }
+   
+   public void testDeployWrongOrder() throws Exception
+   {
+      Simple test1 = null;
+      Simple test2 = null;
+      
+      boolean error = false;
+      
+      List<ObjectName> mbeans2 = deploy(resourceName2);
+      try
+      {
+         assertServiceConfigured(NAME_TWO);
+         
+         test2 = getMBean(Simple.class, NAME_TWO, "Instance");
+         assertEquals("()", test2.constructorUsed);
+         assertEquals(0, test2.createOrder);
+         assertEquals(0, test2.startOrder);
+         assertEquals(0, test2.stopOrder);
+         assertEquals(0, test2.destroyOrder);
+
+         List<ObjectName> mbeans1 = deploy(resourceName1);
+         try
+         {
+            assertServiceRunning(NAME_TWO);
+            assertServiceRunning(NAME_ONE);
+            
+            assertEquals(2, test2.createOrder);
+            assertEquals(4, test2.startOrder);
+            assertEquals(0, test2.stopOrder);
+            assertEquals(0, test2.destroyOrder);
+            test1 = getMBean(Simple.class, NAME_ONE, "Instance");
+            assertEquals("()", test1.constructorUsed);
+            assertEquals(1, test1.createOrder);
+            assertEquals(3, test1.startOrder);
+            assertEquals(0, test1.stopOrder);
+            assertEquals(0, test1.destroyOrder);
+         }
+         catch (Exception e)
+         {
+            error = true;
+            throw e;
+         }
+         catch (Error e)
+         {
+            error = true;
+            throw e;
+         }
+         finally
+         {
+            undeploy(mbeans1);
+
+            if (error == false)
+            {
+               assertServiceDestroyed(NAME_TWO);
+               assertEquals(2, test2.createOrder);
+               assertEquals(4, test2.startOrder);
+               assertEquals(5, test2.stopOrder);
+               assertEquals(7, test2.destroyOrder);
+               assertNotRegistered(NAME_ONE);
+               assertEquals(1, test1.createOrder);
+               assertEquals(3, test1.startOrder);
+               assertEquals(6, test1.stopOrder);
+               assertEquals(8, test1.destroyOrder);
+            }
+         }
+      }
+      catch (Exception e)
+      {
+         error = true;
+         throw e;
+      }
+      catch (Error e)
+      {
+         error = true;
+         throw e;
+      }
+      finally
+      {
+         undeploy(mbeans2);
+
+         if (error == false)
+         {
+            assertNoService(NAME_TWO);
+            assertNotRegistered(NAME_TWO);
+            assertEquals(2, test2.createOrder);
+            assertEquals(4, test2.startOrder);
+            assertEquals(5, test2.stopOrder);
+            assertEquals(7, test2.destroyOrder);
+            assertNoService(NAME_ONE);
+            assertNotRegistered(NAME_ONE);
+            if (test1 != null)
+            {
+               assertEquals(1, test1.createOrder);
+               assertEquals(3, test1.startOrder);
+               assertEquals(6, test1.stopOrder);
+               assertEquals(8, test1.destroyOrder);
+            }
+         }
+      }
+   }
+   
+   public void testRedeployOne() throws Exception
+   {
+      Simple test1 = null;
+      Simple test2 = null;
+      
+      boolean error = false;
+      
+      List<ObjectName> mbeans1 = deploy(resourceName1);
+      try
+      {
+         List<ObjectName> mbeans2 = deploy(resourceName2);
+         try
+         {
+            assertServiceRunning(NAME_ONE);
+            assertServiceRunning(NAME_TWO);
+            
+            test1 = getMBean(Simple.class, NAME_ONE, "Instance");
+            assertEquals("()", test1.constructorUsed);
+            assertEquals(1, test1.createOrder);
+            assertEquals(3, test1.startOrder);
+            assertEquals(0, test1.stopOrder);
+            assertEquals(0, test1.destroyOrder);
+            test2 = getMBean(Simple.class, NAME_TWO, "Instance");
+            assertEquals("()", test2.constructorUsed);
+            assertEquals(2, test2.createOrder);
+            assertEquals(4, test2.startOrder);
+            assertEquals(0, test2.stopOrder);
+            assertEquals(0, test2.destroyOrder);
+            
+            undeploy(mbeans1);
+
+            assertNotRegistered(NAME_ONE);
+            assertServiceDestroyed(NAME_TWO);
+            
+            assertEquals(1, test1.createOrder);
+            assertEquals(3, test1.startOrder);
+            assertEquals(6, test1.stopOrder);
+            assertEquals(8, test1.destroyOrder);
+            assertEquals(2, test2.createOrder);
+            assertEquals(4, test2.startOrder);
+            assertEquals(5, test2.stopOrder);
+            assertEquals(7, test2.destroyOrder);
+            
+            mbeans1 = deploy(resourceName1);
+
+            assertServiceRunning(NAME_ONE);
+            assertServiceRunning(NAME_TWO);
+            
+            test1 = getMBean(Simple.class, NAME_ONE, "Instance");
+            assertEquals("()", test1.constructorUsed);
+            assertEquals(9, test1.createOrder);
+            assertEquals(11, test1.startOrder);
+            assertEquals(0, test1.stopOrder);
+            assertEquals(0, test1.destroyOrder);
+            assertEquals(10, test2.createOrder);
+            assertEquals(12, test2.startOrder);
+            assertEquals(5, test2.stopOrder);
+            assertEquals(7, test2.destroyOrder);
+         }
+         catch (Exception e)
+         {
+            error = true;
+            throw e;
+         }
+         catch (Error e)
+         {
+            error = true;
+            throw e;
+         }
+         finally
+         {
+            undeploy(mbeans2);
+
+            if (error == false)
+            {
+               assertServiceRunning(NAME_ONE);
+               assertEquals(9, test1.createOrder);
+               assertEquals(11, test1.startOrder);
+               assertEquals(0, test1.stopOrder);
+               assertEquals(0, test1.destroyOrder);
+               assertNoService(NAME_TWO);
+               assertNotRegistered(NAME_TWO);
+               assertEquals(10, test2.createOrder);
+               assertEquals(12, test2.startOrder);
+               assertEquals(13, test2.stopOrder);
+               assertEquals(14, test2.destroyOrder);
+            }
+         }
+      }
+      catch (Exception e)
+      {
+         error = true;
+         throw e;
+      }
+      catch (Error e)
+      {
+         error = true;
+         throw e;
+      }
+      finally
+      {
+         undeploy(mbeans1);
+
+         if (error == false)
+         {
+            assertNoService(NAME_ONE);
+            assertNotRegistered(NAME_ONE);
+            assertEquals(9, test1.createOrder);
+            assertEquals(11, test1.startOrder);
+            assertEquals(15, test1.stopOrder);
+            assertEquals(16, test1.destroyOrder);
+            assertNoService(NAME_TWO);
+            assertNotRegistered(NAME_TWO);
+            if (test2 != null)
+            {
+               assertEquals(10, test2.createOrder);
+               assertEquals(12, test2.startOrder);
+               assertEquals(13, test2.stopOrder);
+               assertEquals(14, test2.destroyOrder);
+            }
+         }
+      }
+   }
+   
+   public void testRedeployTwo() throws Exception
+   {
+      Simple test1 = null;
+      Simple test2 = null;
+      
+      boolean error = false;
+      
+      List<ObjectName> mbeans1 = deploy(resourceName1);
+      try
+      {
+         List<ObjectName> mbeans2 = deploy(resourceName2);
+         try
+         {
+            assertServiceRunning(NAME_ONE);
+            assertServiceRunning(NAME_TWO);
+            
+            test1 = getMBean(Simple.class, NAME_ONE, "Instance");
+            assertEquals("()", test1.constructorUsed);
+            assertEquals(1, test1.createOrder);
+            assertEquals(3, test1.startOrder);
+            assertEquals(0, test1.stopOrder);
+            assertEquals(0, test1.destroyOrder);
+            test2 = getMBean(Simple.class, NAME_TWO, "Instance");
+            assertEquals("()", test2.constructorUsed);
+            assertEquals(2, test2.createOrder);
+            assertEquals(4, test2.startOrder);
+            assertEquals(0, test2.stopOrder);
+            assertEquals(0, test2.destroyOrder);
+            
+            undeploy(mbeans2);
+
+            assertServiceRunning(NAME_ONE);
+            assertNoService(NAME_TWO);
+            
+            assertEquals(1, test1.createOrder);
+            assertEquals(3, test1.startOrder);
+            assertEquals(0, test1.stopOrder);
+            assertEquals(0, test1.destroyOrder);
+            assertEquals(2, test2.createOrder);
+            assertEquals(4, test2.startOrder);
+            assertEquals(5, test2.stopOrder);
+            assertEquals(6, test2.destroyOrder);
+            
+            mbeans2 = deploy(resourceName2);
+
+            assertServiceRunning(NAME_ONE);
+            assertServiceRunning(NAME_TWO);
+            
+            assertEquals(1, test1.createOrder);
+            assertEquals(3, test1.startOrder);
+            assertEquals(0, test1.stopOrder);
+            assertEquals(0, test1.destroyOrder);
+            test2 = getMBean(Simple.class, NAME_TWO, "Instance");
+            assertEquals("()", test1.constructorUsed);
+            assertEquals(7, test2.createOrder);
+            assertEquals(8, test2.startOrder);
+            assertEquals(0, test2.stopOrder);
+            assertEquals(0, test2.destroyOrder);
+         }
+         catch (Exception e)
+         {
+            error = true;
+            throw e;
+         }
+         catch (Error e)
+         {
+            error = true;
+            throw e;
+         }
+         finally
+         {
+            undeploy(mbeans2);
+
+            if (error == false)
+            {
+               assertServiceRunning(NAME_ONE);
+               assertEquals(1, test1.createOrder);
+               assertEquals(3, test1.startOrder);
+               assertEquals(0, test1.stopOrder);
+               assertEquals(0, test1.destroyOrder);
+               assertNoService(NAME_TWO);
+               assertNotRegistered(NAME_TWO);
+               assertEquals(7, test2.createOrder);
+               assertEquals(8, test2.startOrder);
+               assertEquals(9, test2.stopOrder);
+               assertEquals(10, test2.destroyOrder);
+            }
+         }
+      }
+      catch (Exception e)
+      {
+         error = true;
+         throw e;
+      }
+      catch (Error e)
+      {
+         error = true;
+         throw e;
+      }
+      finally
+      {
+         undeploy(mbeans1);
+
+         if (error == false)
+         {
+            assertNoService(NAME_ONE);
+            assertNotRegistered(NAME_ONE);
+            assertEquals(1, test1.createOrder);
+            assertEquals(3, test1.startOrder);
+            assertEquals(11, test1.stopOrder);
+            assertEquals(12, test1.destroyOrder);
+            assertNoService(NAME_TWO);
+            assertNotRegistered(NAME_TWO);
+            if (test2 != null)
+            {
+               assertEquals(7, test2.createOrder);
+               assertEquals(8, test2.startOrder);
+               assertEquals(9, test2.stopOrder);
+               assertEquals(10, test2.destroyOrder);
+            }
+         }
+      }
+   }
+}

Added: branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/controller/lifecycle/seperated/test/NewOnDemandDependencyUnitTestCase.java
===================================================================
--- branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/controller/lifecycle/seperated/test/NewOnDemandDependencyUnitTestCase.java	2006-08-10 17:14:01 UTC (rev 55493)
+++ branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/controller/lifecycle/seperated/test/NewOnDemandDependencyUnitTestCase.java	2006-08-10 18:05:14 UTC (rev 55494)
@@ -0,0 +1,45 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt 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.lifecycle.seperated.test;
+
+import junit.framework.Test;
+
+/**
+ * NewOnDemandDependencyUnitTestCase.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class NewOnDemandDependencyUnitTestCase extends NewOnDemandDependencyTest
+{
+   public static Test suite()
+   {
+      return suite(NewOnDemandDependencyUnitTestCase.class);
+   }
+   
+   public NewOnDemandDependencyUnitTestCase(String name)
+   {
+      super(name);
+      resourceName1 = "NewOnDemandDependency_1.xml";
+      resourceName2 = "NewOnDemandDependency_2.xml";
+   }
+}

Added: branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/controller/lifecycle/seperated/test/NewOnDemandServerDependencyUnitTestCase.java
===================================================================
--- branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/controller/lifecycle/seperated/test/NewOnDemandServerDependencyUnitTestCase.java	2006-08-10 17:14:01 UTC (rev 55493)
+++ branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/controller/lifecycle/seperated/test/NewOnDemandServerDependencyUnitTestCase.java	2006-08-10 18:05:14 UTC (rev 55494)
@@ -0,0 +1,45 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt 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.lifecycle.seperated.test;
+
+import junit.framework.Test;
+
+/**
+ * NewOnDemandServerDependencyUnitTestCase.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class NewOnDemandServerDependencyUnitTestCase extends NewOnDemandDependencyTest
+{
+   public static Test suite()
+   {
+      return suite(NewOnDemandServerDependencyUnitTestCase.class);
+   }
+   
+   public NewOnDemandServerDependencyUnitTestCase(String name)
+   {
+      super(name);
+      resourceName1 = "NewOnDemandServerDependency_1.xml";
+      resourceName2 = "NewOnDemandServerDependency_2.xml";
+   }
+}

Modified: branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/controller/support/Simple.java
===================================================================
--- branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/controller/support/Simple.java	2006-08-10 17:14:01 UTC (rev 55493)
+++ branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/controller/support/Simple.java	2006-08-10 18:05:14 UTC (rev 55494)
@@ -29,6 +29,7 @@
 import javax.management.ObjectName;
 
 import org.jboss.system.ServiceMBeanSupport;
+import org.jboss.test.system.controller.integration.support.SimpleBean;
 import org.jboss.util.NotImplementedException;
 import org.w3c.dom.Element;
 
@@ -145,6 +146,10 @@
 
    private JavaBean javaBean;
    
+   private Simple simple;
+   
+   private SimpleBean simpleBean;
+
    public Simple()
    {
       constructorUsed = "()";
@@ -153,6 +158,7 @@
    public Simple(String string)
    {
       constructorUsed = "(java.lang.String)";
+      aString = string;
       if ("error".equals(string))
          throw new Error();
       if ("exception".equals(string))
@@ -582,4 +588,24 @@
    {
       this.javaBean = javaBean;
    }
+   
+   public Simple getSimple()
+   {
+      return simple;
+   }
+
+   public void setSimple(Simple simple)
+   {
+      this.simple = simple;
+   }
+
+   public SimpleBean getSimpleBean()
+   {
+      return simpleBean;
+   }
+
+   public void setSimpleBean(SimpleBean simpleBean)
+   {
+      this.simpleBean = simpleBean;
+   }
 }

Modified: branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/controller/support/SimpleMBean.java
===================================================================
--- branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/controller/support/SimpleMBean.java	2006-08-10 17:14:01 UTC (rev 55493)
+++ branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/controller/support/SimpleMBean.java	2006-08-10 18:05:14 UTC (rev 55494)
@@ -30,6 +30,7 @@
 
 import org.jboss.mx.util.ObjectNameFactory;
 import org.jboss.system.ServiceMBean;
+import org.jboss.test.system.controller.integration.support.SimpleBean;
 import org.w3c.dom.Element;
 
 /**
@@ -183,4 +184,12 @@
    JavaBean getJavaBean();
 
    void setJavaBean(JavaBean javaBean);
+
+   Simple getSimple();
+
+   void setSimple(Simple simple);
+   
+   SimpleBean getSimpleBean();
+
+   void setSimpleBean(SimpleBean simpleBean);
 }

Modified: branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/metadata/attributes/test/AttributeValueUnitTestCase.java
===================================================================
--- branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/metadata/attributes/test/AttributeValueUnitTestCase.java	2006-08-10 17:14:01 UTC (rev 55493)
+++ branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/metadata/attributes/test/AttributeValueUnitTestCase.java	2006-08-10 18:05:14 UTC (rev 55494)
@@ -71,4 +71,10 @@
       ServiceValueMetaData value = unmarshallSingleValue();
       assertJBXBValue(value, "dummy");
    }
+
+   public void testAttributeValueInject() throws Exception
+   {
+      ServiceValueMetaData value = unmarshallSingleValue();
+      assertInjectValue(value, "bean", "property");
+   }
 }

Modified: branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/metadata/basic/test/BasicMBeanUnitTestCase.java
===================================================================
--- branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/metadata/basic/test/BasicMBeanUnitTestCase.java	2006-08-10 17:14:01 UTC (rev 55493)
+++ branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/metadata/basic/test/BasicMBeanUnitTestCase.java	2006-08-10 18:05:14 UTC (rev 55494)
@@ -23,6 +23,7 @@
 
 import javax.management.MalformedObjectNameException;
 
+import org.jboss.dependency.spi.ControllerMode;
 import org.jboss.deployment.DeploymentException;
 import org.jboss.system.metadata.ServiceMetaData;
 import org.jboss.test.system.metadata.test.AbstractMetaDataTest;
@@ -46,6 +47,7 @@
       assertEquals(testBasicMBeanName, metaData.getObjectName());
       assertEquals(testBasicMBeanCode, metaData.getCode());
       assertNull(metaData.getInterfaceName());
+      assertNull(metaData.getMode());
       assertOthers(metaData);
    }
 
@@ -70,8 +72,18 @@
       assertEquals(testBasicMBeanName, metaData.getObjectName());
       assertEquals(testBasicMBeanCode, metaData.getCode());
       assertEquals(testBasicMBeanInterface, metaData.getInterfaceName());
+      assertNull(metaData.getMode());
       assertOthers(metaData);
    }
+
+   public void testBasicMBeanMode() throws Exception
+   {
+      ServiceMetaData metaData = unmarshalSingleMBean();
+      assertEquals(testBasicMBeanName, metaData.getObjectName());
+      assertEquals(testBasicMBeanCode, metaData.getCode());
+      assertEquals(ControllerMode.ON_DEMAND, metaData.getMode());
+      assertOthers(metaData);
+   }
    
    protected void assertOthers(ServiceMetaData metaData) throws Exception
    {

Modified: branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/metadata/test/AbstractMetaDataTest.java
===================================================================
--- branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/metadata/test/AbstractMetaDataTest.java	2006-08-10 17:14:01 UTC (rev 55493)
+++ branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/metadata/test/AbstractMetaDataTest.java	2006-08-10 18:05:14 UTC (rev 55494)
@@ -21,6 +21,7 @@
 */
 package org.jboss.test.system.metadata.test;
 
+import java.io.IOException;
 import java.net.URL;
 import java.util.Arrays;
 import java.util.HashSet;
@@ -30,6 +31,7 @@
 
 import junit.framework.AssertionFailedError;
 
+import org.jboss.dependency.spi.ControllerState;
 import org.jboss.mx.util.ObjectNameFactory;
 import org.jboss.system.metadata.ServiceAttributeMetaData;
 import org.jboss.system.metadata.ServiceConstructorMetaData;
@@ -37,6 +39,7 @@
 import org.jboss.system.metadata.ServiceDependencyMetaData;
 import org.jboss.system.metadata.ServiceDependencyValueMetaData;
 import org.jboss.system.metadata.ServiceElementValueMetaData;
+import org.jboss.system.metadata.ServiceInjectionValueMetaData;
 import org.jboss.system.metadata.ServiceJBXBValueMetaData;
 import org.jboss.system.metadata.ServiceJavaBeanValueMetaData;
 import org.jboss.system.metadata.ServiceMetaData;
@@ -160,11 +163,11 @@
     * @param name the name
     * @return the url of the xml
     */
-   protected URL findXML(String name)
+   protected URL findXML(String name) throws Exception
    {
       URL url = getResource(name);
       if (url == null)
-         fail(name + " not found");
+         throw new IOException(name + " not found");
       return url;
    }
 
@@ -404,6 +407,22 @@
       assertChildOfAttribute(element, expected);
    }
    
+   protected void assertInjectValue(ServiceValueMetaData actual, Object dependency, String property) throws Exception
+   {
+      assertInjectValue(actual, dependency, property, ControllerState.INSTALLED);
+   }
+   
+   protected void assertInjectValue(ServiceValueMetaData actual, Object dependency, String property, ControllerState requiredState) throws Exception
+   {
+      assertNotNull(actual);
+
+      ServiceInjectionValueMetaData value = assertInstanceOf(ServiceInjectionValueMetaData.class, actual);
+      
+      assertEquals(dependency, value.getDependency());
+      assertEquals(property, value.getProperty());
+      assertEquals(requiredState, value.getDependentState());
+   }
+   
    protected void assertChildOfAttribute(Element element, String expected) throws Exception
    {
       assertNotNull(element);

Modified: branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/metadata/value/MetaDataValueTestSuite.java
===================================================================
--- branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/metadata/value/MetaDataValueTestSuite.java	2006-08-10 17:14:01 UTC (rev 55493)
+++ branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/metadata/value/MetaDataValueTestSuite.java	2006-08-10 18:05:14 UTC (rev 55494)
@@ -28,6 +28,7 @@
 import org.jboss.test.system.metadata.value.depends.test.DependencyValueUnitTestCase;
 import org.jboss.test.system.metadata.value.dependslist.test.DependencyListValueUnitTestCase;
 import org.jboss.test.system.metadata.value.element.test.ElementValueUnitTestCase;
+import org.jboss.test.system.metadata.value.inject.test.InjectionValueUnitTestCase;
 import org.jboss.test.system.metadata.value.javabean.test.JavaBeanValueUnitTestCase;
 import org.jboss.test.system.metadata.value.jbxb.test.JBXBValueUnitTestCase;
 import org.jboss.test.system.metadata.value.text.test.TextValueUnitTestCase;
@@ -55,6 +56,7 @@
       suite.addTest(new TestSuite(ElementValueUnitTestCase.class));
       suite.addTest(new TestSuite(JavaBeanValueUnitTestCase.class));
       suite.addTest(new TestSuite(JBXBValueUnitTestCase.class));
+      suite.addTest(new TestSuite(InjectionValueUnitTestCase.class));
       
       return suite;
    }

Added: branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/metadata/value/inject/test/InjectionValueUnitTestCase.java
===================================================================
--- branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/metadata/value/inject/test/InjectionValueUnitTestCase.java	2006-08-10 17:14:01 UTC (rev 55493)
+++ branches/MC_VDF_WORK/system-jmx/src/tests/org/jboss/test/system/metadata/value/inject/test/InjectionValueUnitTestCase.java	2006-08-10 18:05:14 UTC (rev 55494)
@@ -0,0 +1,70 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt 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.metadata.value.inject.test;
+
+import org.jboss.dependency.spi.ControllerState;
+import org.jboss.system.metadata.ServiceValueMetaData;
+import org.jboss.test.system.metadata.value.AbstractValueTest;
+
+/**
+ * InjectionValueUnitTestCase.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class InjectionValueUnitTestCase extends AbstractValueTest
+{
+   public InjectionValueUnitTestCase(String name)
+   {
+      super(name);
+   }
+
+   public void testInjection() throws Exception
+   {
+      ServiceValueMetaData value = unmarshallSingleValue();
+      assertInjectValue(value, "bean", null);
+   }
+
+   public void testInjectionEmpty() throws Exception
+   {
+      ServiceValueMetaData value = unmarshallSingleValue();
+      assertInjectValue(value, "", null);
+   }
+
+   public void testInjectionProperty() throws Exception
+   {
+      ServiceValueMetaData value = unmarshallSingleValue();
+      assertInjectValue(value, "bean", "property");
+   }
+
+   public void testInjectionState() throws Exception
+   {
+      ServiceValueMetaData value = unmarshallSingleValue();
+      assertInjectValue(value, "bean", null, ControllerState.INSTANTIATED);
+   }
+
+   public void testInjectionPropertyState() throws Exception
+   {
+      ServiceValueMetaData value = unmarshallSingleValue();
+      assertInjectValue(value, "bean", "property", ControllerState.INSTANTIATED);
+   }
+}




More information about the jboss-cvs-commits mailing list