android studio上的Junit测试调用Device chooser对话框

时间:2016-01-12 07:55:20

标签: java android junit android-testing

我正在尝试在我的app模块中对我的一个类方法运行junit测试,但每次运行测试时,调用设备选择器对话框 INSTEAD运行并打印我的测试结果控制台

注意:我还在构建变体窗口中将测试工件值更改为单元测试

这是我的班级

public class ManTest{

    @Test
    public void testAddData(){
        //code here
        System.out.println("should print data on the console");
    }
}

此类位置为 app / src / test / java / me.app / ManTest.java

这是我的app.gradle

repositories(){
    mavenCentral()
}

dependencies{
    testCompile 'junit:junit:4.12'
    testCompile "org.mockito:mockito-core:1.9.5"
}

我在哪里做错了或在测试设置中缺少什么?

0 个答案:

没有答案