-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
264a149
commit f7af2c8
Showing
6 changed files
with
57 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,7 @@ Thread.sleep(100); | |
|
||
synchronized (a) { | ||
a.notify(); | ||
|
||
// Block forever | ||
Thread.sleep(60000); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
test-utils/src/main/java/com/github/olivergondza/dumpling/DumplingMatchers.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.github.olivergondza.dumpling; | ||
|
||
import org.hamcrest.Description; | ||
import org.hamcrest.TypeSafeMatcher; | ||
|
||
import java.util.Objects; | ||
|
||
public class DumplingMatchers { | ||
|
||
public static TypeSafeMatcher<StackTraceElement> frameOf(String cls, String method, String source) { | ||
return new TypeSafeMatcher<StackTraceElement>() { | ||
@Override | ||
protected boolean matchesSafely(StackTraceElement item) { | ||
if (!Objects.equals(cls, item.getClassName())) return false; | ||
if (!Objects.equals(method, item.getMethodName())) return false; | ||
if (source != null && !Objects.equals(source, item.getFileName())) return false; | ||
|
||
return true; | ||
} | ||
|
||
@Override | ||
public void describeTo(Description description) { | ||
StackTraceElement expected = new StackTraceElement(cls, method, source, -1); | ||
description.appendText("Stack frame of ").appendValue(expected); | ||
} | ||
}; | ||
} | ||
} |