Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding base classes for Spock. You can now write functional test cases u... #2

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,8 @@
/web-app
target
plugin.xml
/.idea
.idea/


grails-functional-test*.zip
2 changes: 2 additions & 0 deletions FunctionalTestGrailsPlugin.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ class FunctionalTestGrailsPlugin {
def title = "Functional Testing"
def description = '''Simple 'pure grails' functional testing for your web applications'''

def packaging = "binary"

static pluginExcludes = [
'grails-app/controllers/**',
'grails-app/conf/**',
Expand Down
67 changes: 36 additions & 31 deletions grails-app/conf/BuildConfig.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,23 @@ grails.project.work.dir = 'target'

forkConfig = false
grails.project.fork = [
test: forkConfig, // configure settings for the test-app JVM
run: forkConfig, // configure settings for the run-app JVM
war: forkConfig, // configure settings for the run-war JVM
console: forkConfig, // configure settings for the Swing console JVM
compile: forkConfig // configure settings for compilation
test : forkConfig, // configure settings for the test-app JVM
run : forkConfig, // configure settings for the run-app JVM
war : forkConfig, // configure settings for the run-war JVM
console: forkConfig, // configure settings for the Swing console JVM
compile: forkConfig // configure settings for compilation
]

grails.project.dependency.resolver = "maven"
grails.project.dependency.resolution = {
// inherit Grails' default dependencies
inherits("global") {
// uncomment to disable ehcache
// excludes 'xml-apis'
// specify dependency exclusions here; for example, uncomment this to disable ehcache:
// excludes 'ehcache'
//Grails ships with 4.2.5
//excludes 'httpclient'
excludes 'httpcore'
//excludes 'httpcomponents'
}

log 'warn'
Expand All @@ -39,50 +44,50 @@ grails.project.dependency.resolution = {
def htmlUnitVersion = '2.10'

dependencies {
compile( 'org.codehaus.groovy.modules.http-builder:http-builder:0.5.2') {
excludes 'groovy', 'xml-apis', 'xerces'
test('org.codehaus.groovy.modules.http-builder:http-builder:0.5.2') {
excludes 'groovy', 'xml-apis', 'xerces', 'httpcore'
}

// HtmlUnit stuff
compile( "net.sourceforge.htmlunit:htmlunit:$htmlUnitVersion") {
excludes 'xml-apis', 'xerces'
test("net.sourceforge.htmlunit:htmlunit:$htmlUnitVersion") {
excludes 'xml-apis', 'xerces', 'httpcore'
}
compile( "net.sourceforge.htmlunit:htmlunit-core-js:$htmlUnitVersion") {
excludes 'xml-apis', 'xerces'
}
compile( 'org.apache.httpcomponents:httpclient:4.2.3') {
excludes 'xml-apis', 'xerces'
test("net.sourceforge.htmlunit:htmlunit-core-js:$htmlUnitVersion") {
excludes 'xml-apis', 'xerces', 'httpcore'
}
// compile( 'org.apache.httpcomponents:httpclient:4.2.3') {
// excludes 'xml-apis', 'xerces'
// }

test( 'commons-codec:commons-codec:1.7') {
excludes 'xml-apis', 'xerces'
test('commons-codec:commons-codec:1.7') {
excludes 'xml-apis', 'xerces', 'httpcore'
}
build( 'net.sourceforge.nekohtml:nekohtml:1.9.18') {
excludes 'xml-apis', 'xerces'
build('net.sourceforge.nekohtml:nekohtml:1.9.18') {
excludes 'xml-apis', 'xerces', 'httpcore'
}
test( 'net.sourceforge.cssparser:cssparser:0.9.9') {
excludes 'xml-apis', 'xerces'
test('net.sourceforge.cssparser:cssparser:0.9.9') {
excludes 'xml-apis', 'xerces', 'httpcore'
}
test( 'xalan:serializer:2.7.1') {
excludes 'xml-apis', 'xerces'
test('xalan:serializer:2.7.1') {
excludes 'xml-apis', 'xerces', 'httpcore'
}
test( 'xalan:xalan:2.7.1') {
excludes 'xml-apis', 'xerces'
test('xalan:xalan:2.7.1') {
excludes 'xml-apis', 'xerces', 'httpcore'
}
// test( 'xerces:xercesImpl:2.10.0') {
// excludes 'xml-apis'
// }
test( 'org.w3c.css:sac:1.3') {
excludes 'xml-apis', 'xerces'
test('org.w3c.css:sac:1.3') {
excludes 'xml-apis', 'xerces', 'httpcore'
}
}

plugins {
build(':release:3.0.1', ':rest-client-builder:1.0.3', ':tomcat:7.0.52.1') {
export = false
}
runtime ":hibernate:3.6.10.13", {
export = false
}
// runtime ":hibernate:3.6.10.13", {
// export = false
// }
}
}

This file was deleted.

This file was deleted.

17 changes: 17 additions & 0 deletions src/groovy/com/grailsrocks/functionaltest/APIFunctionalSpec.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.grailsrocks.functionaltest

import com.grailsrocks.functionaltest.client.APIClient

/**
* Created on 6/18/14.
*/
class APIFunctionalSpec extends BaseFunctionalSpec{

Class getDefaultClientType() {
APIClient
}

def head(url, Closure paramSetup = null) {
doRequest(url, 'HEAD', paramSetup)
}
}
Loading