我在Espresso库上为自定义组件编写UI测试.我有单独的类,扩展ActivityInstrumentationTestCase2<MyActivityDebug>,对于每一个组件,例如:CheckBoxTest,EditTextTest,SelectorText...现在我单独运行测试过.帮助我,我如何从一个地方为所有课程一次性运行所有测试?
我在Otherclass类中有方法test(),它返回String结果:
public class Otherclass {
int i = 0;
public String test()
{
Thread t = new Thread(new Runnable() {
@Override
public void run() {
System.out.println("GoToThread");
while(i < 10) {
i++;
System.out.println("value "+i);
try {
Thread.sleep(500);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
});
t.start();
String result = "result value i = "+i;
return result;
}
}
Run Code Online (Sandbox Code Playgroud)
我从主类调用此方法
Otherclass oc = new Otherclass();
System.out.println(oc.test());
Run Code Online (Sandbox Code Playgroud)
并希望得到结果为result value i = 10
但是在返回methos …