Permalink
Browse files

0.4.302

  • Loading branch information...
1 parent 4197ef2 commit a218b25b6149cca6934e40150756cfa4bce6c1f0 @alextkachman alextkachman committed Oct 13, 2011
@@ -0,0 +1,30 @@
+
+/*
+ * Copyright 2009-2010 MBTE Sweden AB.
+ *
+ * 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.
+ */
+
+import org.mbte.gretty.httpserver.*
+
+GrettyServer server = []
+server.groovy = [
+ localAddress: new InetSocketAddress("0.0.0.0", 8080),
+ defaultHandler: {
+ response.redirect "/"
+ },
+ "/": {
+ get { response.text = 'Hello World\n' }
+ }
+]
+server.start()
View
@@ -16,8 +16,8 @@
apply plugin: 'idea'
-def _version = '0.4.301'
-def _gppVersion = '0.4.301_1.8.0'
+def _version = '0.4.302'
+def _gppVersion = '0.9.0_1.8.2'
Set groovyProjects = ['gretty', 'gretty-hazelcast']
@@ -111,17 +111,32 @@ if (project.hasProperty('ARTIFACTORY_USER') && project.hasProperty('ARTIFACTORY_
task deployGoogle(dependsOn:[':gretty:sourcesJar', ':gretty:jar', ':gretty-hazelcast:jar', ':gretty-hazelcast:sourcesJar']) << {
ant.taskdef(name:"gcupload", classname:"net.bluecow.googlecode.ant.GoogleCodeUploadTask", classpath:"lib/ant-googlecode-0.0.2.jar")
- ant.gcupload(username:GOOGLE_USER, password:GOOGLE_PASSWORD, projectname:"groovypptest", filename:file("gretty-api/build/libs/gretty-api-${_version}.jar").absolutePath, targetfilename:"gretty-hazelcast-${_version}.jar", summary:"Gretty API module $_version (Use with Groovy++ $_gppVersion)", labels:"Featured", verbose:"true")
-
- ant.gcupload(username:GOOGLE_USER, password:GOOGLE_PASSWORD, projectname:"groovypptest", filename:file("gretty-api/build/libs/gretty-api-${_version}-sources.jar").absolutePath, targetfilename:"gretty-hazelcast-${_version}-sources.jar", summary:"Gretty API module $_version sources", labels:"Featured", verbose:"true")
-
- ant.gcupload(username:GOOGLE_USER, password:GOOGLE_PASSWORD, projectname:"groovypptest", filename:file("gretty/build/libs/gretty-${_version}.jar").absolutePath, targetfilename:"gretty-${_version}.jar", summary:"Gretty $_version (Use with Groovy++ $_gppVersion)", labels:"Featured", verbose:"true")
-
- ant.gcupload(username:GOOGLE_USER, password:GOOGLE_PASSWORD, projectname:"groovypptest", filename:file("gretty/build/libs/gretty-${_version}-sources.jar").absolutePath, targetfilename:"gretty-${_version}-sources.jar", summary:"Gretty $_version sources", labels:"Featured", verbose:"true")
-
- ant.gcupload(username:GOOGLE_USER, password:GOOGLE_PASSWORD, projectname:"groovypptest", filename:file("gretty-hazelcast/build/libs/gretty-hazelcast-${_version}.jar").absolutePath, targetfilename:"gretty-hazelcast-${_version}.jar", summary:"Gretty Hazelcast module $_version (Use with Groovy++ $_gppVersion)", labels:"Featured", verbose:"true")
-
- ant.gcupload(username:GOOGLE_USER, password:GOOGLE_PASSWORD, projectname:"groovypptest", filename:file("gretty-hazelcast/build/libs/gretty-hazelcast-${_version}-sources.jar").absolutePath, targetfilename:"gretty-hazelcast-${_version}-sources.jar", summary:"Gretty Haselcast module $_version sources", labels:"Featured", verbose:"true")
+ def upload = { fileName, targetFile, summary ->
+ ant.gcupload(username:GOOGLE_USER,
+ password:GOOGLE_PASSWORD,
+ projectname:"groovypptest",
+ filename:file(fileName).absolutePath,
+ targetfilename: targetFile,
+ summary:summary,
+ labels:"Featured",
+ verbose:"true")
+ }
+
+ upload( "gretty/build/libs/gretty-${_version}.jar",
+ "gretty-${_version}.jar",
+ "Gretty module $_version (Use with Groovy++ $_gppVersion)")
+
+ upload( "gretty/build/libs/gretty-${_version}-sources.jar",
+ "gretty-${_version}-sources.jar",
+ "Gretty module $_version sources")
+
+ upload( "gretty-hazelcast/build/libs/gretty-hazelcast-${_version}.jar",
+ "gretty-hazelcast-${_version}.jar",
+ "Gretty Hazelcast module $_version (Use with Groovy++ $_gppVersion)")
+
+ upload( "gretty-hazelcast/build/libs/gretty-hazelcast-${_version}-sources.jar",
+ "gretty-hazelcast-${_version}-sources.jar",
+ "Gretty Hazelcast module $_version sources")
}
}
View
@@ -14,10 +14,6 @@
* limitations under the License.
*/
-
-
-
-
dependencies {
groovy group: 'org.codehaus.groovy', name: 'groovy', version: "1.8.0"
compile group: 'org.mbte.groovypp', name: 'groovypp', version: "$gppVersion"
@@ -204,7 +204,7 @@ import org.jboss.netty.handler.codec.http.HttpChunkAggregator
def property = mc.getMetaProperty(e.key)
if(!property && e.value instanceof Closure) {
setUnresolvedProperty(e.key, GrettyRestDescription.fromClosure((Closure)e.value))
- return
+ continue
}
if(e.value instanceof GeneratedClosure) {
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2009-2010 MBTE Sweden AB.
+ *
+ * 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.mbte.gretty.httpserver
+
+import org.mbte.gretty.httpclient.HttpRequestHelper
+import org.jboss.netty.channel.local.LocalAddress
+
+@Typed class AGloverTest extends GroovyTestCase implements HttpRequestHelper {
+ GrettyServer server = []
+
+ @Dynamic protected void setUp () {
+ server.groovy = [
+ localAddress: new LocalAddress("test_server"),
+
+ "/app/:name": {
+ get {
+ response.text = "Hello, ${request.parameters['name']}"
+ }
+ } ,
+ "/image/:id":{
+ get {
+ response.text = "Image: $request.parameters.id"
+ }
+ }
+ ]
+ server.start()
+ }
+
+ protected void tearDown () {
+ server.stop()
+ }
+
+ void testOne () {
+ doTest("/app/lambada") { response ->
+ assertEquals( "Hello, lambada", response.contentText)
+ }
+ }
+
+ void testTwo () {
+ doTest("/image/200") { response ->
+ assertEquals( "Image: 200", response.contentText)
+ }
+ }
+}

0 comments on commit a218b25

Please sign in to comment.