spring-security/samples/xml/cas/cassample/spring-security-samples-xml...

73 lines
2.4 KiB
Groovy

apply plugin: 'io.spring.convention.spring-sample-war'
def keystore = "$rootDir/samples/certificates/server.jks"
def password = 'password'
sourceSets {
test.resources.exclude 'GebConfig.groovy'
integrationTest.groovy.srcDir file('src/integration-test/groovy')
}
dependencies {
compile project(':spring-security-cas')
compile project(':spring-security-core')
compile 'org.jasig.cas.client:cas-client-core'
providedCompile 'javax.servlet:javax.servlet-api'
runtime project(':spring-security-config')
runtime project(':spring-security-web')
runtime 'ch.qos.logback:logback-classic'
runtime 'net.sf.ehcache:ehcache'
runtime 'org.slf4j:jcl-over-slf4j'
runtime 'org.springframework:spring-context-support'
integrationTestCompile project(':spring-security-cas')
integrationTestCompile gebDependencies
integrationTestCompile seleniumDependencies
integrationTestCompile spockDependencies
integrationTestCompile 'org.codehaus.groovy:groovy'
integrationTestCompile 'org.eclipse.jetty:jetty-server'
integrationTestCompile 'org.eclipse.jetty:jetty-servlet'
integrationTestCompile 'org.slf4j:jcl-over-slf4j'
}
integrationTest {
dependsOn { casServer().tasks.appBeforeIntegrationTest }
doFirst {
def casServiceHost = 'localhost:' + gretty.httpsPort
def casServerHost = 'localhost:' + casServer().gretty.httpsPort
systemProperties['cas.server.host'] = casServerHost
systemProperties['cas.service.host'] = casServiceHost
systemProperties['geb.build.baseUrl'] = 'https://'+casServiceHost+'/cas-sample/'
systemProperties['geb.build.reportsDir'] = 'build/geb-reports'
systemProperties['jar.path'] = jar.archivePath
systemProperties['javax.net.ssl.trustStore'] = keystore
systemProperties['javax.net.ssl.trustStorePassword'] = password
}
finalizedBy { casServer().tasks.appAfterIntegrationTest }
}
prepareAppServerForIntegrationTests {
dependsOn { casServer().tasks.appBeforeIntegrationTest }
doLast {
def casServiceHost = 'localhost:' + project.gretty.httpsPort
def casServerHost = 'localhost:' + casServer().gretty.httpsPort
gretty.jvmArgs += ["-Dcas.server.host=${casServerHost}", "-Dcas.service.host=${casServiceHost}"]
}
}
gretty {
contextPath = '/cas-sample/'
httpsEnabled = true
httpsPort = 8443
sslKeyStorePath = keystore
sslKeyStorePassword = password
jvmArgs = ["-Djavax.net.ssl.trustStore=${keystore}", "-Djavax.net.ssl.trustStorePassword=${password}"]
}
def casServer() {
project(':spring-security-samples-xml-casserver')
}