Skip to content
This repository has been archived by the owner on Apr 8, 2019. It is now read-only.

Commit

Permalink
More verbose logging for unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vietj committed Apr 2, 2013
1 parent 2d46c08 commit 604fd30
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 1 deletion.
5 changes: 5 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,11 @@
<artifactId>slf4j-simple</artifactId>
<version>${version.org.slf4j}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${version.org.slf4j}</version>
</dependency>

<!-- Arquillian/Shrinkwrap stack -->
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public Failure(String message, Throwable cause, FailureType type)
this.message = message;
this.cause = cause;
this.type = type;
this.stackTrace = cause != null ? cause : new Exception("Failed at");
this.stackTrace = cause != null ? cause : new Exception(message != null ? message : "Failed at");
}

public String getMessage()
Expand Down
14 changes: 14 additions & 0 deletions test/core/src/main/resources/pc-log4j.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
log4j.rootLogger=${log4j.level}, file, stdout

# Direct log messages to stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
log4j.appender.stdout.threshold=ERROR

# Direct log messages to a log file
log4j.appender.file=org.apache.log4j.FileAppender
log4j.appender.file.File=${gatein.test.output.path}/test.log
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
11 changes: 11 additions & 0 deletions test/servers/tomcat7/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@

<dependencies>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</dependency>

<!-- -->
<dependency>
<groupId>org.gatein.pc</groupId>
Expand Down Expand Up @@ -70,6 +75,12 @@
<excludes>
<exclude>**/EventPayloadBetweenApplicationsWarTestCase.java</exclude>
</excludes>
<systemProperties>
<property>
<name>log4j.configuration</name>
<value>pc-log4j.properties</value>
</property>
</systemProperties>
</configuration>
</execution>
</executions>
Expand Down

0 comments on commit 604fd30

Please sign in to comment.