Groovy动态语言 运行在JVM中的动态语言 可以方便的处理业务逻辑变化大的业务

源代码在线查看: callinnerclassctortest.groovy

软件大小: 1644 K
上传用户: maple_78
关键词: Groovy JVM 动态语言 运行
下载地址: 免注册下载 普通下载 VIP

相关代码

				import groovy.OuterUser
				
				/**
				 * Checks that it's possible to call inner classes constructor from groovy
				 * @author Guillaume Laforge
				 */
				class CallInnerClassCtorTest extends GroovyTestCase {
				
				    void testCallCtor() {
				        def user = new groovy.OuterUser()
				        user.name = "Guillaume"
				        user.age = 27
				
				        assert user.name == "Guillaume"
				        assert user.age == 27
				    }
				
				    void testCallInnerCtor() {
				        def address = new groovy.OuterUser.InnerAddress()
				        address.city = "Meudon"
				        address.zipcode = 92360
				
				        assert address.city == "Meudon"
				        assert address.zipcode == 92360
				    }
				
				    void testCallInnerInnerCtor() {
				        def address = new groovy.OuterUser.InnerAddress.Street()
				        address.name = "rue de la paix"
				        address.number = 17
				
				        assert address.name == "rue de la paix"
				        assert address.number == 17
				    }
				
				}			

相关资源