This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
run-app -debug -reloading | |
-XX:MaxPermSize=512m -Xmx4096m | |
// To run in grails 2.4 | |
grails -debug test-app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Inline Testing | |
grails.plugin.location."platform-ui" = "../grails-platform-ui" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
plugin.platformCore.events.catchFlushExceptions = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//grails.project.class.dir = "target/classes" | |
//grails.project.test.class.dir = "target/test-classes" | |
//grails.project.test.reports.dir = "target/test-reports" | |
grails.project.work.dir="target" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.hibernate.criterion.CriteriaSpecification | |
BlogEntry.withCriteria { | |
maxResults 5 | |
resultTransformer(CriteriaSpecification.ALIAS_TO_ENTITY_MAP) | |
projections { | |
count('id', 'total') | |
groupProperty('author', 'author') | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Convert | |
myCoolemailService.myEmailService = Mock(MyEmailService) | |
// to | |
myCoolemailService.myEmailService = Mock([useObjenesis: false], MyEmailService) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Collections.emptyList() | |
// Use Collections.emptyList() when you do not wish to modify the returned list, otherwise [] | |
// That's what you use if you want to pass a default parameter that will not be modified by the called funciton | |
// http://stackoverflow.com/questions/5552258/collections-emptylist-vs-new-instance |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Templates rendered by TagLib may be verified as follows | |
class SomeAwesomeSpec extends Specification { | |
public static final String BLAH = "BLAH" | |
void "test something"() { | |
given: | |
groovyPages.put("/path/to/_blah.gsp", BLAH) | |
when: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@TestFor(MyQuartzJob) | |
@TestMixin(ControllerUnitTestMixin) // This allows access to grailsApplication | |
class MyQuartzJobSpec extends Specification { | |
def job | |
def setup() { | |
grailsApplication.config.some.config.stuff = true | |
job = new MyQuartzJob() | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
log4j = { | |
... | |
debug 'org.hibernate.SQL' | |
trace 'org.hibernate.type.descriptor.sql.BasicBinder' | |
} |
OlderNewer