Grails claims that it encourages writing test – for example, a test class is created every time you create a controller or domain. However, working on my first Grails project I find it quite confusing which kind of test supports what.
For example, we use GreenMail in our testing environment. To check for sent mails, we have to use GrailsUnitTests, even if we are testing a Controller, because the content of mails is always empty in ControllerUnitTests.
Checking view names or redirects in those two types of tests is also slightly different:
-
//ControllerUnitTest
-
assert controller.modelAndView.view == "send"
-
assert controller.redirectArgs.controller == "delivery"
-
//GrailsUnitTests
-
assert controller.modelAndView.view == "Message/send"
-
assert controller.response.redirectUrl == "/delivery"
This is pretty annoying and I hope it will be unified in future versions of Grails. >> more…
This is a short article I write because it would have saved me some significant time had I been able to google it (no time-travel google (yet) – find articles you will write in the future). So maybe somebody in the future will find this useful
.
What we were doing is to use a Microsoft Business Intelligence/Reporting Server to report on data in an Oracle production database.
Creating the OLAP cubes in the MS system, everything worked fine until I tried to pull in aggregate data over a date field from the database, giving me the mysterious “Not a legal OleAut date” error message that can be found in the various forums, but none in the context of OLAP cubes. >> more…
Per default, Google Analytics tracks the whole URL. As a lot of our URLs contain some parameters or IDs, and we’re not interessted in tracking them, we needed to find a way to truncate them. As Grails unfortunately does not provide methods to access the current view and controller (which is basically what we’d like to track) in GSPs, we used this code:
-
pageTracker._trackPageview(${request.getServletPath() – ‘/grails/’ – ‘.dispatch’});
Not as clean as we’d like to have it, so suggestions are welcome!
It can happen more quickly than you think… even in environments which seem to follow an architectural role model, some dusty corners remain.
We are running an MS SQL Server Reporting Services server for some internal reports on the Oracle production database. Nice enough report generator. Now, I have done more than just some MS Access in prehistoric times, and constantly feel reminded of that “put these 120 line SQL query into the puny little properties textbox and it will do what you want” type of development. Things have definitely improved over that with MS Visual Studio 2008 and the report designer, but then, without prior notice, I was struggling with Visual Basic… >> more…
For the new application we’re building, we not only want to try new technology (Groovy and Grails instead of Java), but also a new way of deployment – some cloud instead of our own servers in the data center.
First thing we found was Google’s Application Engine, but this post points out some serious shortcomings. It only supports Grails 1.1.1 (current version at this time is 1.2.2), you can’t write to the file system (which is not too bad, because big table should be fine for our needs) and – that was the worst thing – there was no further development of the project. >> more…