2008-06-30

JICE构造对象实例

关键字: 单元测试
具体应用请参看另一篇: JTestCase+JICE使用小结http://jlusdy.javaeye.com/blog/209755

JICE构造比较常见的对象实例如下:

String
					<param name="localFilePath" type="" use-jice="yes">
						<jice>
							<string class="java.lang.String" xmlns="http://www.jicengine.org/jic/2.0">
								C:/作成機能</string>
						</jice>
					</param>

Bean
<param name="userInfo" type="" use-jice="yes">   
                        <jice>   
                            <bean xmlns="http://www.jicengine.org/jic/2.0" class="com.test.userInfoBean">   
                                <userId class="java.lang.String">0000000001</userId>   
                                <userName class="java.lang.String">USER_1</userName>   
                            </bean>   
                        </jice>   
                    </param>   


List
<param name="subList" type="" use-jice="yes">
						<jice>
					        <container xmlns="http://www.jicengine.org/jic/2.0" 
				        		   class="java.util.List" type="container" instance="subdatas">
							  	<subdatas class="java.util.ArrayList">
							                              <bean action="parent.add(this)" xmlns="http://www.jicengine.org/jic/2.0" class="com.test.userInfoBean">   
                                <userId class="java.lang.String">0000000001</userId>   
                                <userName class="java.lang.String">USER_1</userName>   
                            </bean>   
			            <bean action="parent.add(this)" xmlns="http://www.jicengine.org/jic/2.0" class="com.test.userInfoBean">   
                                <userId class="java.lang.String">0000000002</userId>   
                                <userName class="java.lang.String">USER_2</userName>   
                            </bean> 						</subdatas>
						  	</container>
					    </jice>
					</param>

<list xmlns="http://www.jicengine.org/jic/2.1" class="java.util.ArrayList" type="list">
	<e>1</e>
	<e class="int">2</e>
	<e>-3344</e>
	<e class="int">-4</e>
</list>

Map
<param name="reqMap" type="" use-jice="yes">
						<jice>
							<map xmlns="http://www.jicengine.org/jic/2.0" class="java.util.HashMap" type="map">
								<entry action="put(key,value)">
									<key class="java.lang.String">SR1</key>
    								<value class="java.lang.String">SR1</value>
								</entry>
								<entry action="put(key,value)">
									<key class="java.lang.String">SR2</key>
    								<value class="java.lang.String">SR2</value>
								</entry>
							</map>
						</jice>
					</param>

Date
<updatedDate class="java.util.Date" instance="dateFormat.parse(dateString)">
											<dateFormat class="java.text.SimpleDateFormat" args="cdata">yyyy/MM/dd HH:mm:ss.SSS</dateFormat>
											<dateString>2008/06/02 10:27:27.607</dateString>
										</updatedDate>

String[]
<sort class="java.lang.String[]" type="array">
						<e class="java.lang.String">1.1.2</e>
			<e class="java.lang.String">1.1.3</e>
						
</sort>
评论
发表评论

您还没有登录,请登录后发表评论

jlusdy
搜索本博客
博客分类
最近加入圈子
存档
最新评论