File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
test/persistence/org/codehaus/groovy/grails/orm/hibernate Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -133,7 +133,13 @@ protected void onSetUp() throws Exception {}
133133 protected final void tearDown () throws Exception {
134134 ConfigurationHolder .setConfig (null );
135135 ApplicationHolder .setApplication (null );
136- GroovySystem .getMetaClassRegistry ().setMetaClassCreationHandle (new MetaClassRegistry .MetaClassCreationHandle ());
136+ MetaClassRegistry metaClassRegistry = GroovySystem .getMetaClassRegistry ();
137+ Class [] loadedClasses = gcl .getLoadedClasses ();
138+ for (int i = 0 ; i < loadedClasses .length ; i ++) {
139+ Class loadedClass = loadedClasses [i ];
140+ metaClassRegistry .removeMetaClass (loadedClass );
141+ }
142+ metaClassRegistry .setMetaClassCreationHandle (new MetaClassRegistry .MetaClassCreationHandle ());
137143 PluginManagerHolder .setPluginManager (null );
138144 if (TransactionSynchronizationManager .hasResource (this .sessionFactory )) {
139145 SessionHolder holder = (SessionHolder ) TransactionSynchronizationManager .getResource (this .sessionFactory );
You can’t perform that action at this time.
0 commit comments