commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hls...@apache.org
Subject cvs commit: jakarta-commons-sandbox/hivemind/src/test/hivemind/test/rules TestClassTranslator.java TestEnumerationTranslator.java
Date Mon, 08 Sep 2003 20:14:19 GMT
hlship      2003/09/08 13:14:19

  Modified:    hivemind/xdocs index.xml extension-points.xml navigation.xml
                        bootstrap.xml multithreading.xml ioc.xml
                        services.xml rules.xml
               hivemind/src/test/hivemind/test TestMessagesImpl.java
                        HiveMindTestCase.java
               hivemind/src/java/org/apache/commons/hivemind/parse
                        DescriptorParser.java
               hivemind/src/java/org/apache/commons/hivemind/util
                        AbstractResource.java
               hivemind/src/java/org/apache/commons/hivemind Resource.java
                        HiveMindMessages.properties
               hivemind/src/test/hivemind/test/config
                        TestExtensionPoint.java
               hivemind/src/test/hivemind/test/util
                        TestClasspathResource.java
               hivemind/src/java/org/apache/commons/hivemind/impl
                        RegistryBuilder.java MessagesImpl.java
                        SchemaProcessorImpl.java
               hivemind/src/java/org/apache/commons/hivemind/schema
                        Translator.java
               hivemind/src/test/hivemind/test/parse
                        TestDescriptorParser.java
               hivemind/src/test/hivemind/test/rules
                        TestClassTranslator.java
                        TestEnumerationTranslator.java
  Added:       hivemind/src/test/hivemind/test/config/impl
                        ResourceHolder.java
               hivemind/src/test/hivemind/test/config
                        ResourceTranslator.xml
               hivemind/src/java/org/apache/commons/hivemind/schema/rules
                        ResourceTranslator.java
  Log:
  Add resource translator.
  
  Revision  Changes    Path
  1.9       +55 -21    jakarta-commons-sandbox/hivemind/xdocs/index.xml
  
  Index: index.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/xdocs/index.xml,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- index.xml	30 Aug 2003 14:24:08 -0000	1.8
  +++ index.xml	8 Sep 2003 20:14:18 -0000	1.9
  @@ -24,7 +24,7 @@
     	<p>
     	Using HiveMind means writing less code; code that you would ordinarily write
     	for reading configuration files ... gone.  Code for managing singleton service objects ... gone.
  -  	The use of <em>interceptors</em>	 means that much repetative coding also dissappears.  
  +  	The use of <em>interceptors</em>	 means that much repetetive coding also dissappears.  
     	For example, you can have a service automatically log method entry and exit using
     	an interceptor rather than in your own code.
     	</p>
  @@ -67,8 +67,9 @@
     	<section name="Status">
     	
     	<p>
  -  	A new release of Javassist is expected towards the end of the month (Aug 2003). A release of
  -  	HiveMind will follow; at which point HiveMind 1.0 will enter a beta period.	
  +  	HiveMind is nearly ready to go into 1.0 beta. It's more than time to start building a community ...
  +  	contact <a href="mailto:hlship@apache.org">Howard M. Lewis Ship</a> if you would like
  +  	to get involved!  
     	</p>
     		
     	</section>
  @@ -84,19 +85,25 @@
       	<p>
       	Services are represented as an Java interface accessible
       	within a <em>registry</em> using
  -    	a well known name.  Services are usually singletons, though
  +    	a unique id.  Services are usually singletons, though
       	other service models are available.
       	</p>
       	
       	<p>
  -    	Extension points are lists of elements, also accessible
  -    	using a well known name.	The elements of an extension point
  +    	Extension points are used for configuration information. Each extension point is a list of elements, 
  +    	also accessible
  +    	using a unique id.	The elements of an extension point
       	are provided by extensions
       	that appear in many modules, which is the basis for
       	allowing multiple modules to work together to form
       	the application.
       	</p>
       	
  +    	<p>
  +    	Frequently, services and extension points are used together; modules contribute to an extension
  +    	point and a related services makes use of the combined data.
  +    	</p>
  +    	
       </section>
       
       <section name="Modules">
  @@ -170,8 +177,8 @@
       You code is responsible for:
       <ul>
       <li>Obtaining a reference to the registry singleton</li>	
  -    <li>Knowing the name of the service to access</li>
  -    <li>Passing in the class for the interface</li>
  +    <li>Knowing the complete id of the service to access</li>
  +    <li>Passing in the interface class</li>
       </ul>	
       </p>	
       
  @@ -179,7 +186,7 @@
       HiveMind is responsible for:
       <ul>
       <li>Finding the service, creating it as needed</li>
  -    <li>Checking the type of the service against your codes expections</li>
  +    <li>Checking the type of the service against your code's expections</li>
       <li>Operating in a completely thread-safe manner</li>
       <li>Reporting any errors in a useful, verbose fashion</li>
       </ul>	
  @@ -219,19 +226,21 @@
     	
   <p>
   The concept behind HiveMind, and most other microkernels, is to reduce the amount of code in your application
  -and make it more testable. If your applications are like my applications, there is an awful lot of code
  +and  at the same time,
  +make your application more testable. If your applications are like my applications, there is an awful lot of code
   in place that deals just with creating objects and hooking them together, and reading and processing configuration
   data. 
   </p>	
   
   <p>
   HiveMind moves virtually all of that logic into the framework, driven by the module deployment descriptors.
  -Inside the descriptor, you describe your services, your configuration data, and how everything is hooked together.	
  +Inside the descriptor, you describe your services, your configuration data (extension points), 
  +and how everything is hooked together.	
   </p>
   
   <p>
   HiveMind can do all the busy work for you; using HiveMind makes it
  -so that <em>the easiest approach is also correct approach.</em>
  +so that <em>the easiest approach is also the correct approach.</em>
   </p>
   
   <table>
  @@ -280,31 +289,56 @@
   	<td>
   	
   <pre>
  -
  -SomeOtherService _otherService;
  +private SomeOtherService _otherService;
   
   public String myMethod(String param)
   {
     if (_otherService == null)
  -    _otherService = // . . .
  +    _otherService = // Lookup other service . . .
   
  -  _otherService.doSomething(. . . );
  +  _otherService.doSomething(. . .);
     
     . . .
   }	
  -	
   </pre>	
   
   <p>
  -Note: not thread safe.	
  +How the other service is looked up is specified to the environment; it might be a JNDI lookup for an EJB. For
  +other microkernels, such as Avalon, there will be calls to a specific API.
  +</p>
  +
  +<p>
  +In addition, this code is not thread-safe; multiple threads could execute it simultaneously, causing
  +unwanted (and possibly destructive) multiple lookups of the other service.
   </p>
   		
   	</td>
   
   <td>
   Let HiveMind assign the other service as a property.
  -HiveMind creates proxies that automatically create
  -services just-in-time (in a thread safe manner).	
  +
  +
  +<pre>
  +private SomeOtherService _otherService;
  +
  +public void setOtherService(SomeOtherService otherService)
  +{
  +  _otherService = otherService;
  +}
  +
  +public String myMethod(String param)
  +{
  +  _otherService.doSomething(. . .);
  +  
  +  . . .
  +}
  +</pre>
  +
  +<p>
  +HiveMind uses a system of proxies to defer creation of services until actually
  +needed; HiveMind is also completely threadsafe.
  +</p>
  +
   </td>
   </tr>
   
  
  
  
  1.8       +20 -8     jakarta-commons-sandbox/hivemind/xdocs/extension-points.xml
  
  Index: extension-points.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/xdocs/extension-points.xml,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- extension-points.xml	30 Aug 2003 14:54:29 -0000	1.7
  +++ extension-points.xml	8 Sep 2003 20:14:18 -0000	1.8
  @@ -23,8 +23,8 @@
   There is not a direct connection between a service and a extension point, though it is often the case
   that a service and an extension point will be similarily named (or even identically named; services
   and extension points are in seperate namespaces).	Any relationship between a service and an extension point
  -is explicit only in code ... the service may request an extension point from the registry and operate
  -on the elements it receives.
  +is explicit only in code ... the service may be configured with the elements of an extension point and operate 
  +on those elements in some way.
   </p>
   
   		</section>
  @@ -117,7 +117,18 @@
   <p>
   This extra work in the module descriptor eliminates a large amount of custom Java code that would
   otherwise be necessary to walk the XML contributions tree and convert elements and attributes
  -into objects and properties.	The end result is very concise, readable contributions (as shown in the &_extension;
  +into objects and properties.	Yes, you could do this in your own code ... but would you really 
  +include all the error checking that HiveMind does?  Or the line-precise error reporting? Would you bother
  +to create unit tests for all the failure conditions?  
  +</p>
  +
  +<p>
  +Using HiveMind allows you to write the schema and rules and know that the conversion from XML to Java objects
  +is done uniformly, efficiently and robustly.
  +</p>
  +
  +<p>
  +The end result of thsi mechanism is very concise, readable contributions (as shown in the &_extension;
   in the example).
   </p>
   
  @@ -127,7 +138,7 @@
   
   <section name="Accessing Extension Points">
   
  -<p>Like services, configurations are meant to be easy to access.</p>
  +<p>Like services, extension points are meant to be easy to access.</p>
   
   <source><![CDATA[
   Registry registry = HiveMind.getDefault();
  @@ -168,7 +179,7 @@
   </p>
   
   <p>
  -The element list for a configuration extension point is not created until the
  +The  list of elements for an extension point is not created until the
   first call to <code>Registry.getExtensionPointElements()</code>	for that extension point.
   </p>
   
  @@ -180,8 +191,9 @@
   </p>	
   
   <p>
  -In general, you will never know this; when you access the <code>size()</code> of the list or <code>get()</code>
  -any of its elements, the conversion of &_extension; contributions into Java objects will be triggered, and those
  +In general, you will never know (or need to know) this; when you access the <code>size()</code> of the list or <code>get()</code>
  +any of its elements, the conversion of &_extension; contributions into Java
  +objects will be triggered, and those
   Java objects will be returned in the list.
   </p>
   
  
  
  
  1.15      +5 -1      jakarta-commons-sandbox/hivemind/xdocs/navigation.xml
  
  Index: navigation.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/xdocs/navigation.xml,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- navigation.xml	5 Sep 2003 16:12:54 -0000	1.14
  +++ navigation.xml	8 Sep 2003 20:14:18 -0000	1.15
  @@ -18,7 +18,11 @@
   				<item name="ManifestClassPath" href="/ant/ManifestClassPath.html"/>
   				<item name="ConstructRegistry" href="/ant/ConstructRegistry.html"/>	
   			</item>
  +		</menu>
  +		<menu name="Resources">
   			<item name="Downloads" href="http://jakarta.apache.org/~hlship/hivemind/"/>
  +			<item name="Tapestry and HiveMind Blog"
  +					href="http://javatapestry.blogspot.com/"/>
   		</menu>
   	</body>
   </project>
  
  
  
  1.2       +3 -3      jakarta-commons-sandbox/hivemind/xdocs/bootstrap.xml
  
  Index: bootstrap.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/xdocs/bootstrap.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- bootstrap.xml	4 Sep 2003 23:59:03 -0000	1.1
  +++ bootstrap.xml	8 Sep 2003 20:14:18 -0000	1.2
  @@ -134,8 +134,8 @@
   <p>
   Building the registry requires four steps:
   <ul>
  -<li>Create a <a href="apidocs/org/apache/commons/hivemind/ClassResolver.html">ClassResolver</a> instance. The
  -	DefaultClassResolver is pretty much all you'll need, it use's the thread's context class loader.</li>	
  +<li>Create a <a href="apidocs/org/apache/commons/hivemind/ClassResolver.html">ClassResolver</a> instance. 
  +	DefaultClassResolver uses the thread's context class loader.</li>	
   <li>
   Create a <a href="apidocs/org/apache/commons/hivemind/impl/RegistryBuilder.html">RegistryBuilder</a> instance.
   </li>
  
  
  
  1.4       +9 -9      jakarta-commons-sandbox/hivemind/xdocs/multithreading.xml
  
  Index: multithreading.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/xdocs/multithreading.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- multithreading.xml	30 Aug 2003 14:54:29 -0000	1.3
  +++ multithreading.xml	8 Sep 2003 20:14:18 -0000	1.4
  @@ -21,7 +21,7 @@
   </p>
   
   <p>
  -In the world of J2EE, multi-threading is an issue.  HiveMind services are all singletons, and must
  +In the world of J2EE, multi-threading is always an issue.  HiveMind services are usually singletons, and must
   be prepared to operate in a multi-threaded environment.  That means services should not have
   any specific state, much like a servlet.
   </p>
  @@ -39,7 +39,7 @@
   </p>
   
   <p>
  -The construction activities are not threadsafe.   This includes the parser, and other
  +The construction activities are not thread-safe.   This includes the parser, and other
   code (virtually all of which is hidden from your application).
   </p>
   
  @@ -47,7 +47,7 @@
   The construction state ends when the <code>RegistryBuilder</code>	returns
   the
   <a href="apidocs/org/apache/commons/hivemind/Registry.html">Registry</a>
  -from method <code>constructRegistry()</code>.  The registry is threadsafe.
  +from method <code>constructRegistry()</code>.  The registry is thread-safe.
   </p>
   	
   </section>
  @@ -55,19 +55,19 @@
   <section name="Runtime State">
   
   <p>
  -Everything that occurs with the registry and modules must be threadsafe.  Key methods
  +Everything that occurs with the registry and modules must be thread-safe.  Key methods
   are always synchronized.  In particular, the methods that construct a service
  -and construct extension point elements are threadsafe.  Operations such as building the interceptor stack,
  +and construct extension point elements are thread-safe.  Operations such as building the interceptor stack,
   instantiating core service implementations, and converting XML to Java objects
  -operate in a threadsafe manner.  However, different threads may be building different
  -services simultaneously.  This means that, for example, an interceptor service must still be threadsafe, since
  +operate in a thread-safe manner.  However, different threads may be building different
  +services simultaneously.  This means that, for example, an interceptor service must still be thread-safe, since
   it may be called upon to generate interceptors for two or more
   different services simultaneously.	
   </p>	
   
   <p>
   On the other hand, the Java objects constructed from XML &rules; don't need to be
  -threadsafe, since that construction is synchronized properly ... only a single thread
  +thread-safe, since that construction is synchronized properly ... only a single thread
   will be converting XML to Java objects for any single extension point.
   </p>
   	
  
  
  
  1.6       +3 -3      jakarta-commons-sandbox/hivemind/xdocs/ioc.xml
  
  Index: ioc.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/xdocs/ioc.xml,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ioc.xml	20 Aug 2003 20:40:45 -0000	1.5
  +++ ioc.xml	8 Sep 2003 20:14:18 -0000	1.6
  @@ -41,10 +41,10 @@
   <p>
   On the other hand, HiveMind is responsible for creating services (including core implementations
   and interceptors).  It is quite possible to create service factories that do very container-like things,
  -including connecting services together.  For example,
  +including connecting services together.  
   <a href="base-registry/hivemind.html#service:hivemind.BuilderFactory">hivemind.BuilderFactory</a>	
   does just that, instantiating an object to act as the core service implementation, then setting
  -properties of the object, some of which are references to services and configuration element data.
  +properties of the object, some of which are references to services and  extension point element data.
   </p>
   
   <p>
  
  
  
  1.20      +16 -7     jakarta-commons-sandbox/hivemind/xdocs/services.xml
  
  Index: services.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/xdocs/services.xml,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- services.xml	24 Aug 2003 03:28:30 -0000	1.19
  +++ services.xml	8 Sep 2003 20:14:18 -0000	1.20
  @@ -33,10 +33,14 @@
   				An example is provided later in this document.</p>
   				
   			<p>
  -			The &_service; also specifies the service model for the service:
  +			HiveMind is responsible for supplying the service implementation as needed; in most
  +			cases, the service implementation is an additional Java class which implements the
  +			service interface.  HiveMind will instantiate the class and configure it as needed.	
  +			The exact timing is determined from the service's service model:
   			<ul>
   			<li><b>singleton</b>	: the service is constructed on first reference</li>
  -			<li><b>deferred</b> : the service is a singleton, but is not constructed until needed</li>
  +			<li><b>deferred</b> : the service is a singleton, but is not constructed until 
  +				a method of the service interface is invoked</li>
   			<li><b>threaded</b> : invoking a service method constructs and binds an instance of
   				the service to the current thread</li>
   			</ul>	
  @@ -48,6 +52,11 @@
   				number of interceptors. Interceptors sit between the core implementation
   				and the client, and add functionality to the core implementation such as
   				logging, security, transaction demarkation or performance monitoring.</p>
  +				
  +			<p>
  +			Instantiating the core implementation, configuring it, and wrapping it with any
  +			interceptors is referred to as <i>constructing the service</i>.
  +			</p>
   		</section>
   		
   		<section name="Extending Services">
  @@ -59,7 +68,7 @@
   						<ul> 
   							<li>Service constructors:
   							<ul>
  -									<li>&create-instance; to instantiate an instance of a Java class</li>
  +									<li>&create-instance; to instantiate an instance of a Java class as the implementation</li>
   									<li>&invoke-factory; to have another service create the implementation</li>
   								</ul>
   								</li>
  @@ -281,7 +290,7 @@
   		<section name="Deferred Service Model">
   			
   		<p>
  -		Creating a service instance can be somewhat expensive; it involves instantiating a core
  +		Constructing a service can be somewhat expensive; it involves instantiating a core
   		service implementation, configuring its properties (some of which may also be services),
   		and building the stack of interceptors for the service.  Although HiveMind
   		encourages you to define your application in terms of a large number of small, simple, testable
  @@ -327,8 +336,8 @@
   <p>
   In general, singleton services should be sufficient. In some cases, 
   the service may need to keep some specific state. State and multithreading don't mix, so the
  -<b>threaded</b> service model creates, as needed, a service implementation
  -for the current thread.  Once created, the service implementation stays bound to the thread until it is discarded.
  +<b>threaded</b> service model constructs, as needed, a service implementation
  +for the current thread.  Once constructed, the service implementation stays bound to the thread until it is discarded.
   </p>	
   
   <p>
  
  
  
  1.5       +16 -1     jakarta-commons-sandbox/hivemind/xdocs/rules.xml
  
  Index: rules.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/xdocs/rules.xml,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- rules.xml	20 Aug 2003 20:40:45 -0000	1.4
  +++ rules.xml	8 Sep 2003 20:14:18 -0000	1.5
  @@ -361,6 +361,21 @@
   
   </subsection>
   
  +<subsection name="resource">
  +
  +<p>
  +The resource translator is used to find a resource packaged with (or near) the module's deployment descriptor.
  +The input value is the relative path to a file.  The translator converts the input value to a
  +<a href="apidocs/org/apache/commons/hivemind/Resource.html">Resource</a>	 for that file.
  +</p>
  +
  +<p>
  +If the file doesn't exist, then an error is logged (and null is returned). If a localization of the
  +file exists, then the Resource for that localization is returned.	
  +</p>
  +	
  +</subsection>
  +
   <subsection name="service">
   
   <p>
  
  
  
  1.6       +2 -2      jakarta-commons-sandbox/hivemind/src/test/hivemind/test/TestMessagesImpl.java
  
  Index: TestMessagesImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/src/test/hivemind/test/TestMessagesImpl.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- TestMessagesImpl.java	30 Aug 2003 14:29:52 -0000	1.5
  +++ TestMessagesImpl.java	8 Sep 2003 20:14:18 -0000	1.6
  @@ -79,7 +79,7 @@
   
       protected Messages read(String file, Locale locale) throws Exception
       {
  -        Resource l = getLocation(file);
  +        Resource l = getResource(file);
   
           return new MessagesImpl(l, locale);
       }
  
  
  
  1.20      +3 -3      jakarta-commons-sandbox/hivemind/src/test/hivemind/test/HiveMindTestCase.java
  
  Index: HiveMindTestCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/src/test/hivemind/test/HiveMindTestCase.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- HiveMindTestCase.java	30 Aug 2003 14:29:52 -0000	1.19
  +++ HiveMindTestCase.java	8 Sep 2003 20:14:18 -0000	1.20
  @@ -136,12 +136,12 @@
   
       protected ModuleDescriptor parse(String file) throws Exception
       {
  -        Resource location = getLocation(file);
  +        Resource location = getResource(file);
   
           return _parser.parse(location, _resolver);
       }
   
  -    protected Resource getLocation(String file)
  +    protected Resource getResource(String file)
       {
           URL url = getClass().getResource(file);
   
  
  
  
  1.31      +6 -3      jakarta-commons-sandbox/hivemind/src/java/org/apache/commons/hivemind/parse/DescriptorParser.java
  
  Index: DescriptorParser.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/src/java/org/apache/commons/hivemind/parse/DescriptorParser.java,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- DescriptorParser.java	5 Sep 2003 22:32:38 -0000	1.30
  +++ DescriptorParser.java	8 Sep 2003 20:14:18 -0000	1.31
  @@ -98,6 +98,7 @@
   import org.apache.commons.hivemind.schema.rules.InvokeParentRule;
   import org.apache.commons.hivemind.schema.rules.ReadAttributeRule;
   import org.apache.commons.hivemind.schema.rules.ReadContentRule;
  +import org.apache.commons.hivemind.schema.rules.ResourceTranslator;
   import org.apache.commons.hivemind.schema.rules.ServiceTranslator;
   import org.apache.commons.hivemind.schema.rules.SetParentRule;
   import org.apache.commons.logging.Log;
  @@ -164,7 +165,7 @@
       private static final int STATE_SCHEMA = 9;
       private static final int STATE_ELEMENT = 10;
       private static final int STATE_RULES = 11;
  -    
  +
       /**
        * Used with &lt;invoke-factory&gt; and &lt;interceptor&gt; to
        * collect parameters that will be passed to the implementation or
  @@ -346,6 +347,7 @@
           _translatorClasses.put("service", ServiceTranslator.class);
           _translatorClasses.put("enumeration", EnumerationTranslator.class);
           _translatorClasses.put("extension-point", ExtensionPointTranslator.class);
  +        _translatorClasses.put("resource", ResourceTranslator.class);
       }
   
       /**
  @@ -1029,7 +1031,8 @@
       {
           ElementImpl element = buildLWDomElement(elementName);
   
  -        AbstractServiceInvocationDescriptor sid = (AbstractServiceInvocationDescriptor) peekObject();
  +        AbstractServiceInvocationDescriptor sid =
  +            (AbstractServiceInvocationDescriptor) peekObject();
   
           sid.addParameter(element);
   
  
  
  
  1.3       +2 -2      jakarta-commons-sandbox/hivemind/src/java/org/apache/commons/hivemind/util/AbstractResource.java
  
  Index: AbstractResource.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/src/java/org/apache/commons/hivemind/util/AbstractResource.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- AbstractResource.java	30 Aug 2003 14:29:56 -0000	1.2
  +++ AbstractResource.java	8 Sep 2003 20:14:18 -0000	1.3
  @@ -93,7 +93,7 @@
           return _name;
       }
   
  -    public Resource getRelativeLocation(String name)
  +    public Resource getRelativeResource(String name)
       {
           if (name.startsWith("/"))
           {
  
  
  
  1.1                  jakarta-commons-sandbox/hivemind/src/test/hivemind/test/config/impl/ResourceHolder.java
  
  Index: ResourceHolder.java
  ===================================================================
  /*
   * ====================================================================
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2003 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Commons", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   */
  
  package hivemind.test.config.impl;
  
  import org.apache.commons.hivemind.Resource;
  
  /**
   * Used for testing {@link org.apache.commons.hivemind.schema.rules.ResourceTranslator}.
   *
   * @author Howard Lewis Ship
   * @version $Id: ResourceHolder.java,v 1.1 2003/09/08 20:14:18 hlship Exp $
   */
  public class ResourceHolder
  {
      private Resource _resource;
      
      public Resource getResource()
      {
          return _resource;
      }
  
      public void setResource(Resource resource)
      {
          _resource = resource;
      }
  
  }
  
  
  
  1.3       +2 -2      jakarta-commons-sandbox/hivemind/src/java/org/apache/commons/hivemind/Resource.java
  
  Index: Resource.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/src/java/org/apache/commons/hivemind/Resource.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Resource.java	30 Aug 2003 14:29:52 -0000	1.2
  +++ Resource.java	8 Sep 2003 20:14:18 -0000	1.3
  @@ -131,7 +131,7 @@
        * 
        */
       
  -    public Resource getRelativeLocation(String name);
  +    public Resource getRelativeResource(String name);
       
       /**
        * Returns the path that represents the resource.  This should 
  
  
  
  1.27      +3 -1      jakarta-commons-sandbox/hivemind/src/java/org/apache/commons/hivemind/HiveMindMessages.properties
  
  Index: HiveMindMessages.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/src/java/org/apache/commons/hivemind/HiveMindMessages.properties,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- HiveMindMessages.properties	5 Sep 2003 15:04:41 -0000	1.26
  +++ HiveMindMessages.properties	8 Sep 2003 20:14:18 -0000	1.27
  @@ -117,6 +117,8 @@
   
   ExtensionPointTranslator.error=Error accessing extension point {0} (at {1}): {2}
   
  +ResourceTranslator.error=Unable to localize resource {0} for module {1} (at {2}).
  +
   # service.impl package
   
   RemoteExceptionCoordinator.method-while-locked=RemoteExceptionCoordinator method {0} was invoked during a notification.
  
  
  
  1.11      +47 -1     jakarta-commons-sandbox/hivemind/src/test/hivemind/test/config/TestExtensionPoint.java
  
  Index: TestExtensionPoint.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/src/test/hivemind/test/config/TestExtensionPoint.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- TestExtensionPoint.java	30 Aug 2003 14:29:56 -0000	1.10
  +++ TestExtensionPoint.java	8 Sep 2003 20:14:18 -0000	1.11
  @@ -65,17 +65,22 @@
   import hivemind.test.config.impl.FrobableHolder;
   import hivemind.test.config.impl.IntHolder;
   import hivemind.test.config.impl.Parent;
  +import hivemind.test.config.impl.ResourceHolder;
   
   import java.util.List;
  +import java.util.Locale;
   
   import org.apache.commons.hivemind.ApplicationRuntimeException;
   import org.apache.commons.hivemind.Element;
   import org.apache.commons.hivemind.Module;
   import org.apache.commons.hivemind.Registry;
  +import org.apache.commons.hivemind.Resource;
   import org.apache.commons.hivemind.impl.RegistryBuilder;
   import org.apache.commons.hivemind.impl.RegistryImpl;
   import org.apache.commons.hivemind.impl.SchemaProcessorImpl;
   import org.apache.commons.hivemind.schema.rules.BooleanTranslator;
  +import org.apache.commons.hivemind.schema.rules.ResourceTranslator;
  +import org.apache.commons.hivemind.util.ClasspathResource;
   
   /**
    * A number of tests related to processing of extension points.
  @@ -515,6 +520,47 @@
           checkLoggingEvent(
               null,
               "Default for symbol 'fred' \\(at .*?\\) duplicates prior value \\(at .*\\) and has been ignored\\.",
  +            false);
  +    }
  +
  +    public void testResourceTranslator() throws Exception
  +    {
  +        RegistryBuilder builder = new RegistryBuilder();
  +
  +        Resource moduleResource =
  +            new ClasspathResource(_resolver, "/hivemind/test/config/ResourceTranslator.xml");
  +
  +        builder.processModule(_resolver, moduleResource);
  +        builder.processModule(_resolver, getMasterModuleLocation());
  +
  +        Registry r = builder.constructRegistry(Locale.FRENCH);
  +
  +        List l = r.getExtensionPointElements("hivemind.test.config.ResourceTranslator");
  +
  +        interceptLogging(ResourceTranslator.class.getName());
  +
  +        assertEquals(4, l.size());
  +
  +        ResourceHolder h = (ResourceHolder) l.get(0);
  +
  +        assertEquals(moduleResource.getRelativeResource("Empty.xml"), h.getResource());
  +
  +        h = (ResourceHolder) l.get(1);
  +
  +        assertEquals(
  +            moduleResource.getRelativeResource("Localized_fr.properties"),
  +            h.getResource());
  +
  +        h = (ResourceHolder) l.get(2);
  +        assertNull(h.getResource());
  +
  +        h = (ResourceHolder) l.get(3);
  +        assertNull(h.getResource());
  +
  +        checkLoggingEvent(
  +            null,
  +            "Unable to localize resource DoesNotExist.xml for module hivemind.test.config "
  +                + "\\(at classpath:/hivemind/test/config/ResourceTranslator.xml, .*\\)\\.",
               false);
       }
   }
  
  
  
  1.1                  jakarta-commons-sandbox/hivemind/src/test/hivemind/test/config/ResourceTranslator.xml
  
  Index: ResourceTranslator.xml
  ===================================================================
  <?xml version="1.0"?>
  <!-- $Id: ResourceTranslator.xml,v 1.1 2003/09/08 20:14:18 hlship Exp $ -->
  
  <module id="hivemind.test.config" version="1.0.0">
  
    <extension-point id="ResourceTranslator">
    
      <schema>
      
        <element name="resource">
        
          <rules>
            <create-object class="hivemind.test.config.impl.ResourceHolder"/>
            <read-content property="resource" translator="resource"/>
            <invoke-parent method="addElement"/>	
          	
          </rules>	
        	
        </element>	
      	
      </schema>	
    	
    </extension-point>
    
    <extension point-id="ResourceTranslator">
    
      <resource>Empty.xml</resource>	
      <resource>Localized.properties</resource>
      <resource>DoesNotExist.xml</resource>
      <resource></resource>
    	
    </extension>
  
  </module>
  
  
  1.3       +7 -7      jakarta-commons-sandbox/hivemind/src/test/hivemind/test/util/TestClasspathResource.java
  
  Index: TestClasspathResource.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/src/test/hivemind/test/util/TestClasspathResource.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TestClasspathResource.java	30 Aug 2003 14:29:55 -0000	1.2
  +++ TestClasspathResource.java	8 Sep 2003 20:14:18 -0000	1.3
  @@ -93,7 +93,7 @@
       public void testClasspathRelativeSameResource()
       {
           Resource l1 = new ClasspathResource(_resolver, "/foo/bar/Baz");
  -        Resource l2 = l1.getRelativeLocation("Baz");
  +        Resource l2 = l1.getRelativeResource("Baz");
   
           assertSame(l1, l2);
       }
  @@ -102,7 +102,7 @@
       {
           Resource l1 = new ClasspathResource(_resolver, "/foo/bar/Baz");
           Resource expected = new ClasspathResource(_resolver, "/foo/bar/Fubar");
  -        Resource actual = l1.getRelativeLocation("Fubar");
  +        Resource actual = l1.getRelativeResource("Fubar");
   
           assertEquals(expected, actual);
       }
  @@ -111,7 +111,7 @@
       {
           Resource l1 = new ClasspathResource(_resolver, "/foo/bar/Baz");
           Resource expected = new ClasspathResource(_resolver, "/foo/bar/gloop/Yup");
  -        Resource actual = l1.getRelativeLocation("gloop/Yup");
  +        Resource actual = l1.getRelativeResource("gloop/Yup");
   
           assertEquals(expected, actual);
       }
  @@ -120,7 +120,7 @@
       {
           Resource l1 = new ClasspathResource(_resolver, "/foo/bar/Baz");
           Resource expected = new ClasspathResource(_resolver, "/bip/bop/Boop");
  -        Resource actual = l1.getRelativeLocation("/bip/bop/Boop");
  +        Resource actual = l1.getRelativeResource("/bip/bop/Boop");
   
           assertEquals(expected, actual);
       }
  @@ -176,7 +176,7 @@
       public void testClasspathRelativeSamePath()
       {
           Resource l1 = new ClasspathResource(_resolver, "/foo/bar/Baz");
  -        Resource l2 = l1.getRelativeLocation("/foo/bar/Baz");
  +        Resource l2 = l1.getRelativeResource("/foo/bar/Baz");
   
           assertSame(l1, l2);
       }
  @@ -185,7 +185,7 @@
       {
           Resource l1 = new ClasspathResource(_resolver, "/");
           Resource expected = new ClasspathResource(_resolver, "/foo");
  -        Resource actual = l1.getRelativeLocation("foo");
  +        Resource actual = l1.getRelativeResource("foo");
   
           assertEquals(expected, actual);
       }
  
  
  
  1.28      +4 -2      jakarta-commons-sandbox/hivemind/src/java/org/apache/commons/hivemind/impl/RegistryBuilder.java
  
  Index: RegistryBuilder.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/src/java/org/apache/commons/hivemind/impl/RegistryBuilder.java,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- RegistryBuilder.java	4 Sep 2003 23:58:00 -0000	1.27
  +++ RegistryBuilder.java	8 Sep 2003 20:14:19 -0000	1.28
  @@ -637,9 +637,11 @@
           // Allow the factory id to be unqualified, to refer to an interceptor factory
           // service from within the same module.
   
  -        ic.setFactoryId(qualify(sourceModule.getModuleId(), id.getServiceId()));
  +        ic.setFactoryServiceId(qualify(sourceModule.getModuleId(), id.getFactoryServiceId()));
           ic.setLocation(id.getLocation());
           ic.setOrder(id.getOrder());
  +        ic.setContributingModule(sourceModule);
  +        ic.setParameters(id.getParameters());
   
           sep.addInterceptorContribution(ic);
       }
  
  
  
  1.5       +2 -2      jakarta-commons-sandbox/hivemind/src/java/org/apache/commons/hivemind/impl/MessagesImpl.java
  
  Index: MessagesImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/src/java/org/apache/commons/hivemind/impl/MessagesImpl.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- MessagesImpl.java	30 Aug 2003 14:29:51 -0000	1.4
  +++ MessagesImpl.java	8 Sep 2003 20:14:19 -0000	1.5
  @@ -110,7 +110,7 @@
           while (g.more())
           {
               String name = g.next();
  -            Resource l = moduleLocation.getRelativeLocation(name);
  +            Resource l = moduleLocation.getRelativeResource(name);
               URL url = l.getResourceURL();
   
               if (url != null)
  
  
  
  1.6       +4 -1      jakarta-commons-sandbox/hivemind/src/java/org/apache/commons/hivemind/impl/SchemaProcessorImpl.java
  
  Index: SchemaProcessorImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/src/java/org/apache/commons/hivemind/impl/SchemaProcessorImpl.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- SchemaProcessorImpl.java	30 Aug 2003 14:29:51 -0000	1.5
  +++ SchemaProcessorImpl.java	8 Sep 2003 20:14:19 -0000	1.6
  @@ -190,6 +190,9 @@
        */
       public void process(List elements, Module contributingModule)
       {
  +        if (elements == null)
  +            return;
  +
           if (_schema == null)
           {
               _elements.addAll(elements);
  
  
  
  1.1                  jakarta-commons-sandbox/hivemind/src/java/org/apache/commons/hivemind/schema/rules/ResourceTranslator.java
  
  Index: ResourceTranslator.java
  ===================================================================
  /*
   * ====================================================================
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2003 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Commons", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   */
  
  package org.apache.commons.hivemind.schema.rules;
  
  import java.util.Locale;
  
  import org.apache.commons.hivemind.Element;
  import org.apache.commons.hivemind.HiveMind;
  import org.apache.commons.hivemind.Module;
  import org.apache.commons.hivemind.Resource;
  import org.apache.commons.hivemind.schema.SchemaProcessor;
  import org.apache.commons.hivemind.schema.Translator;
  import org.apache.commons.lang.StringUtils;
  import org.apache.commons.logging.Log;
  import org.apache.commons.logging.LogFactory;
  
  /**
   * Translator that converts the value to be a resource relative to 
   * the contributing module's deployment descriptor.
   *
   * @author Howard Lewis Ship
   * @version $Id: ResourceTranslator.java,v 1.1 2003/09/08 20:14:19 hlship Exp $
   */
  public class ResourceTranslator implements Translator
  {
      private static final Log LOG = LogFactory.getLog(ResourceTranslator.class);
      /**
       * Finds the resource.  If the inputValue is blank, then returns null.
       * Interprets the inputValue as a relative path from the contributing module's descriptor.
       * In addition, a localized resource will be returned if avaiable (localized to
       * the {@link org.apache.commons.hivemind.Registry#getLocale() registry's locale}.
       * 
       */
      public Object translate(SchemaProcessor processor, Element element, String inputValue)
      {
          if (StringUtils.isBlank(inputValue))
              return null;
  
          Module module = processor.getContributingModule();
          Locale locale = module.getRegistry().getLocale();
  
          Resource descriptor = module.getLocation().getResource();
  
          Resource resource = descriptor.getRelativeResource(inputValue);
  
          Resource result = resource.getLocalization(locale);
  
          if (result == null)
              LOG.error(
                  HiveMind.format(
                      "ResourceTranslator.error",
                      inputValue,
                      module.getModuleId(),
                      element.getLocation()));
  
          return result;
      }
  
  }
  
  
  
  1.4       +6 -1      jakarta-commons-sandbox/hivemind/src/java/org/apache/commons/hivemind/schema/Translator.java
  
  Index: Translator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/src/java/org/apache/commons/hivemind/schema/Translator.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Translator.java	30 Aug 2003 14:29:53 -0000	1.3
  +++ Translator.java	8 Sep 2003 20:14:19 -0000	1.4
  @@ -86,5 +86,10 @@
    */
   public interface Translator
   {
  +	/**
  +	 * Invoked by a {@link Rule} to translate an inputValue into an appropriate object.
  +	 * Substitution symbols will already have been expanded before this method is
  +	 * invoked.
  +	 */
       public Object translate(SchemaProcessor processor, Element element, String inputValue);
   }
  
  
  
  1.24      +4 -4      jakarta-commons-sandbox/hivemind/src/test/hivemind/test/parse/TestDescriptorParser.java
  
  Index: TestDescriptorParser.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/src/test/hivemind/test/parse/TestDescriptorParser.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- TestDescriptorParser.java	30 Aug 2003 14:29:56 -0000	1.23
  +++ TestDescriptorParser.java	8 Sep 2003 20:14:19 -0000	1.24
  @@ -213,11 +213,11 @@
           assertEquals(2, l.size());
   
           InterceptorDescriptor id = (InterceptorDescriptor) l.get(0);
  -        assertEquals("MyInterceptor", id.getServiceId());
  +        assertEquals("MyInterceptor", id.getFactoryServiceId());
           assertEquals(1000, id.getOrder());
   
           id = (InterceptorDescriptor) l.get(1);
  -        assertEquals("OtherInterceptor", id.getServiceId());
  +        assertEquals("OtherInterceptor", id.getFactoryServiceId());
           assertEquals(0, id.getOrder());
       }
   
  @@ -233,7 +233,7 @@
   
           InterceptorDescriptor id = (InterceptorDescriptor) l.get(0);
   
  -        assertEquals("MyInterceptor", id.getServiceId());
  +        assertEquals("MyInterceptor", id.getFactoryServiceId());
       }
   
       public void testExtensionSchema() throws Exception
  
  
  
  1.8       +3 -3      jakarta-commons-sandbox/hivemind/src/test/hivemind/test/rules/TestClassTranslator.java
  
  Index: TestClassTranslator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/src/test/hivemind/test/rules/TestClassTranslator.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- TestClassTranslator.java	30 Aug 2003 14:29:55 -0000	1.7
  +++ TestClassTranslator.java	8 Sep 2003 20:14:19 -0000	1.8
  @@ -96,7 +96,7 @@
       {
           ClassTranslator t = new ClassTranslator();
           ElementImpl e = new ElementImpl();
  -        Location l = new LocationImpl(getLocation("TestClassTranslator.class"), 50);
  +        Location l = new LocationImpl(getResource("TestClassTranslator.class"), 50);
           e.setLocation(l);
   
           SchemaProcessor p = new MockSchemaProcessor();
  @@ -117,7 +117,7 @@
       {
           ClassTranslator t = new ClassTranslator();
           ElementImpl e = new ElementImpl();
  -        Location l = new LocationImpl(getLocation("TestClassTranslator.class"), 50);
  +        Location l = new LocationImpl(getResource("TestClassTranslator.class"), 50);
           e.setLocation(l);
   
           SchemaProcessor p = new MockSchemaProcessor();
  
  
  
  1.5       +2 -2      jakarta-commons-sandbox/hivemind/src/test/hivemind/test/rules/TestEnumerationTranslator.java
  
  Index: TestEnumerationTranslator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/src/test/hivemind/test/rules/TestEnumerationTranslator.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- TestEnumerationTranslator.java	30 Aug 2003 14:29:55 -0000	1.4
  +++ TestEnumerationTranslator.java	8 Sep 2003 20:14:19 -0000	1.5
  @@ -84,7 +84,7 @@
       private Element forgeElement()
       {
           ElementImpl e = new ElementImpl();
  -        Location l = new LocationImpl(getLocation("TestEnumerationTranslator.class"), 50);
  +        Location l = new LocationImpl(getResource("TestEnumerationTranslator.class"), 50);
           e.setLocation(l);
   
           return e;
  
  
  

Mime
View raw message