Skip to content

Commit

Permalink
Important change in structure to make all tests run with JUnit5 frame…
Browse files Browse the repository at this point in the history
…work, including all Cucumber tests (that used to work with JUnit4 only).
  • Loading branch information
tommens committed Feb 22, 2023
1 parent df3c512 commit f81ee78
Show file tree
Hide file tree
Showing 14 changed files with 56 additions and 744 deletions.
83 changes: 54 additions & 29 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,58 +1,75 @@
<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">
<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>calculator</groupId>
<artifactId>calculator-cucumber</artifactId>
<version>0.4.3</version>
<packaging>jar</packaging>
<name>Calculator with Cucumber tests</name>
<version>0.5.0</version>
<name>Calculator with JUnit5 and Cucumber tests</name>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<project.encoding>UTF-8</project.encoding>
<project.build.sourceEncoding>${project.encoding}</project.build.sourceEncoding>
<project.reporting.outputEncoding>${project.encoding}</project.reporting.outputEncoding>

<slf4j.version>2.0.6</slf4j.version>
<logback.version>1.4.5</logback.version>
<java.version>17</java.version>
<junit.version>5.9.2</junit.version>
<junit-jupiter.version>5.9.2</junit-jupiter.version>
<junit-platform-suite.version>1.9.2</junit-platform-suite.version>
<cucumber.version>7.11.1</cucumber.version>
<maven.compiler.version>3.10.1</maven.compiler.version>
<maven.surefire.version>2.22.2</maven.surefire.version>
<jacoco.version>0.8.8</jacoco.version>
<javadoc.version>3.5.0</javadoc.version>
<javadoc.version>3.4.1</javadoc.version>
<sonar.organization>tommens</sonar.organization>
<sonar.host.url>https://sonarcloud.io</sonar.host.url>

<maven.compiler.target>${java.version}</maven.compiler.target>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.version>3.10.1</maven.compiler.version>
<maven.surefire.version>2.22.2</maven.surefire.version>
<maven-surefire-plugin.version>3.0.0-M9</maven-surefire-plugin.version>

</properties>

<dependencies>

<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java</artifactId>
<version>${cucumber.version}</version>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>${junit-jupiter.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-junit</artifactId>
<version>${cucumber.version}</version>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-suite</artifactId>
<version>${junit-platform-suite.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>${junit.version}</version>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java</artifactId>
<version>${cucumber.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>${junit.version}</version>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-junit-platform-engine</artifactId>
<version>${cucumber.version}</version>
<scope>test</scope>
</dependency>

</dependencies>

<!--
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
</plugin>
</plugins>
</build>-->

<build>
<plugins>
<plugin>
Expand All @@ -69,6 +86,13 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven.surefire.version}</version>
<configuration>
<properties>
<configurationParameters>
cucumber.junit-platform.naming-strategy=long
</configurationParameters>
</properties>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
Expand Down Expand Up @@ -129,4 +153,5 @@
</plugin>
</plugins>
</build>
</project>

</project>
4 changes: 2 additions & 2 deletions src/main/java/calculator/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
/**
* A very simple calculator in Java
* University of Mons - UMONS
* Département d'Informatique
* Faculté des Sciences
* Software Engineering Lab
* Faculty of Sciences
*
* @author tommens
*/
Expand Down
115 changes: 0 additions & 115 deletions src/test/java/cucumbertests/CalculatorSteps.java

This file was deleted.

12 changes: 0 additions & 12 deletions src/test/java/cucumbertests/RunCucumberTest.java

This file was deleted.

66 changes: 0 additions & 66 deletions src/test/java/junit5tests/TestCounting.java

This file was deleted.

Loading

0 comments on commit f81ee78

Please sign in to comment.