Permalink
Browse files

many small updates, add license header in source files, and copy some…

… classes in the test webapp to have some initial test
  • Loading branch information...
1 parent 1e12872 commit b176b7deccf36fee5c65df457dae4f61487abf9c @smartiniOnGitHub committed Sep 17, 2012
Showing with 1,626 additions and 98 deletions.
  1. +70 −0 AkkaGrailsPlugin.groovy
  2. +0 −63 GrailsAkkaGrailsPlugin.groovy
  3. +1 −1 application.properties
  4. +20 −17 docs/TODO.md
  5. +23 −8 grails-app/conf/BuildConfig.groovy
  6. +18 −1 grails-app/conf/Config.groovy
  7. +22 −1 grails-app/conf/DataSource.groovy
  8. +20 −1 grails-app/conf/UrlMappings.groovy
  9. +4 −0 grails-app/conf/hibernate/.gitignore
  10. +4 −0 grails-app/conf/spring/.gitignore
  11. +4 −0 src/docs/css/.gitignore
  12. +16 −0 test/integration/grails_akka/LocalAkkaIntegrationTests.groovy
  13. +16 −0 test/integration/grails_akka/RemoteAkkaIntegrationTests.groovy
  14. +16 −0 test/integration/grails_akka/actor/BaseActor.groovy
  15. +16 −0 test/integration/grails_akka/actor/GreetingActor.groovy
  16. +16 −0 test/integration/grails_akka/command/ActorCommand.groovy
  17. +16 −0 test/integration/grails_akka/command/Command.groovy
  18. +16 −0 test/integration/grails_akka/command/GenericCommand.groovy
  19. +16 −0 test/integration/grails_akka/command/GenericCommandArguments.groovy
  20. +16 −0 test/integration/grails_akka/message/BaseMessage.groovy
  21. +16 −0 test/integration/grails_akka/message/GenericMessage.groovy
  22. +16 −0 test/integration/grails_akka/message/Greeting.groovy
  23. +16 −0 test/integration/grails_akka/message/ImmutableMessage.groovy
  24. +16 −0 test/integration/grails_akka/message/Shutdown.groovy
  25. +16 −0 test/integration/grails_akka/message/Stop.groovy
  26. +16 −0 test/integration/grails_akka/message/Wait.groovy
  27. +16 −0 test/unit/grails_akka/LocalAkkaUnitTests.groovy
  28. +16 −0 test/unit/grails_akka/actor/BaseActor.groovy
  29. +16 −0 test/unit/grails_akka/actor/GreetingActor.groovy
  30. +16 −0 test/unit/grails_akka/command/ActorCommand.groovy
  31. +16 −0 test/unit/grails_akka/command/Command.groovy
  32. +16 −0 test/unit/grails_akka/command/GenericCommand.groovy
  33. +16 −0 test/unit/grails_akka/command/GenericCommandArguments.groovy
  34. +16 −0 test/unit/grails_akka/message/BaseMessage.groovy
  35. +16 −0 test/unit/grails_akka/message/GenericMessage.groovy
  36. +16 −0 test/unit/grails_akka/message/Greeting.groovy
  37. +16 −0 test/unit/grails_akka/message/ImmutableMessage.groovy
  38. +16 −0 test/unit/grails_akka/message/Shutdown.groovy
  39. +16 −0 test/unit/grails_akka/message/Stop.groovy
  40. +16 −0 test/unit/grails_akka/message/Wait.groovy
  41. +1 −1 test/webapp/grails-akka-test/README.md
  42. +21 −2 test/webapp/grails-akka-test/grails-app/conf/ApplicationResources.groovy
  43. +17 −0 test/webapp/grails-akka-test/grails-app/conf/BootStrap.groovy
  44. +20 −2 test/webapp/grails-akka-test/grails-app/conf/BuildConfig.groovy
  45. +17 −0 test/webapp/grails-akka-test/grails-app/conf/Config.groovy
  46. +17 −0 test/webapp/grails-akka-test/grails-app/conf/DataSource.groovy
  47. +20 −1 test/webapp/grails-akka-test/grails-app/conf/UrlMappings.groovy
  48. +4 −0 test/webapp/grails-akka-test/grails-app/conf/hibernate/.gitignore
  49. +4 −0 test/webapp/grails-akka-test/grails-app/conf/spring/.gitignore
  50. +4 −0 test/webapp/grails-akka-test/grails-app/controllers/.gitignore
  51. +4 −0 test/webapp/grails-akka-test/grails-app/domain/.gitignore
  52. +4 −0 test/webapp/grails-akka-test/grails-app/i18n/.gitignore
  53. +4 −0 test/webapp/grails-akka-test/grails-app/services/.gitignore
  54. +4 −0 test/webapp/grails-akka-test/grails-app/taglib/.gitignore
  55. +4 −0 test/webapp/grails-akka-test/grails-app/utils/.gitignore
  56. +4 −0 test/webapp/grails-akka-test/grails-app/views/.gitignore
  57. +4 −0 test/webapp/grails-akka-test/lib/.gitignore
  58. +4 −0 test/webapp/grails-akka-test/scripts/.gitignore
  59. +16 −0 test/webapp/grails-akka-test/src/groovy/grails_akka/actor/BaseActor.groovy
  60. +16 −0 test/webapp/grails-akka-test/src/groovy/grails_akka/actor/GreetingActor.groovy
  61. +16 −0 test/webapp/grails-akka-test/src/groovy/grails_akka/command/ActorCommand.groovy
  62. +16 −0 test/webapp/grails-akka-test/src/groovy/grails_akka/command/Command.groovy
  63. +16 −0 test/webapp/grails-akka-test/src/groovy/grails_akka/command/GenericCommand.groovy
  64. +16 −0 test/webapp/grails-akka-test/src/groovy/grails_akka/command/GenericCommandArguments.groovy
  65. +16 −0 test/webapp/grails-akka-test/src/groovy/grails_akka/message/BaseMessage.groovy
  66. +16 −0 test/webapp/grails-akka-test/src/groovy/grails_akka/message/GenericMessage.groovy
  67. +16 −0 test/webapp/grails-akka-test/src/groovy/grails_akka/message/Greeting.groovy
  68. +16 −0 test/webapp/grails-akka-test/src/groovy/grails_akka/message/ImmutableMessage.groovy
  69. +16 −0 test/webapp/grails-akka-test/src/groovy/grails_akka/message/Shutdown.groovy
  70. +16 −0 test/webapp/grails-akka-test/src/groovy/grails_akka/message/Stop.groovy
  71. +16 −0 test/webapp/grails-akka-test/src/groovy/grails_akka/message/Wait.groovy
  72. +4 −0 test/webapp/grails-akka-test/test/integration/.gitignore
  73. +240 −0 test/webapp/grails-akka-test/test/integration/grails_akka/LocalAkkaIntegrationTests.groovy
  74. +124 −0 test/webapp/grails-akka-test/test/integration/grails_akka/RemoteAkkaIntegrationTests.groovy
  75. +4 −0 test/webapp/grails-akka-test/test/unit/.gitignore
  76. +239 −0 test/webapp/grails-akka-test/test/unit/grails_akka/LocalAkkaUnitTests.groovy
View
@@ -0,0 +1,70 @@
+/*
+ * 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
+ *
+ * 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.apache.log4j.Logger
+
+class AkkaGrailsPlugin {
+ def version = "0.5"
+ def grailsVersion = "2.0 > *"
+ def dependsOn = [:]
+ def pluginExcludes = [
+ "grails-app/views/error.gsp"
+ // , "src/docs/"
+ ]
+
+ def title = "Akka Integration"
+ def author = "Sandro Martini"
+ def authorEmail = "sandro.martini@gmail.com"
+ def description = '''\
+Let Grails webapps to call/use Akka actors from Groovy and Java.
+Note that it requires a Servlet 3.x environment to run.
+'''
+ def documentation = "http://grails.org/plugin/akka"
+
+ // Extra (optional) plugin metadata
+ def license = "APACHE"
+ // def organization = [ name: "MartinS", url: "https://github.com/smartiniOnGitHub/grails-akka/" ]
+ // def developers = [ [ name: "other developer", email: "other.developer@my-company.com" ]]
+ def issueManagement = [ system: "github", url: "https://github.com/smartiniOnGitHub/grails-akka/issues/" ]
+ def scm = [ url: "https://github.com/smartiniOnGitHub/grails-akka/" ]
+
+
+ // private Logger log = Logger.getLogger('grails.plugin.akka.AkkaGrailsPlugin')
+
+
+ def doWithWebDescriptor = { xml ->
+ }
+
+ def doWithSpring = {
+ }
+
+ def doWithDynamicMethods = { ctx ->
+ }
+
+ def doWithApplicationContext = { applicationContext ->
+ }
+
+ def onChange = { event ->
+ }
+
+ def onConfigChange = { event ->
+ }
+
+ def onShutdown = { event ->
+ }
+
+}
@@ -1,63 +0,0 @@
-class GrailsAkkaGrailsPlugin {
- // the plugin version
- def version = "0.5"
- // the version or versions of Grails the plugin is designed for
- def grailsVersion = "2.0 > *"
- // the other plugins this plugin depends on
- def dependsOn = [:]
- // resources that are excluded from plugin packaging
- def pluginExcludes = [
- "grails-app/views/error.gsp"
- , "src/docs/"
- ]
-
- def title = "Grails Akka Plugin" // Headline display name of the plugin
- def author = "Sandro Martini"
- def authorEmail = "sandro.martini@gmail.com"
- def description = '''\
-Let Grails webapps to call/use Akka actors from Groovy and Java.
-Note that it requires a Servlet 3.x environment to run.
-'''
-
- // URL to the plugin's documentation
- def documentation = "http://grails.org/plugin/grails-akka"
-
- // Extra (optional) plugin metadata
-
- // License: one of 'APACHE', 'GPL2', 'GPL3'
- def license = "APACHE"
-
- // Details of company behind the plugin (if there is one)
-// def organization = [ name: "MartinS", url: "https://github.com/smartiniOnGitHub/grails-akka/" ]
-
- // Any additional developers beyond the author specified above.
-// def developers = [ [ name: "other developer", email: "other.developer@my-company.com" ]]
-
- // Location of the plugin's issue tracker.
- def issueManagement = [ system: "github", url: "https://github.com/smartiniOnGitHub/grails-akka/issues/" ]
-
- // Online location of the plugin's browseable source code.
- def scm = [ url: "https://github.com/smartiniOnGitHub/grails-akka/" ]
-
- def doWithWebDescriptor = { xml ->
- }
-
- def doWithSpring = {
- }
-
- def doWithDynamicMethods = { ctx ->
- }
-
- def doWithApplicationContext = { applicationContext ->
- }
-
- def onChange = { event ->
- }
-
- def onConfigChange = { event ->
- }
-
- def onShutdown = { event ->
- }
-
-}
View
@@ -1,4 +1,4 @@
#Grails Metadata file
#Thu Sep 06 11:44:25 CEST 2012
app.grails.version=2.0.4
-app.name=grails-akka
+app.name=akka
View
@@ -4,16 +4,6 @@ grails-akka - TODO
TODO
----
-- exclude the transitivity of scala, to avoid dependency errors in the grails dependency-report ...
- + put exclusions for this in the BuildConfig of the plugin, until I get 0 evicted (in build, compile, and runtime)... ok
- * I commented all the exclusions for now otherwise a compile error will happen ...
- just for reference, but could be the wrong way to do this, so let's see later if/how to fix this
-
-- try with some local actor:
- + then verify them from the test webapp ...
-
-- in the test webapp, do a grails war and inspect the generated war file ...
-
- fix docs and write the 2 Changelog (or similar) ... with 0.5, and 1.0, then remove this line
- package the plugin and verify if all is good ...
@@ -31,6 +21,10 @@ TODO
+ make an akkaService, and test it
* do it in the test webapp, because probably in the plugin it would be hard to have it so much generalized ...
+ fix TODO in code ...
+ + exclude the transitivity of scala, to avoid dependency errors in the grails dependency-report ...
+ * put exclusions for this in the BuildConfig of the plugin, until I get 0 evicted (in build, compile, and runtime)... ok
+ * I commented all the exclusions for now otherwise a compile error will happen ...
+ just for reference, but could be the wrong way to do this, so let's see later if/how to fix this
- for release 1.0 or later:
@@ -47,6 +41,7 @@ TODO
+ enabling scala ...
* re-enable the creation of scala source folders when installing the plugin in a test webapp ...
* enable scala compilation and verify if some scala content there is compiled ...
+ * or maybe use the grails-scala plugin, but ONLY if updated to Scala version used by Akka here (now is Scala-2.9.2) ...
+ create a sample Java/Groovy project where to put common classes for messages, and use it from the test webapp ...
* maybe build it with gradle ...
@@ -59,12 +54,6 @@ TODO
DONE
----
-- add references to akka license and scala license in NOTICE ... ok
-
-- add (as usual) the ant build_trim-whitespace.xml, to normalize sources ...
- + use it with: ant -f build_trim-whitespace.xml
- (the trim-whitespace target is the default)
-
- run grails tests with output to console enabled, like this:
cls && grails test-app unit: -echoOut
cls && grails test-app integration: -echoOut
@@ -83,7 +72,21 @@ cls && grails test-app integration: -echoOut
- move test classes in subpackages by type (actor, command, message) ... ok
- copy classes used by tests (actor, command, message) even under the test webapp, to test (later) real calls to them from there ... ok
-- comment the creation of scala source folders and other scala-related stuff ...
+- comment the creation of scala source folders and other scala-related stuff ... ok
+
+- add (as usual) the ant build_trim-whitespace.xml, to normalize sources ...
+ + use it with: ant -f build_trim-whitespace.xml
+ (the trim-whitespace target is the default)
+
+- add references to akka license (and maybe even to scala license) in NOTICE ... ok
+- add Apache license header in any file, important ... ok
+
+- try with some local actor:
+ + then verify them from the test webapp ... ok
+
+- in the test webapp, do a grails war and inspect the generated war file ...
+
+
---------------
@@ -1,3 +1,20 @@
+/*
+ * 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
+ *
+ * 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.
+ */
+
// grails.servlet.version = "3.0" // verify if makes sense to enable this even here ...
grails.project.class.dir = "target/classes"
// grails.project.docs.output.dir = 'docs/manual'
@@ -28,20 +45,18 @@ grails.project.dependency.resolution = {
dependencies {
// specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes eg.
- compile("com.typesafe.akka:akka-actor:$akkaVersion", "com.typesafe.akka:akka-remote:$akkaVersion") {
- // disable excludes, or compile errors will happen ...
- // // exclude, to avoid version conflict
- // excludes 'scala-library'
- // excludes 'commons-codec'
- // excludes 'commons-io'
- }
- test("com.typesafe.akka:akka-testkit:$akkaVersion") {
+
+ def excludes = {
// disable excludes, or compile errors will happen ...
// // exclude, to avoid version conflict
// excludes 'scala-library'
// excludes 'commons-codec'
// excludes 'commons-io'
+ // transitive = false
}
+
+ compile("com.typesafe.akka:akka-actor:$akkaVersion", "com.typesafe.akka:akka-remote:$akkaVersion", excludes)
+ test("com.typesafe.akka:akka-testkit:$akkaVersion", excludes)
}
plugins {
@@ -1,3 +1,20 @@
+/*
+ * 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
+ *
+ * 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.
+ */
+
// configuration for plugin testing - will not be included in the plugin zip
log4j = {
@@ -26,4 +43,4 @@ log4j = {
grails.doc.authors = 'Sandro Martini'
grails.doc.license = 'Apache License 2.0'
-grails.doc.title = 'Akka Plugin'
+grails.doc.title = 'Akka Integration'
@@ -1,16 +1,36 @@
+/*
+ * 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
+ *
+ * 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.
+ */
+
dataSource {
pooled = true
driverClassName = "org.h2.Driver"
username = "sa"
password = ""
}
+
hibernate {
cache.use_second_level_cache = true
cache.use_query_cache = false
cache.region.factory_class = 'net.sf.ehcache.hibernate.EhCacheRegionFactory'
}
+
// environment specific settings
-environments {
+environments
+{
development {
dataSource {
dbCreate = "create-drop" // one of 'create', 'create-drop', 'update', 'validate', ''
@@ -40,4 +60,5 @@ environments {
}
}
}
+
}
@@ -1,4 +1,22 @@
-class UrlMappings {
+/*
+ * 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
+ *
+ * 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.
+ */
+
+class UrlMappings
+{
static mappings = {
"/$controller/$action?/$id?"{
@@ -10,4 +28,5 @@ class UrlMappings {
"/"(view:"/index")
"500"(view:'/error')
}
+
}
@@ -0,0 +1,4 @@
+.DS_Store
+.hg
+.settings
+.svn
@@ -0,0 +1,4 @@
+.DS_Store
+.hg
+.settings
+.svn
View
@@ -0,0 +1,4 @@
+.DS_Store
+.hg
+.settings
+.svn
@@ -1,3 +1,19 @@
+/*
+ * 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
+ *
+ * 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 grails_akka
import static org.junit.Assert.*
Oops, something went wrong.

0 comments on commit b176b7d

Please sign in to comment.