Any better alternative to Groovy for Java integration testing? [closed]

五迷三道 提交于 2019-12-05 13:34:56

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.

I would recommend RSpec with JRUby.

RSpec is very clear, descriptive and easy to understand, even non-programmers can use it. With JRuby you can do pretty much everything you can do with Java.

So RSpec with JRuby sounds like a good match for your requirements.

For an example see http://patshaughnessy.net/2009/6/25/taming-the-beast-using-jruby-and-rspec-to-test-a-j2ee-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!