ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-ant-myrmidon/container/src/test/org/apache/myrmidon/components/configurer/test/data ConfigTestConfigAdder.java ConfigTestTypedAdder.java ConfigTestTypedConfigAdder.java
Date Sun, 21 Apr 2002 02:41:23 GMT
donaldp     02/04/20 19:41:23

  Modified:    container/src/java/org/apache/myrmidon/components/configurer
                        ClassicConfigurer.java DefaultConfigurer.java
                        DefaultObjectConfigurer.java
                        DefaultPropertyConfigurer.java
                        ObjectConfigurer.java PropertyConfigurer.java
                        ReportableConfigurationException.java
               container/src/test/org/apache/myrmidon/components/configurer/test
                        ConfigTestConfigurable.java
                        DefaultConfigurerTestCase.java
               container/src/test/org/apache/myrmidon/components/configurer/test/data
                        ConfigTestConfigAdder.java
                        ConfigTestTypedAdder.java
                        ConfigTestTypedConfigAdder.java
  Log:
  Follow through with the Configuration -> ModelElement move.
  
  Revision  Changes    Path
  1.13      +48 -49    jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/configurer/ClassicConfigurer.java
  
  Index: ClassicConfigurer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/configurer/ClassicConfigurer.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- ClassicConfigurer.java	1 Apr 2002 09:56:25 -0000	1.12
  +++ ClassicConfigurer.java	21 Apr 2002 02:41:23 -0000	1.13
  @@ -14,9 +14,6 @@
   import org.apache.aut.converter.ConverterException;
   import org.apache.avalon.excalibur.i18n.ResourceManager;
   import org.apache.avalon.excalibur.i18n.Resources;
  -import org.apache.avalon.framework.configuration.Configurable;
  -import org.apache.avalon.framework.configuration.Configuration;
  -import org.apache.avalon.framework.configuration.ConfigurationException;
   import org.apache.avalon.framework.logger.AbstractLogEnabled;
   import org.apache.avalon.framework.logger.LogEnabled;
   import org.apache.avalon.framework.service.ServiceException;
  @@ -24,6 +21,9 @@
   import org.apache.avalon.framework.service.Serviceable;
   import org.apache.myrmidon.api.TaskContext;
   import org.apache.myrmidon.api.TaskException;
  +import org.apache.myrmidon.api.metadata.ModelElement;
  +import org.apache.myrmidon.api.metadata.ModelException;
  +import org.apache.myrmidon.api.metadata.Modeller;
   import org.apache.myrmidon.interfaces.configurer.Configurer;
   
   /**
  @@ -63,15 +63,15 @@
        *
        * @param object the object
        * @param clazz the Class object to  use during configuration
  -     * @param configuration the configuration
  +     * @param model the configuration
        * @param context the Context
  -     * @exception ConfigurationException if an error occurs
  +     * @exception ModelException if an error occurs
        */
       public void configureElement( Object object,
                                     Class clazz,
  -                                  Configuration configuration,
  +                                  ModelElement model,
                                     TaskContext context )
  -        throws ConfigurationException
  +        throws ModelException
       {
           throw new UnsupportedOperationException();
       }
  @@ -91,14 +91,14 @@
        * @param name the attribute name
        * @param value the attribute value
        * @param context the Context
  -     * @exception ConfigurationException if an error occurs
  +     * @exception ModelException if an error occurs
        */
       public void configureAttribute( Object object,
                                       Class clazz,
                                       String name,
                                       String value,
                                       TaskContext context )
  -        throws ConfigurationException
  +        throws ModelException
       {
           throw new UnsupportedOperationException();
       }
  @@ -112,14 +112,14 @@
        * mapping rules to map configuration to types
        *
        * @param object the object
  -     * @param configuration the configuration
  +     * @param model the configuration
        * @param context the Context
  -     * @exception ConfigurationException if an error occurs
  +     * @exception ModelException if an error occurs
        */
       public void configureElement( final Object object,
  -                                  final Configuration configuration,
  +                                  final ModelElement model,
                                     final TaskContext context )
  -        throws ConfigurationException
  +        throws ModelException
       {
           if( DEBUG )
           {
  @@ -127,7 +127,7 @@
               getLogger().debug( message );
           }
   
  -        if( object instanceof Configurable )
  +        if( object instanceof Modeller )
           {
               if( DEBUG )
               {
  @@ -135,8 +135,8 @@
                   getLogger().debug( message );
               }
   
  -            final Configurable configurable = (Configurable)object;
  -            configurable.configure( configuration );
  +            final Modeller modeller = (Modeller)object;
  +            modeller.model( model );
           }
           else
           {
  @@ -146,11 +146,11 @@
                   getLogger().debug( message );
               }
   
  -            final String[] attributes = configuration.getAttributeNames();
  +            final String[] attributes = model.getAttributeNames();
               for( int i = 0; i < attributes.length; i++ )
               {
                   final String name = attributes[ i ];
  -                final String value = configuration.getAttribute( name );
  +                final String value = model.getAttribute( name );
   
                   if( DEBUG )
                   {
  @@ -162,11 +162,10 @@
                   doConfigureAttribute( object, name, value, context );
               }
   
  -            final Configuration[] children = configuration.getChildren();
  -
  +            final ModelElement[] children = model.getChildren();
               for( int i = 0; i < children.length; i++ )
               {
  -                final Configuration child = children[ i ];
  +                final ModelElement child = children[ i ];
   
                   if( DEBUG )
                   {
  @@ -178,7 +177,7 @@
                   doConfigureElement( object, child, context );
               }
   
  -            final String content = configuration.getValue( null );
  +            final String content = model.getContent();
               if( null != content )
               {
                   if( !content.trim().equals( "" ) )
  @@ -205,13 +204,13 @@
        * @param name the attribute name
        * @param value the attribute value
        * @param context the Context
  -     * @exception ConfigurationException if an error occurs
  +     * @exception ModelException if an error occurs
        */
       public void configureAttribute( final Object object,
                                       final String name,
                                       final String value,
                                       final TaskContext context )
  -        throws ConfigurationException
  +        throws ModelException
       {
           doConfigureAttribute( object, name, value, context );
       }
  @@ -222,12 +221,12 @@
        * @param object the object
        * @param content the content value to be set
        * @param context the Context
  -     * @exception ConfigurationException if an error occurs
  +     * @exception ModelException if an error occurs
        */
       private void configureContent( final Object object,
                                      final String content,
                                      final TaskContext context )
  -        throws ConfigurationException
  +        throws ModelException
       {
           setValue( object, "addContent", content, context );
       }
  @@ -236,7 +235,7 @@
                                          final String name,
                                          final String value,
                                          final TaskContext context )
  -        throws ConfigurationException
  +        throws ModelException
       {
           final String methodName = getMethodNameFor( name );
           setValue( object, methodName, value, context );
  @@ -246,7 +245,7 @@
                              final String methodName,
                              final String value,
                              final TaskContext context )
  -        throws ConfigurationException
  +        throws ModelException
       {
           // OMFG the rest of this is soooooooooooooooooooooooooooooooo
           // slow. Need to cache results per class etc.
  @@ -257,7 +256,7 @@
           {
               final String message =
                   REZ.getString( "no-attribute-method.error", methodName );
  -            throw new ConfigurationException( message );
  +            throw new ModelException( message );
           }
   
           setValue( object, value, context, methods );
  @@ -267,7 +266,7 @@
                              final String value,
                              final TaskContext context,
                              final Method[] methods )
  -        throws ConfigurationException
  +        throws ModelException
       {
           try
           {
  @@ -278,7 +277,7 @@
           {
               final String message =
                   REZ.getString( "bad-property-resolve.error", value );
  -            throw new ConfigurationException( message, te );
  +            throw new ModelException( message, te );
           }
       }
   
  @@ -286,7 +285,7 @@
                              Object value,
                              final Method[] methods,
                              final TaskContext context )
  -        throws ConfigurationException
  +        throws ModelException
       {
           final Class sourceClass = value.getClass();
           final String source = sourceClass.getName();
  @@ -301,14 +300,14 @@
   
           final String message =
               REZ.getString( "no-can-convert.error", methods[ 0 ].getName(), source );
  -        throw new ConfigurationException( message );
  +        throw new ModelException( message );
       }
   
       private boolean setValue( final Object object,
                                 final Object originalValue,
                                 final Method method,
                                 final TaskContext context )
  -        throws ConfigurationException
  +        throws ModelException
       {
           Class parameterType = method.getParameterTypes()[ 0 ];
           if( parameterType.isPrimitive() )
  @@ -329,13 +328,13 @@
                   getLogger().debug( message, ce );
               }
   
  -            throw new ConfigurationException( ce.getMessage(), ce );
  +            throw new ModelException( ce.getMessage(), ce );
           }
           catch( final Exception e )
           {
               final String message =
                   REZ.getString( "bad-convert-for-attribute.error", method.getName() );
  -            throw new ConfigurationException( message, e );
  +            throw new ModelException( message, e );
           }
   
           if( null == value )
  @@ -351,12 +350,12 @@
           {
               //should never happen ....
               final String message = REZ.getString( "illegal-access.error" );
  -            throw new ConfigurationException( message, iae );
  +            throw new ModelException( message, iae );
           }
           catch( final InvocationTargetException ite )
           {
               final String message = REZ.getString( "invoke-target.error", method.getName() );
  -            throw new ConfigurationException( message, ite );
  +            throw new ModelException( message, ite );
           }
   
           return true;
  @@ -485,9 +484,9 @@
       }
   
       private void doConfigureElement( final Object object,
  -                                     final Configuration configuration,
  +                                     final ModelElement configuration,
                                        final TaskContext context )
  -        throws ConfigurationException
  +        throws ModelException
       {
           final String name = configuration.getName();
           final String javaName = getJavaNameFor( name );
  @@ -510,7 +509,7 @@
               {
                   final String message =
                       REZ.getString( "no-element-method.error", javaName );
  -                throw new ConfigurationException( message );
  +                throw new ModelException( message );
               }
   
               //guess it is first method ????
  @@ -520,31 +519,31 @@
   
       private void createElement( final Object object,
                                   final Method method,
  -                                final Configuration configuration,
  +                                final ModelElement configuration,
                                   final TaskContext context )
  -        throws ConfigurationException
  +        throws ModelException
       {
           try
           {
               final Object created = method.invoke( object, new Object[ 0 ] );
               doConfigureElement( created, configuration, context );
           }
  -        catch( final ConfigurationException ce )
  +        catch( final ModelException ce )
           {
               throw ce;
           }
           catch( final Exception e )
           {
               final String message = REZ.getString( "subelement-create.error" );
  -            throw new ConfigurationException( message, e );
  +            throw new ModelException( message, e );
           }
       }
   
       private void addElement( final Object object,
                                final Method method,
  -                             final Configuration configuration,
  +                             final ModelElement configuration,
                                final TaskContext context )
  -        throws ConfigurationException
  +        throws ModelException
       {
           try
           {
  @@ -554,14 +553,14 @@
               doConfigureElement( created, configuration, context );
               method.invoke( object, new Object[]{created} );
           }
  -        catch( final ConfigurationException ce )
  +        catch( final ModelException ce )
           {
               throw ce;
           }
           catch( final Exception e )
           {
               final String message = REZ.getString( "subelement-create.error" );
  -            throw new ConfigurationException( message, e );
  +            throw new ModelException( message, e );
           }
       }
   }
  
  
  
  1.48      +36 -36    jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/configurer/DefaultConfigurer.java
  
  Index: DefaultConfigurer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/configurer/DefaultConfigurer.java,v
  retrieving revision 1.47
  retrieving revision 1.48
  diff -u -r1.47 -r1.48
  --- DefaultConfigurer.java	11 Apr 2002 12:58:58 -0000	1.47
  +++ DefaultConfigurer.java	21 Apr 2002 02:41:23 -0000	1.48
  @@ -13,15 +13,15 @@
   import org.apache.aut.converter.ConverterException;
   import org.apache.avalon.excalibur.i18n.ResourceManager;
   import org.apache.avalon.excalibur.i18n.Resources;
  -import org.apache.avalon.framework.configuration.Configurable;
  -import org.apache.avalon.framework.configuration.Configuration;
  -import org.apache.avalon.framework.configuration.ConfigurationException;
   import org.apache.avalon.framework.logger.AbstractLogEnabled;
   import org.apache.avalon.framework.logger.LogEnabled;
   import org.apache.avalon.framework.service.ServiceException;
   import org.apache.avalon.framework.service.ServiceManager;
   import org.apache.avalon.framework.service.Serviceable;
   import org.apache.myrmidon.api.TaskContext;
  +import org.apache.myrmidon.api.metadata.ModelElement;
  +import org.apache.myrmidon.api.metadata.ModelException;
  +import org.apache.myrmidon.api.metadata.Modeller;
   import org.apache.myrmidon.interfaces.configurer.Configurer;
   import org.apache.myrmidon.interfaces.role.RoleInfo;
   import org.apache.myrmidon.interfaces.role.RoleManager;
  @@ -32,7 +32,7 @@
    * Class used to configure tasks.
    *
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
  - * @version $Revision: 1.47 $ $Date: 2002/04/11 12:58:58 $
  + * @version $Revision: 1.48 $ $Date: 2002/04/21 02:41:23 $
    * @ant.type type="configurer" name="default"
    */
   public class DefaultConfigurer
  @@ -74,21 +74,21 @@
        * @param object the object
        * @param configuration the configuration
        * @param context the Context
  -     * @exception ConfigurationException if an error occurs
  +     * @exception ModelException if an error occurs
        */
       public void configureElement( final Object object,
  -                                  final Configuration configuration,
  +                                  final ModelElement configuration,
                                     final TaskContext context )
  -        throws ConfigurationException
  +        throws ModelException
       {
           configureElement( object, object.getClass(), configuration, context );
       }
   
       public void configureElement( final Object object,
                                     final Class clazz,
  -                                  final Configuration configuration,
  +                                  final ModelElement configuration,
                                     final TaskContext context )
  -        throws ConfigurationException
  +        throws ModelException
       {
           try
           {
  @@ -105,7 +105,7 @@
               // Wrap all other errors with general purpose error message
               final String message = REZ.getString( "bad-configure-element.error",
                                                     configuration.getName() );
  -            throw new ConfigurationException( message, e );
  +            throw new ModelException( message, e );
           }
       }
   
  @@ -119,31 +119,31 @@
        */
       private void configureObject( final Object object,
                                     final Class clazz,
  -                                  final Configuration configuration,
  +                                  final ModelElement model,
                                     final TaskContext context )
           throws Exception
       {
  -        if( object instanceof Configurable )
  +        if( object instanceof Modeller )
           {
               // Let the object configure itself
  -            ( (Configurable)object ).configure( configuration );
  +            ( (Modeller)object ).model( model );
           }
           else
           {
               // Start configuration of the object
  -            final String elemName = configuration.getName();
  +            final String elemName = model.getName();
               final ObjectConfigurer configurer = getConfigurer( clazz );
               final ConfigurationState state = configurer.startConfiguration( object );
   
               // Set each of the attributes
  -            final String[] attributes = configuration.getAttributeNames();
  +            final String[] attributes = model.getAttributeNames();
               for( int i = 0; i < attributes.length; i++ )
               {
                   final String name = attributes[ i ];
                   try
                   {
                       // Set the attribute
  -                    final String value = configuration.getAttribute( name );
  +                    final String value = model.getAttribute( name );
                       setAttribute( state, name, value, context );
                   }
                   catch( final NoSuchPropertyException nspe )
  @@ -161,7 +161,7 @@
               }
   
               // Set the text content
  -            final String content = configuration.getValue( null );
  +            final String content = model.getContent();
               if( null != content && content.length() > 0 )
               {
                   try
  @@ -184,10 +184,10 @@
               }
   
               // Create and configure each of the child elements
  -            final Configuration[] children = configuration.getChildren();
  +            final ModelElement[] children = model.getChildren();
               for( int i = 0; i < children.length; i++ )
               {
  -                final Configuration childConfig = children[ i ];
  +                final ModelElement childConfig = children[ i ];
                   final String name = childConfig.getName();
                   try
                   {
  @@ -225,13 +225,13 @@
        * @param name the attribute name
        * @param value the attribute value
        * @param context the Context
  -     * @exception ConfigurationException if an error occurs
  +     * @exception ModelException if an error occurs
        */
       public void configureAttribute( final Object object,
                                       final String name,
                                       final String value,
                                       final TaskContext context )
  -        throws ConfigurationException
  +        throws ModelException
       {
           configureAttribute( object, object.getClass(), name, value, context );
       }
  @@ -245,14 +245,14 @@
        * @param name the attribute name
        * @param value the attribute value
        * @param context the Context
  -     * @exception ConfigurationException if an error occurs
  +     * @exception ModelException if an error occurs
        */
       public void configureAttribute( final Object object,
                                       final Class clazz,
                                       final String name,
                                       final String value,
                                       final TaskContext context )
  -        throws ConfigurationException
  +        throws ModelException
       {
           // Locate the configurer for this object
           final ObjectConfigurer configurer = getConfigurer( clazz );
  @@ -271,7 +271,7 @@
                   REZ.getString( "bad-set-class-attribute.error",
                                  name,
                                  object.getClass().getName() );
  -            throw new ConfigurationException( message, ce );
  +            throw new ModelException( message, ce );
           }
   
           // Finish up
  @@ -301,7 +301,7 @@
        * Configures a property from a nested element.
        */
       private void configureElement( final ConfigurationState state,
  -                                   final Configuration element,
  +                                   final ModelElement element,
                                      final TaskContext context )
           throws Exception
       {
  @@ -322,7 +322,7 @@
        * Configure a property from an inline object.
        */
       private void configureInline( final ConfigurationState state,
  -                                  final Configuration element,
  +                                  final ModelElement element,
                                     final TaskContext context )
           throws Exception
       {
  @@ -344,7 +344,7 @@
        * Configures a property from a reference.
        */
       private void configureReference( final ConfigurationState state,
  -                                     final Configuration element,
  +                                     final ModelElement element,
                                        final TaskContext context )
           throws Exception
       {
  @@ -354,7 +354,7 @@
               0 != element.getChildren().length )
           {
               final String message = REZ.getString( "extra-config-for-ref.error" );
  -            throw new ConfigurationException( message );
  +            throw new ModelException( message );
           }
   
           // Set the property
  @@ -387,7 +387,7 @@
           if( null == ref )
           {
               final String message = REZ.getString( "unknown-reference.error", id );
  -            throw new ConfigurationException( message );
  +            throw new ModelException( message );
           }
   
           // Convert the object, if necessary
  @@ -401,7 +401,7 @@
               catch( ConverterException e )
               {
                   final String message = REZ.getString( "mismatch-ref-types.error", id, name );
  -                throw new ConfigurationException( message, e );
  +                throw new ModelException( message, e );
               }
           }
   
  @@ -451,7 +451,7 @@
        * Locates the configurer for a particular class.
        */
       private ObjectConfigurer getConfigurer( final Class clazz )
  -        throws ConfigurationException
  +        throws ModelException
       {
           ObjectConfigurer configurer =
               (ObjectConfigurer)m_configurerCache.get( clazz );
  @@ -467,7 +467,7 @@
        * Creates and configures an inline object.
        */
       private Object setupChild( final ConfigurationState state,
  -                               final Configuration element,
  +                               final ModelElement element,
                                  final TaskContext context,
                                  final PropertyConfigurer childConfigurer )
           throws Exception
  @@ -475,9 +475,9 @@
           final String name = element.getName();
           final Class type = childConfigurer.getType();
   
  -        if( Configuration.class == type )
  +        if( ModelElement.class == type )
           {
  -            //special case where you have add...(Configuration)
  +            //special case where you have add...(ModelElement)
               return element;
           }
   
  @@ -588,7 +588,7 @@
           {
               // An interface - don't know how to instantiate it
               final String message = REZ.getString( "instantiate-interface.error", type.getName() );
  -            throw new ConfigurationException( message );
  +            throw new ModelException( message );
           }
   
           // Use the no-args constructor
  @@ -631,7 +631,7 @@
               final String message =
                   REZ.getString( "create-object.error",
                                  type.getName() );
  -            throw new ConfigurationException( message, e );
  +            throw new ModelException( message, e );
           }
       }
   }
  
  
  
  1.21      +13 -13    jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/configurer/DefaultObjectConfigurer.java
  
  Index: DefaultObjectConfigurer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/configurer/DefaultObjectConfigurer.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- DefaultObjectConfigurer.java	29 Mar 2002 12:56:03 -0000	1.20
  +++ DefaultObjectConfigurer.java	21 Apr 2002 02:41:23 -0000	1.21
  @@ -17,14 +17,14 @@
   import java.util.Map;
   import org.apache.avalon.excalibur.i18n.ResourceManager;
   import org.apache.avalon.excalibur.i18n.Resources;
  -import org.apache.avalon.framework.configuration.ConfigurationException;
  +import org.apache.myrmidon.api.metadata.ModelException;
   
   /**
    * An object configurer which uses reflection to determine the properties
    * of a class.
    *
    * @author <a href="mailto:adammurdoch_ml@yahoo.com">Adam Murdoch</a>
  - * @version $Revision: 1.20 $ $Date: 2002/03/29 12:56:03 $
  + * @version $Revision: 1.21 $ $Date: 2002/04/21 02:41:23 $
    */
   class DefaultObjectConfigurer
       implements ObjectConfigurer
  @@ -73,7 +73,7 @@
        * Enables all properties and content handling.
        */
       private void enableAll()
  -        throws ConfigurationException
  +        throws ModelException
       {
           enableSetters();
           enableAdders();
  @@ -85,7 +85,7 @@
        * Enables all setters.
        */
       private void enableSetters()
  -        throws ConfigurationException
  +        throws ModelException
       {
           // Locate all the setter methods
           final Collection methods = findMethods( "set", false );
  @@ -111,7 +111,7 @@
        * Enables all adders.
        */
       private void enableAdders()
  -        throws ConfigurationException
  +        throws ModelException
       {
           // Locate all the adder methods
           final Collection methods = findMethods( "add", false );
  @@ -144,7 +144,7 @@
        * Enables the typed adder.
        */
       private void enableTypedAdder()
  -        throws ConfigurationException
  +        throws ModelException
       {
           final Collection methods = findMethods( "add", true );
           if( methods.size() == 0 )
  @@ -162,7 +162,7 @@
                   REZ.getString( "typed-adder-non-interface.error",
                                  m_class.getName(),
                                  type.getName() );
  -            throw new ConfigurationException( message );
  +            throw new ModelException( message );
           }
   
           m_typedPropertyConfigurer
  @@ -176,7 +176,7 @@
        * Enables text content.
        */
       private void enableContent()
  -        throws ConfigurationException
  +        throws ModelException
       {
           // Locate the 'addContent' methods, which return void, and take
           // a single parameter.
  @@ -206,7 +206,7 @@
        */
       private Collection findMethods( final String prefix,
                                       final boolean exactMatch )
  -        throws ConfigurationException
  +        throws ModelException
       {
           final Map methods = new HashMap();
           final List allMethods = findMethodsWithPrefix( prefix, exactMatch );
  @@ -246,7 +246,7 @@
                           REZ.getString( "multiple-methods-for-element.error",
                                          m_class.getName(),
                                          methodName );
  -                    throw new ConfigurationException( message );
  +                    throw new ModelException( message );
                   }
   
                   // Else, current type is string, and new type is not, so
  @@ -268,7 +268,7 @@
        * Locates the configurer for a particular class.
        */
       public static ObjectConfigurer getConfigurer( final Class classInfo )
  -        throws ConfigurationException
  +        throws ModelException
       {
           final DefaultObjectConfigurer configurer = new DefaultObjectConfigurer( classInfo );
           configurer.enableAll();
  @@ -279,7 +279,7 @@
        * Starts the configuration of an object.
        */
       public ConfigurationState startConfiguration( Object object )
  -        throws ConfigurationException
  +        throws ModelException
       {
           return new ConfigurationState( this, object, getPropertyCount() );
       }
  @@ -289,7 +289,7 @@
        * validation and type conversion.
        */
       public Object finishConfiguration( final ConfigurationState state )
  -        throws ConfigurationException
  +        throws ModelException
       {
           // Make sure there are no pending created objects
           final ConfigurationState defState = (ConfigurationState)state;
  
  
  
  1.10      +6 -6      jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/configurer/DefaultPropertyConfigurer.java
  
  Index: DefaultPropertyConfigurer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/configurer/DefaultPropertyConfigurer.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- DefaultPropertyConfigurer.java	29 Mar 2002 12:56:03 -0000	1.9
  +++ DefaultPropertyConfigurer.java	21 Apr 2002 02:41:23 -0000	1.10
  @@ -11,14 +11,14 @@
   import java.lang.reflect.Method;
   import org.apache.avalon.excalibur.i18n.ResourceManager;
   import org.apache.avalon.excalibur.i18n.Resources;
  -import org.apache.avalon.framework.configuration.ConfigurationException;
  +import org.apache.myrmidon.api.metadata.ModelException;
   
   /**
    * The default property configurer implementation, which uses reflection to
    * create and set property values.
    *
    * @author <a href="mailto:adammurdoch_ml@yahoo.com">Adam Murdoch</a>
  - * @version $Revision: 1.9 $ $Date: 2002/03/29 12:56:03 $
  + * @version $Revision: 1.10 $ $Date: 2002/04/21 02:41:23 $
    */
   class DefaultPropertyConfigurer
       implements PropertyConfigurer
  @@ -66,14 +66,14 @@
        * Adds a value for this property, to an object.
        */
       public void addValue( final ConfigurationState state, final Object value )
  -        throws ConfigurationException
  +        throws ModelException
       {
           final ConfigurationState defState = (ConfigurationState)state;
           // Check the property count
           if( defState.getPropertyCount( m_propertyIndex ) >= m_maxCount )
           {
               final String message = REZ.getString( "too-many-values.error" );
  -            throw new ConfigurationException( message );
  +            throw new ModelException( message );
           }
           defState.incPropertyCount( m_propertyIndex );
   
  @@ -85,11 +85,11 @@
           catch( final InvocationTargetException ite )
           {
               final Throwable cause = ite.getTargetException();
  -            throw new ConfigurationException( cause.getMessage(), cause );
  +            throw new ModelException( cause.getMessage(), cause );
           }
           catch( final Exception e )
           {
  -            throw new ConfigurationException( e.getMessage(), e );
  +            throw new ModelException( e.getMessage(), e );
           }
       }
   
  
  
  
  1.8       +6 -6      jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/configurer/ObjectConfigurer.java
  
  Index: ObjectConfigurer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/configurer/ObjectConfigurer.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ObjectConfigurer.java	5 Mar 2002 14:46:05 -0000	1.7
  +++ ObjectConfigurer.java	21 Apr 2002 02:41:23 -0000	1.8
  @@ -7,13 +7,13 @@
    */
   package org.apache.myrmidon.components.configurer;
   
  -import org.apache.avalon.framework.configuration.ConfigurationException;
  +import org.apache.myrmidon.api.metadata.ModelException;
   
   /**
    * Configures objects of a particular class.
    *
    * @author <a href="mailto:adammurdoch_ml@yahoo.com">Adam Murdoch</a>
  - * @version $Revision: 1.7 $ $Date: 2002/03/05 14:46:05 $
  + * @version $Revision: 1.8 $ $Date: 2002/04/21 02:41:23 $
    */
   interface ObjectConfigurer
   {
  @@ -23,10 +23,10 @@
        * @param object The object about to be configured.
        * @return  The state object, used to track type-specific state during
        *          configuration.
  -     * @throws  ConfigurationException On error starting the configuration.
  +     * @throws  ModelException On error starting the configuration.
        */
       ConfigurationState startConfiguration( Object object )
  -        throws ConfigurationException;
  +        throws ModelException;
   
       /**
        * Finishes the configuration of an object, performing any final
  @@ -34,10 +34,10 @@
        *
        * @param state The state object.
        * @return The configured object.
  -     * @throws ConfigurationException On error finishing the configurtion.
  +     * @throws ModelException On error finishing the configurtion.
        */
       Object finishConfiguration( ConfigurationState state )
  -        throws ConfigurationException;
  +        throws ModelException;
   
       /**
        * Returns a configurer for a atribute property of this class.
  
  
  
  1.6       +4 -4      jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/configurer/PropertyConfigurer.java
  
  Index: PropertyConfigurer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/configurer/PropertyConfigurer.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- PropertyConfigurer.java	5 Mar 2002 08:44:14 -0000	1.5
  +++ PropertyConfigurer.java	21 Apr 2002 02:41:23 -0000	1.6
  @@ -7,14 +7,14 @@
    */
   package org.apache.myrmidon.components.configurer;
   
  -import org.apache.avalon.framework.configuration.ConfigurationException;
  +import org.apache.myrmidon.api.metadata.ModelException;
   
   /**
    * Configures a property of an object.
    * TODO - axe createValue().
    *
    * @author <a href="mailto:adammurdoch_ml@yahoo.com">Adam Murdoch</a>
  - * @version $Revision: 1.5 $ $Date: 2002/03/05 08:44:14 $
  + * @version $Revision: 1.6 $ $Date: 2002/04/21 02:41:23 $
    */
   interface PropertyConfigurer
   {
  @@ -29,8 +29,8 @@
        * @param state The state object, representing the object being configured.
        * @param value The property value.  This must be assignable to the type
        *              returned by {@link #getType}.
  -     * @throws ConfigurationException If the property cannot be set.
  +     * @throws ModelException If the property cannot be set.
        */
       void addValue( ConfigurationState state, Object value )
  -        throws ConfigurationException;
  +        throws ModelException;
   }
  
  
  
  1.2       +9 -8      jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/configurer/ReportableConfigurationException.java
  
  Index: ReportableConfigurationException.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/configurer/ReportableConfigurationException.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ReportableConfigurationException.java	24 Feb 2002 07:43:37 -0000	1.1
  +++ ReportableConfigurationException.java	21 Apr 2002 02:41:23 -0000	1.2
  @@ -7,7 +7,7 @@
    */
   package org.apache.myrmidon.components.configurer;
   
  -import org.apache.avalon.framework.configuration.ConfigurationException;
  +import org.apache.myrmidon.api.metadata.ModelException;
   
   /**
    * A marker exception.
  @@ -15,24 +15,25 @@
    * TODO - this should extend ConfigurationException, except it is final.
    *
    * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
  - * @version $Revision: 1.1 $ $Date: 2002/02/24 07:43:37 $
  + * @version $Revision: 1.2 $ $Date: 2002/04/21 02:41:23 $
    */
   class ReportableConfigurationException
       extends Exception
   {
  -    private ConfigurationException m_cause;
  +    private ModelException m_cause;
   
  -    public ReportableConfigurationException( String s )
  +    public ReportableConfigurationException( final String message )
       {
  -        m_cause = new ConfigurationException( s );
  +        m_cause = new ModelException( message );
       }
   
  -    public ReportableConfigurationException( String s, Throwable throwable )
  +    public ReportableConfigurationException( final String message,
  +                                             final Throwable throwable )
       {
  -        m_cause = new ConfigurationException( s, throwable );
  +        m_cause = new ModelException( message, throwable );
       }
   
  -    public ConfigurationException getCause()
  +    public ModelException getCause()
       {
           return m_cause;
       }
  
  
  
  1.2       +10 -10    jakarta-ant-myrmidon/container/src/test/org/apache/myrmidon/components/configurer/test/ConfigTestConfigurable.java
  
  Index: ConfigTestConfigurable.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/test/org/apache/myrmidon/components/configurer/test/ConfigTestConfigurable.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ConfigTestConfigurable.java	17 Mar 2002 08:07:08 -0000	1.1
  +++ ConfigTestConfigurable.java	21 Apr 2002 02:41:23 -0000	1.2
  @@ -7,30 +7,30 @@
    */
   package org.apache.myrmidon.components.configurer.test;
   
  -import org.apache.avalon.framework.configuration.Configurable;
  -import org.apache.avalon.framework.configuration.Configuration;
  -import org.apache.avalon.framework.configuration.ConfigurationException;
  +import org.apache.myrmidon.api.metadata.ModelElement;
  +import org.apache.myrmidon.api.metadata.ModelException;
  +import org.apache.myrmidon.api.metadata.Modeller;
   
   /**
    * Simple class to test {@link org.apache.avalon.framework.configuration.Configurable}.
    *
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
  - * @version $Revision: 1.1 $ $Date: 2002/03/17 08:07:08 $
  + * @version $Revision: 1.2 $ $Date: 2002/04/21 02:41:23 $
    */
   public class ConfigTestConfigurable
  -    implements Configurable
  +    implements Modeller
   {
  -    private Configuration m_configuration;
  +    private ModelElement m_model;
   
  -    public void configure( Configuration configuration )
  -        throws ConfigurationException
  +    public void model( final ModelElement model )
  +        throws ModelException
       {
  -        m_configuration = configuration;
  +        m_model = model;
       }
   
       public boolean equals( final Object object )
       {
           final ConfigTestConfigurable other = (ConfigTestConfigurable)object;
  -        return m_configuration == other.m_configuration;
  +        return m_model == other.m_model;
       }
   }
  
  
  
  1.9       +68 -68    jakarta-ant-myrmidon/container/src/test/org/apache/myrmidon/components/configurer/test/DefaultConfigurerTestCase.java
  
  Index: DefaultConfigurerTestCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/test/org/apache/myrmidon/components/configurer/test/DefaultConfigurerTestCase.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- DefaultConfigurerTestCase.java	17 Apr 2002 11:57:28 -0000	1.8
  +++ DefaultConfigurerTestCase.java	21 Apr 2002 02:41:23 -0000	1.9
  @@ -11,9 +11,9 @@
   import org.apache.aut.converter.lib.StringToIntegerConverter;
   import org.apache.avalon.excalibur.i18n.Resources;
   import org.apache.avalon.framework.ExceptionUtil;
  -import org.apache.avalon.framework.configuration.ConfigurationException;
  -import org.apache.avalon.framework.configuration.DefaultConfiguration;
   import org.apache.myrmidon.api.TaskContext;
  +import org.apache.myrmidon.api.metadata.ModelException;
  +import org.apache.myrmidon.api.metadata.ModelElement;
   import org.apache.myrmidon.components.AbstractComponentTest;
   import org.apache.myrmidon.components.store.DefaultPropertyStore;
   import org.apache.myrmidon.components.configurer.DefaultConfigurer;
  @@ -108,7 +108,7 @@
           throws Exception
       {
           // Setup test data
  -        final DefaultConfiguration config = new DefaultConfiguration( "test", "test" );
  +        final ModelElement config = new ModelElement( "test", "test" );
           final String value1 = "some value";
           config.setAttribute( "some-prop", value1 );
   
  @@ -130,7 +130,7 @@
           throws Exception
       {
           // Setup test data
  -        final DefaultConfiguration config = new DefaultConfiguration( "test", "test" );
  +        final ModelElement config = new ModelElement( "test", "test" );
           config.setAttribute( "int-prop", "90" );
           config.setAttribute( "integer-prop", "-401" );
   
  @@ -156,7 +156,7 @@
           throws Exception
       {
           // Setup test data
  -        final DefaultConfiguration config = new DefaultConfiguration( "test", "test" );
  +        final ModelElement config = new ModelElement( "test", "test" );
           config.setAttribute( "unknown", "some value" );
   
           final ConfigTestEmpty test = new ConfigTestEmpty();
  @@ -167,7 +167,7 @@
               m_configurer.configureElement( test, config, m_context );
               fail();
           }
  -        catch( final ConfigurationException ce )
  +        catch( final ModelException ce )
           {
               final String message = REZ.getString( "no-such-attribute.error", "test", "unknown" );
               assertSameMessage( message, ce );
  @@ -181,12 +181,12 @@
           throws Exception
       {
           // Setup test data
  -        final DefaultConfiguration config = new DefaultConfiguration( "test", "test" );
  -        final DefaultConfiguration child1 = new DefaultConfiguration( "prop", "test" );
  +        final ModelElement config = new ModelElement( "test", "test" );
  +        final ModelElement child1 = new ModelElement( "prop", "test" );
           final String value1 = "some value";
           child1.setAttribute( "some-prop", value1 );
           config.addChild( child1 );
  -        final DefaultConfiguration child2 = new DefaultConfiguration( "prop", "test" );
  +        final ModelElement child2 = new ModelElement( "prop", "test" );
           final String value2 = "another value";
           child2.setAttribute( "some-prop", value2 );
           config.addChild( child2 );
  @@ -214,8 +214,8 @@
           throws Exception
       {
           // Setup test data
  -        final DefaultConfiguration config = new DefaultConfiguration( "test", "test" );
  -        final DefaultConfiguration elem = new DefaultConfiguration( "unknown", "test" );
  +        final ModelElement config = new ModelElement( "test", "test" );
  +        final ModelElement elem = new ModelElement( "unknown", "test" );
           config.addChild( elem );
   
           final ConfigTestEmpty test = new ConfigTestEmpty();
  @@ -226,7 +226,7 @@
               m_configurer.configureElement( test, config, m_context );
               fail();
           }
  -        catch( final ConfigurationException ce )
  +        catch( final ModelException ce )
           {
               final String message = REZ.getString( "no-such-element.error", "test", "unknown" );
               assertSameMessage( message, ce );
  @@ -240,9 +240,9 @@
           throws Exception
       {
           // Create the test data
  -        final DefaultConfiguration config = new DefaultConfiguration( "test", "test" );
  +        final ModelElement config = new ModelElement( "test", "test" );
           final String value1 = "some value";
  -        config.setValue( value1 );
  +        config.setContent( value1 );
   
           final ConfigTestContent test = new ConfigTestContent();
   
  @@ -262,8 +262,8 @@
           throws Exception
       {
           // Create the test data
  -        final DefaultConfiguration config = new DefaultConfiguration( "test", "test" );
  -        config.setValue( "some value" );
  +        final ModelElement config = new ModelElement( "test", "test" );
  +        config.setContent( "some value" );
   
           final ConfigTestEmpty test = new ConfigTestEmpty();
   
  @@ -273,7 +273,7 @@
               m_configurer.configureElement( test, config, m_context );
               fail();
           }
  -        catch( final ConfigurationException ce )
  +        catch( final ModelException ce )
           {
               final String message = REZ.getString( "no-content.error", "test" );
               assertSameMessage( message, ce );
  @@ -287,7 +287,7 @@
           throws Exception
       {
           // Setup test data
  -        final DefaultConfiguration config = new DefaultConfiguration( "test", "test" );
  +        final ModelElement config = new ModelElement( "test", "test" );
           config.setAttribute( "prop", "some ${prop-a} value" );
   
           final ConfigTestPropResolution test = new ConfigTestPropResolution();
  @@ -309,7 +309,7 @@
       public void testReferenceAttribute() throws Exception
       {
           // Setup test data
  -        final DefaultConfiguration config = new DefaultConfiguration( "test", "test" );
  +        final ModelElement config = new ModelElement( "test", "test" );
           config.setAttribute( "some-prop-ref", "prop-a" );
   
           final ConfigTestReferenceAttribute test = new ConfigTestReferenceAttribute();
  @@ -321,7 +321,7 @@
           {
               configure( test, config );
           }
  -        catch( ConfigurationException e )
  +        catch( ModelException e )
           {
               //Expected to fail as -ref no longer supported
               //pattern for attributes
  @@ -341,8 +341,8 @@
       public void testReferenceElement() throws Exception
       {
           // Setup test data
  -        final DefaultConfiguration config = new DefaultConfiguration( "test", "test" );
  -        final DefaultConfiguration elem = new DefaultConfiguration( "some-prop-ref", "test" );
  +        final ModelElement config = new ModelElement( "test", "test" );
  +        final ModelElement elem = new ModelElement( "some-prop-ref", "test" );
           elem.setAttribute( "id", "prop-a" );
           config.addChild( elem );
   
  @@ -366,8 +366,8 @@
           throws Exception
       {
           // Setup test data
  -        final DefaultConfiguration config = new DefaultConfiguration( "test", "test" );
  -        final DefaultConfiguration elem = new DefaultConfiguration( "some-prop-ref", "test" );
  +        final ModelElement config = new ModelElement( "test", "test" );
  +        final ModelElement elem = new ModelElement( "some-prop-ref", "test" );
           elem.setAttribute( "id", "prop-a" );
           elem.setAttribute( "extra-attr", "some value" );
           config.addChild( elem );
  @@ -380,7 +380,7 @@
               m_configurer.configureElement( test, config, m_context );
               fail();
           }
  -        catch( ConfigurationException e )
  +        catch( ModelException e )
           {
               final String[] messages = new String[]
               {
  @@ -397,7 +397,7 @@
       public void testReferenceConversion() throws Exception
       {
           // Setup test data
  -        final DefaultConfiguration config = new DefaultConfiguration( "test", "test" );
  +        final ModelElement config = new ModelElement( "test", "test" );
           config.setAttribute( "prop-a-ref", "id" );
   
           final Integer refValue = new Integer( 21 );
  @@ -412,7 +412,7 @@
           {
               configure( test, config );
           }
  -        catch( ConfigurationException e )
  +        catch( ModelException e )
           {
               //Good should no longer work
               return;
  @@ -434,8 +434,8 @@
           throws Exception
       {
           // Setup test data
  -        final DefaultConfiguration config = new DefaultConfiguration( "test", "test" );
  -        final DefaultConfiguration child = new DefaultConfiguration( "prop-a", "test" );
  +        final ModelElement config = new ModelElement( "test", "test" );
  +        final ModelElement child = new ModelElement( "prop-a", "test" );
           config.addChild( child );
   
           registerRole( new RoleInfo( "myrole1", null, MyRole1.class, "default-type" ) );
  @@ -460,7 +460,7 @@
           throws Exception
       {
           // Setup test data
  -        final DefaultConfiguration config = new DefaultConfiguration( "test", "test" );
  +        final ModelElement config = new ModelElement( "test", "test" );
   
           final ConfigTestNonInterfaceAdder test = new ConfigTestNonInterfaceAdder();
   
  @@ -470,7 +470,7 @@
               m_configurer.configureElement( test, config, m_context );
               fail();
           }
  -        catch( final ConfigurationException ce )
  +        catch( final ModelException ce )
           {
               final String[] messages = {
                   REZ.getString( "bad-configure-element.error", "test" ),
  @@ -489,7 +489,7 @@
           throws Exception
       {
           // Setup test data
  -        final DefaultConfiguration config = new DefaultConfiguration( "test", "test" );
  +        final ModelElement config = new ModelElement( "test", "test" );
   
           final ConfigTestMultipleTypedAdder test = new ConfigTestMultipleTypedAdder();
   
  @@ -499,7 +499,7 @@
               m_configurer.configureElement( test, config, m_context );
               fail();
           }
  -        catch( final ConfigurationException ce )
  +        catch( final ModelException ce )
           {
               final String[] messages = new String[]
               {
  @@ -519,9 +519,9 @@
           throws Exception
       {
           // Setup test data
  -        final DefaultConfiguration config = new DefaultConfiguration( "test", "test" );
  -        final DefaultConfiguration child1 = new DefaultConfiguration( "my-type1", "test" );
  -        final DefaultConfiguration child2 = new DefaultConfiguration( "my-type2", "test" );
  +        final ModelElement config = new ModelElement( "test", "test" );
  +        final ModelElement child1 = new ModelElement( "my-type1", "test" );
  +        final ModelElement child2 = new ModelElement( "my-type2", "test" );
           config.addChild( child1 );
           config.addChild( child2 );
   
  @@ -547,8 +547,8 @@
           throws Exception
       {
           // Setup test data
  -        final DefaultConfiguration config = new DefaultConfiguration( "test", "test" );
  -        final DefaultConfiguration child1 = new DefaultConfiguration( "my-type1", "test" );
  +        final ModelElement config = new ModelElement( "test", "test" );
  +        final ModelElement child1 = new ModelElement( "my-type1", "test" );
           config.addChild( child1 );
   
           // Register incompatible types with the same name, as data-type and myrole1.
  @@ -576,8 +576,8 @@
           throws Exception
       {
           // Setup test data
  -        final DefaultConfiguration config = new DefaultConfiguration( "test", "test" );
  -        final DefaultConfiguration child = new DefaultConfiguration( "some-type", "test" );
  +        final ModelElement config = new ModelElement( "test", "test" );
  +        final ModelElement child = new ModelElement( "some-type", "test" );
           child.setAttribute( "prop", "some value" );
           config.addChild( child );
   
  @@ -604,9 +604,9 @@
           throws Exception
       {
           // Setup test data
  -        final DefaultConfiguration config = new DefaultConfiguration( "test", "test" );
  -        final DefaultConfiguration child1 = new DefaultConfiguration( "my-type1", "test" );
  -        final DefaultConfiguration child2 = new DefaultConfiguration( "my-type2", "test" );
  +        final ModelElement config = new ModelElement( "test", "test" );
  +        final ModelElement child1 = new ModelElement( "my-type1", "test" );
  +        final ModelElement child2 = new ModelElement( "my-type2", "test" );
           config.addChild( child1 );
           config.addChild( child2 );
   
  @@ -628,9 +628,9 @@
           throws Exception
       {
           // Setup test data
  -        final DefaultConfiguration config = new DefaultConfiguration( "test", "test" );
  -        final DefaultConfiguration child1 = new DefaultConfiguration( "config", "test" );
  -        final DefaultConfiguration child2 = new DefaultConfiguration( "config", "test" );
  +        final ModelElement config = new ModelElement( "test", "test" );
  +        final ModelElement child1 = new ModelElement( "config", "test" );
  +        final ModelElement child2 = new ModelElement( "config", "test" );
           config.addChild( child1 );
           config.addChild( child2 );
   
  @@ -652,7 +652,7 @@
           throws Exception
       {
           // Setup test data
  -        final DefaultConfiguration config = new DefaultConfiguration( "test", "test" );
  +        final ModelElement config = new ModelElement( "test", "test" );
   
           final ConfigTestConfigurable test = new ConfigTestConfigurable();
   
  @@ -660,7 +660,7 @@
           m_configurer.configureElement( test, config, m_context );
   
           final ConfigTestConfigurable expected = new ConfigTestConfigurable();
  -        expected.configure( config );
  +        expected.model( config );
           assertEquals( expected, test );
       }
   
  @@ -671,7 +671,7 @@
           throws Exception
       {
           // Setup test data
  -        final DefaultConfiguration config = new DefaultConfiguration( "test", "test" );
  +        final ModelElement config = new ModelElement( "test", "test" );
           config.setAttribute( "some-prop-ref", "${id}" );
   
           final ConfigTestIdResolve test = new ConfigTestIdResolve();
  @@ -684,7 +684,7 @@
           {
               configure( test, config );
           }
  -        catch( ConfigurationException e )
  +        catch( ModelException e )
           {
               return;
           }
  @@ -706,7 +706,7 @@
           fail( "-ref pattern on attributes no longer supported" );
   
           // Setup test data
  -        final DefaultConfiguration config = new DefaultConfiguration( "test", "test" );
  +        final ModelElement config = new ModelElement( "test", "test" );
           config.setAttribute( "some-prop-ref", "unknown-prop" );
   
           final ConfigTestUnknownReference test = new ConfigTestUnknownReference();
  @@ -717,7 +717,7 @@
               m_configurer.configureElement( test, config, m_context );
               fail();
           }
  -        catch( ConfigurationException e )
  +        catch( ModelException e )
           {
               final String[] messages = new String[]
               {
  @@ -738,7 +738,7 @@
           fail( "-ref pattern on attributes no longer supported" );
   
           // Setup test data
  -        final DefaultConfiguration config = new DefaultConfiguration( "test", "test" );
  +        final ModelElement config = new ModelElement( "test", "test" );
           config.setAttribute( "some-prop-ref", "prop-a" );
   
           final ConfigTestMismatchedRefType test = new ConfigTestMismatchedRefType();
  @@ -751,7 +751,7 @@
               m_configurer.configureElement( test, config, m_context );
               fail();
           }
  -        catch( ConfigurationException e )
  +        catch( ModelException e )
           {
               final String[] messages = new String[]
               {
  @@ -772,8 +772,8 @@
           throws Exception
       {
           // Setup test data
  -        final DefaultConfiguration config = new DefaultConfiguration( "test", "test" );
  -        final DefaultConfiguration child = new DefaultConfiguration( "my-role1-ref", "test" );
  +        final ModelElement config = new ModelElement( "test", "test" );
  +        final ModelElement child = new ModelElement( "my-role1-ref", "test" );
           child.setAttribute( "id", "id2" );
           config.addChild( child );
   
  @@ -798,8 +798,8 @@
       public void testNestedErrors() throws Exception
       {
           // Setup test data
  -        final DefaultConfiguration config = new DefaultConfiguration( "test", "test" );
  -        final DefaultConfiguration elem = new DefaultConfiguration( "prop", "test" );
  +        final ModelElement config = new ModelElement( "test", "test" );
  +        final ModelElement elem = new ModelElement( "prop", "test" );
           elem.setAttribute( "not-a-prop", "not-a-value" );
           config.addChild( elem );
   
  @@ -811,7 +811,7 @@
               m_configurer.configureElement( test, config, m_context );
               fail();
           }
  -        catch( ConfigurationException e )
  +        catch( ModelException e )
           {
               final String message = REZ.getString( "no-such-attribute.error",
                                                     "prop",
  @@ -828,12 +828,12 @@
           throws Exception
       {
           // Setup test data
  -        final DefaultConfiguration config = new DefaultConfiguration( "test", "test" );
  +        final ModelElement config = new ModelElement( "test", "test" );
           config.setAttribute( "prop1", "some-value" );
  -        config.setValue( "99" );
  -        DefaultConfiguration elem = new DefaultConfiguration( "prop2", "test" );
  +        config.setContent( "99" );
  +        ModelElement elem = new ModelElement( "prop2", "test" );
           config.addChild( elem );
  -        elem = new DefaultConfiguration( "my-type1", "test" );
  +        elem = new ModelElement( "my-type1", "test" );
           config.addChild( elem );
   
           registerConverter( ObjectToMyRole1Converter.class, String.class, MyRole1.class );
  @@ -862,9 +862,9 @@
       public void testSetAndAdd() throws Exception
       {
           // Setup test data
  -        final DefaultConfiguration config = new DefaultConfiguration( "test", "test" );
  +        final ModelElement config = new ModelElement( "test", "test" );
           config.setAttribute( "prop", "some value" );
  -        DefaultConfiguration elem = new DefaultConfiguration( "prop", "test" );
  +        ModelElement elem = new ModelElement( "prop", "test" );
           elem.setAttribute( "prop", "another value" );
           config.addChild( elem );
   
  @@ -883,14 +883,14 @@
       }
   
       private void configure( final Object test,
  -                            final DefaultConfiguration config )
  -        throws ConfigurationException
  +                            final ModelElement config )
  +        throws ModelException
       {
           try
           {
               m_configurer.configureElement( test, config, m_context );
           }
  -        catch( final ConfigurationException ce )
  +        catch( final ModelException ce )
           {
               ExceptionUtil.printStackTrace( ce );
               throw ce;
  
  
  
  1.2       +7 -7      jakarta-ant-myrmidon/container/src/test/org/apache/myrmidon/components/configurer/test/data/ConfigTestConfigAdder.java
  
  Index: ConfigTestConfigAdder.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/test/org/apache/myrmidon/components/configurer/test/data/ConfigTestConfigAdder.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ConfigTestConfigAdder.java	17 Mar 2002 08:07:08 -0000	1.1
  +++ ConfigTestConfigAdder.java	21 Apr 2002 02:41:23 -0000	1.2
  @@ -8,26 +8,26 @@
   package org.apache.myrmidon.components.configurer.test.data;
   
   import java.util.ArrayList;
  -import org.apache.avalon.framework.configuration.Configuration;
  +import org.apache.myrmidon.api.metadata.ModelElement;
   
   /**
  - * Simple class to test adder for Configurations.
  + * Simple class to test adder for ModelElement adds.
    *
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
  - * @version $Revision: 1.1 $ $Date: 2002/03/17 08:07:08 $
  + * @version $Revision: 1.2 $ $Date: 2002/04/21 02:41:23 $
    */
   public class ConfigTestConfigAdder
   {
  -    private ArrayList m_configurations = new ArrayList();
  +    private ArrayList m_models = new ArrayList();
   
  -    public void addConfig( final Configuration configuration )
  +    public void addConfig( final ModelElement model )
       {
  -        m_configurations.add( configuration );
  +        m_models.add( model );
       }
   
       public boolean equals( final Object object )
       {
           final ConfigTestConfigAdder other = (ConfigTestConfigAdder)object;
  -        return m_configurations.equals( other.m_configurations );
  +        return m_models.equals( other.m_models );
       }
   }
  
  
  
  1.3       +2 -2      jakarta-ant-myrmidon/container/src/test/org/apache/myrmidon/components/configurer/test/data/ConfigTestTypedAdder.java
  
  Index: ConfigTestTypedAdder.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/test/org/apache/myrmidon/components/configurer/test/data/ConfigTestTypedAdder.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ConfigTestTypedAdder.java	19 Mar 2002 11:19:24 -0000	1.2
  +++ ConfigTestTypedAdder.java	21 Apr 2002 02:41:23 -0000	1.3
  @@ -11,10 +11,10 @@
   import org.apache.myrmidon.components.configurer.test.MyRole1;
   
   /**
  - * Simple class to test adder for Configurations.
  + * Simple class to test adder for Roles.
    *
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
  - * @version $Revision: 1.2 $ $Date: 2002/03/19 11:19:24 $
  + * @version $Revision: 1.3 $ $Date: 2002/04/21 02:41:23 $
    */
   public class ConfigTestTypedAdder
   {
  
  
  
  1.2       +7 -7      jakarta-ant-myrmidon/container/src/test/org/apache/myrmidon/components/configurer/test/data/ConfigTestTypedConfigAdder.java
  
  Index: ConfigTestTypedConfigAdder.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/test/org/apache/myrmidon/components/configurer/test/data/ConfigTestTypedConfigAdder.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ConfigTestTypedConfigAdder.java	17 Mar 2002 08:07:08 -0000	1.1
  +++ ConfigTestTypedConfigAdder.java	21 Apr 2002 02:41:23 -0000	1.2
  @@ -8,26 +8,26 @@
   package org.apache.myrmidon.components.configurer.test.data;
   
   import java.util.ArrayList;
  -import org.apache.avalon.framework.configuration.Configuration;
  +import org.apache.myrmidon.api.metadata.ModelElement;
   
   /**
  - * Simple class to test adder for Configurations.
  + * Simple class to test adder for ModelElement adds.
    *
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
  - * @version $Revision: 1.1 $ $Date: 2002/03/17 08:07:08 $
  + * @version $Revision: 1.2 $ $Date: 2002/04/21 02:41:23 $
    */
   public class ConfigTestTypedConfigAdder
   {
  -    private ArrayList m_configurations = new ArrayList();
  +    private ArrayList m_models = new ArrayList();
   
  -    public void add( final Configuration configuration )
  +    public void add( final ModelElement model )
       {
  -        m_configurations.add( configuration );
  +        m_models.add( model );
       }
   
       public boolean equals( final Object object )
       {
           final ConfigTestTypedConfigAdder other = (ConfigTestTypedConfigAdder)object;
  -        return m_configurations.equals( other.m_configurations );
  +        return m_models.equals( other.m_models );
       }
   }
  
  
  

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message