Is there RSpec analogue for Groovy/Grails?
I found a few blog posts mentioning GSpec but there is not much out there.
Is built-in Grails testing framework as good as it gets in Grails?
Grails offers various other testing frameworks through the use of plugins. For instance the Spock plugin simplifies testing using a very expressive natural language. You can find more information on Spock here as well.
Another popular testing framework for Grails is EasyB. It also has a plugin.
I would recommend you look at the various testing frameworks available, then see how they are supported by Grails.
Related
I am trying to create functional tests in grails. I have integration and unit tests. But i am unable to create functional tests directory. I am using grails 2.4.5 version
Grails 2 does not ship with functional testing capabilities. Noted in the documentation here. Using a plugin for functional testing is the recommended practice.
Grails does not ship with any support for writing functional tests
directly, but there are several plugins available for this.
Canoo Webtest - http://grails.org/plugin/webtest
G-Func - http://grails.org/plugin/functional-test
Geb - http://grails.org/plugin/geb
Selenium-RC - http://grails.org/plugin/selenium-rc
WebDriver -http://grails.org/plugin/webdriver
Consult the documentation for each plugin for its capabilities.
Grails 3 does ship with the ability to create functional testing using the Geb framework as documented here:
Grails by default ships with support for writing functional tests
using the Geb framework. To create a functional test you can use the
create-functional-test command which will create a new functional
test
I would like to know about Grails Framework. When I search grails tool suite to download,i just can find 'Based on Eclipse'. Is there anything for Netbeans IDE? Can I use Grails framework on Netbeans IDE?
Yes, You can use NetBeans 6.5 or above versions which support Groovy/ Grails development. NetBeans comes with a Groovy editor with various integrated tools and offers features like code completion, providing name of dynamic methods for grails domain and controller class. It is light and offers great functional features.
Check this link
http://grails.github.io/grails-doc/latest/guide/gettingStarted.html#ide
Also you can take help from book Grails in Action to know more about Grails framework and how to develop applications using it.
IMHO JetBrains IntelliJ IDEA is the best IDEA for Grails and it blows all other IDEs out of the water. Although you have to pay $199 for the license, it is definitely worth the $$$.
If you are a student you can get the Academic license for free :).
Is it possible to use a grails plugin outside a grails application?
I would like to use the functionality of grails-mail-plugin in a simple groovy/gradle app.
I found some information about binary plugins but I'm not sure how to define the dependency to an official grails plugin.
Thanks!
I don't think you could use any Grails plugin itself outside the Grails environment, usually there is a ton of Grails-specific assumptions built into the plugins' code.
If your Groovy application uses Spring, you could migrate the most important functionality out of it.
For this, you will have to get into the innards of the source code of the plugin (e.g. how it uses the Spring Mail package for example) which not may be very quick or easy work.
If your requirements are simple, you may be better of with building a standalone solution, possibly, directly on top of JavaMail.
If you already have a heterogeneous architecture, you may build a separate Grails application/module which only does mailing functionality (possibly through the Async Mail plugins database tables) in integration with the module you build in pure Groovy.
What does intellij do that other IDEs dont vis-a-vis grails? Im trying to decide whether I should renew my license when it comes time.... thanx...
Discussing about IDEs is a highly religious task, so the following points are my personal opinion. IntelliJ's advantages are IMHO:
Debugging works better
GSP content assist
DSL awareness
better refactoring support for Groovy
Grails project view
Integrated UML diagramm of domain classes
synchronisation of dependencies
I'd like to try unit test in ASP.NET MVC framework. But I don't know which unit test framework I have to choose.
NUnit, xUnit.net, MbUnit. or the unit test framework included with Visual Studio, which one is better?
If you are interested in following BDD guidelines, I highly recommend xUnit.NET with Moq as the mocking framework. The two are some of the most forward looking and modern unit testing frameworks available these days, and combined they make both a powerful and flexible unit testing platform. xUnit.NET is extremely extensible as its Fact and Trait attributes can be extended with your own attributes, and the testing frameworks behavior can be changed to suit your needs.
A great example of this flexibility is the ObservationAttribute and supporting framework to allow BDD style testing with xunit.net, found here:
http://iridescence.no/post/Extending-xUnit-with-a-Custom-ObservationAttribute-for-BDD-Style-Testing.aspx
I use the above BDD-style testing to create Test-Class-Per-Unit style BDD tests for my ASP.NET MVC controllers (well, and everything else I unit test, too.)
ASP.Net MVC doesn't make any specific demands of a framework, any will work just fine. NUnit is the most widely used, and for that reason it is my default choice.
Once you get into unit testing, some of the other frameworks offer different advanced features that you may like to check out.
I don't know anyone using the MS unit testing framework.
I would recommend to start from xUnit if your have not used any testing framework before. It's hard to decide which framework is better but I think that xUnit is the "most modern" among NUnit, MbUnit and MSTest. Start learning xUnit from this article and then this
I am using MSTest :) so now you know one ;)
Seriously, I think that MSTest is a the best framework for the start with TDD.
It is liteweight and it is generating all that you need for the wrapup and the most important thing, it is integrated in the visual studio...so, why don't you start with mstest and later on you can switch to advanced frameworks with no problems.
So in short, I would recomend a MSTest.
cheers