右键单击包并选择Run Tests...将导致消息No tests were found。在Android的早期版本中,我们找到了我的测试,并将使用此方法运行。单独运行测试类似乎仍然有效。我尝试过Invalidate Cache / Restart,但仍然遇到同样的问题。
日志:
---- IntelliJ IDEA coverage runner ----
sampling ...
include patterns:
exclude patterns:0 test classes found in package '<default package>'
Pro
我试图像这样运行一个单元测试:
@org.junit.jupiter.api.Test
void junit5codeCoverage() {
final int result = new Foo().junit5();
Assert.assertEquals(Looper.getMainLooper().getThread(), Thread.currentThread());
assertEquals(-1, result);
}
这是一个带有Android依赖项的Junit5测试(即Looper.getMainL
我有一个包含多个测试方法的测试类,我想根据一些标准对它们进行分组。为此,在方法级别上使用JUnit的@Category注释似乎是一个很好的解决方案:
public class TestClass {
@Test
@Category(AssignmentServiceCategory.class)
public void testMethod1() {}
@Test
@Category(OtherCategory.class)
public void testMethod2() {}
}
我想在IntelliJ中为这些单独的类别创建不同的运行配置
我正在使用IntelliJ在Java9中构建一个spring引导项目,但是每当我使用@SpringBootTest或@DataJpaTest时,我都会得到@SpringBootTest。
在此之后,我在--add-modules=java.xml.bind运行配置- VM options中添加了--add-modules=java.xml.bind,它修复了问题,但只针对我添加它的运行配置。
现在,我有了多个使用@SpringBootTest或@DataJpaTest的测试类,如果我手动地将--add-modules=java.xml.bind添加到每个运行配置中,那么每个测试类都可以单独工作
我想在安多伊德工作室做一些单元测试。在“运行配置”-tab中,我已经完成了它,以便JUnit在整个项目中搜索测试。我的JRE配置为1.8,我已经启用了代码覆盖。但是,每次尝试运行测试时,都会得到以下"IDE致命错误“:
Unable to determine list of modules to build
java.lang.IllegalStateException: Unable to determine list of modules to build
at com.android.tools.idea.gradle.run.MakeBeforeRunTaskProvi
在IntelliJ集成开发环境中运行Geb测试时,我得到了以下错误。
org.codehaus.groovy.runtime.InvokerInvocationException: groovy.lang.MissingMethodException: No signature of method: features.step_definitions.MyHomeStepDef.to() is applicable for argument types: (java.lang.Class) values: [class geb.pages.MyLandingPage]
Possible sol