commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject cvs commit: jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly suite.jelly
Date Tue, 24 Sep 2002 11:04:56 GMT
jstrachan    2002/09/24 04:04:56

  Modified:    jelly/src/test/org/apache/commons/jelly suite.jelly
  Log:
  Added support for a <j:setProperties> tag which can make creating beans and setting
properties on them much simpler.
  e.g.
  
  <j:new var="customer" className="com.acme.MyCustomer"/>
  <j:setProperties object="${customer}" name="James" location="London" orders="${foo.findOrders()}"/>
  
  Revision  Changes    Path
  1.2       +24 -1     jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/suite.jelly
  
  Index: suite.jelly
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/suite.jelly,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- suite.jelly	11 Aug 2002 11:45:19 -0000	1.1
  +++ suite.jelly	24 Sep 2002 11:04:56 -0000	1.2
  @@ -1,5 +1,8 @@
   <?xml version="1.0"?>
  -<test:suite xmlns:j="jelly:core" xmlns:test="jelly:junit" xmlns:x="jelly:xml">
  +<test:suite 
  +	xmlns:j="jelly:core" 
  +	xmlns:test="jelly:junit" 
  +	xmlns:log="jelly:log">
   
     <test:case name="testChoose">
   
  @@ -63,4 +66,24 @@
   	  		  
     </test:case>
   
  +	<test:case name="testNewAndSetProperties">
  +		<j:new className="org.apache.commons.jelly.define.Customer" var="customer"/>
  +		<j:setProperties object="${customer}" name="James" city="London" />
  +
  +		<log:info>Created a new bean: ${customer}</log:info>
  +			
  +		<test:assert test="${customer != null}">Created a customer DynaBean</test:assert>
  +		
  +		<test:assertEquals 
  +			expected="James" 
  +			actual="${customer.name}"/>
  +			
  +		<test:assertEquals 
  +			expected="London" 
  +			actual="${customer.city}"/>
  +			
  +		<test:assertEquals 
  +			expected="org.apache.commons.jelly.define.Customer" 
  +			actual="${customer.class.name}"/>
  +  </test:case>
   </test:suite>
  
  
  

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


Mime
View raw message