[jboss-cvs] JBossAS SVN: r65015 - in branches/Branch_4_2/system/src: resources/tests/org/jboss/test/system/controller/instantiate/test and 7 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Sep 3 10:39:04 EDT 2007


Author: adrian at jboss.org
Date: 2007-09-03 10:39:03 -0400 (Mon, 03 Sep 2007)
New Revision: 65015

Modified:
   branches/Branch_4_2/system/src/main/org/jboss/system/ServiceConfigurator.java
   branches/Branch_4_2/system/src/resources/tests/org/jboss/test/system/controller/instantiate/test/PlainMBeanArgValueMissing_bad.xml
   branches/Branch_4_2/system/src/resources/tests/org/jboss/test/system/controller/instantiate/test/StandardMBeanArgValueMissing_bad.xml
   branches/Branch_4_2/system/src/tests/org/jboss/test/system/controller/AbstractControllerTest.java
   branches/Branch_4_2/system/src/tests/org/jboss/test/system/controller/configure/attribute/test/DependsAttributeOldUnitTestCase.java
   branches/Branch_4_2/system/src/tests/org/jboss/test/system/controller/configure/attribute/test/DependsListAttributeOldUnitTestCase.java
   branches/Branch_4_2/system/src/tests/org/jboss/test/system/controller/configure/value/depends/test/DependencyValueOldUnitTestCase.java
   branches/Branch_4_2/system/src/tests/org/jboss/test/system/controller/configure/value/dependslist/test/DependencyListValueOldUnitTestCase.java
   branches/Branch_4_2/system/src/tests/org/jboss/test/system/controller/configure/value/javabean/test/JavaBeanValueOldUnitTestCase.java
   branches/Branch_4_2/system/src/tests/org/jboss/test/system/controller/configure/value/text/test/TextValueOldUnitTestCase.java
   branches/Branch_4_2/system/src/tests/org/jboss/test/system/controller/instantiate/test/ConstructorArgsErrorOldUnitTestCase.java
Log:
[JBAS-3572] - Fix the FAILS_IN_OLD problems in JBoss 4.2

Modified: branches/Branch_4_2/system/src/main/org/jboss/system/ServiceConfigurator.java
===================================================================
--- branches/Branch_4_2/system/src/main/org/jboss/system/ServiceConfigurator.java	2007-09-03 14:08:18 UTC (rev 65014)
+++ branches/Branch_4_2/system/src/main/org/jboss/system/ServiceConfigurator.java	2007-09-03 14:39:03 UTC (rev 65015)
@@ -370,6 +370,8 @@
                      if (attr == null)
                         throw new DeploymentException("No Attribute found with name: " + mbeanRefName);
                      proxyType = attr.getType();
+                     if (proxyType == null)
+                        throw new DeploymentException(objectName + " null attribute type for " + attr.getName());
                   }
                   Class proxyClass = cl.loadClass(proxyType);
                   attribute = MBeanProxyExt.create(proxyClass, dependsObjectName,
@@ -492,6 +494,8 @@
       String attributeName = attr.getName();
       String attributeText = getElementContent(element, trim, replace);
       String typeName = attr.getType();
+      if (typeName == null)
+         throw new DeploymentException("No attribute type for " + attr.getName());
 
       // see if it is a primitive type first
       Class typeClass = Classes.getPrimitiveTypeForName(typeName);
@@ -592,6 +596,8 @@
       String attributeClassName = element.getAttribute("attributeClass");
       if( attributeClassName == null || attributeClassName.length() == 0 )
          attributeClassName = attr.getType();
+      if (attributeClassName == null)
+         throw new DeploymentException("No attribute class name for " + attr.getName());
       Class attributeClass = cl.loadClass(attributeClassName);
       // Create the bean instance
       Object bean = attributeClass.newInstance();
@@ -678,6 +684,9 @@
          throw new DeploymentException("No object name found for attribute!");
       } // end of if ()
 
+      if (dependsObjectName.isPattern())
+         throw new DeploymentException(container + " cannot depend on a pattern: " + dependsObjectName);
+      
       serviceController.registerDependency(container, dependsObjectName);
 
       return dependsObjectName;

Modified: branches/Branch_4_2/system/src/resources/tests/org/jboss/test/system/controller/instantiate/test/PlainMBeanArgValueMissing_bad.xml
===================================================================
--- branches/Branch_4_2/system/src/resources/tests/org/jboss/test/system/controller/instantiate/test/PlainMBeanArgValueMissing_bad.xml	2007-09-03 14:08:18 UTC (rev 65014)
+++ branches/Branch_4_2/system/src/resources/tests/org/jboss/test/system/controller/instantiate/test/PlainMBeanArgValueMissing_bad.xml	2007-09-03 14:39:03 UTC (rev 65015)
@@ -3,7 +3,7 @@
 <server>
    <mbean name="jboss.test:type=test" code="org.jboss.test.system.controller.support.Simple">
       <constructor>
-         <arg type="java.lang.Integer"/>
+         <arg type="int"/>
       </constructor>
    </mbean>
 </server>
\ No newline at end of file

Modified: branches/Branch_4_2/system/src/resources/tests/org/jboss/test/system/controller/instantiate/test/StandardMBeanArgValueMissing_bad.xml
===================================================================
--- branches/Branch_4_2/system/src/resources/tests/org/jboss/test/system/controller/instantiate/test/StandardMBeanArgValueMissing_bad.xml	2007-09-03 14:08:18 UTC (rev 65014)
+++ branches/Branch_4_2/system/src/resources/tests/org/jboss/test/system/controller/instantiate/test/StandardMBeanArgValueMissing_bad.xml	2007-09-03 14:39:03 UTC (rev 65015)
@@ -4,7 +4,7 @@
    <mbean name="jboss.test:type=test" code="org.jboss.test.system.controller.support.Simple"
           interface="org.jboss.test.system.controller.support.SimpleMBean">
       <constructor>
-         <arg type="java.lang.Integer"/>
+         <arg type="int"/>
       </constructor>
    </mbean>
 </server>
\ No newline at end of file

Modified: branches/Branch_4_2/system/src/tests/org/jboss/test/system/controller/AbstractControllerTest.java
===================================================================
--- branches/Branch_4_2/system/src/tests/org/jboss/test/system/controller/AbstractControllerTest.java	2007-09-03 14:08:18 UTC (rev 65014)
+++ branches/Branch_4_2/system/src/tests/org/jboss/test/system/controller/AbstractControllerTest.java	2007-09-03 14:39:03 UTC (rev 65015)
@@ -369,9 +369,4 @@
    {
       return (Simple) getMBean(Simple.class, SimpleMBean.OBJECT_NAME, "Instance");
    }
-   
-   protected void FAILS_IN_OLD()
-   {
-      getLog().debug("This test fails with the old service controller, ignoring.");
-   }
 }

Modified: branches/Branch_4_2/system/src/tests/org/jboss/test/system/controller/configure/attribute/test/DependsAttributeOldUnitTestCase.java
===================================================================
--- branches/Branch_4_2/system/src/tests/org/jboss/test/system/controller/configure/attribute/test/DependsAttributeOldUnitTestCase.java	2007-09-03 14:08:18 UTC (rev 65014)
+++ branches/Branch_4_2/system/src/tests/org/jboss/test/system/controller/configure/attribute/test/DependsAttributeOldUnitTestCase.java	2007-09-03 14:39:03 UTC (rev 65015)
@@ -74,7 +74,7 @@
    
    public void testDependsAttributePatternValue() throws Exception
    {
-      FAILS_IN_OLD();
+      assertDeployFailure(SimpleMBean.OBJECT_NAME, DeploymentException.class);
    }
 
    public void testDependsAttributeNotFound() throws Exception

Modified: branches/Branch_4_2/system/src/tests/org/jboss/test/system/controller/configure/attribute/test/DependsListAttributeOldUnitTestCase.java
===================================================================
--- branches/Branch_4_2/system/src/tests/org/jboss/test/system/controller/configure/attribute/test/DependsListAttributeOldUnitTestCase.java	2007-09-03 14:08:18 UTC (rev 65014)
+++ branches/Branch_4_2/system/src/tests/org/jboss/test/system/controller/configure/attribute/test/DependsListAttributeOldUnitTestCase.java	2007-09-03 14:39:03 UTC (rev 65015)
@@ -74,7 +74,7 @@
    
    public void testDependsListAttributePatternValue() throws Exception
    {
-      FAILS_IN_OLD();
+      assertDeployFailure(SimpleMBean.OBJECT_NAME, DeploymentException.class);
    }
 
    public void testDependsListAttributeNotFound() throws Exception

Modified: branches/Branch_4_2/system/src/tests/org/jboss/test/system/controller/configure/value/depends/test/DependencyValueOldUnitTestCase.java
===================================================================
--- branches/Branch_4_2/system/src/tests/org/jboss/test/system/controller/configure/value/depends/test/DependencyValueOldUnitTestCase.java	2007-09-03 14:08:18 UTC (rev 65014)
+++ branches/Branch_4_2/system/src/tests/org/jboss/test/system/controller/configure/value/depends/test/DependencyValueOldUnitTestCase.java	2007-09-03 14:39:03 UTC (rev 65015)
@@ -72,11 +72,11 @@
    
    public void testPatternValue() throws Exception
    {
-      FAILS_IN_OLD();
+      assertDeployFailure(SimpleMBean.OBJECT_NAME, DeploymentException.class);
    }
    
    public void testNoAttributeInfoType() throws Exception
    {
-      FAILS_IN_OLD();
+      assertDeployFailure(SimpleMBean.OBJECT_NAME, DeploymentException.class);
    }
 }

Modified: branches/Branch_4_2/system/src/tests/org/jboss/test/system/controller/configure/value/dependslist/test/DependencyListValueOldUnitTestCase.java
===================================================================
--- branches/Branch_4_2/system/src/tests/org/jboss/test/system/controller/configure/value/dependslist/test/DependencyListValueOldUnitTestCase.java	2007-09-03 14:08:18 UTC (rev 65014)
+++ branches/Branch_4_2/system/src/tests/org/jboss/test/system/controller/configure/value/dependslist/test/DependencyListValueOldUnitTestCase.java	2007-09-03 14:39:03 UTC (rev 65015)
@@ -72,6 +72,6 @@
    
    public void testPatternValue() throws Exception
    {
-      FAILS_IN_OLD();
+      assertDeployFailure(SimpleMBean.OBJECT_NAME, DeploymentException.class);
    }
 }

Modified: branches/Branch_4_2/system/src/tests/org/jboss/test/system/controller/configure/value/javabean/test/JavaBeanValueOldUnitTestCase.java
===================================================================
--- branches/Branch_4_2/system/src/tests/org/jboss/test/system/controller/configure/value/javabean/test/JavaBeanValueOldUnitTestCase.java	2007-09-03 14:08:18 UTC (rev 65014)
+++ branches/Branch_4_2/system/src/tests/org/jboss/test/system/controller/configure/value/javabean/test/JavaBeanValueOldUnitTestCase.java	2007-09-03 14:39:03 UTC (rev 65015)
@@ -21,10 +21,10 @@
  */
 package org.jboss.test.system.controller.configure.value.javabean.test;
 
-import junit.framework.Test;
+import junit.framework.Test;
+
+import org.jboss.test.AbstractTestDelegate;
 
-import org.jboss.test.AbstractTestDelegate;
-
 /**
  * JavaBeanValueOldUnitTestCase.
  * 
@@ -47,9 +47,4 @@
    {
       return getOldControllerDelegate(clazz);
    }
-
-   public void testNoAttributeInfoType() throws Exception
-   {
-      FAILS_IN_OLD();
-   }
 }

Modified: branches/Branch_4_2/system/src/tests/org/jboss/test/system/controller/configure/value/text/test/TextValueOldUnitTestCase.java
===================================================================
--- branches/Branch_4_2/system/src/tests/org/jboss/test/system/controller/configure/value/text/test/TextValueOldUnitTestCase.java	2007-09-03 14:08:18 UTC (rev 65014)
+++ branches/Branch_4_2/system/src/tests/org/jboss/test/system/controller/configure/value/text/test/TextValueOldUnitTestCase.java	2007-09-03 14:39:03 UTC (rev 65015)
@@ -47,9 +47,4 @@
    {
       return getOldControllerDelegate(clazz);
    }
-   
-   public void testNoAttributeInfoType() throws Exception
-   {
-      FAILS_IN_OLD();
-   }
 }

Modified: branches/Branch_4_2/system/src/tests/org/jboss/test/system/controller/instantiate/test/ConstructorArgsErrorOldUnitTestCase.java
===================================================================
--- branches/Branch_4_2/system/src/tests/org/jboss/test/system/controller/instantiate/test/ConstructorArgsErrorOldUnitTestCase.java	2007-09-03 14:08:18 UTC (rev 65014)
+++ branches/Branch_4_2/system/src/tests/org/jboss/test/system/controller/instantiate/test/ConstructorArgsErrorOldUnitTestCase.java	2007-09-03 14:39:03 UTC (rev 65015)
@@ -23,6 +23,7 @@
 
 import junit.framework.Test;
 
+import org.jboss.deployment.DeploymentException;
 import org.jboss.test.AbstractTestDelegate;
 import org.jboss.test.system.controller.support.SimpleMBean;
 
@@ -61,7 +62,7 @@
    
    public void testPlainMBeanArgValueMissing() throws Exception
    {
-      FAILS_IN_OLD();
+      assertMaybeParseFailure(SimpleMBean.OBJECT_NAME, NumberFormatException.class);
    }
    
    public void testStandardMBeanArgTypeMissing() throws Exception
@@ -76,6 +77,6 @@
    
    public void testStandardMBeanArgValueMissing() throws Exception
    {
-      FAILS_IN_OLD();
+      assertMaybeParseFailure(SimpleMBean.OBJECT_NAME, NumberFormatException.class);
    }
 }




More information about the jboss-cvs-commits mailing list