java groovy集成,Groovy for Java集成测试的更好选择?

I am planning to test my Java-based web application using its programming interfaces. To this aim, I intend to call my session beans using their RMI/WebService interfaces and check if their supported services are correct or not. To do this, I need a scripting language to:

Call my RMI/WebService interfaces

Execute SQL statements (e.g. for cleaning the DB at first)

Have a simple flow control (loops, conditions, etc. )

Be easy to understand. I may ask my non-programmer staff to write test scripts

I am planning to use Groovy to this aim. Is there any better suggestion or alternative for Groovy?

Edit 1

Other introduced alternatives to Groovy mentioned in answers are JRuby and RSpec. Is there any comparison for them on the web?

解决方案

I think Groovy is the best that you can use for your tests. Groovy integration with Java is seamless, thus calling methods, libraries, and stuff like that usually run smooth.

Also companies which are starting to use Groovy usually start using it for tests, and later use it in production code.

As @tim_yates said, Spock is a Groovy framework for testing and a great one. You can also use JUnit/EasyMock/TestNG/Whatever without problems, and Groovy itself comes with the GroovyTestCase (based on JUnit) which gets the job done.

Groovy also enables you to write cool DSLs, which help you to achieve a programming language for non-programmers, as you said you need.

SQL support in Groovy is also simple. You can use groovy.sql package classes and get started really fast with it, or you can go for JPA if you want.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值