mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-15 04:18:53 +01:00
Added a connection registry to avoid creating redundant connections.
This commit is contained in:
19
test/net/sf/briar/BriarTestCase.java
Normal file
19
test/net/sf/briar/BriarTestCase.java
Normal file
@@ -0,0 +1,19 @@
|
||||
package net.sf.briar;
|
||||
|
||||
import java.lang.Thread.UncaughtExceptionHandler;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
public abstract class BriarTestCase extends TestCase {
|
||||
|
||||
public BriarTestCase() {
|
||||
super();
|
||||
// Ensure exceptions thrown on worker threads cause tests to fail
|
||||
UncaughtExceptionHandler fail = new UncaughtExceptionHandler() {
|
||||
public void uncaughtException(Thread thread, Throwable throwable) {
|
||||
fail();
|
||||
}
|
||||
};
|
||||
Thread.setDefaultUncaughtExceptionHandler(fail);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user