This file contains hidden or 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
/** | |
* This script restarts a remote tomcat instance | |
* Usage: groovy restartRemoteTomcat.groovy or groovy restartRemoteTomcat.groovy remoteServer remoteUser pathToTomcatBinDirectory | |
* Example: groovy restartRemoteTomcat myServer username "/home/username/apache-tomcat-7.0.39/bin/" | |
*/ | |
@Grapes([ | |
@Grab('org.apache.ant:ant:1.8.3'), | |
@Grab(group = 'ant', module = 'ant-jsch', version = '1.6.5'), | |
@Grab(group = 'com.jcraft', module = 'jsch', version = '0.1.48'), |
This file contains hidden or 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
def mimeType = grailsMimeUtility.getMimeTypeForExtension(extension) | |
println mimeType.name |
This file contains hidden or 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
TwitterReaderService twitterReaderServiceMock = Mock(TwitterReaderService) | |
def setup() { | |
controller.twitterReaderService = twitterReaderServiceMock | |
} |
This file contains hidden or 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
service.metaClass.runAsync = { it() } | |
// The first line basically says ‘take the code within the runAsync closure, and just execute it’. | |
// http://fbflex.wordpress.com/2011/10/26/grails-quick-tip-testing-spock-interactions-wrapped-by-the-executor-plugin/ |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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) |