Skip to content
Browse files

Updates for Griffon 0.9.5

  • Loading branch information...
1 parent 2598349 commit cefea1ca5bea4ce80f74aae48ddce60d5008e3d1 @aalmiray aalmiray committed Mar 6, 2012
View
55 .classpath
@@ -1,55 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src/main"/>
- <classpathentry kind="src" path="griffon-app/conf"/>
- <classpathentry kind="src" path="griffon-app/models"/>
- <classpathentry kind="src" path="griffon-app/views"/>
- <classpathentry kind="src" path="griffon-app/controllers"/>
- <classpathentry kind="src" path="test/integration"/>
- <classpathentry kind="src" path="test/unit"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="var" path="GRIFFON_HOME/ant/lib/ant.jar"/>
-<classpathentry kind="var" path="GRIFFON_HOME/lib/ant.jar" />
-
-<classpathentry kind="var" path="GRIFFON_HOME/lib/ant-junit.jar" />
-
-<classpathentry kind="var" path="GRIFFON_HOME/lib/commons-logging-1.1.jar" />
-
-<classpathentry kind="var" path="GRIFFON_HOME/lib/groovy-all-1.6-RC-1-SNAPSHOT.jar" />
-
-<classpathentry kind="var" path="GRIFFON_HOME/lib/jline-0.9.94.jar" />
-
-<classpathentry kind="var" path="GRIFFON_HOME/lib/junit-3.8.2.jar" />
-
-<classpathentry kind="var" path="GRIFFON_HOME/lib/commons-cli-1.0.jar" />
-
-<classpathentry kind="var" path="GRIFFON_HOME/lib/log4j-1.2.15.jar" />
-
-<classpathentry kind="var" path="GRIFFON_HOME/lib/swingx-0.9.3.jar" />
-
-<classpathentry kind="var" path="GRIFFON_HOME/lib/ant-trax.jar" />
-
-<classpathentry kind="var" path="GRIFFON_HOME/lib/ant-nodeps.jar" />
-
-<classpathentry kind="var" path="GRIFFON_HOME/lib/swing-worker.jar" />
-
-<classpathentry kind="var" path="GRIFFON_HOME/lib/swingxbuilder-0.1.6-SNAPSHOT.jar" />
-
-<classpathentry kind="var" path="GRIFFON_HOME/lib/MultipleGradientPaint.jar" />
-
-<classpathentry kind="var" path="GRIFFON_HOME/lib/spring-2.5.1.jar" />
-
-<classpathentry kind="var" path="GRIFFON_HOME/lib/commons-lang-2.1.jar" />
-
-<classpathentry kind="var" path="GRIFFON_HOME/lib/ant-launcher.jar" />
-
-
-<classpathentry kind="var" path="GRIFFON_HOME/dist/griffon-resources-0.1-SNAPSHOT.jar" />
-
-<classpathentry kind="var" path="GRIFFON_HOME/dist/griffon-rt-0.1-SNAPSHOT.jar" />
-
-<classpathentry kind="var" path="GRIFFON_HOME/dist/griffon-cli-0.1-SNAPSHOT.jar" />
-
-
- <classpathentry kind="output" path="staging/classes"/>
-</classpath>
View
1 .gitignore
@@ -0,0 +1 @@
+target
View
23 .project
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>easyb</name>
- <comment/>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.codehaus.groovy.eclipse.groovyBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.codehaus.groovy.eclipse.groovyNature</nature>
- </natures>
-</projectDescription>
View
70 EasybGriffonPlugin.groovy
@@ -1,5 +1,5 @@
/*
- * Copyright 2009-2011 the original author or authors.
+ * Copyright 2009-2012 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.
@@ -18,17 +18,61 @@
* @author Andres Almiray
*/
class EasybGriffonPlugin {
- def version = '0.5'
- def dependsOn = [:]
- def griffonVersion = '0.9.4 > *'
- def license = 'Apache Software License 2.0'
-
- def author = 'Andres Almiray'
- def authorEmail = 'aalmiray@users.sourceforge.net'
- def title = 'Enables BDD testing with Easyb'
- def description = '''
-Enables BDD testing with Easyb (http://easyb.org)
-'''
+ // the plugin version
+ String version = '0.6'
+ // the version or versions of Griffon the plugin is designed for
+ String griffonVersion = '0.9.5 > *'
+ // the other plugins this plugin depends on
+ Map dependsOn = [:]
+ // resources that are included in plugin packaging
+ List pluginIncludes = []
+ // the plugin license
+ String license = 'Apache Software License 2.0'
+ // Toolkit compatibility. No value means compatible with all
+ // Valid values are: swing, javafx, swt, pivot, gtk
+ List toolkits = []
+ // Platform compatibility. No value means compatible with all
+ // Valid values are:
+ // linux, linux64, windows, windows64, macosx, macosx64, solaris
+ List platforms = []
+ // URL where documentation can be found
+ String documentation = ''
+ // URL where source can be found
+ String source = 'https://github.com/griffon/griffon-easyb-plugin'
+
+ List authors = [
+ [
+ name: 'Andres Almiray',
+ email: 'aalmiray@yahoo.com'
+ ]
+ ]
+ String title = 'Enables BDD testing with Easyb'
+ // accepts Markdown syntax. See http://daringfireball.net/projects/markdown/ for details
+ String description = '''
+Brings Behavior Driven Development to your Griffon application via [Easyb][1]. This is a direct port of the
+[Grails Easyb plugin][2] made by Richard Vowles and Gustavo Madruga.
+
+Usage
+-----
+
+The [Easyb][1] project has excellent documentation to get you started writing stories.
+
+### Running Tests
- def documentation = 'http://griffon.codehaus.org/Easyb+Plugin'
+Tests are run just like normal Griffon tests via grails `test-app`. A new _easyb_ test type is added to the unit,
+integration and functional phases. You can use the Griffon 0.9 test type targeting feature to run only your Easyb tests…
+
+ griffon test-app :easyb
+
+Class names of Easyb tests must end in *Story*; otherwise the Griffon test runner won't find them.
+
+Scripts
+-------
+
+ * **create-unit-story** - creates a new Unit story. Mimics GriffonUnitTestCase
+ * **create-integration-story** - creates a new Integration story. Mimics a regular JUnit integration test
+
+[1]: http://easyb.org
+[2]: http://grails.org/plugin/easyb
+'''
}
View
4 application.properties
@@ -1,4 +1,2 @@
-#Griffon Metadata file
-#Mon Jun 21 14:06:05 CEST 2010
-app.griffon.version=0.9.4
+app.griffon.version=0.9.5-rc2
app.name=easyb
View
17 griffon-app/conf/BuildConfig.groovy
@@ -2,10 +2,7 @@ griffon.project.dependency.resolution = {
inherits("global")
log "warn"
repositories {
- griffonPlugins()
griffonHome()
- griffonCentral()
-
mavenCentral()
}
dependencies {
@@ -22,4 +19,16 @@ griffon {
}
}
-griffon.jars.destDir='target/addon'
+log4j = {
+ // Example of changing the log pattern for the default console
+ // appender:
+ appenders {
+ console name: 'stdout', layout: pattern(conversionPattern: '%d [%t] %-5p %c - %m%n')
+ }
+
+ error 'org.codehaus.griffon',
+ 'org.springframework',
+ 'org.apache.karaf',
+ 'groovyx.net'
+ warn 'griffon'
+}
View
BIN griffon-easyb-0.5.zip
Binary file not shown.
View
12 plugin.xml
@@ -1,12 +0,0 @@
-<plugin name='easyb' version='0.5' griffonVersion='0.9.4 &gt; *' jdk='1.5'>
- <author>Andres Almiray</author>
- <authorEmail>aalmiray@users.sourceforge.net</authorEmail>
- <title>Enables BDD testing with Easyb</title>
- <description>Enables BDD testing with Easyb (http://easyb.org)</description>
- <documentation>http://griffon.codehaus.org/Easyb+Plugin</documentation>
- <license>Apache Software License 2.0</license>
- <resources>
- <resource>BuildConfig</resource>
- </resources>
- <dependencies />
-</plugin>
View
4 scripts/CreateIntegrationStory.groovy
@@ -1,5 +1,5 @@
/*
- * Copyright 2004-2011 the original author or authors.
+ * Copyright 2004-2012 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.
@@ -22,11 +22,9 @@
import griffon.util.GriffonUtil
-includeTargets << griffonScript("Init")
includeTargets << griffonScript("CreateIntegrationTest")
target(createIntegrationStory: "Creates a new Griffon Easyb story") {
- depends(checkVersion, parseArguments)
promptForName(type: "Easyb Story")
def (pkg, name) = extractArtifactName(argsMap["params"][0])
def fqn = "${pkg?pkg:''}${pkg?'.':''}${GriffonUtil.getClassNameRepresentation(name)}"
View
4 scripts/CreateUnitStory.groovy
@@ -1,5 +1,5 @@
/*
- * Copyright 2004-2011 the original author or authors.
+ * Copyright 2004-2012 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.
@@ -22,11 +22,9 @@
import griffon.util.GriffonUtil
-includeTargets << griffonScript("Init")
includeTargets << griffonScript("CreateIntegrationTest")
target(createUnitStory: "Creates a new Griffon Easyb story") {
- depends(checkVersion, parseArguments)
promptForName(type: "Easyb Story")
def (pkg, name) = extractArtifactName(argsMap["params"][0])
def fqn = "${pkg?pkg:''}${pkg?'.':''}${GriffonUtil.getClassNameRepresentation(name)}"
View
12 scripts/_Events.groovy
@@ -1,5 +1,5 @@
/*
- * Copyright 2009-2010 the original author or authors.
+ * Copyright 2009-2012 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.
@@ -27,17 +27,7 @@ eventAllTestsStart = {
loadTestTypeClass = { ->
def doLoad = { ->
-// def easybPluginDir = pluginSettings.getPluginDirForName('easyb')
if(!easybPluginDir) return
-/*
- ant.fileset(dir: "${easybPluginDir.file}/dist/", includes: "*-test.jar").each { f ->
- addUrlIfNotPresent classLoader, f.file
- }
- ant.fileset(dir: "${easybPluginDir.file}/lib/", includes: "*jar").each { f ->
- addUrlIfNotPresent classLoader, f.file
- }
-*/
-
classLoader.loadClass('griffon.plugin.easyb.test.GriffonEasybTestType')
}
View
10 scripts/_Install.groovy
@@ -1,10 +0,0 @@
-//
-// This script is executed by Griffon after plugin was installed to project.
-// This script is a Gant script so you can use all special variables provided
-// by Gant (such as 'baseDir' which points on project base dir). You can
-// use 'ant' to access a global instance of AntBuilder
-//
-// For example you can create directory under project tree:
-//
-// ant.mkdir(dir:"${basedir}/griffon-app/jobs")
-//
View
5 scripts/_Uninstall.groovy
@@ -1,5 +0,0 @@
-//
-// This script is executed by Griffon when the plugin is uninstalled from project.
-// Use this script if you intend to do any additional clean-up on uninstall, but
-// beware of messing up SVN directories!
-//
View
46 src/cli/org/codehaus/griffon/cli/shell/command/CreateIntegrationStoryCommand.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2012 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.griffon.cli.shell.command;
+
+import org.codehaus.griffon.cli.shell.AbstractGriffonCommand;
+import org.codehaus.griffon.cli.shell.Command;
+import org.codehaus.griffon.cli.shell.Argument;
+import org.codehaus.griffon.cli.shell.Option;
+
+/**
+ * @author Andres Almiray
+ */
+@Command(scope = "easyb",
+ name = "create-integration-story",
+ description = "Creates a new Griffon integration story which loads the whole Griffon environment when run")
+public class CreateIntegrationStoryCommand extends AbstractGriffonCommand {
+ @Argument(index = 0,
+ name = "name",
+ description = "The name of the story to be created.",
+ required = false)
+ private String name;
+
+ @Option(name = "--skip-package-prompt",
+ description = "Skips the usage of the application's default package if the name of the class is not fully qualified.",
+ required = false)
+ private boolean skipPackagePrompt = false;
+
+ @Option(name = "--archetype",
+ description = "Archetype to be searched for templates.",
+ required = false)
+ private String archetype = "default";
+}
View
46 src/cli/org/codehaus/griffon/cli/shell/command/CreateUnitStoryCommand.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2012 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.griffon.cli.shell.command;
+
+import org.codehaus.griffon.cli.shell.AbstractGriffonCommand;
+import org.codehaus.griffon.cli.shell.Command;
+import org.codehaus.griffon.cli.shell.Argument;
+import org.codehaus.griffon.cli.shell.Option;
+
+/**
+ * @author Andres Almiray
+ */
+@Command(scope = "easyb",
+ name = "create-unit-story",
+ description = "Creates a new Griffon unit story")
+public class CreateUnitStoryCommand extends AbstractGriffonCommand {
+ @Argument(index = 0,
+ name = "name",
+ description = "The name of the story to be created.",
+ required = false)
+ private String name;
+
+ @Option(name = "--skip-package-prompt",
+ description = "Skips the usage of the application's default package if the name of the class is not fully qualified.",
+ required = false)
+ private boolean skipPackagePrompt = false;
+
+ @Option(name = "--archetype",
+ description = "Archetype to be searched for templates.",
+ required = false)
+ private String archetype = "default";
+}
View
22 src/cli/org/codehaus/griffon/cli/shell/help/create-integration-story.txt
@@ -0,0 +1,22 @@
+DESCRIPTION
+ create-integration-story
+
+ Creates a new Griffon integration story which loads the whole Griffon
+ environment when run.
+
+SYNTAX
+ create-integration-story [options] [name]
+
+ARGUMENTS
+ name
+ The name of the story to be created.
+
+OPTIONS
+ --archetype
+ Archetype to be searched for templates.
+ (defaults to default)
+ --non-interactive
+ Controls if the shell can ask for input or not.
+ --skip-package-prompt
+ Skips the usage of the application's default package if the
+ name of the class is not fully qualified.
View
21 src/cli/org/codehaus/griffon/cli/shell/help/create-unit-story.txt
@@ -0,0 +1,21 @@
+DESCRIPTION
+ create-unit-story
+
+ Creates a new Griffon unit story.
+
+SYNTAX
+ create-unit-story [options] [name]
+
+ARGUMENTS
+ name
+ The name of the story to be created.
+
+OPTIONS
+ --archetype
+ Archetype to be searched for templates.
+ (defaults to default)
+ --non-interactive
+ Controls if the shell can ask for input or not.
+ --skip-package-prompt
+ Skips the usage of the application's default package if the
+ name of the class is not fully qualified.
View
6 src/templates/artifacts/EasybStory.groovy
@@ -1,6 +1,4 @@
-@artifact.package@
-
-scenario "Hello Groovy", {
+@artifact.package@scenario "Hello Groovy", {
given "A prefix string 'Hello '", {
prefix = "Hello "
}
@@ -14,6 +12,6 @@ scenario "Hello Groovy", {
}
then "The greeting should be equal to 'Hello Groovy'", {
- greeting.shouldBe "Hello Groovy"
+ greeting.shouldBe "Failure"
}
}

0 comments on commit cefea1c

Please sign in to comment.
Something went wrong with that request. Please try again.