小编Oni*_*uka的帖子

黄瓜junit runner java.lang.NoSuchMethodError:

试图实施黄瓜做一些自动化测试.jUnit测试.我创建了2个文件并编辑了maven项目附带的pom.xml来添加依赖项.内容如下所示.两个文件中的第一个是黄瓜.feature文件,它是简单语言的小黄瓜.另一个是CukesRunner.java

当我使用Project -> Run as ... -> Maven test它运行我的测试它按预期工作.

但是,当我使用Eclipse Eclipse JUnit GUI运行CukesRunner.java文件时,出现错误:

java.lang.NoSuchMethodError: org.junit.runner.Description.createSuiteDescription(Ljava/lang/String;Ljava/io/Serializable;[Ljava/lang/annotation/Annotation;)Lorg/junit/runner/Description;
    at cucumber.runtime.junit.FeatureRunner.getDescription(FeatureRunner.java:43)
    at cucumber.api.junit.Cucumber.describeChild(Cucumber.java:77)
    at cucumber.api.junit.Cucumber.describeChild(Cucumber.java:41)
    at org.junit.runners.ParentRunner.getDescription(ParentRunner.java:226)
    ... 
Run Code Online (Sandbox Code Playgroud)

pom.xml中:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>com.bdd</groupId>
  <artifactId>airportparking</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>jar</packaging>

  <name>airportparking</name>
  <url>http://maven.apache.org</url>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <dependencies>
        <dependency>
            <groupId>info.cukes</groupId>
            <artifactId>cucumber-java</artifactId>
            <version>1.1.5</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>info.cukes</groupId>
            <artifactId>cucumber-junit</artifactId>
            <version>1.1.5</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.rubiconproject.oss</groupId>
            <artifactId>jchronic</artifactId>
            <version>0.2.6</version>
            <scope>test</scope>
        </dependency>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.8.2</version>
        <scope>test</scope>
    </dependency>
  </dependencies>
</project>
Run Code Online (Sandbox Code Playgroud)


CukesRunner.java:

package com.bdd.airportparking;

import cucumber.api.junit.*;
import org.junit.runner.RunWith;

@RunWith(Cucumber.class)
@Cucumber.Options(
        format={"pretty", "html:target/cucumber"}, …
Run Code Online (Sandbox Code Playgroud)

java junit cucumber maven cucumber-jvm

7
推荐指数
1
解决办法
2万
查看次数

TDD和单元测试,GML Game Maker语言

我是GML和TDD的超级n00bs.我想对Game Maker Language,GML进行测试驱动开发和单元测试.是否可能因为GML是事件驱动的?我没有找到很多关于如何在GML中实现单元测试和测试驱动开发的示例或教程的财富.

你如何用游戏制作者语言编写单元测试?

tdd unit-testing gml

5
推荐指数
1
解决办法
890
查看次数

标签 统计

cucumber ×1

cucumber-jvm ×1

gml ×1

java ×1

junit ×1

maven ×1

tdd ×1

unit-testing ×1