Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test refactor and upgrade to grooscript 0.3.4
- Loading branch information
1 parent
dcf0854
commit c596c2b
Showing
5 changed files
with
50 additions
and
36 deletions.
There are no files selected for viewing
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
22 changes: 0 additions & 22 deletions
22
src/groovy/org/grooscript/grails/plugin/PhantomJsCase.groovy
This file was deleted.
Oops, something went wrong.
39 changes: 39 additions & 0 deletions
39
src/groovy/org/grooscript/grails/plugin/test/PhantomJsCase.groovy
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package org.grooscript.grails.plugin.test | ||
|
||
import org.codehaus.groovy.grails.web.mapping.LinkGenerator | ||
import org.grooscript.GsConverter | ||
import org.grooscript.asts.PhantomJsTestImpl | ||
import org.springframework.beans.factory.annotation.Autowired | ||
import static org.grooscript.grails.util.Util.* | ||
|
||
/** | ||
* User: jorgefrancoleza | ||
* Date: 13/10/13 | ||
*/ | ||
class PhantomJsCase extends GroovyTestCase { | ||
|
||
private static final FUNCTION_NAME = 'gsTestFunction' | ||
|
||
@Autowired | ||
LinkGenerator grailsLinkGenerator | ||
|
||
//TODO not working atm, need fix in grooscript | ||
def phantomJs(params) { | ||
if (params.controller && params.code) { | ||
def url = grailsLinkGenerator.link(params) | ||
def converter = new GsConverter() | ||
converter.classPath = 'src/main' | ||
def testCode = converter.toJs("def ${FUNCTION_NAME} = { -> \n" + params.code + "\n}\n") | ||
if (!grailsLinkGenerator.getContextPath()) { | ||
url += '/grooscript-vertx' | ||
} | ||
println 'url->'+url | ||
println 'basr->'+grailsLinkGenerator.getServerBaseURL() | ||
println 'context->'+grailsLinkGenerator.getContextPath() | ||
println 'testCode->'+testCode | ||
PhantomJsTestImpl.doPhantomJsTest(url, testCode, FUNCTION_NAME) | ||
} else { | ||
consoleError 'Need define "controller" and "code" params at least' | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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