A few days back I was reading an article on Coding Standards. There are a few articles and even books available on this topic. Following coding standards consistently, I believe is very important for a software development team. Coding standards are not written in stone. They are guidelines for making software code more readable. Like most guidelines they can be, and usually are customized for individual teams. Most teams have well defined ways in which they structure their code and name variables, methods, classes, etc. The specific standard a team adopts is not as important as the practice of ensuring that the entire team adheres to the same standard.
If you are trying to test Grails domain class constraints by putting your unit test cases in the 'test/unit' directory, then your tests will fail because the domain objects will not have the 'valdate' method. This can be resolved in two ways: Place the test cases inside test/integration (which will slow things down) Use the method 'mockForConstraintsTests(Trail)' to create mock method in your domain class and continue writing your test cases in 'test/unit' What follows is some example code around this finding. I am working on a Groovy on Grails project for a website to help programmers keep up and refresh their skills. I started with some domain classes and then moved on to write some unit tests. When we create a Grails project using grails create-app , it creates several directories, one of which is a directory called 'test' for holding unit tests. This directory contains two directories, 'unit', and 'integration' for unit and ...
Comments