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
A simple payment app. | |
Your task is to implement a simple payment tracking system in Grails or your preferred framework. | |
Requirements: | |
- Accounts have a balance, name, email. | |
- Every user starts off with £200. | |
- We would like to see proper use of tests, gsp tags and clean code. | |
- Don't worry about putting in a proper user management or security layer. |
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
blah:se tomaslin$ grails -Dgrails.env=cf cf-update | |
... | |
Updating Application: | |
Checking for available resources: | |
Error: 500 Internal Server Error | |
blah:se tomaslin$ grails -Dgrails.env=cf cf-update | |
... | |
Updating Application: | |
Checking for available resources: OK |
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
@Grapes([ | |
@Grab("org.codehaus.geb:geb-core:0.6.0"), | |
@Grab("org.seleniumhq.selenium:selenium-firefox-driver:2.4.0"), | |
@Grab("net.sf.opencsv:opencsv:2.0") | |
]) | |
import geb.Browser | |
import au.com.bytecode.opencsv.* | |
def fileLocation = 'secret_escapes_20111004_1436.csv' // the location of your csv file. You can go to your pivotal board and do an export to CSV. |
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
package com.flashsales.utils | |
// maps UI Performance tags to resources plugin tags | |
class ConvertUiPerformanceTagLib { | |
static namespace = 'p' | |
def css = { attrs -> | |
attrs.uri = "/css/${ attrs.remove( 'name' ) }.css" | |
attrs.type = 'css' |
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
role defined previously | |
User.createCriteria().list(){ | |
createAlias( 'userRole', 'ur' ) | |
and{ | |
eq( 'role', 'ur.role' ) | |
eq( 'ur.role', role ) | |
} | |
projections{ | |
property("username") |
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
Get a free appfog account at http://www.appfog.com | |
Install the gem | |
sudo gem install af | |
Go to your app directory | |
1. Create a war file | |
grails war |
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
package com.example.helloworld; | |
import javax.ws.rs.*; | |
import javax.ws.rs.core.MediaType; | |
@Produces(MediaType.APPLICATION_JSON) | |
public class HelloWorldService{ | |
} |
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
Plano de viagem para : Kalil Lima | |
Plano de viagem para : Sra. Camila Silva | |
Plano de viagem para : Sr. Lucas Salomao | |
Motivo da viagem : . | |
Valor estimado da viagem : 4155.03 BRL | |
Reserva : Y9E44L | |
Código(s) de reserva do voo | |
Amadeus : Y9E44L |
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
def output = new File('allTests.txt') | |
output.write('') | |
new File( System.getProperty("user.dir") ).eachDirRecurse{ | |
if( it.name == 'test' ){ | |
it.eachDirRecurse{ testDir -> | |
if( !testDir.absolutePath.contains( 'internal' ) && !testDir.absolutePath.contains('ratpack-test-support') ){ | |
testDir.eachFile{ file -> | |
if( file.name.endsWith('Spec.groovy') ){ |
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
******************************************************************************** | |
ratpack/ratpack-core/src/test/groovy/org/ratpackframework/block/BlockingSpec.groovy | |
******************************************************************************** | |
class BlockingSpec extends RatpackGroovyDslSpec { | |
def "can perform blocking operations"() { | |
when: | |
def steps = [] | |
app { | |
handlers { | |
get { |
OlderNewer