大名鼎鼎的java动态脚本语言。已经通过了sun的认证

源代码在线查看: newexpressiontest.groovy

软件大小: 1630 K
上传用户: hjf
关键词: java sun 动态 脚本
下载地址: 免注册下载 普通下载 VIP

相关代码

				import org.codehaus.groovy.runtime.DummyBean								class NewExpressionTest extends GroovyTestCase {								    void testNewInstance() {				        def cheese = new String( "hey you hosers" )				        				        assert cheese != null				        				        println(cheese)				    }								    void testNewBeanNoArgs() {				        def bean = new DummyBean()				        assert bean.name == "James"				        assert bean.i == 123				    }								    void testNewBean1Args() {				        def bean = new DummyBean("Bob")				        assert bean.name == "Bob"				        assert bean.i == 123				    }								    void testNewBean2Args() {				        def bean = new DummyBean("Bob", 1707)				        assert bean.name == "Bob"				        assert bean.i == 1707				    }								    void testNewInstanceWithFullyQualifiedName() {				        def bean = new org.codehaus.groovy.runtime.DummyBean("Bob", 1707)				        assert bean.name == "Bob"				        assert bean.i == 1707				    }								    void testNewInstanceWithFullyQualifiedNameNotImported() {				        def bean = new java.io.File("Foo")								        println "Created $bean"								        assert bean != null				    }				    				    void testNewOnMultipleLines() {				        def bean = 				          new				            File				            ("Foo")								        assert bean != null				    }								}							

相关资源