Skip to content

Instantly share code, notes, and snippets.

@marcellodesales
Created May 1, 2013 17:15
Show Gist options
  • Save marcellodesales/5496686 to your computer and use it in GitHub Desktop.
Save marcellodesales/5496686 to your computer and use it in GitHub Desktop.
Gradle, Embedded Tomcat, Jacoco, Java 7: Works for unit tests (JUnit), but does not work for integration tests (RestAssured) when run. * gradle test = works (Unit test class uses the service classes locally) * gradle integrationTest = Does not work, even though Tomcat starts running locally on a daemon thread and it is successfully stopped. Cove…
package com.example.account;
import static com.jayway.restassured.RestAssured.*;
import static com.jayway.restassured.matcher.RestAssuredMatchers.*;
import static org.hamcrest.Matchers.*;
import net.sf.json.JSONObject;
import org.junit.Test;
public class AccountIntegrationTest {
@Test
public void testUserLoginSuccess() {
JSONObject input = new JSONObject();
input.put("username", "fffftest1");
input.put("password", "password@1234");
given().
contentType("application/json").request().body(input.toString()).
expect().
body("status.code", equalTo(200)).
when().
post("/app/service/session/login");
}
}
/******* Java project plugin *******/
apply plugin: 'java'
/******* IDE plugins ********/
apply plugin: 'eclipse'
/******* Deployment + Test Plugins ******/
apply plugin: 'maven'
apply plugin: 'tomcat'
apply plugin: 'jacoco'
buildscript {
repositories {
mavenCentral()
}
//******************* Supporting Embedded Tomcat
dependencies {
classpath 'org.gradle.api.plugins:gradle-tomcat-plugin:0.9.8'
classpath 'org.ajoberstar:gradle-jacoco:0.3.0'
}
}
sourceCompatibility = 1.7
targetCompatibility = 1.7
sourceSets {
integrationTest {
java.srcDir file('src/integration-test/java')
resources.srcDir file('src/integration-test/resources')
}
}
repositories {
mavenCentral()
}
dependencies {
compile 'com.sun.jersey:jersey-client:1.17'
compile 'com.sun.jersey:jersey-server:1.17'
compile 'com.sun.jersey:jersey-servlet:1.17'
compile 'com.sun.jersey:jersey-core:1.17'
compile 'com.sun.jersey:jersey-json:1.17'
compile 'com.sun.jersey.contribs:jersey-multipart:1.17'
compile 'com.google.guava:guava:13.0.1'
compile 'com.google.code.gson:gson:2.2.2'
compile 'com.octo.captcha:jcaptcha-all:1.0-RC6'
compile 'commons-io:commons-io:2.4'
compile 'javax.ws.rs:jsr311-api:1.1.1'
providedCompile 'javax.servlet:javax.servlet-api:3.0.1', 'javax.servlet:jsp-api:2.0'
compile 'log4j:log4j:1.2.17'
compile 'nl.captcha:simplecaptcha:1.2.1'
compile group: 'net.sf.json-lib', name: 'json-lib', version: '2.3', classifier: 'jdk15'
compile 'org.apache.commons:commons-codec:1.3'
compile 'org.apache.commons:commons-io:1.3.2'
compile 'org.codehaus.jackson:jackson-core-asl:1.9.12'
compile 'org.codehaus.jackson:jackson-xc:1.9.12'
compile 'org.codehaus.jackson:jackson-mapper-asl:1.9.12'
compile 'org.codehaus.jackson:jackson-jaxrs:1.9.12'
compile 'xom:xom:1.1'
// UNIT Tests
testCompile 'junit:junit:4.11'
// Integration Tests
testCompile 'com.jayway.restassured:rest-assured:1.8.0'
testCompile 'com.jayway.restassured:json-path:1.8.0'
testCompile 'org.codehaus.groovy:groovy-all:2.1.3'
integrationTestCompile sourceSets.main.output
integrationTestCompile configurations.testCompile
integrationTestCompile sourceSets.test.output
integrationTestRuntime configurations.testRuntime
// Embedded Tomcat Support
def tomcatVersion = '7.0.29'
tomcat "org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}",
"org.apache.tomcat.embed:tomcat-embed-logging-juli:${tomcatVersion}"
tomcat("org.apache.tomcat.embed:tomcat-embed-jasper:${tomcatVersion}") {
exclude group: 'org.eclipse.jdt.core.compiler', module: 'ecj'
}
}
// set source file encoding for all compile tasks
tasks.withType(Compile) {
options.encoding = 'UTF-8'
}
jacoco {
// change the version of Jacoco in use
toolVersion = '0.6.2+'
}
test {
maxParallelForks = 5
forkEvery = 5
jacoco {
// would have been enabled by default
enabled = true
}
}
// ########################### Embedded Tomcat Support ###############################
tomcatRun {
httpPort = 8080
}
[tomcatRun, tomcatRunWar, tomcatStop]*.stopPort = 8081
[tomcatRun, tomcatRunWar, tomcatStop]*.stopKey = 'stopKey'
[tomcatRun, tomcatRunWar]*.outputFile = project.file("$buildDir/tomcat.log")
// ########################## Integration Tests ###############################
task integrationTest(type: Test, dependsOn: jar, description: 'Runs the integration tests.', group: 'verification') {
println "Starting the integration tests"
testClassesDir = sourceSets.integrationTest.output.classesDir
classpath = sourceSets.integrationTest.runtimeClasspath
testLogging.showStandardStreams = true
jacoco {
// would have been enabled by default
enabled = true
}
}
integrationTest.doFirst {
println 'Starting the embedded tomcat server'
tasks.tomcatRun.daemon=true
tasks.tomcatRun.execute()
}
integrationTest.doLast {
println 'Stopping the embedded tomcat server'
tasks.tomcatStop.execute()
}
import org.ajoberstar.gradle.jacoco.tasks.*
task testReport(type: JacocoReport) {
executionData test
// specify one or more source sets that you want to report on the coverage of
sourceSets project.sourceSets.main
destPath 'build/reports/coverage-unit'
}
task integrationTestReport(type: JacocoReport) {
// can include one or more execution files
executionData integrationTest
// specify one or more source sets that you want to report on the coverage of
sourceSets project.sourceSets.main
destPath 'build/reports/coverage-integration'
}
gradle.taskGraph.afterTask { task ->
if (task == test) {
tasks.testReport.execute()
}
if (task == integrationTest) {
tasks.integrationTestReport.execute()
}
}
mdesales@mdesales-desktop-vm:~/dev/taxartifactplatform/tap-services$ gradle clean iT --stacktraceStarting the integration tests
:clean
:compileJava
:processResources
:classes
:compileTestJava
:processTestResources UP-TO-DATE
:testClasses
:compileIntegrationTestJava
:processIntegrationTestResources UP-TO-DATE
:integrationTestClasses
:jar
:integrationTest
Starting the embedded tomcat server
Started Tomcat Server
The Server is running at http://localhost:8080/app
AccountIntegrationTest > testUserLoginSuccess STANDARD_OUT
2013-04-30 17:27:00,056 [Test worker] DEBUG org.apache.http.impl.conn.BasicClientConnectionManager - Get connection for route {}->http://localhost:8080
2013-04-30 17:27:00,090 [Test worker] DEBUG org.apache.http.impl.conn.DefaultClientConnectionOperator - Connecting to localhost:8080
2013-04-30 17:27:00,176 [Test worker] DEBUG org.apache.http.client.protocol.RequestAddCookies - CookieSpec selected: best-match
2013-04-30 17:27:00,192 [Test worker] DEBUG org.apache.http.client.protocol.RequestAuthCache - Auth cache not set in the context
2013-04-30 17:27:00,192 [Test worker] DEBUG org.apache.http.client.protocol.RequestTargetAuthentication - Target auth state: UNCHALLENGED
2013-04-30 17:27:00,193 [Test worker] DEBUG org.apache.http.client.protocol.RequestProxyAuthentication - Proxy auth state: UNCHALLENGED
2013-04-30 17:27:00,193 [Test worker] DEBUG org.apache.http.impl.client.DefaultHttpClient - Attempt 1 to execute request
2013-04-30 17:27:00,194 [Test worker] DEBUG org.apache.http.impl.conn.DefaultClientConnection - Sending request: POST /app/service/session/login HTTP/1.1
2013-04-30 17:27:00,194 [Test worker] DEBUG org.apache.http.wire - >> "POST /app/service/session/login HTTP/1.1[\r][\n]"
2013-04-30 17:27:00,195 [Test worker] DEBUG org.apache.http.wire - >> "Accept: */*[\r][\n]"
2013-04-30 17:27:00,196 [Test worker] DEBUG org.apache.http.wire - >> "Content-Length: 51[\r][\n]"
2013-04-30 17:27:00,196 [Test worker] DEBUG org.apache.http.wire - >> "Content-Type: application/json; charset=ISO-8859-1[\r][\n]"
2013-04-30 17:27:00,196 [Test worker] DEBUG org.apache.http.wire - >> "Host: localhost:8080[\r][\n]"
2013-04-30 17:27:00,196 [Test worker] DEBUG org.apache.http.wire - >> "Connection: Keep-Alive[\r][\n]"
2013-04-30 17:27:00,196 [Test worker] DEBUG org.apache.http.wire - >> "Accept-Encoding: gzip,deflate[\r][\n]"
2013-04-30 17:27:00,196 [Test worker] DEBUG org.apache.http.wire - >> "[\r][\n]"
2013-04-30 17:27:00,197 [Test worker] DEBUG org.apache.http.headers - >> POST /quadf/service/session/login HTTP/1.1
2013-04-30 17:27:00,197 [Test worker] DEBUG org.apache.http.headers - >> Accept: */*
2013-04-30 17:27:00,197 [Test worker] DEBUG org.apache.http.headers - >> Content-Length: 51
2013-04-30 17:27:00,197 [Test worker] DEBUG org.apache.http.headers - >> Content-Type: application/json; charset=ISO-8859-1
2013-04-30 17:27:00,197 [Test worker] DEBUG org.apache.http.headers - >> Host: localhost:8080
2013-04-30 17:27:00,197 [Test worker] DEBUG org.apache.http.headers - >> Connection: Keep-Alive
2013-04-30 17:27:00,197 [Test worker] DEBUG org.apache.http.headers - >> Accept-Encoding: gzip,deflate
2013-04-30 17:27:00,197 [Test worker] DEBUG org.apache.http.wire - >> "{"username":"fffftest1","password":"password@1234"}"
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/u1/install/gradle-1.5/lib/logback-classic-1.0.9.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/mdesales/.gradle/caches/artifacts-23/filestore/org.slf4j/slf4j-log4j12/1.6.6/jar/5cd9b4fbc3ff6a97beaade3206137d76f65df805/slf4j-log4j12-1.6.6.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/mdesales/.gradle/caches/artifacts-23/filestore/org.apache.activemq/activemq-all/5.7.0/jar/6f1871f5953ab51a8cdce33cfb9ca01e5a58260e/activemq-all-5.7.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
2013-04-30 17:27:00,897 [http-bio-8080-exec-1] DEBUG platform.core.Client - send(Object,ClientOptions) called Object.class=service.session.StartSessionRequest options=[ClientOptions: cmprs=NONE fmt=XML 9 hdrs: [ offeringid:sp Authorization:OAuth oauth_signatur...412... test:test country:US appid:test tid:557d763f-1354-42fd-b3a3-1b8ef8106b92 requestid:95c19df9-ceea-4734-a5da-f5cd3e718882 interface.version:1.0.38 locale:en_US]]
2013-04-30 17:27:01,063 [http-bio-8080-exec-1] INFO platform.core.CoreSchemaFactory - Successfully loaded (old) default XMLSchemaFactory.
2013-04-30 17:27:01,231 [http-bio-8080-exec-1] ERROR platform.core.CoreSchemaFactory - Can't load rn=schemas/session.xsd as schema: ignoring!
2013-04-30 17:27:01,249 [http-bio-8080-exec-1] INFO com.mycompany.sp.platform.core.ServiceDescriptorFactory - Service session interface version 1.0.43
2013-04-30 17:27:01,489 [http-bio-8080-exec-1] DEBUG com.mycompany.sp.platform.core.Marshaller - marshallToXml: inputMsgClass=StartSessionRequest outputLen=363
2013-04-30 17:27:01,489 [http-bio-8080-exec-1] DEBUG com.mycompany.sp.platform.core.Client - sendRaw() called with: origPayloadLen=363 origOptions=[ClientOptions: cmprs=NONE fmt=XML 9 hdrs: [ mycompany_offeringid:mycompany.cg.cfp.sp Authorization:OAuth oauth_signatur...412... mycompany_test:test mycompany_country:US mycompany_appid:mycompany.cg.cfp.test mycompany_tid:557d763f-1354-42fd-b3a3-1b8ef8106b92 mycompany_requestid:95c19df9-ceea-4734-a5da-f5cd3e718882 interface.version:1.0.38 mycompany_locale:en_US]]
2013-04-30 17:27:01,563 [http-bio-8080-exec-1] DEBUG org.apache.http.impl.conn.PoolingClientConnectionManager - Connection request: [route: {s}->https://session-cqaws-qy.cfp.mycompany.net][total kept alive: 0; route allocated: 0 of 50; total allocated: 0 of 100]
2013-04-30 17:27:01,581 [http-bio-8080-exec-1] DEBUG org.apache.http.impl.conn.PoolingClientConnectionManager - Connection leased: [id: 0][route: {s}->https://session-cqaws-qy.cfp.net][total kept alive: 0; route allocated: 1 of 50; total allocated: 1 of 100]
2013-04-30 17:27:01,987 [http-bio-8080-exec-1] DEBUG org.apache.http.impl.conn.DefaultClientConnectionOperator - Connecting to session-cqawsnet:443
2013-04-30 17:27:02,582 [http-bio-8080-exec-1] DEBUG org.apache.http.client.protocol.RequestAddCookies - CookieSpec selected: best-match
2013-04-30 17:27:02,600 [http-bio-8080-exec-1] DEBUG org.apache.http.client.protocol.RequestAuthCache - Auth cache not set in the context
2013-04-30 17:27:02,601 [http-bio-8080-exec-1] DEBUG org.apache.http.client.protocol.RequestProxyAuthentication - Proxy auth state: UNCHALLENGED
2013-04-30 17:27:02,602 [http-bio-8080-exec-1] DEBUG org.apache.http.impl.client.DefaultHttpClient - Attempt 1 to execute request
2013-04-30 17:27:02,602 [http-bio-8080-exec-1] DEBUG org.apache.http.impl.conn.DefaultClientConnection - Sending request: POST /session HTTP/1.1
2013-04-30 17:27:02,603 [http-bio-8080-exec-1] DEBUG org.apache.http.wire - >> "POST /session HTTP/1.1[\r][\n]"
2013-04-30 17:27:02,604 [http-bio-8080-exec-1] DEBUG org.apache.http.wire - >> "interface.version: 1.0.38[\r][\n]"
2013-04-30 17:27:02,604 [http-bio-8080-exec-1] DEBUG org.apache.http.wire - >> "Content-Type: application/xml[\r][\n]"
2013-04-30 17:27:02,605 [http-bio-8080-exec-1] DEBUG org.apache.http.wire - >> "Authorization: OAuth oauth_signature_method="RSA-SHA1", oauth_version="1.0", oauth_consumer_key="cg.cfp.test", oauth_timestamp="1367368020", oauth_nonce="cb0396e9-b6a7-45ca-b641-59e99bcd38ff", xoauth_version="1.0", oauth_signature="WiV7jQ8ZZ3gE9gRqjXYyhYRZ8EZd0ypocOu6YZl1eSP1clkMVs4%2FuAPfmt2eNdwOhLvYtdzN0gf5wWIYlevSFDzYm4SUg0mo5lNT%2BHegeFyuGcNEZVB1OwiLdboxU%2FB8V0YUtyiwG9fhSakv6lvCbUEotfCUC9vwpFQQrkmtyBs%3D"[\r][\n]"
2013-04-30 17:27:02,606 [http-bio-8080-exec-1] DEBUG org.apache.http.wire - >> "Content-Length: 363[\r][\n]"
2013-04-30 17:27:02,606 [http-bio-8080-exec-1] DEBUG org.apache.http.wire - >> "Host: session-cqaws-qy.cfpnet[\r][\n]"
2013-04-30 17:27:02,607 [http-bio-8080-exec-1] DEBUG org.apache.http.wire - >> "Connection: Keep-Alive[\r][\n]"
2013-04-30 17:27:02,607 [http-bio-8080-exec-1] DEBUG org.apache.http.wire - >> "User-Agent: Apache-HttpClient/4.2.1 (java 1.5)[\r][\n]"
2013-04-30 17:27:02,607 [http-bio-8080-exec-1] DEBUG org.apache.http.wire - >> "[\r][\n]"
2013-04-30 17:27:02,607 [http-bio-8080-exec-1] DEBUG org.apache.http.headers - >> POST /session HTTP/1.1
2013-04-30 17:27:02,607 [http-bio-8080-exec-1] DEBUG org.apache.http.headers - >> interface.version: 1.0.38
2013-04-30 17:27:02,607 [http-bio-8080-exec-1] DEBUG org.apache.http.headers - >> Content-Type: application/xml
2013-04-30 17:27:02,608 [http-bio-8080-exec-1] DEBUG org.apache.http.headers - >> Authorization: OAuth oauth_signature_method="RSA-SHA1", oauth_version="1.0", oauth_consumer_key="cg.cfp.test", oauth_timestamp="1367368020", oauth_nonce="cb0396e9-b6a7-45ca-b641-59e99bcd38ff", xoauth_version="1.0", oauth_signature="WiV7jQ8ZZ3gE9gRqjXYyhYRZ8EZd0ypocOu6YZl1eSP1clkMVs4%2FuAPfmt2eNdwOhLvYtdzN0gf5wWIYlevSFDzYm4SUg0mo5lNT%2BHegeFyuGcNEZVB1OwiLdboxU%2FB8V0YUtyiwG9fhSakv6lvCbUEotfCUC9vwpFQQrkmtyBs%3D"
2013-04-30 17:27:02,608 [http-bio-8080-exec-1] DEBUG org.apache.http.headers - >> tid: 557d763f-1354-42fd-b3a3-1b8ef8106b92
2013-04-30 17:27:02,608 [http-bio-8080-exec-1] DEBUG org.apache.http.headers - >> requestid: 95c19df9-ceea-4734-a5da-f5cd3e718882
2013-04-30 17:27:02,608 [http-bio-8080-exec-1] DEBUG org.apache.http.headers - >> locale: en_US
2013-04-30 17:27:02,608 [http-bio-8080-exec-1] DEBUG org.apache.http.headers - >> Content-Length: 363
2013-04-30 17:27:02,609 [http-bio-8080-exec-1] DEBUG org.apache.http.headers - >> Host: session.net
2013-04-30 17:27:02,609 [http-bio-8080-exec-1] DEBUG org.apache.http.headers - >> Connection: Keep-Alive
2013-04-30 17:27:02,609 [http-bio-8080-exec-1] DEBUG org.apache.http.headers - >> User-Agent: Apache-HttpClient/4.2.1 (java 1.5)
2013-04-30 17:27:02,609 [http-bio-8080-exec-1] DEBUG org.apache.http.wire - >> "<?xml version="1.0" encoding="utf-8" standalone="yes"?><ns2:StartSessionRequest xmlns:ns2="http://cfp.com/service/session" xmlns:ns3="http://cfp.com/base"><credential xsi:type="ns2:LoginInfo" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><userName>fffftest1</userName><password>password@1234</password></credential></ns2:StartSessionRequest>"
2013-04-30 17:27:02,939 [http-bio-8080-exec-1] DEBUG org.apache.http.wire - << "HTTP/1.1 200 OK[\r][\n]"
2013-04-30 17:27:02,943 [http-bio-8080-exec-1] DEBUG org.apache.http.wire - << "Date: Tue, 30 Apr 2013 05:27:02 GMT[\r][\n]"
2013-04-30 17:27:02,943 [http-bio-8080-exec-1] DEBUG org.apache.http.wire - << "Server: Mule Core/3.2.2[\r][\n]"
2013-04-30 17:27:02,943 [http-bio-8080-exec-1] DEBUG org.apache.http.wire - << "Expires: Tue, 30 Apr 2013 05:27:02 GMT[\r][\n]"
2013-04-30 17:27:02,943 [http-bio-8080-exec-1] DEBUG org.apache.http.wire - << "Content-Type: application/xml;charset=UTF-8[\r][\n]"
2013-04-30 17:27:02,943 [http-bio-8080-exec-1] DEBUG org.apache.http.wire - << "X-MULE_ENCODING: UTF-8[\r][\n]"
2013-04-30 17:27:02,943 [http-bio-8080-exec-1] DEBUG org.apache.http.wire - << "Content-Length: 403[\r][\n]"
2013-04-30 17:27:02,943 [http-bio-8080-exec-1] DEBUG org.apache.http.wire - << "X-Cnection: close[\r][\n]"
2013-04-30 17:27:02,943 [http-bio-8080-exec-1] DEBUG org.apache.http.wire - << "Cache-Control: no-cache, no-store[\r][\n]"
2013-04-30 17:27:02,944 [http-bio-8080-exec-1] DEBUG org.apache.http.wire - << "Keep-Alive: timeout=15, max=100[\r][\n]"
2013-04-30 17:27:02,944 [http-bio-8080-exec-1] DEBUG org.apache.http.wire - << "Connection: Keep-Alive[\r][\n]"
2013-04-30 17:27:02,944 [http-bio-8080-exec-1] DEBUG org.apache.http.wire - << "[\r][\n]"
2013-04-30 17:27:02,945 [http-bio-8080-exec-1] DEBUG org.apache.http.impl.conn.DefaultClientConnection - Receiving response: HTTP/1.1 200 OK
2013-04-30 17:27:02,945 [http-bio-8080-exec-1] DEBUG org.apache.http.headers - << HTTP/1.1 200 OK
2013-04-30 17:27:02,945 [http-bio-8080-exec-1] DEBUG org.apache.http.headers - << Date: Tue, 30 Apr 2013 05:27:02 GMT
2013-04-30 17:27:02,945 [http-bio-8080-exec-1] DEBUG org.apache.http.headers - << Server: Mule Core/3.2.2
2013-04-30 17:27:02,945 [http-bio-8080-exec-1] DEBUG org.apache.http.headers - << Expires: Tue, 30 Apr 2013 05:27:02 GMT
2013-04-30 17:27:02,945 [http-bio-8080-exec-1] DEBUG org.apache.http.headers - << Content-Type: application/xml;charset=UTF-8
2013-04-30 17:27:02,945 [http-bio-8080-exec-1] DEBUG org.apache.http.headers - << X-MULE_ENCODING: UTF-8
2013-04-30 17:27:02,945 [http-bio-8080-exec-1] DEBUG org.apache.http.headers - << Content-Length: 403
2013-04-30 17:27:02,945 [http-bio-8080-exec-1] DEBUG org.apache.http.headers - << X-Cnection: close
2013-04-30 17:27:02,946 [http-bio-8080-exec-1] DEBUG org.apache.http.headers - << Cache-Control: no-cache, no-store
2013-04-30 17:27:02,946 [http-bio-8080-exec-1] DEBUG org.apache.http.headers - << Keep-Alive: timeout=15, max=100
2013-04-30 17:27:02,946 [http-bio-8080-exec-1] DEBUG org.apache.http.headers - << Connection: Keep-Alive
2013-04-30 17:27:02,953 [http-bio-8080-exec-1] DEBUG org.apache.http.impl.client.DefaultHttpClient - Connection can be kept alive for 15000 MILLISECONDS
2013-04-30 17:27:02,957 [http-bio-8080-exec-1] DEBUG org.apache.http.wire - << "<?xml version="1.0" encoding="utf-8" standalone="yes"?><ns2:StartSessionResponse xmlns:ns2="http://cfp.mycompany.com/service/session" xmlns:ns3="http://cfp.mycompany.com/base"><sessionToken><value>Y29tLmludHVpdC5jZnAuc3AucGxhdGZvcm0uY29yZS5TZXNzaW9uSW5mbwAyNDk2MjIwNDYAVjEtMzAtUTMzZm56ZGZ2ZDUzNmJueHFlOGduYQAyMABudWxs</value></sessionToken><userIdentifier>249622046</userIdentifier></ns2:StartSessionResponse>"
2013-04-30 17:27:02,958 [http-bio-8080-exec-1] DEBUG org.apache.http.impl.conn.PoolingClientConnectionManager - Connection [id: 0][route: {s}->https://session-cqaws-qy.cfp.mycompany.net] can be kept alive for 15000 MILLISECONDS
2013-04-30 17:27:02,958 [http-bio-8080-exec-1] DEBUG org.apache.http.impl.conn.PoolingClientConnectionManager - Connection released: [id: 0][route: {s}->https://session-cqaws-qy.cfp.mycompany.net][total kept alive: 1; route allocated: 1 of 50; total allocated: 1 of 100]
2013-04-30 17:27:02,958 [http-bio-8080-exec-1] INFO com.mycompany.sp.platform.core.Client - sendRaw url="https://session-cqaws-qy.cfp.mycompany.net/session" sentHdrs=10 origBytes=363 sentBytes=363 rcvdBytes=403 rsltBytes=403 sendRawMicrosecs=1456680
2013-04-30 17:27:02,958 [http-bio-8080-exec-1] DEBUG com.mycompany.sp.platform.core.Client - HeaderNames: interface.version, Content-Type, mycompany_offeringid, Authorization, mycompany_test, mycompany_country, mycompany_appid, mycompany_tid, mycompany_requestid, mycompany_locale
2013-04-30 17:27:03,047 [http-bio-8080-exec-1] DEBUG com.mycompany.sp.platform.core.Unmarshaller - unmarshallFromXml: inputLen=403 outputMsgClass=StartSessionResponse
2013-04-30 17:27:03,113 [Test worker] DEBUG org.apache.http.wire - << "HTTP/1.1 200 OK[\r][\n]"
2013-04-30 17:27:03,116 [Test worker] DEBUG org.apache.http.wire - << "Server: Apache-Coyote/1.1[\r][\n]"
2013-04-30 17:27:03,116 [Test worker] DEBUG org.apache.http.wire - << "Set-Cookie: sessionToken=Y29tLmludHVpdC5jZnAuc3AucGxhdGZvcm0uY29yZS5TZXNzaW9uSW5mbwAyNDk2MjIwNDYAVjEtMzAtUTMzZm56ZGZ2ZDUzNmJueHFlOGduYQAyMABudWxs;Version=1;Comment=;Domain=;Path=/quadf[\r][\n]"
2013-04-30 17:27:03,116 [Test worker] DEBUG org.apache.http.wire - << "Content-Type: application/json[\r][\n]"
2013-04-30 17:27:03,117 [Test worker] DEBUG org.apache.http.wire - << "Transfer-Encoding: chunked[\r][\n]"
2013-04-30 17:27:03,117 [Test worker] DEBUG org.apache.http.wire - << "Date: Wed, 01 May 2013 00:27:03 GMT[\r][\n]"
2013-04-30 17:27:03,117 [Test worker] DEBUG org.apache.http.wire - << "[\r][\n]"
2013-04-30 17:27:03,118 [Test worker] DEBUG org.apache.http.impl.conn.DefaultClientConnection - Receiving response: HTTP/1.1 200 OK
2013-04-30 17:27:03,118 [Test worker] DEBUG org.apache.http.headers - << HTTP/1.1 200 OK
2013-04-30 17:27:03,118 [Test worker] DEBUG org.apache.http.headers - << Server: Apache-Coyote/1.1
2013-04-30 17:27:03,118 [Test worker] DEBUG org.apache.http.headers - << Set-Cookie: sessionToken=Y29tLmludHVpdC5jZnAuc3AucGxhdGZvcm0uY29yZS5TZXNzaW9uSW5mbwAyNDk2MjIwNDYAVjEtMzAtUTMzZm56ZGZ2ZDUzNmJueHFlOGduYQAyMABudWxs;Version=1;Comment=;Domain=;Path=/quadf
2013-04-30 17:27:03,118 [Test worker] DEBUG org.apache.http.headers - << Content-Type: application/json
2013-04-30 17:27:03,118 [Test worker] DEBUG org.apache.http.headers - << Transfer-Encoding: chunked
2013-04-30 17:27:03,118 [Test worker] DEBUG org.apache.http.headers - << Date: Wed, 01 May 2013 00:27:03 GMT
2013-04-30 17:27:03,125 [Test worker] WARN org.apache.http.client.protocol.ResponseProcessCookies - Invalid cookie header: "Set-Cookie: sessionToken=Y29tLmludHVpdC5jZnAuc3AucGxhdGZvcm0uY29yZS5TZXNzaW9uSW5mbwAyNDk2MjIwNDYAVjEtMzAtUTMzZm56ZGZ2ZDUzNmJueHFlOGduYQAyMABudWxs;Version=1;Comment=;Domain=;Path=/quadf". Blank value for domain attribute
2013-04-30 17:27:03,126 [Test worker] DEBUG org.apache.http.impl.client.DefaultHttpClient - Connection can be kept alive indefinitely
2013-04-30 17:27:03,159 [Test worker] DEBUG com.jayway.restassured.internal.RequestSpecificationImpl$RestAssuredHttpBuilder - Parsing response as: application/json
2013-04-30 17:27:03,159 [Test worker] DEBUG com.jayway.restassured.internal.RequestSpecificationImpl$RestAssuredHttpBuilder - Parsed data to instance of: class org.apache.http.conn.EofSensorInputStream
2013-04-30 17:27:03,239 [Test worker] DEBUG org.apache.http.wire - << "76[\r][\n]"
2013-04-30 17:27:03,239 [Test worker] DEBUG org.apache.http.wire - << "{"status":{"code":200,"message":"OK","fieldName":null,"fieldDescription":null},"value":{"userIdentifier":"249622046"}}"
2013-04-30 17:27:03,243 [Test worker] DEBUG org.apache.http.wire - << "[\r][\n]"
2013-04-30 17:27:03,243 [Test worker] DEBUG org.apache.http.wire - << "0[\r][\n]"
2013-04-30 17:27:03,243 [Test worker] DEBUG org.apache.http.wire - << "[\r][\n]"
2013-04-30 17:27:03,243 [Test worker] DEBUG org.apache.http.impl.conn.BasicClientConnectionManager - Releasing connection org.apache.http.impl.conn.ManagedClientConnectionImpl@56b2d6bd
2013-04-30 17:27:03,245 [Test worker] DEBUG org.apache.http.impl.conn.BasicClientConnectionManager - Connection can be kept alive indefinitely
Stopping the embedded tomcat server
Code Coverage report located at build/reports/coverage-integration
The web application [/quadf] created a ThreadLocal with key of type [com.sun.xml.bind.v2.ClassFactory$1] (value [com.sun.xml.bind.v2.ClassFactory$1@fb5c0f9]) and a value of type [java.util.WeakHashMap] (value [{class javax.xml.bind.annotation.W3CDomHandler=java.lang.ref.WeakReference@6590237d}]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
The web application [/quadf] created a ThreadLocal with key of type [com.sun.xml.bind.v2.ClassFactory$1] (value [com.sun.xml.bind.v2.ClassFactory$1@fb5c0f9]) and a value of type [java.util.WeakHashMap] (value [{class javax.xml.bind.annotation.W3CDomHandler=java.lang.ref.WeakReference@5a0a17a2, class com.mycompany.sp.service.session.StartSessionResponse=java.lang.ref.WeakReference@4c95badc, class com.mycompany.sp.service.session.SessionToken=java.lang.ref.WeakReference@7a1ee8cb}]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment