Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0173a07
commit 65e07e5
Showing
12 changed files
with
155 additions
and
286 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,74 +1,19 @@ | |||
class PlasticCriteriaGrailsPlugin { | class PlasticCriteriaGrailsPlugin { | ||
// the plugin version | def version = "0.6" | ||
def version = "0.6" | def grailsVersion = "1.3 > *" | ||
// the version or versions of Grails the plugin is designed for | def pluginExcludes = [ | ||
def grailsVersion = "1.3 > *" | 'grails-app/domain/**', | ||
// the other plugins this plugin depends on | |||
def dependsOn = [:] | |||
// resources that are excluded from plugin packaging | |||
def pluginExcludes = [ | |||
'grails-app/views/error.gsp', | |||
'grails-app/domain/plastic/criteria/Artist.groovy', | |||
'grails-app/domain/plastic/criteria/Portrait.groovy', | |||
'src/groovy/plastic/criteria/CriteriaDocTests.groovy' | 'src/groovy/plastic/criteria/CriteriaDocTests.groovy' | ||
] | ] | ||
|
|
||
// TODO Fill in these fields | def title = "Plastic Criteria Plugin" | ||
def title = "Plastic Criteria Plugin" // Headline display name of the plugin | def author = "Fabio Issamu Oshiro" | ||
def author = "Fabio Issamu Oshiro" | def authorEmail = "" | ||
def authorEmail = "" | def description = 'Mock Grails Criteria for Unit Tests' | ||
def description = '''\ | def documentation = "http://grails.org/plugin/plastic-criteria" | ||
Mock Grails Criteria for Unit Tests |
|
||
''' | // def license = "WTFPL" | ||
|
def organization = [ name: "Investtools", url: "http://www.investtools.com.br/" ] | ||
// URL to the plugin's documentation | def issueManagement = [ system: "GitHub", url: "https://github.com/fabiooshiro/plastic-criteria/issues" ] | ||
def documentation = "http://grails.org/plugin/plastic-criteria" | def scm = [ url: "https://github.com/fabiooshiro/plastic-criteria" ] | ||
|
|||
// 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: "Investtools", url: "http://www.investtools.com.br/" ] | |||
|
|||
// Any additional developers beyond the author specified above. | |||
// def developers = [ [ name: "Joe Bloggs", email: "joe@bloggs.net" ]] | |||
|
|||
// Location of the plugin's issue tracker. | |||
// def issueManagement = [ system: "JIRA", url: "http://jira.grails.org/browse/GPMYPLUGIN" ] | |||
|
|||
// Online location of the plugin's browseable source code. | |||
def scm = [ url: "https://github.com/fabiooshiro/plastic-criteria" ] | |||
|
|||
def doWithWebDescriptor = { xml -> | |||
// TODO Implement additions to web.xml (optional), this event occurs before | |||
} | |||
|
|||
def doWithSpring = { | |||
// TODO Implement runtime spring config (optional) | |||
} | |||
|
|||
def doWithDynamicMethods = { ctx -> | |||
// TODO Implement registering dynamic methods to classes (optional) | |||
} | |||
|
|||
def doWithApplicationContext = { applicationContext -> | |||
// TODO Implement post initialization spring config (optional) | |||
} | |||
|
|||
def onChange = { event -> | |||
// TODO Implement code that is executed when any artefact that this plugin is | |||
// watching is modified and reloaded. The event contains: event.source, | |||
// event.application, event.manager, event.ctx, and event.plugin. | |||
} | |||
|
|||
def onConfigChange = { event -> | |||
// TODO Implement code that is executed when the project configuration changes. | |||
// The event is the same as for 'onChange'. | |||
} | |||
|
|||
def onShutdown = { event -> | |||
// TODO Implement code that is executed when the application shuts down (optional) | |||
} | |||
} | } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,7 +1 @@ | |||
#Grails Metadata file | |||
#Mon Jan 21 11:35:17 BRST 2013 | |||
app.grails.version=2.1.3 | app.grails.version=2.1.3 | ||
app.name=plastic-criteria | |||
plugins.hibernate=2.1.3 | |||
plugins.rest-client-builder=1.0.2 | |||
plugins.svn=1.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,39 +1,24 @@ | |||
grails.project.class.dir = "target/classes" | grails.project.work.dir = 'target' | ||
grails.project.test.class.dir = "target/test-classes" | |||
grails.project.test.reports.dir = "target/test-reports" | |||
grails.project.target.level = 1.6 | grails.project.target.level = 1.6 | ||
//grails.project.war.file = "target/${appName}-${appVersion}.war" | |||
|
|
||
grails.project.dependency.resolution = { | grails.project.dependency.resolution = { | ||
// inherit Grails' default dependencies | |||
inherits("global") { | |||
// uncomment to disable ehcache | |||
// excludes 'ehcache' | |||
} | |||
log "warn" // log level of Ivy resolver, either 'error', 'warn', 'info', 'debug' or 'verbose' | |||
repositories { | |||
grailsCentral() | |||
// uncomment the below to enable remote dependency resolution | |||
// from public Maven repositories | |||
mavenCentral() | |||
mavenLocal() | |||
//mavenRepo "http://snapshots.repository.codehaus.org" | |||
//mavenRepo "http://repository.codehaus.org" | |||
//mavenRepo "http://download.java.net/maven/2/" | |||
//mavenRepo "http://repository.jboss.com/maven2/" | |||
} | |||
dependencies { | |||
// specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes eg. | |||
|
|
||
// runtime 'mysql:mysql-connector-java:5.1.5' | inherits 'global' | ||
// build ":release:2.0.0" | log 'warn' | ||
|
|||
repositories { | |||
grailsCentral() | |||
mavenLocal() | |||
mavenCentral() | |||
} | |||
|
|||
dependencies { | |||
compile 'javassist:javassist:3.12.1.GA' | compile 'javassist:javassist:3.12.1.GA' | ||
} | } | ||
|
|
||
plugins { | plugins { | ||
build(":tomcat:$grailsVersion", | build(":release:2.0.0") { | ||
":release:2.0.0") { | export = false | ||
export = false | } | ||
} | } | ||
} | |||
} | } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,26 +1,6 @@ | |||
// configuration for plugin testing - will not be included in the plugin zip | |||
|
|||
log4j = { | log4j = { | ||
// Example of changing the log pattern for the default console | error 'org.codehaus.groovy.grails', | ||
// appender: | 'org.springframework', | ||
// | 'org.hibernate', | ||
//appenders { | 'net.sf.ehcache.hibernate' | ||
// console name:'stdout', layout:pattern(conversionPattern: '%c{2} %m%n') | |||
//} | |||
|
|||
error 'org.codehaus.groovy.grails.web.servlet', // controllers | |||
'org.codehaus.groovy.grails.web.pages', // GSP | |||
'org.codehaus.groovy.grails.web.sitemesh', // layouts | |||
'org.codehaus.groovy.grails.web.mapping.filter', // URL mapping | |||
'org.codehaus.groovy.grails.web.mapping', // URL mapping | |||
'org.codehaus.groovy.grails.commons', // core / classloading | |||
'org.codehaus.groovy.grails.plugins', // plugins | |||
'org.codehaus.groovy.grails.orm.hibernate', // hibernate integration | |||
'org.springframework', | |||
'org.hibernate', | |||
'net.sf.ehcache.hibernate' | |||
|
|||
warn 'org.mortbay.log' | |||
} | } | ||
grails.views.default.codec="none" // none, html, base64 | |||
grails.views.gsp.encoding="UTF-8" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,43 +1,14 @@ | |||
dataSource { | dataSource { | ||
pooled = true | pooled = true | ||
driverClassName = "org.h2.Driver" | driverClassName = 'org.h2.Driver' | ||
username = "sa" | username = 'sa' | ||
password = "" | password = '' | ||
dbCreate = 'update' | |||
url = 'jdbc:h2:mem:testDb' | |||
} | } | ||
|
|||
hibernate { | hibernate { | ||
cache.use_second_level_cache = true | cache.use_second_level_cache = false | ||
cache.use_query_cache = true | cache.use_query_cache = false | ||
cache.region.factory_class = 'net.sf.ehcache.hibernate.EhCacheRegionFactory' | cache.provider_class = 'org.hibernate.cache.EhCacheProvider' | ||
} | |||
// environment specific settings | |||
environments { | |||
development { | |||
dataSource { | |||
dbCreate = "create-drop" // one of 'create', 'create-drop', 'update', 'validate', '' | |||
url = "jdbc:h2:mem:devDb;MVCC=TRUE" | |||
} | |||
} | |||
test { | |||
dataSource { | |||
dbCreate = "update" | |||
url = "jdbc:h2:mem:testDb;MVCC=TRUE" | |||
} | |||
} | |||
production { | |||
dataSource { | |||
dbCreate = "update" | |||
url = "jdbc:h2:prodDb;MVCC=TRUE" | |||
pooled = true | |||
properties { | |||
maxActive = -1 | |||
minEvictableIdleTimeMillis=1800000 | |||
timeBetweenEvictionRunsMillis=1800000 | |||
numTestsPerEvictionRun=3 | |||
testOnBorrow=true | |||
testWhileIdle=true | |||
testOnReturn=true | |||
validationQuery="SELECT 1" | |||
} | |||
} | |||
} | |||
} | } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,13 +1,12 @@ | |||
package plastic.criteria; | package plastic.criteria | ||
|
|
||
public class Artist { | class Artist { | ||
|
|
||
String name | String name | ||
|
|||
String toString(){ | String toString(){ | ||
name | name | ||
} | } | ||
|
|||
static hasMany = [portraits: Portrait] | static hasMany = [portraits: Portrait] | ||
|
|||
} | } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,25 +1,24 @@ | |||
package plastic.criteria; | package plastic.criteria | ||
|
|
||
public class Portrait { | class Portrait { | ||
|
|
||
static belongsTo = [artist: Artist] | static belongsTo = [artist: Artist] | ||
|
|||
String name | String name | ||
|
|||
BigDecimal value | BigDecimal value | ||
|
|||
BigDecimal lastSoldPrice | BigDecimal lastSoldPrice | ||
|
|||
String color | String color | ||
|
|||
String toString(){ | String toString(){ | ||
"${name} (id: ${id})" | "${name} (id: ${id})" | ||
} | } | ||
|
|||
static constraints = { | static constraints = { | ||
color nullable: true | color nullable: true | ||
value nullable: true | value nullable: true | ||
lastSoldPrice nullable: true | lastSoldPrice nullable: true | ||
} | } | ||
|
|||
} | } |
Oops, something went wrong.