Skip to content

Commit

Permalink
Upgrading to grails 2.1.1 and spock 0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
ctoestreich committed Nov 10, 2012
1 parent fbd188b commit b8fa47e
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 50 deletions.
6 changes: 3 additions & 3 deletions application.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Grails Metadata file
#Wed Dec 21 12:55:59 CST 2011
app.grails.version=2.0.0
#Sat Nov 10 09:45:37 CST 2012
app.grails.version=2.1.1
app.name=grails-spock-constraints
app.servlet.version=2.5
app.version=0.1
app.version=2.0
16 changes: 3 additions & 13 deletions grails-app/conf/BuildConfig.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,6 @@ grails.project.dependency.resolution = {
grailsHome()
grailsCentral()
mavenCentral()

mavenRepo "http://m2repo.spockframework.org/snapshots"

// uncomment these to enable remote dependency resolution from public Maven repositories
//mavenCentral()
//mavenLocal()
//mavenRepo "http://snapshots.repository.codehaus.org"
//mavenRepo "http://repository.codehaus.org"
//mavenRepo "http://download.java.net/maven/2/"
//mavenRepo "http://repository.jboss.com/maven2/"
}
dependencies {
// specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes eg.
Expand All @@ -40,11 +30,11 @@ grails.project.dependency.resolution = {

plugins {
compile ":hibernate:$grailsVersion"
compile ":jquery:1.6.1.1"
compile ":resources:1.1.1"
runtime ":jquery:1.8.2"
compile ":resources:1.2.RC2"

build ":tomcat:$grailsVersion"

test ":spock:0.6-SNAPSHOT"
test ":spock:0.7"
}
}
47 changes: 38 additions & 9 deletions grails-spock-constraints-grailsPlugins.iml
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,54 @@
<datasource-map />
</configuration>
</facet>
<facet type="web" name="GrailsWeb">
<configuration>
<webroots>
<root url="file://$USER_HOME$/.grails/2.1.1/projects/grails-spock-constraints/plugins/jquery-ui-1.8.24/web-app" relative="/" />
<root url="file://$USER_HOME$/.grails/2.1.1/projects/grails-spock-constraints/plugins/jquery-1.8.2/web-app" relative="/" />
</webroots>
<sourceRoots />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$USER_HOME$/.grails/2.0.0/projects/grails-spock-constraints/plugins/hibernate-2.0.0" />
<content url="file://$USER_HOME$/.grails/2.0.0/projects/grails-spock-constraints/plugins/tomcat-2.0.0" />
<content url="file://$USER_HOME$/.grails/2.1.1/projects/grails-spock-constraints/plugins/hibernate-2.1.1">
<sourceFolder url="file://$USER_HOME$/.grails/2.1.1/projects/grails-spock-constraints/plugins/hibernate-2.1.1/grails-app/i18n" isTestSource="false" />
</content>
<content url="file://$USER_HOME$/.grails/2.1.1/projects/grails-spock-constraints/plugins/jquery-1.8.2">
<sourceFolder url="file://$USER_HOME$/.grails/2.1.1/projects/grails-spock-constraints/plugins/jquery-1.8.2/src/groovy" isTestSource="false" />
<sourceFolder url="file://$USER_HOME$/.grails/2.1.1/projects/grails-spock-constraints/plugins/jquery-1.8.2/grails-app/i18n" isTestSource="false" />
<sourceFolder url="file://$USER_HOME$/.grails/2.1.1/projects/grails-spock-constraints/plugins/jquery-1.8.2/grails-app/services" isTestSource="false" />
<sourceFolder url="file://$USER_HOME$/.grails/2.1.1/projects/grails-spock-constraints/plugins/jquery-1.8.2/grails-app/taglib" isTestSource="false" />
</content>
<content url="file://$USER_HOME$/.grails/2.1.1/projects/grails-spock-constraints/plugins/jquery-ui-1.8.24">
<sourceFolder url="file://$USER_HOME$/.grails/2.1.1/projects/grails-spock-constraints/plugins/jquery-ui-1.8.24/grails-app/i18n" isTestSource="false" />
<sourceFolder url="file://$USER_HOME$/.grails/2.1.1/projects/grails-spock-constraints/plugins/jquery-ui-1.8.24/grails-app/taglib" isTestSource="false" />
</content>
<content url="file://$USER_HOME$/.grails/2.1.1/projects/grails-spock-constraints/plugins/resources-1.2.RC2">
<sourceFolder url="file://$USER_HOME$/.grails/2.1.1/projects/grails-spock-constraints/plugins/resources-1.2.RC2/src/java" isTestSource="false" />
<sourceFolder url="file://$USER_HOME$/.grails/2.1.1/projects/grails-spock-constraints/plugins/resources-1.2.RC2/src/groovy" isTestSource="false" />
<sourceFolder url="file://$USER_HOME$/.grails/2.1.1/projects/grails-spock-constraints/plugins/resources-1.2.RC2/grails-app/i18n" isTestSource="false" />
<sourceFolder url="file://$USER_HOME$/.grails/2.1.1/projects/grails-spock-constraints/plugins/resources-1.2.RC2/grails-app/taglib" isTestSource="false" />
</content>
<content url="file://$USER_HOME$/.grails/2.1.1/projects/grails-spock-constraints/plugins/spock-0.7" />
<content url="file://$USER_HOME$/.grails/2.1.1/projects/grails-spock-constraints/plugins/tomcat-2.1.1" />
<content url="file://$USER_HOME$/.grails/2.1.1/projects/grails-spock-constraints/plugins/webxml-1.4.1">
<sourceFolder url="file://$USER_HOME$/.grails/2.1.1/projects/grails-spock-constraints/plugins/webxml-1.4.1/src/groovy" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" scope="PROVIDED" name="grails-2.0.0" level="application" />
<orderEntry type="library" scope="PROVIDED" name="grails-2.1.1" level="application" />
<orderEntry type="module-library" exported="">
<library name="Grails User Library (grails-spock-constraints-grailsPlugins)">
<CLASSES>
<root url="jar://$USER_HOME$/.grails/ivy-cache/org.hamcrest/hamcrest-core/jars/hamcrest-core-1.2.jar!/" />
<root url="jar://$USER_HOME$/.grails/ivy-cache/org.codehaus.groovy/groovy-all/jars/groovy-all-1.8.4.jar!/" />
<root url="jar://$USER_HOME$/.grails/ivy-cache/junit/junit-dep/jars/junit-dep-4.9.jar!/" />
<root url="jar://$USER_HOME$/.grails/ivy-cache/org.spockframework/spock-core/jars/spock-core-0.6-groovy-1.8-SNAPSHOT.jar!/" />
<root url="jar://$USER_HOME$/.grails/ivy-cache/org.spockframework/spock-grails-support/jars/spock-grails-support-0.6-groovy-1.8-SNAPSHOT.jar!/" />
<root url="jar://$USER_HOME$/.grails/ivy-cache/net.sf.ehcache/ehcache-core/jars/ehcache-core-2.4.3.jar!/" />
<root url="jar://$USER_HOME$/.grails/ivy-cache/xml-apis/xml-apis/jars/xml-apis-1.0.b2.jar!/" />
<root url="jar://$USER_HOME$/.grails/ivy-cache/antlr/antlr/jars/antlr-2.7.6.jar!/" />
<root url="jar://$USER_HOME$/.grails/ivy-cache/org.hamcrest/hamcrest-core/jars/hamcrest-core-1.3.jar!/" />
<root url="jar://$USER_HOME$/.grails/ivy-cache/junit/junit-dep/jars/junit-dep-4.10.jar!/" />
<root url="jar://$USER_HOME$/.grails/ivy-cache/org.spockframework/spock-core/jars/spock-core-0.7-groovy-1.8.jar!/" />
<root url="jar://$USER_HOME$/.grails/ivy-cache/org.spockframework/spock-grails-support/jars/spock-grails-support-0.7-groovy-1.8.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
Expand Down
24 changes: 11 additions & 13 deletions grails-spock-constraints.iml
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,16 @@
<output url="file://$MODULE_DIR$/web-app/WEB-INF/classes" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/grails-app/conf" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/grails-app/domain" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/grails-app/i18n" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/test/unit" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/grails-app/utils" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/groovy" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/grails-app/conf" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/grails-app/controllers" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/grails-app/domain" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/grails-app/services" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/grails-app/taglib" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/grails-app/utils" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/grails-app/i18n" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/test/unit" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/test/integration" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/target/classes" />
<excludeFolder url="file://$MODULE_DIR$/target/test-classes" />
Expand All @@ -62,15 +62,12 @@
<orderEntry type="module-library" exported="">
<library name="Grails User Library (grails-spock-constraints)">
<CLASSES>
<root url="file://$MODULE_DIR$/lib" />
<root url="jar://$USER_HOME$/.grails/ivy-cache/org.hamcrest/hamcrest-core/jars/hamcrest-core-1.2.jar!/" />
<root url="jar://$USER_HOME$/.grails/ivy-cache/org.codehaus.groovy/groovy-all/jars/groovy-all-1.8.4.jar!/" />
<root url="jar://$USER_HOME$/.grails/ivy-cache/junit/junit-dep/jars/junit-dep-4.9.jar!/" />
<root url="jar://$USER_HOME$/.grails/ivy-cache/org.spockframework/spock-core/jars/spock-core-0.6-groovy-1.8-SNAPSHOT.jar!/" />
<root url="jar://$USER_HOME$/.grails/ivy-cache/org.spockframework/spock-grails-support/jars/spock-grails-support-0.6-groovy-1.8-SNAPSHOT.jar!/" />
<root url="jar://$USER_HOME$/.grails/ivy-cache/net.sf.ehcache/ehcache-core/jars/ehcache-core-2.4.3.jar!/" />
<root url="jar://$USER_HOME$/.grails/ivy-cache/xml-apis/xml-apis/jars/xml-apis-1.0.b2.jar!/" />
<root url="jar://$USER_HOME$/.grails/ivy-cache/antlr/antlr/jars/antlr-2.7.6.jar!/" />
<root url="file://$MODULE_DIR$/lib" />
<root url="jar://$USER_HOME$/.grails/ivy-cache/org.hamcrest/hamcrest-core/jars/hamcrest-core-1.3.jar!/" />
<root url="jar://$USER_HOME$/.grails/ivy-cache/junit/junit-dep/jars/junit-dep-4.10.jar!/" />
<root url="jar://$USER_HOME$/.grails/ivy-cache/org.spockframework/spock-core/jars/spock-core-0.7-groovy-1.8.jar!/" />
<root url="jar://$USER_HOME$/.grails/ivy-cache/org.spockframework/spock-grails-support/jars/spock-grails-support-0.7-groovy-1.8.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
Expand All @@ -79,6 +76,7 @@
</orderEntry>
<orderEntry type="library" name="grails-2.0.0" level="application" />
<orderEntry type="module" module-name="grails-spock-constraints-grailsPlugins" />
<orderEntry type="library" name="grails-2.1.1" level="application" />
</component>
</module>

6 changes: 6 additions & 0 deletions grails-spock-constraints.ipr
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
<option name="SKIP_IMPORT_STATEMENTS" value="false" />
</component>
<component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
<component name="EntryPointsManager">
<entry_points version="2.0" />
</component>
<component name="IdProvider" IDEtalkID="BF8A5100DEBE97CB080721D73A704209" />
<component name="InspectionProjectProfileManager">
<profiles>
Expand Down Expand Up @@ -382,6 +385,9 @@
<module fileurl="file://$PROJECT_DIR$/grails-spock-constraints-grailsPlugins.iml" filepath="$PROJECT_DIR$/grails-spock-constraints-grailsPlugins.iml" />
</modules>
</component>
<component name="ProjectResources">
<default-html-doctype>http://www.w3.org/1999/xhtml</default-html-doctype>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_5" assert-keyword="true" jdk-15="true" project-jdk-name="1.6" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/classes" />
</component>
Expand Down
4 changes: 1 addition & 3 deletions test/unit/com/tgid/data/ConstraintUnitSpec.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ import spock.lang.Specification
abstract class ConstraintUnitSpec extends Specification {

String getLongString(Integer length) {
def longString = ""
length.times { longString += "a" }
longString
'a' * length
}

String getEmail(Boolean valid) {
Expand Down
18 changes: 9 additions & 9 deletions test/unit/com/tgid/data/PersonSpec.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class PersonSpec extends ConstraintUnitSpec {
mockForConstraintsTests(Person, [new Person(ssn: '123456789')])
}

@Unroll({"test person all constraints $field is $error"})
@Unroll("test person all constraints #field is #error")
def "test person all constraints"() {
when:
def obj = new Person("$field": val)
Expand Down Expand Up @@ -45,7 +45,7 @@ class PersonSpec extends ConstraintUnitSpec {
'invalid.bountyhunter' | 'username' | 'buba'
}

@Unroll({"person $field is $error using $val"})
@Unroll("person #field is #error using #val")
def "test person age constraints"() {
when:
def obj = new Person("$field": val)
Expand All @@ -63,7 +63,7 @@ class PersonSpec extends ConstraintUnitSpec {
'valid' | 'age' | 0
}

@Unroll({"person $field is $error using $val"})
@Unroll("person #field is #error using #val")
def "test person ssn constraints"() {
when:
def obj = new Person("$field": val)
Expand All @@ -80,7 +80,7 @@ class PersonSpec extends ConstraintUnitSpec {
'valid' | 'ssn' | '123-45-6787'
}

@Unroll({"person $field is $error using $val"})
@Unroll("person #field is #error using #val")
def "test person username constraints"() {
when:
def obj = new Person("$field": val)
Expand All @@ -97,7 +97,7 @@ class PersonSpec extends ConstraintUnitSpec {
'valid' | 'username' | 'bobajunior'
}

@Unroll({"person $field is $error using $val"})
@Unroll("person #field is #error using #val")
def "test person homepage constraints"() {
when:
def obj = new Person("$field": val)
Expand All @@ -114,7 +114,7 @@ class PersonSpec extends ConstraintUnitSpec {
'valid' | 'homePage' | getUrl(true)
}

@Unroll({"person $field is $error using $val"})
@Unroll("person #field is #error using #val")
def "test person gender constraints"() {
when:
def obj = new Person("$field": val)
Expand All @@ -131,7 +131,7 @@ class PersonSpec extends ConstraintUnitSpec {
'valid' | 'gender' | 'Female'
}

@Unroll({"person $field is $error using $val"})
@Unroll("person #field is #error using #val")
def "test person credit card constraints"() {
when:
def obj = new Person("$field": val)
Expand All @@ -147,7 +147,7 @@ class PersonSpec extends ConstraintUnitSpec {
'valid' | 'amex' | getCreditCard(true)
}

@Unroll({"person $field is $error using $val"})
@Unroll("person #field is #error using #val")
def "test person birth date constraints"() {
when:
def obj = new Person("$field": val)
Expand All @@ -163,7 +163,7 @@ class PersonSpec extends ConstraintUnitSpec {
'valid' | 'birthDate' | new Date()
}

@Unroll({"person $field testing $error"})
@Unroll("person #field testing #error")
def "test person children constraints"() {
when:
def obj = new Person("$field": val)
Expand Down

0 comments on commit b8fa47e

Please sign in to comment.