⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 getpropertiestest.java

📁 在Struts2中的jar包xwork的源代码.版本为2.0.7
💻 JAVA
字号:
/* * Created on Jan 23, 2006 * * TODO To change the template for this generated file go to * Window - Preferences - Java - Code Style - Code Templates */package com.opensymphony.xwork2.util;import java.util.ArrayList;import java.util.Collection;import java.util.HashSet;import junit.framework.TestCase;/** * @author Gabe * * TODO To change the template for this generated type comment go to * Window - Preferences - Java - Code Style - Code Templates */public class GetPropertiesTest extends TestCase {    public void testGetCollectionProperties()  {        doGetCollectionPropertiesTest(new ArrayList());        doGetCollectionPropertiesTest(new HashSet());            }        public void doGetCollectionPropertiesTest(Collection c) {        ValueStack vs = ValueStackFactory.getFactory().createValueStack();        Foo foo = new Foo();        foo.setBarCollection(c);        vs.push(foo);        assertEquals(Boolean.TRUE, vs.findValue("barCollection.isEmpty"));        assertEquals(Boolean.TRUE, vs.findValue("barCollection.empty"));        assertEquals(new Integer(0), vs.findValue("barCollection.size"));        assertTrue(vs.findValue("barCollection.iterator") instanceof java.util.Iterator);    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -