diff --git a/examples/pubsub-demo/build.gradle b/examples/pubsub-demo/build.gradle index 91879538..b8ee19f7 100644 --- a/examples/pubsub-demo/build.gradle +++ b/examples/pubsub-demo/build.gradle @@ -1,20 +1,13 @@ plugins { - id 'application' id 'groovy' - id 'org.grails.grails-web' - id 'org.grails.plugins.views-json' } +version = rootProject.version group = 'pubsub.demo' -configurations.all { - - resolutionStrategy.dependencySubstitution { - substitute module("org.codehaus.groovy:groovy") using module('org.apache.groovy:groovy:4.0.22') - substitute module("org.codehaus.groovy:groovy-templates") using module('org.apache.groovy:groovy-templates:4.0.22') - substitute module("org.codehaus.groovy:groovy-xml") using module('org.apache.groovy:groovy-xml:4.0.22') - substitute module("org.codehaus.groovy:groovy-json") using module('org.apache.groovy:groovy-json:4.0.22') - } -} + +// Must be applied after version is set +apply plugin: 'org.grails.grails-web' + dependencies { implementation project(':grails-plugin-async') @@ -30,8 +23,7 @@ dependencies { implementation 'org.grails:grails-web-boot' implementation 'org.grails.plugins:hibernate5' - implementation libs.grails.views.json - implementation libs.grails.views.json.templates + implementation 'org.grails.plugins:views-json' implementation 'org.springframework.boot:spring-boot-autoconfigure' implementation 'org.springframework.boot:spring-boot-starter' @@ -40,7 +32,8 @@ dependencies { implementation libs.micronaut.serde.jackson runtimeOnly 'com.h2database:h2' - runtimeOnly 'org.apache.tomcat:tomcat-jdbc' + runtimeOnly 'org.fusesource.jansi:jansi' + runtimeOnly 'com.zaxxer:HikariCP' testImplementation libs.micronaut.http.client testImplementation 'org.grails:grails-web-testing-support' diff --git a/examples/pubsub-demo/grails-app/conf/application.yml b/examples/pubsub-demo/grails-app/conf/application.yml index e335872a..787238d9 100644 --- a/examples/pubsub-demo/grails-app/conf/application.yml +++ b/examples/pubsub-demo/grails-app/conf/application.yml @@ -1,52 +1,48 @@ info: - app: - name: '@info.app.name@' - version: '@info.app.version@' - grailsVersion: '@info.app.grailsVersion@' + app: + name: '@info.app.name@' + version: '@info.app.version@' + grailsVersion: '@info.app.grailsVersion@' grails: - views: - default: - codec: html - gorm: - reactor: - events: false - mime: - disable: - accept: - header: - userAgents: - - Gecko - - WebKit - - Presto - - Trident - types: - json: - - application/json - - text/json - hal: - - application/hal+json - - application/hal+xml - xml: - - text/xml - - application/xml - atom: application/atom+xml - css: text/css - csv: text/csv - js: text/javascript - rss: application/rss+xml - text: text/plain - all: '*/*' + views: + default: + codec: html + mime: + disable: + accept: + header: + userAgents: + - Gecko + - WebKit + - Presto + - Trident + types: + json: + - application/json + - text/json + hal: + - application/hal+json + - application/hal+xml + xml: + - text/xml + - application/xml + atom: application/atom+xml + css: text/css + csv: text/csv + js: text/javascript + rss: application/rss+xml + text: text/plain + all: '*/*' dataSource: - url: jdbc:h2:mem:devDb;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE - driverClassName: org.h2.Driver - username: sa - password: '' - pooled: true - jmxExport: true + dbCreate: create-drop + url: jdbc:h2:mem:devDb;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE + driverClassName: org.h2.Driver + username: sa + password: '' + pooled: true + jmxExport: true hibernate: - hbm2ddl: - auto: update - cache: - queries: false - use_second_level_cache: false - use_query_cache: false \ No newline at end of file + cache: + queries: false + use_second_level_cache: false + use_query_cache: false \ No newline at end of file diff --git a/examples/pubsub-demo/src/integration-test/groovy/pubsub/demo/PubSubSpec.groovy b/examples/pubsub-demo/src/integration-test/groovy/pubsub/demo/PubSubSpec.groovy index 275094ac..0a073bd5 100644 --- a/examples/pubsub-demo/src/integration-test/groovy/pubsub/demo/PubSubSpec.groovy +++ b/examples/pubsub-demo/src/integration-test/groovy/pubsub/demo/PubSubSpec.groovy @@ -3,7 +3,6 @@ package pubsub.demo import grails.gorm.transactions.Rollback import grails.testing.mixin.integration.Integration import jakarta.inject.Inject -import spock.lang.Ignore import spock.lang.Specification import spock.util.concurrent.PollingConditions @@ -68,7 +67,6 @@ class PubSubSpec extends Specification { @Rollback - @Ignore void 'Test synchronous event listener'() { when: 'when a event listener cancels an insert' diff --git a/examples/pubsub-demo/src/integration-test/groovy/pubsub/demo/TaskControllerSpec.groovy b/examples/pubsub-demo/src/integration-test/groovy/pubsub/demo/TaskControllerSpec.groovy index 05ce059b..78a800b7 100644 --- a/examples/pubsub-demo/src/integration-test/groovy/pubsub/demo/TaskControllerSpec.groovy +++ b/examples/pubsub-demo/src/integration-test/groovy/pubsub/demo/TaskControllerSpec.groovy @@ -7,7 +7,7 @@ import io.micronaut.http.HttpStatus import io.micronaut.http.client.HttpClient import io.micronaut.http.client.exceptions.HttpClientResponseException import spock.lang.AutoCleanup -import spock.lang.Ignore +import spock.lang.PendingFeature import spock.lang.Shared import spock.lang.Specification @@ -25,7 +25,11 @@ class TaskControllerSpec extends Specification { client = HttpClient.create("http://localhost:$serverPort".toURL()) } - @Ignore + @PendingFeature(reason = ''' + For some reason the response body is blank with bootTestRun. + However, when starting the application with bootRun, + the response body is as expected. + ''') void 'test async error handling'() { when: 'we invoke an endpoint that throws an exception' diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 136d1cce..d1d09e07 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -37,6 +37,4 @@ spring-test = { module = 'org.springframework:spring-test' } spring-tx = { module = 'org.springframework:spring-tx' } spring-web = { module = 'org.springframework:spring-web' } micronaut-serde-jackson = { module = 'io.micronaut.serde:micronaut-serde-jackson', version.ref = 'micronaut-serde-jackson' } -micronaut-http-client = { module = 'io.micronaut:micronaut-http-client', version.ref = 'micronaut-http-client' } -grails-views-json = { module = 'org.grails.plugins:views-json' } -grails-views-json-templates = { module = 'org.grails.plugins:views-json-templates' } +micronaut-http-client = { module = 'io.micronaut:micronaut-http-client', version.ref = 'micronaut-http-client' } \ No newline at end of file diff --git a/grails-async-core/src/test/groovy/grails/async/PromiseMapSpec.groovy b/grails-async-core/src/test/groovy/grails/async/PromiseMapSpec.groovy index 7af91361..c13a2309 100644 --- a/grails-async-core/src/test/groovy/grails/async/PromiseMapSpec.groovy +++ b/grails-async-core/src/test/groovy/grails/async/PromiseMapSpec.groovy @@ -1,11 +1,11 @@ /* - * Copyright 2013 SpringSource + * Copyright 2013-2024 the original author or authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -15,7 +15,7 @@ */ package grails.async -import spock.lang.Ignore +import spock.lang.PendingFeature import spock.lang.Specification import spock.util.concurrent.PollingConditions @@ -97,7 +97,7 @@ class PromiseMapSpec extends Specification { err.message == 'java.lang.RuntimeException: bad' } - @Ignore(''' + @PendingFeature(reason = ''' This test fails because the chained call to then does not use the map returned from the previous closure. So the same first map is returned over and over. diff --git a/grails-async-rxjava/src/test/groovy/org/grails/async/factory/rxjava/RxJavaPromiseMapSpec.groovy b/grails-async-rxjava/src/test/groovy/org/grails/async/factory/rxjava/RxJavaPromiseMapSpec.groovy index 75f634ef..e6a85409 100644 --- a/grails-async-rxjava/src/test/groovy/org/grails/async/factory/rxjava/RxJavaPromiseMapSpec.groovy +++ b/grails-async-rxjava/src/test/groovy/org/grails/async/factory/rxjava/RxJavaPromiseMapSpec.groovy @@ -1,7 +1,7 @@ package org.grails.async.factory.rxjava import grails.async.PromiseMap -import spock.lang.Ignore +import spock.lang.PendingFeature import spock.lang.Specification import spock.util.concurrent.PollingConditions @@ -86,7 +86,7 @@ class RxJavaPromiseMapSpec extends Specification{ } } - @Ignore(''' + @PendingFeature(reason = ''' This test fails because the chained call to then does not use the map returned from the previous closure. So the same first map is returned over and over. @@ -97,10 +97,8 @@ class RxJavaPromiseMapSpec extends Specification{ def map = new PromiseMap() map['one'] = { 1 } def promise = map.then { - println it it['four'] = 4; it }.then { - println it it['eight'] = 8; it } def result = promise.get()