Skip to content

Commit

Permalink
Merge pull request #53 from Arkilog/master
Browse files Browse the repository at this point in the history
Issue #44 native-realm-only + spring-filter tests
  • Loading branch information
pmcneil committed Oct 22, 2015
2 parents c4b3b89 + 05f6866 commit 7835d33
Show file tree
Hide file tree
Showing 54 changed files with 1,083 additions and 389 deletions.
20 changes: 18 additions & 2 deletions .travis.yml
Expand Up @@ -24,5 +24,21 @@ before_install:
- sdk install grails $GRAILS_VERSION || true
- cd ./shiro3
- chmod +x ./gradlew
script: ./gradlew clean :grails-shiro:test :cli-tests:test :wildcard-realm:integrationTest :annotation-test:integrationTest -i | grep -v "Gradle compiler daemon" | grep -v "^Tasks to be executed:" | grep -v "^Resolved versions" | grep -v "^Applying dependency management to configuration" | grep -v "^Using version" | grep -v "^Downloading"; exit `echo "${PIPESTATUS[0]}"`

before_script:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
- sleep 3 # give xvfb some time to start
script: >
./gradlew clean
:grails-shiro:test
:cli-tests:test
:wildcard-realm:integrationTest
:native-realm-only:integrationTest
:spring-filter:integrationTest
:annotation-test:integrationTest -i |
grep -v "Gradle compiler daemon" |
grep -v "^Tasks to be executed:" |
grep -v "^Resolved versions" |
grep -v "^Applying dependency management to configuration" |
grep -v "^Using version" |
grep -v "^Downloading"; exit `echo "${PIPESTATUS[0]}"`
16 changes: 8 additions & 8 deletions shiro3/annotation-test/grails-app/conf/logback.groovy
Expand Up @@ -39,13 +39,13 @@ if(Environment.current == Environment.DEVELOPMENT) {
logger 'grails.artefact.Interceptor', DEBUG, ['STDOUT','DEVLOG'], false
logger 'grails.artefact.Filter', DEBUG, ['STDOUT','DEVLOG'], false
logger 'grails.artefact.Realm', DEBUG, ['STDOUT','DEVLOG'], false
logger 'shiro',DEBUG, ['STDOUT','DEVLOG']
logger 'shiro3',DEBUG, ['STDOUT','DEVLOG']
logger 'org.apache.shiro',DEBUG, ['STDOUT','DEVLOG']
logger 'grails.app.realms', DEBUG, ['STDOUT','DEVLOG']
logger 'grails.app.taglibs', DEBUG, ['STDOUT','DEVLOG']
logger 'grails.app.interceptors', DEBUG, ['STDOUT','DEVLOG']
logger 'grails.app.controllers', DEBUG, ['STDOUT','DEVLOG']
logger 'grails.app.services', DEBUG, ['STDOUT','DEVLOG']
logger 'shiro',DEBUG, ['STDOUT','DEVLOG'], false
logger 'shiro3',DEBUG, ['STDOUT','DEVLOG'], false
logger 'org.apache.shiro',DEBUG, ['STDOUT','DEVLOG'], false
logger 'grails.app.realms', DEBUG, ['STDOUT','DEVLOG'], false
logger 'grails.app.taglibs', DEBUG, ['STDOUT','DEVLOG'], false
logger 'grails.app.interceptors', DEBUG, ['STDOUT','DEVLOG'], false
logger 'grails.app.controllers', DEBUG, ['STDOUT','DEVLOG'], false
logger 'grails.app.services', DEBUG, ['STDOUT','DEVLOG'], false
}

14 changes: 9 additions & 5 deletions shiro3/default/build.gradle
Expand Up @@ -17,7 +17,7 @@ plugins {
}

version "0.1"
group "mydefault"
group "spring.filter"

apply plugin: "spring-boot"
apply plugin: "war"
Expand Down Expand Up @@ -68,17 +68,21 @@ dependencies {
testCompile "org.grails.plugins:geb"

// Note: It is recommended to update to a more robust driver (Chrome, Firefox etc.)
testRuntime 'org.seleniumhq.selenium:selenium-htmlunit-driver:2.44.0'
// testRuntime 'org.seleniumhq.selenium:selenium-htmlunit-driver:2.44.0'
String seleniumVersion = '2.47.1'
testCompile "org.seleniumhq.selenium:selenium-firefox-driver:$seleniumVersion"

console "org.grails:grails-console"

testCompile ("org.codehaus.groovy.modules.http-builder:http-builder:0.5.0") {
testCompile ("org.codehaus.groovy.modules.http-builder:http-builder:0.7.1") {
exclude module:"commons-logging"
exclude module:"httpclient"
exclude module:"groovy"
exclude module:"xml-apis"
}
testCompile 'org.gebish:geb-core:0.12.2'

compile project(":grails-shiro")

console "org.grails:grails-console"
}

task wrapper(type: Wrapper) {
Expand Down
Expand Up @@ -16,7 +16,7 @@ import grails.transaction.Rollback
@Integration(applicationClass=mydefault.Application)
@Rollback
class BasicAuthenticationSpec extends Specification {
def http = new HTTPBuilder("http://localhost:8080")
def http = new HTTPBuilder("http://localhost:8080/")

def "Test basic authentication response"() {
when: "I access the basic list page"
Expand Down
Expand Up @@ -68,7 +68,7 @@ class FormAuthenticationSpec extends GebReportingSpec {

def "Test authentication with query parameters"() {
given:
def http = new HTTPBuilder("http://localhost:8080")
def http = new HTTPBuilder("http://localhost:8080/")
http.post path: "/auth/signIn", body: [username: "dilbert", password: "password"]
http.post path: "/form/save", body: [name: "One"]
http.post path: "/form/save", body: [name: "Two"]
Expand Down
26 changes: 24 additions & 2 deletions shiro3/default/src/integration-test/groovy/GebConfig.groovy
Expand Up @@ -7,7 +7,29 @@
This is the Geb configuration file.
See: http://www.gebish.org/manual/current/configuration.html
*/
//It's using htmlunit
reportsDir = "build/geb-reports"

import org.openqa.selenium.firefox.FirefoxDriver
//import org.openqa.selenium.chrome.ChromeDriver

def url = System.env['geb.build.baseUrl'] ?: "http://localhost:8080/"
baseUrl = url
reportsDir = "build/geb-reports"
driver = { new FirefoxDriver() }

environments {

// run as “grails -Dgeb.env=chrome test-app”
// See: http://code.google.com/p/selenium/wiki/ChromeDriver
// chrome {
// driver = {
// System.setProperty('webdriver.chrome.driver', '/home/pmcneil/devel/chromedriver/chromedriver')
// new ChromeDriver()
// }
// }

// run as “grails -Dgeb.env=firefox test-app”
// See: http://code.google.com/p/selenium/wiki/FirefoxDriver
// firefox {
// driver = { new FirefoxDriver() }
// }
}

0 comments on commit 7835d33

Please sign in to comment.