Skip to content

Commit

Permalink
Fix ThrowableProxy unit tests
Browse files Browse the repository at this point in the history
Modified the regex patterns in RootCauseFirstThrowableProxyTest and
ExtendedThrowableProxyTest to find any packaging info in the throwable's
stack trace, including inexact matches.

On Cloudbees Jenkins, these tests were failing because they were looking
for an exact match of the JUnit package but only found an inexact one.
  • Loading branch information
tony19 committed Sep 13, 2013
1 parent 5d62ee9 commit dcfb0a0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Expand Up @@ -65,7 +65,7 @@ public void integration() {
String res = pl.doLayout(e);

// make sure that at least some package data was output
Pattern p = Pattern.compile(" \\[junit.*\\]");
Pattern p = Pattern.compile("\\s*at .*?\\[.*?\\]");
Matcher m = p.matcher(res);
int i = 0;
while(m.find()) {
Expand Down
Expand Up @@ -19,6 +19,7 @@
import ch.qos.logback.classic.PatternLayout;
import ch.qos.logback.classic.spi.ILoggingEvent;
import ch.qos.logback.classic.spi.LoggingEvent;

import org.junit.Before;
import org.junit.Test;

Expand Down Expand Up @@ -68,7 +69,7 @@ public void integration() {

//then
// make sure that at least some package data was output
Pattern p = Pattern.compile(" \\[junit.*\\]");
Pattern p = Pattern.compile("\\s*at .*?\\[.*?\\]");
Matcher m = p.matcher(result);
int i = 0;
while(m.find()) {
Expand Down

0 comments on commit dcfb0a0

Please sign in to comment.