Код: Выделить всё
public class FooThread extends Thread {
TestRunner runner;
Foo foo;
public void run() {
initSomeThreadLocalStuff(); // inits foo and runner
runner.runJUnitTests(); // JUnitCore.runTest(TestClass)
}
private void initSomeThreadLocalStuff() {
foo = new Foo(this);
// ...
}
}
public class Foo() {
public Foo(FooThread t) {
// ...
}
}
Подробнее здесь: https://stackoverflow.com/questions/279 ... junit-test
Мобильная версия