hivemind-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From k...@apache.org
Subject cvs commit: jakarta-hivemind/framework/src/test/hivemind/test/services/impl ConstructorAccessImpl.java
Date Fri, 01 Oct 2004 21:34:06 GMT
knut        2004/10/01 14:34:06

  Modified:    framework/src/java/org/apache/hivemind/service/impl
                        BuilderPropertyFacet.java
               framework/src/test/hivemind/test/services TestServices.java
                        ConstructorFactory.xml
               framework/src/documentation/content/xdocs/hivemind
                        BuilderFactory.xml
               .        status.xml
               framework/src/descriptor/META-INF hivemodule.xml
               framework/src/java/org/apache/hivemind/util
                        ConstructorUtils.java
               framework/src/test/hivemind/test/services/impl
                        ConstructorAccessImpl.java
  Log:
  Fixes HIVEMIND-63. BuilderFactory now accepts <null/> as constructor parameter.
  Puts previously unused statement in ConstructorUtils to work and thus raises code coverage
thereof to 97% :-)
  
  Revision  Changes    Path
  1.5       +4 -5      jakarta-hivemind/framework/src/java/org/apache/hivemind/service/impl/BuilderPropertyFacet.java
  
  Index: BuilderPropertyFacet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-hivemind/framework/src/java/org/apache/hivemind/service/impl/BuilderPropertyFacet.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- BuilderPropertyFacet.java	5 Jun 2004 19:09:13 -0000	1.4
  +++ BuilderPropertyFacet.java	1 Oct 2004 21:34:05 -0000	1.5
  @@ -17,10 +17,9 @@
   import org.apache.hivemind.internal.Module;
   
   /**
  - * Implementation of {@link org.apache.hivemind.service.impl.BuilderFacet}
  - * that stores a value.  This corresponds to the
  - * &lt;set&gt; type elements.
  - *
  + * Implementation of {@link org.apache.hivemind.service.impl.BuilderFacet}that stores a
value. This
  + * corresponds to the &lt;set&gt; type elements and all constructor parameter elements.
  + * 
    * @author Howard Lewis Ship
    */
   public class BuilderPropertyFacet extends BuilderFacet
  @@ -37,4 +36,4 @@
           _value = object;
       }
   
  -}
  +}
  \ No newline at end of file
  
  
  
  1.22      +3 -3      jakarta-hivemind/framework/src/test/hivemind/test/services/TestServices.java
  
  Index: TestServices.java
  ===================================================================
  RCS file: /home/cvs/jakarta-hivemind/framework/src/test/hivemind/test/services/TestServices.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- TestServices.java	15 Aug 2004 15:41:57 -0000	1.21
  +++ TestServices.java	1 Oct 2004 21:34:05 -0000	1.22
  @@ -307,15 +307,15 @@
       {
           Registry r = buildFrameworkRegistry("ConstructorFactory.xml");
   
  -        interceptLogging("hivemind");
  -
           String[] servicesToTest =
               {
                   "DefaultConstructor",
                   "LongConstructor",
  +                "ServiceConstructor",
                   "MultiConstructor",
                   "ConfigurationConstructor",
  -                "LogAndMessagesConstructor" };
  +                "LogAndMessagesConstructor",
  +                "NullConstructor"};
   
           for (int i = 0; i < servicesToTest.length; i++)
           {
  
  
  
  1.3       +8 -7      jakarta-hivemind/framework/src/test/hivemind/test/services/ConstructorFactory.xml
  
  Index: ConstructorFactory.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-hivemind/framework/src/test/hivemind/test/services/ConstructorFactory.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ConstructorFactory.xml	9 Aug 2004 14:53:44 -0000	1.2
  +++ ConstructorFactory.xml	1 Oct 2004 21:34:05 -0000	1.3
  @@ -46,21 +46,22 @@
     	</invoke-factory>	
     </service-point>
   
  -  <service-point id="ConfigurationConstructor" interface="hivemind.test.services.ConstructorAccess">
  +  <service-point id="LogAndMessagesConstructor" interface="hivemind.test.services.ConstructorAccess">
     	<invoke-factory>
     		<construct class="hivemind.test.services.impl.ConstructorAccessImpl">
  -  			<configuration>DummyConfiguration</configuration>
  -  			<set property="expectedConstructorMessage" value="(List)"/>
  +  			<log/>
  +  			<messages/>
  +  			<set property="expectedConstructorMessage" value="(Log, Messages)"/>
     		</construct>
     	</invoke-factory>	
     </service-point>
   
  -  <service-point id="LogAndMessagesConstructor" interface="hivemind.test.services.ConstructorAccess">
  +  <service-point id="NullConstructor" interface="hivemind.test.services.ConstructorAccess">
     	<invoke-factory>
     		<construct class="hivemind.test.services.impl.ConstructorAccessImpl">
  -  			<log/>
  -  			<messages/>
  -  			<set property="expectedConstructorMessage" value="(Log, Messages)"/>
  +  			<long>42</long>
  +  			<null/>
  +  			<set property="expectedConstructorMessage" value="(long, null)"/>
     		</construct>
     	</invoke-factory>	
     </service-point>
  
  
  
  1.11      +6 -0      jakarta-hivemind/framework/src/documentation/content/xdocs/hivemind/BuilderFactory.xml
  
  Index: BuilderFactory.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-hivemind/framework/src/documentation/content/xdocs/hivemind/BuilderFactory.xml,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- BuilderFactory.xml	27 Sep 2004 13:51:37 -0000	1.10
  +++ BuilderFactory.xml	1 Oct 2004 21:34:05 -0000	1.11
  @@ -48,6 +48,7 @@
       <resource> ... </resource>
       <service> ... </service>
       <object> ... </object>
  +    <null/>
       
       <event-listener service-id="..." event-type-name="..."/>
       <set property="..." value="..."/>
  @@ -231,6 +232,11 @@
             <td>object</td>
             <td><em>variable</em></td>
             <td>As determined by the object translator, this is decidedly free-form.
See &hivemind.ObjectProviders;.</td>
  +        </tr>
  +        <tr>
  +          <td>null</td>
  +          <td><em>any reference type</em></td>
  +          <td>Always simply <code>null</code>.</td>
           </tr>
   				<tr>
   					<td>service-id</td>
  
  
  
  1.65      +3 -0      jakarta-hivemind/status.xml
  
  Index: status.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-hivemind/status.xml,v
  retrieving revision 1.64
  retrieving revision 1.65
  diff -u -r1.64 -r1.65
  --- status.xml	27 Sep 2004 14:38:11 -0000	1.64
  +++ status.xml	1 Oct 2004 21:34:05 -0000	1.65
  @@ -40,6 +40,9 @@
         <action type="add" dev="HLS" fixes-bug="HIVEMIND-58">
           Add visibility (public or private) to configuration points, service points and
schemas.
         </action>
  +      <action type="fix" dev="KW" fixes-bug="HIVEMIND-63">
  +        Add &lt;null&gt; constructor parameter element to BuilderFactory service.
  +      </action>
       </release>
   
      <release version="1.0" date="Sep 22 2004">
  
  
  
  1.17      +10 -0     jakarta-hivemind/framework/src/descriptor/META-INF/hivemodule.xml
  
  Index: hivemodule.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-hivemind/framework/src/descriptor/META-INF/hivemodule.xml,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- hivemodule.xml	27 Sep 2004 14:35:57 -0000	1.16
  +++ hivemodule.xml	1 Oct 2004 21:34:05 -0000	1.17
  @@ -349,6 +349,16 @@
             </rules>
           </element>
           
  +        <element name="null">
  +          
  +          Placeholder for a null object provided by the object translator as a constructor
parameter.
  +            
  +          <rules>
  +            <create-object class="org.apache.hivemind.service.impl.BuilderPropertyFacet"/>
  +            <invoke-parent depth="6" method="addParameter"/>
  +          </rules>
  +        </element>
  +        
           <element name="set">
             
             Configures a property of the service instance.
  
  
  
  1.5       +1 -1      jakarta-hivemind/framework/src/java/org/apache/hivemind/util/ConstructorUtils.java
  
  Index: ConstructorUtils.java
  ===================================================================
  RCS file: /home/cvs/jakarta-hivemind/framework/src/java/org/apache/hivemind/util/ConstructorUtils.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ConstructorUtils.java	29 Jul 2004 13:18:51 -0000	1.4
  +++ ConstructorUtils.java	1 Oct 2004 21:34:05 -0000	1.5
  @@ -101,7 +101,7 @@
   
           for (int i = 0; i < types.length; i++)
           {
  -            if (types[i] == null && actualTypes[i].isPrimitive())
  +            if (types[i] == null && !actualTypes[i].isPrimitive())
                   continue;
   
               if (!isCompatible(actualTypes[i], types[i]))
  
  
  
  1.4       +48 -42    jakarta-hivemind/framework/src/test/hivemind/test/services/impl/ConstructorAccessImpl.java
  
  Index: ConstructorAccessImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-hivemind/framework/src/test/hivemind/test/services/impl/ConstructorAccessImpl.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ConstructorAccessImpl.java	26 Feb 2004 23:07:35 -0000	1.3
  +++ ConstructorAccessImpl.java	1 Oct 2004 21:34:05 -0000	1.4
  @@ -31,47 +31,53 @@
   public class ConstructorAccessImpl implements ConstructorAccess
   {
   
  -	private String actualMessage;
  -	private String expectedMessage;
  +    private String actualMessage;
   
  -	public ConstructorAccessImpl()
  -	{
  -		actualMessage = "()";
  -	}
  -
  -	public ConstructorAccessImpl(long l)
  -	{
  -		actualMessage = "(long)";
  -	}
  -
  -	public ConstructorAccessImpl(ConstructorAccess service)
  -	{
  -		actualMessage = "(ConstructorAccess)";
  -	}
  -
  -	public ConstructorAccessImpl(ConstructorAccess service, String s)
  -	{
  -		actualMessage = "(ConstructorAccess, String)";
  -	}
  -
  -	public ConstructorAccessImpl(List configurations)
  -	{
  -		actualMessage = "(List)";
  -	}
  -
  -	public ConstructorAccessImpl(Log log, Messages messages)
  -	{
  -		actualMessage = "(Log, Messages)";
  -	}
  -
  -	public void setExpectedConstructorMessage(String expectedMessage)
  -	{
  -		this.expectedMessage = expectedMessage;
  -	}
  -
  -	public void verify() throws AssertionFailedError
  -	{
  -		Assert.assertEquals(expectedMessage, actualMessage);
  -	}
  +    private String expectedMessage;
   
  -}
  +    public ConstructorAccessImpl()
  +    {
  +        actualMessage = "()";
  +    }
  +
  +    public ConstructorAccessImpl(long l)
  +    {
  +        actualMessage = "(long)";
  +    }
  +
  +    public ConstructorAccessImpl(ConstructorAccess service)
  +    {
  +        actualMessage = "(ConstructorAccess)";
  +    }
  +
  +    public ConstructorAccessImpl(ConstructorAccess service, String s)
  +    {
  +        actualMessage = "(ConstructorAccess, String)";
  +    }
  +
  +    public ConstructorAccessImpl(List configurations)
  +    {
  +        actualMessage = "(List)";
  +    }
  +
  +    public ConstructorAccessImpl(Log log, Messages messages)
  +    {
  +        actualMessage = "(Log, Messages)";
  +    }
  +
  +    public ConstructorAccessImpl(long l, ConstructorAccess nullObject)
  +    {
  +        actualMessage = "(long, " + nullObject + ")";
  +    }
  +    
  +    public void setExpectedConstructorMessage(String expectedMessage)
  +    {
  +        this.expectedMessage = expectedMessage;
  +    }
  +
  +    public void verify() throws AssertionFailedError
  +    {
  +        Assert.assertEquals(expectedMessage, actualMessage);
  +    }
  +
  +}
  \ No newline at end of file
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-cvs-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-cvs-help@jakarta.apache.org


Mime
View raw message