Skip to content

Commit

Permalink
Finally got POMs right for junit5 and cucumber I think. No cucumber w…
Browse files Browse the repository at this point in the history
…arnings.
  • Loading branch information
heymumford committed Oct 7, 2024
1 parent c0b3005 commit ce80e94
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 87 deletions.
61 changes: 22 additions & 39 deletions Samstraumr-v0.2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,18 @@
<java.version>21</java.version>
<maven.compiler.release>${java.version}</maven.compiler.release>

<!-- List all product versions in this parent POM, not in child POMs -->
<!-- Dependency Versions -->
<slf4j.version>2.0.16</slf4j.version>
<log4j.version>2.24.0</log4j.version>
<oshi-core.version>6.6.5</oshi-core.version> <!-- Java 11+ compatible -->
<oshi-core.version>6.6.5</oshi-core.version>
<jackson-databind.version>2.18.0</jackson-databind.version>
<jackson-core.version>2.18.0</jackson-core.version>
<junit.version>5.11.2</junit.version>
<junit-platform-suite-api.version>1.11.2</junit-platform-suite-api.version>
<junit-platform-console-standalone.version>1.11.2</junit-platform-console-standalone.version>
<mockito.version>3.9.0</mockito.version>
<cucumber-java.version>7.20.0</cucumber-java.version>
<cucumber-junit.version>5.0.0</cucumber-junit.version>
<cucumber-junit-platform-engine.version>7.20.0</cucumber-junit-platform-engine.version>
<junit-platform.version>1.11.2</junit-platform.version>
<mockito.version>5.11.0</mockito.version>
<cucumber.version>7.15.0</cucumber.version>
<maven.compiler.plugin.version>3.13.0</maven.compiler.plugin.version>
<maven.surefire.plugin.version>3.5.0</maven.surefire.plugin.version>
<maven.surefire.plugin.version>3.2.5</maven.surefire.plugin.version>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -78,50 +75,34 @@
<!-- Testing Dependencies (JUnit, Mockito, Cucumber) -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>${junit.version}</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<artifactId>junit-jupiter</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-suite-api</artifactId>
<version>${junit-platform-suite-api.version}</version>
<artifactId>junit-platform-suite</artifactId>
<version>${junit-platform.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java</artifactId>
<version>${cucumber-java.version}</version>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-junit</artifactId>
<version>${cucumber-junit.version}</version>
<version>${cucumber.version}</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-junit-platform-engine -->
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-junit-platform-engine</artifactId>
<version>${cucumber-junit-platform-engine.version}</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.junit.platform/junit-platform-console-standalone -->
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-console-standalone</artifactId>
<version>${junit-platform-console-standalone.version}</version>
<version>${cucumber.version}</version>
<scope>test</scope>
</dependency>


</dependencies>
</dependencyManagement>

Expand All @@ -144,13 +125,15 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven.surefire.plugin.version}</version>
<configuration>
<testFailureIgnore>false</testFailureIgnore> <!-- Fail the build if tests fail -->
<includes>
<include>**/*Test.java</include>
</includes>
<properties>
<configurationParameters>
cucumber.junit-platform.naming-strategy=long
cucumber.plugin=pretty
</configurationParameters>
</properties>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
</project>
68 changes: 23 additions & 45 deletions Samstraumr-v0.2/samstraumr-core/pom.xml
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<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>

<artifactId>samstraumr-core</artifactId>
<packaging>jar</packaging>
<version>0.2a</version>

<parent>
<groupId>org.samstraumr</groupId>
<artifactId>samstraumr-framework</artifactId>
<version>0.2</version>
</parent>

<dependencies>
<!-- This is a child POM. Version numbers belong only in parent POM. -->
<artifactId>samstraumr-core</artifactId>
<packaging>jar</packaging>
<name>Samstraumr Core</name>

<dependencies>
<!-- Logging -->
<dependency>
<groupId>org.slf4j</groupId>
Expand All @@ -23,20 +22,22 @@
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j2-impl</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<scope>runtime</scope>
</dependency>

<!-- JSON handling with Jackson -->
<!-- Jackson for JSON serialization -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<artifactId>jackson-core</artifactId>
</dependency>

<!-- OSHI for system information -->
Expand All @@ -45,67 +46,44 @@
<artifactId>oshi-core</artifactId>
</dependency>

<!-- Testing dependencies -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>
<!-- Testing -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-suite-api</artifactId>
<artifactId>junit-platform-suite</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-junit-platform-engine</artifactId>
<artifactId>cucumber-java</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-console-standalone</artifactId>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-junit-platform-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java</artifactId>
<scope>test</scope>
</dependency>


</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<includes>
<include>**/*Test.java</include>
<include>**/*IT.java</include>
</includes>
<properties>
<configurationParameters>
cucumber.junit-platform.naming-strategy=long
cucumber.glue=org.samstraumr.tube.steps
cucumber.features=src/test/resources/tube/features
</configurationParameters>

</properties>
</configuration>
</plugin>

</plugins>
</build>

</project>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ public void the_Tube_should_log_the_reason(String reason) {
assertTrue(log.contains(reason)); // Ensure the reason is logged
}

@Then("the Tube's log should be queryable")
public void the_Tube_s_log_should_be_queryable() {
@Then("the Tube log should be queryable")
public void the_Tube_log_should_be_queryable() {
assertFalse(testTube.queryMimirLog().isEmpty()); // Ensure the log is populated and queryable
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ Feature: Tube Initialization and Logging
Then the Tube should initialize with a unique UUID
And the Tube should log its environment details
And the Tube should log the reason "Test Initialization"
And the Tube's log should be queryable
And the Tube log should be queryable

0 comments on commit ce80e94

Please sign in to comment.