Skip to content

Commit 89560ea

Browse files
committed
feedback: styling & removing debug
1 parent 0f21e24 commit 89560ea

File tree

13 files changed

+187
-190
lines changed

13 files changed

+187
-190
lines changed

docs/guide-developer/src/main/docs/stepByStep.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ dependencies {
3232
project(':grails-datastore-web'),
3333
project(':grails-datastore-gorm-support')
3434
35-
testImplementation project(':grails-datastore-gorm-tck').testFixtures
35+
testImplementation project(':grails-datastore-gorm-tck')
3636
testRuntime "javax.servlet:javax.servlet-api:$servletApiVersion"
3737
3838
}

docs/guide-developer/src/main/docs/testing.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ The `grails-datastore-gorm-tck` project provides several hundred tests to guaran
22

33
[source,groovy]
44
----
5-
testCompile project(':grails-datastore-gorm-tck').testFixtures
5+
testCompile project(':grails-datastore-gorm-tck')
66
----
77

88
Then create a `Setup.groovy` file that sets up your custom datastore in your implementation.

gradle/tck-config.gradle

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
dependencies {
2-
if(!project.hasProperty('includeBaseTckClass') || project.findProperty('includeBaseTckClass')) {
2+
if (!project.hasProperty('includeBaseTckClass') || project.findProperty('includeBaseTckClass')) {
33
testImplementation project(':grails-datastore-gorm-tck-base')
44
}
5-
// testImplementation project(path: ':grails-datastore-gorm-tck', configuration: 'testArtifacts')
65
testImplementation project(':grails-datastore-gorm-tck')
76
testImplementation project(':grails-datastore-gorm-tck-domains')
87
}
98

109
// TODO: gradle will happily put the jar file on the classpath, but junit won't find the tests. Dynamic test discovery also won't find them.
11-
tasks.register("extractTckJar", Copy) {
10+
tasks.register('extractTckJar', Copy) {
1211
dependsOn(configurations.testRuntimeClasspath)
1312

14-
Provider<Directory> extractTarget = layout.buildDirectory.dir("extracted-tck-classes")
13+
Provider<Directory> extractTarget = layout.buildDirectory.dir('extracted-tck-classes')
1514

1615
doFirst {
1716
extractTarget.get().asFile.deleteDir()
@@ -26,8 +25,8 @@ tasks.register("extractTckJar", Copy) {
2625
}
2726

2827
tasks.withType(Test).configureEach {
29-
dependsOn("extractTckJar")
28+
dependsOn('extractTckJar')
3029
doFirst {
31-
testClassesDirs += files(layout.buildDirectory.dir("extracted-tck-classes"))
30+
testClassesDirs += files(layout.buildDirectory.dir('extracted-tck-classes'))
3231
}
3332
}

grails-data-graphql/examples/spring-boot-app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ buildscript {
33
mavenCentral()
44
}
55
dependencies {
6-
implementation platform("org.grails:grails-bom:$grailsVersion")
6+
classpath platform("org.grails:grails-bom:$grailsVersion")
77
classpath("org.springframework.boot:spring-boot-gradle-plugin")
88
}
99
}

grails-data-hibernate5/gorm/src/test/groovy/grails/gorm/tests/GormDatastoreSpec.groovy

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import grails.gorm.tck.PlantCategory
2525
import grails.gorm.tck.Publication
2626
import grails.gorm.tck.Task
2727
import grails.gorm.tck.TestEntity
28+
import groovy.util.logging.Slf4j
2829
import org.grails.datastore.mapping.core.DatastoreUtils
2930
import org.grails.datastore.mapping.core.Session
3031
import spock.lang.Shared
@@ -42,6 +43,7 @@ import spock.lang.Specification
4243
* This class must contain a static no-arg method called "setup()"
4344
* that returns a Session instance.
4445
*/
46+
@Slf4j
4547
abstract class GormDatastoreSpec extends Specification {
4648

4749
static final CURRENT_TEST_NAME = "current.gorm.test"
@@ -61,7 +63,7 @@ abstract class GormDatastoreSpec extends Specification {
6163
}
6264

6365
def setup() {
64-
System.out.println("Using hibernate5 datastore class")
66+
log.info('Using hibernate5 datastore class')
6567
cleanRegistry()
6668
System.setProperty(CURRENT_TEST_NAME, this.getClass().simpleName - 'Spec')
6769
session = createSession()

grails-data-hibernate5/gorm/src/test/groovy/org/grails/datastore/gorm/Setup.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class Setup {
6969
}
7070

7171
static Session setup(List<Class> classes, ConfigObject grailsConfig = new ConfigObject(), boolean isTransactional = true) {
72-
System.setProperty("hibernate5.gorm.suite", "true")
72+
System.setProperty('hibernate5.gorm.suite', "true")
7373
grailsApplication = new DefaultGrailsApplication(classes as Class[], new GroovyClassLoader(Setup.getClassLoader()))
7474
if(grailsConfig) {
7575
grailsApplication.config.putAll(grailsConfig)

grails-datastore-gorm-tck-base/src/main/groovy/grails/gorm/tests/GormDatastoreSpec.groovy

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import grails.gorm.tck.PlantCategory
2525
import grails.gorm.tck.Publication
2626
import grails.gorm.tck.Task
2727
import grails.gorm.tck.TestEntity
28+
import groovy.util.logging.Slf4j
2829
import org.grails.datastore.mapping.core.DatastoreUtils
2930
import org.grails.datastore.mapping.core.Session
3031

@@ -43,9 +44,10 @@ import spock.lang.Specification
4344
* This class must contain a static no-arg method called "setup()"
4445
* that returns a Session instance.
4546
*/
47+
@Slf4j
4648
abstract class GormDatastoreSpec extends Specification {
4749

48-
static final CURRENT_TEST_NAME = "current.gorm.test"
50+
static final CURRENT_TEST_NAME = 'current.gorm.test'
4951
static final SETUP_CLASS_NAME = 'org.grails.datastore.gorm.Setup'
5052
static final TEST_CLASSES = [
5153
Book, ChildEntity, City, ClassWithListArgBeforeValidate, ClassWithNoArgBeforeValidate,
@@ -62,7 +64,7 @@ abstract class GormDatastoreSpec extends Specification {
6264
}
6365

6466
def setup() {
65-
System.out.println("Using base datastore class")
67+
log.info('Using base datastore class')
6668
cleanRegistry()
6769
System.setProperty(CURRENT_TEST_NAME, this.getClass().simpleName - 'Spec')
6870
session = createSession()

grails-datastore-gorm-tck/src/main/groovy/grails/gorm/tck/BuiltinUniqueConstraintWorksWithTargetProxiesConstraintsSpec.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import org.grails.datastore.mapping.proxy.ProxyHandler
55
import spock.lang.PendingFeatureIf
66

77
class BuiltinUniqueConstraintWorksWithTargetProxiesConstraintsSpec extends GormDatastoreSpec {
8-
@PendingFeatureIf({ !Boolean.getBoolean("hibernate5.gorm.suite") && !Boolean.getBoolean("hibernate6.gorm.suite") && !Boolean.getBoolean("mongodb.gorm.suite")})
8+
@PendingFeatureIf({ !Boolean.getBoolean('hibernate5.gorm.suite') && !Boolean.getBoolean('hibernate6.gorm.suite') && !Boolean.getBoolean('mongodb.gorm.suite')})
99
void "test unique constraint on root instance"() {
1010

1111
setup:
@@ -26,7 +26,7 @@ class BuiltinUniqueConstraintWorksWithTargetProxiesConstraintsSpec extends GormD
2626
ContactDetails.deleteAll(contactDetails1)
2727
}
2828

29-
@PendingFeatureIf({ !Boolean.getBoolean("hibernate5.gorm.suite") && !Boolean.getBoolean("hibernate6.gorm.suite") && !Boolean.getBoolean("mongodb.gorm.suite")})
29+
@PendingFeatureIf({ !Boolean.getBoolean('hibernate5.gorm.suite') && !Boolean.getBoolean('hibernate6.gorm.suite') && !Boolean.getBoolean('mongodb.gorm.suite')})
3030
void "test unique constraint for the associated child object"() {
3131

3232
setup:

grails-datastore-gorm-tck/src/main/groovy/grails/gorm/tck/DirtyCheckingAfterListenerSpec.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class DirtyCheckingAfterListenerSpec extends GormDatastoreSpec {
3535
}
3636
}
3737

38-
@PendingFeatureIf({ !Boolean.getBoolean("hibernate5.gorm.suite") && !Boolean.getBoolean("hibernate6.gorm.suite") && !Boolean.getBoolean("mongodb.gorm.suite") })
38+
@PendingFeatureIf({ !Boolean.getBoolean('hibernate5.gorm.suite') && !Boolean.getBoolean('hibernate6.gorm.suite') && !Boolean.getBoolean('mongodb.gorm.suite') })
3939
void "test state change from listener update the object"() {
4040

4141
when:

grails-datastore-gorm-tck/src/main/groovy/grails/gorm/tck/DirtyCheckingSpec.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ class DirtyCheckingSpec extends GormDatastoreSpec {
152152
TestAuthor.deleteAll()
153153
}
154154

155-
@IgnoreIf({ !Boolean.getBoolean("mongodb.gorm.suite")})
155+
@IgnoreIf({ !Boolean.getBoolean('mongodb.gorm.suite')})
156156
void "test initialized proxy is not marked as dirty"() {
157157

158158
given:

0 commit comments

Comments
 (0)