jdaugherty commented on code in PR #15565:
URL: https://github.com/apache/grails-core/pull/15565#discussion_r3053517857


##########
grails-core/src/main/groovy/org/grails/plugins/AbstractGrailsPluginManager.java:
##########
@@ -388,30 +386,6 @@ public boolean isShutdown() {
         return shutdown;
     }
 
-    /**
-     * @deprecated Plugin filtering is now handled by {@link PluginDiscovery}.
-     * Use {@link PluginDiscovery#setPluginFilter(PluginFilter)} instead.
-     * This method will be removed in Grails 8.0.0.
-     */
-    @Deprecated(forRemoval = true, since = "7.1")
-    @Override
-    public void setPluginFilter(PluginFilter pluginFilter) {
-        pluginDiscovery.setPluginFilter(new 
CompatibilityPluginFilter(pluginFilter, plugins.values()));
-        reinitializeDiscovery();

Review Comment:
   Can't reinitialize be removed too?



##########
grails-data-mongodb/core/src/test/groovy/org/apache/grails/data/mongo/core/GrailsDataMongoTckManagerSpec.groovy:
##########
@@ -0,0 +1,100 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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
+ *
+ *   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, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.grails.data.mongo.core
+
+import org.apache.grails.data.testing.tck.domains.DataServiceRoutingProduct
+import 
org.apache.grails.data.testing.tck.domains.DataServiceRoutingProductService
+import 
org.apache.grails.data.testing.tck.tests.DataServiceConnectionRoutingSpec
+import spock.lang.Specification
+
+class GrailsDataMongoTckManagerSpec extends Specification {
+
+    void 'cleanup closes the primary datastore so repeated setup stays 
healthy'() {
+        given:
+        def manager = new GrailsDataMongoTckManager()
+        manager.setupSpec()
+
+        when:
+        manager.setup(DataServiceConnectionRoutingSpec)
+        manager.setupMultiDataSource(DataServiceRoutingProduct)
+
+        and:
+        def productService = manager.getServiceForConnection(
+                DataServiceRoutingProductService,
+                'secondary'
+        ) as DataServiceRoutingProductService
+        def saved = productService.save(
+                new DataServiceRoutingProduct(name: 'product-0', amount: 1)
+        )
+
+        then:
+        saved != null
+        saved.id != null
+        manager.mongoDatastore != null
+
+        when:
+        manager.cleanupMultiDataSource()
+        manager.cleanup()
+
+        then:
+        manager.mongoDatastore == null
+        manager.mongoClient == null
+        manager.grailsApplication == null
+        manager.mappingContext == null
+
+        when:
+        manager.setup(DataServiceConnectionRoutingSpec)
+        manager.setupMultiDataSource(DataServiceRoutingProduct)
+
+        and:
+        productService = manager.getServiceForConnection(
+                DataServiceRoutingProductService,
+                'secondary'
+        ) as DataServiceRoutingProductService
+        saved = productService.save(
+                new DataServiceRoutingProduct(name: 'product-1', amount: 1)
+        )
+
+        then:
+        saved != null
+        saved.id != null
+        manager.mongoDatastore != null
+
+        when:
+        manager.cleanupMultiDataSource()
+        manager.cleanup()
+
+        then:
+        manager.mongoDatastore == null
+        manager.mongoClient == null
+        manager.grailsApplication == null
+        manager.mappingContext == null
+
+        then:
+        noExceptionThrown()
+
+        cleanup:
+        manager.cleanupMultiDataSource()
+        manager.cleanup()
+        manager.cleanupSpec()

Review Comment:
   Is this really a deprecation removal? seems like this should be separate 
from this pr



##########
grails-domain-class/src/main/groovy/org/grails/plugins/domain/GrailsDomainClassAutoConfiguration.groovy:
##########
@@ -69,13 +68,6 @@ class GrailsDomainClassAutoConfiguration {
         new DefaultConstraintEvaluatorFactoryBean(messageSources, 
mappingContext, grailsApplication)
     }
 
-    @Lazy
-    @Bean(name = ConstraintsEvaluator.BEAN_NAME)
-    @Deprecated(since = '7.1', forRemoval = true)
-    ConstraintEvaluatorAdapter 
constraintsEvaluator(DefaultConstraintEvaluatorFactoryBean 
validateableConstraintsEvaluator) {
-        new ConstraintEvaluatorAdapter(validateableConstraintsEvaluator.object)

Review Comment:
   I assume the other bean is still wired?



##########
grails-data-mongodb/core/src/test/groovy/org/apache/grails/data/mongo/core/GrailsDataMongoTckManager.groovy:
##########
@@ -136,17 +138,31 @@ class GrailsDataMongoTckManager extends 
GrailsDataTckManager {
 
     @Override
     void destroy() {
-        mongoDatastore.getMongoClient().listDatabaseNames().findAll {!(it in 
['admin', 'config', 'local']) }.each {
+        try {
+            mongoDatastore?.mongoClient?.listDatabaseNames()
+                    ?.findAll { !(it in ['admin', 'config', 'local']) }
+                    ?.each {
+                        try {
+                            mongoDatastore.mongoClient.getDatabase(it as 
String).drop()
+                        }
+                        catch (ignored) {
+                            log.warn("Could not drop ${it}")
+                        }
+                    }
+            for (cls in domainClasses) {
+                GormEnhancer.findValidationApi(cls).validator = null
+            }
+        }
+        finally {
             try {
-                mongoDatastore.getMongoClient().getDatabase(it).drop()
+                mongoDatastore?.close()

Review Comment:
   isn't close different than drop?



##########
grails-events/compat/README.md:
##########
@@ -1,19 +0,0 @@
-<!--
-SPDX-License-Identifier: Apache-2.0
-
-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
-
-    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,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
--->
-
-## grails-events-compat
-
-This subproject established a compatibility layer for plugins built with older 
versions of Grails that worked with Reactor 2

Review Comment:
   We should remove the old async libraries since they are so out if date



##########
grails-test-suite-web/src/test/groovy/org/grails/web/converters/JSONConverterTests.groovy:
##########
@@ -95,21 +95,14 @@ class JSONConverterTests extends Specification implements 
ControllerUnitTest<JSO
         def enumInstance = Role.HEAD
         params.e = enumInstance
         controller.testEnum()
-        def json = response.json
 
         then:
-        json.enumType == "org.grails.web.converters.Role"
-        json.name == "HEAD"
-        json.size() == 2
+        def e = thrown(ConverterException)

Review Comment:
   Isn't this because we didn't register our marshaller?



##########
grails-doc/src/en/guide/theWebLayer/gson/converters.adoc:
##########
@@ -17,7 +17,7 @@ specific language governing permissions and limitations
 under the License.
 ////
 
-It is possible to register custom converters to change how a given class is 
rendered with json views. To do so, create a class that implements 
link:{api}grails/plugin/json/builder/JsonGenerator.Converter.html[Converter]. 
Then you must register the class in 
`src/main/resources/META-INF/services/grails.plugin.json.builder.JsonGenerator$Converter`.
+It is possible to register custom converters to change how a given class is 
rendered with json views. To do so, create a class that implements 
link:{api}groovy.json.JsonGenerator.Converter.html[Converter]. Then you must 
register the class in 
`src/main/resources/META-INF/services/groovy.json.JsonGenerator$Converter`.

Review Comment:
   I think this needs to be in the upgrade notes



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to