Browse Source

Merge pull request #1340 from lhotari/grails-2.4.4-upgrade

Groovy: Update Grails to 2.4.4
Hamilton Turner 10 years ago
parent
commit
7715f1f18e

+ 1 - 1
config/benchmark_profile

@@ -20,7 +20,7 @@ export TFB_DISTRIB_DESCRIPTION=$DISTRIB_DESCRIPTION
 
 export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-amd64
 export RESIN_HOME=${IROOT}/resin-4.0.41
-export GRAILS_HOME=${IROOT}/grails-2.4.2
+export GRAILS_HOME=${IROOT}/grails-2.4.4
 export VERTX_HOME=${IROOT}/vert.x-2.1.1
 export TOMCAT_HOME=${IROOT}/apache-tomcat-7.0.35
 export NODE_HOME=${IROOT}/node-v0.10.8-linux-x64

+ 1 - 1
frameworks/Groovy/grails/README.md

@@ -4,7 +4,7 @@ This is the Grails portion of a [benchmarking test suite](../) comparing a varie
 
 ## Infrastructure Software Versions
 The tests were run with:
-* [Grails 2.4.2](http://grails.org/)
+* [Grails 2.4.4](http://grails.org/)
 
 ## Test URLs
 

+ 0 - 4
frameworks/Groovy/grails/bash_profile.sh

@@ -1,4 +0,0 @@
-export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-amd64
-export RESIN_HOME=${IROOT}/resin-4.0.41
-
-export GRAILS_PATH=${IROOT}/grails-2.4.2/bin/

+ 1 - 1
frameworks/Groovy/grails/hello/application.properties

@@ -1,6 +1,6 @@
 #Grails Metadata file
 #Tue Feb 25 10:29:09 EET 2014
-app.grails.version=2.4.2
+app.grails.version=2.4.4
 app.name=hello
 app.servlet.version=2.5
 app.version=0.1

+ 4 - 4
frameworks/Groovy/grails/hello/grails-app/conf/BuildConfig.groovy

@@ -45,7 +45,7 @@ grails.project.dependency.resolution = {
         inherits true // Whether to inherit repository definitions from plugins
         grailsPlugins()
         grailsHome()
-		mavenLocal()
+        mavenLocal()
         grailsCentral()
         mavenCentral()
 
@@ -60,11 +60,11 @@ grails.project.dependency.resolution = {
     dependencies {
         // specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes eg.
 
-        runtime 'mysql:mysql-connector-java:5.1.29'
+        runtime 'mysql:mysql-connector-java:5.1.34'
     }
 
     plugins {
-        runtime ":hibernate:3.6.10.16"
+        runtime ":hibernate:3.6.10.18"
         //runtime ":jquery:1.10.2"
         //runtime ":resources:1.2.1"
 
@@ -73,6 +73,6 @@ grails.project.dependency.resolution = {
         //runtime ":cached-resources:1.0"
         //runtime ":yui-minify-resources:0.1.4"
 
-        build ":tomcat:7.0.54"
+        build ":tomcat:7.0.55.2"
     }
 }

+ 3 - 0
frameworks/Groovy/grails/hello/grails-app/conf/mysql-connection.properties

@@ -58,3 +58,6 @@ maintainTimeStats=false
 # timeouts for TCP/IP
 connectTimeout=15000
 socketTimeout=120000
+
+# enable batch mode
+rewriteBatchedStatements=true

+ 3 - 6
frameworks/Groovy/grails/hello/grails-app/controllers/hello/HelloController.groovy

@@ -1,16 +1,13 @@
 package hello
 
+import grails.compiler.GrailsCompileStatic
 import grails.converters.JSON
-import grails.transaction.Transactional
-import groovy.transform.CompileStatic
-import groovy.transform.TypeCheckingMode;
 
 import java.util.concurrent.ThreadLocalRandom
 
-import org.springframework.transaction.annotation.Propagation;
-import org.hibernate.Session;
+import org.hibernate.Session
 
-@CompileStatic
+@GrailsCompileStatic
 class HelloController {
 
     def index() {

+ 3 - 0
frameworks/Groovy/grails/hello/grails-app/domain/hello/Fortune.groovy

@@ -1,5 +1,8 @@
 package hello
 
+import grails.compiler.GrailsCompileStatic
+
+@GrailsCompileStatic
 class Fortune {
     Integer id
     String message

+ 3 - 0
frameworks/Groovy/grails/hello/grails-app/domain/hello/World.groovy

@@ -1,5 +1,8 @@
 package hello
 
+import grails.compiler.GrailsCompileStatic
+
+@GrailsCompileStatic
 class World {
     Integer id
     Integer randomNumber

+ 0 - 85
frameworks/Groovy/grails/hello/src/groovy/org/codehaus/groovy/grails/plugins/codecs/JSONEncoder.java

@@ -1,85 +0,0 @@
-/*
- * Copyright 2013 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
- *
- * 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.codehaus.groovy.grails.plugins.codecs;
-
-import org.apache.commons.lang.StringUtils;
-import org.codehaus.groovy.grails.support.encoding.CodecIdentifier;
-import org.codehaus.groovy.grails.support.encoding.DefaultCodecIdentifier;
-
-/**
- * Escapes characters in JSON output
- *
- * @author Lari Hotari
- * @since 2.3.4
- */
-public class JSONEncoder extends AbstractCharReplacementEncoder {
-    public static final CodecIdentifier JSON_CODEC_IDENTIFIER = new DefaultCodecIdentifier(
-            "JSON", "Json") {
-        public boolean isEquivalent(CodecIdentifier other) {
-            return super.isEquivalent(other) || JavaScriptEncoder.JAVASCRIPT_CODEC_IDENTIFIER.getCodecName().equals(other.getCodecName());
-        };
-    };
-
-    public JSONEncoder() {
-        super(JSON_CODEC_IDENTIFIER);
-    }
-
-    /* (non-Javadoc)
-     * @see org.codehaus.groovy.grails.plugins.codecs.AbstractCharReplacementEncoder#escapeCharacter(char, char)
-     */
-    @Override
-    protected String escapeCharacter(char ch, char previousChar) {
-        switch (ch) {
-            case '"':
-                return "\\\"";
-            case '\\':
-                return "\\\\";
-            case '\t':
-                return "\\t";
-            case '\n':
-                return "\\n";
-            case '\r':
-                return "\\r";
-            case '\f':
-                return "\\f";
-            case '\b':
-                return "\\b";
-            case '\u000B': // vertical tab: http://bclary.com/2004/11/07/#a-7.8.4
-                return "\\v";
-            case '\u2028':
-                return "\\u2028"; // Line separator
-            case '\u2029':
-                return "\\u2029"; // Paragraph separator
-            case '/':
-                // preserve special handling that exists in JSONObject.quote to improve security if JSON is embedded in HTML document
-                // prevents outputting "</" gets outputted with unicode escaping for the slash
-                if (previousChar == '<') {
-                    return "\\u002f"; 
-                }
-                break;
-        }
-        if(ch < ' ') {
-            // escape all other control characters
-            return "\\u" + StringUtils.leftPad(Integer.toHexString(ch), 4, '0');
-        }
-        return null;
-    }
-
-    @Override
-    public boolean isApplyToSafelyEncoded() {
-        return true;
-    }
-}

+ 5 - 1
frameworks/Groovy/grails/install.sh

@@ -1,3 +1,7 @@
 #!/bin/bash
+export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-amd64
+export RESIN_HOME=${IROOT}/resin-4.0.41
 
-fw_depends grails resin 
+export GRAILS_PATH=${IROOT}/grails-2.4.4/bin/
+
+fw_depends grails resin

+ 6 - 1
frameworks/Groovy/grails/setup.sh

@@ -1,4 +1,8 @@
 #!/bin/bash
+export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-amd64
+export RESIN_HOME=${IROOT}/resin-4.0.41
+
+export GRAILS_PATH=${IROOT}/grails-2.4.4/bin/
 
 sed -i 's|jdbc:mysql://.*:3306|jdbc:mysql://'"${DBHOST}"':3306|g' hello/grails-app/conf/DataSource.groovy
 
@@ -6,8 +10,9 @@ export PATH=${GRAILS_PATH}:$PATH
 export GRAILS_AGENT_CACHE_DIR=${IROOT}/.grails/.slcache
 
 cd hello
+grails -Dgrails.work.dir=${IROOT}/.grails -non-interactive -plain-output refresh-dependencies
 grails -Dgrails.work.dir=${IROOT}/.grails -non-interactive -plain-output compile
 grails -Dgrails.work.dir=${IROOT}/.grails prod -non-interactive -plain-output war
 rm -rf $RESIN_HOME/webapps/*
 cp target/hello-0.1.war $RESIN_HOME/webapps/grails.war
-$RESIN_HOME/bin/resinctl start
+$RESIN_HOME/bin/resinctl start

+ 4 - 4
toolset/setup/linux/frameworks/grails.sh

@@ -1,9 +1,9 @@
 #!/bin/bash
 
-RETCODE=$(fw_exists ${IROOT}/grails-2.4.2.installed)
+RETCODE=$(fw_exists ${IROOT}/grails-2.4.4.installed)
 [ ! "$RETCODE" == 0 ] || { return 0; }
 
-fw_get http://dist.springframework.org.s3.amazonaws.com/release/GRAILS/grails-2.4.2.zip -O grails-2.4.2.zip
-fw_unzip grails-2.4.2.zip
+fw_get http://dist.springframework.org.s3.amazonaws.com/release/GRAILS/grails-2.4.4.zip -O grails-2.4.4.zip
+fw_unzip grails-2.4.4.zip
 
-touch ${IROOT}/grails-2.4.2.installed
+touch ${IROOT}/grails-2.4.4.installed