English 中文(简体)
失踪的“Run”作为Junnit试验
原标题:Missing "Run as JUnit Test"

我在Eclipse中通过在贾瓦班上进行右翼扫描和选择新日尼特试验场,进行了第4号日子试验。 当我右翼插座时,I号试验舱“在服务器上的Run”,但不是“作为Junnit测试的Run”。 我正在使用Eclipse 3.6.1。

问题回答

在我的案件中,Eclipse必须达到一个腐败的国家。 重新启动Eclipse将这一问题固定下来。

我认为我会看到这个问题。 在Eclipse将其确定为测试案例之前,你需要在档案中进行实际测试。 插入:

@Test
public void foo() {

}

建造道路和项目方面需要Jnit5 jdk8。

  1. (d) 确保贵班级有星号(从<条码>中摘录)

  2. 右翼“Run As”-> “Run Conciguration” -> 从左边“JUnit”进行JUSG测试;

  1. check whether you have jave 8 or above and configured correct jdk in build path.
  2. check at least @Test is used in your test case class file
  3. Then go to run configuration->select Junit->right click and new configuration->browse the package->select junit5 as test runner.

“entergraph

如果你在Maven项目中体验到,则在使用Alt+F5的pom.xml和重载项目后添加。 由于旧的JDK版本,测试并不奏效。

<properties>
    <maven.compiler.target>1.8</maven.compiler.target>
    <maven.compiler.source>1.8</maven.compiler.source>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

确保有一个有效的违约构造者,供你测试。

就我而言,问题有所不同。 我正在将全国测试转换为Junnit。 测试组的进口满足了@试验说明,但这是错误的说明。 我删除了“试验国家”进口,并添加了“Junnit”进口用于“试验”的选项,以及像“Junnit”测试一样运行的右翼菜单。

The eclipse shortcut to run Junit test is Alt+Shift+X, T. If its not working just press Alt+shift+X a menu will popup just look for Junit.

我在将现有项目输入Kepler-based Eclipse IDEJava开发商版本时,就遇到了这些症状。

将该项目输入一个Luna-based Eclipse IDE, 用于Java EEDevelopments<>>>>>/em>,正确地将其归入一个 Java项目(项目icon现在包括很少J),现在允许进行Junnit测试。

在我的案件中, Java建路(.classpath文档)腐败。 尤其是,冲突交织在一起,没有解决。 因此,JUS4图书馆失踪。

我曾经有过同样的问题,而是因为我在宣言中“Class To BeedSpec”之后就放弃了“扩展规格”。

Make sure that you include import org.junit.Test; and the tests have @Test before them, I have missed that before when coping some functions from other files.

To solve the situation, a restart of eclipse wasn´t enough in my case, I had to remove and re-add the project to my workspace as well.

If, the configuration is of SpringRunner.class for Junit. Make sure your maven clean install with maven update and refresh is run in your project with right jdk and mavens password/configuration.

对我来说,这次是,Junit只是 class上了阶级(但过去曾经是过)。 这是我使用Junit 5的第一个Eclipse项目。 难道这可以做些什么? 我知道这是一个非常老的职位,但我认为,由于最近的原因,可能需要这样做。

  • Right-click your project and choose properties
  • choose Build Path -> Configure Build Path
  • Click on Libraries tab.
  • Click on Add Library button.
  • Click on JUnit and Next button.
  • Choose JUnit version. (for me, Junit 5)
  • Click Finish.

Info From https://www.eclipse.org/forums/index.php/t/304679/





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签