Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: separation of unit tests into junit4/junit5 (#1363) #1558

Merged
merged 4 commits into from
Oct 27, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,14 @@
</properties>
<modules>
<module>vaadin-testbench-bom</module>
<module>vaadin-testbench-unit</module>
<module>vaadin-testbench-core</module>
<module>vaadin-testbench-integration-tests</module>
<module>vaadin-testbench-shared</module>
<module>vaadin-testbench-core</module>
<module>vaadin-testbench-core-junit5</module>
<module>vaadin-testbench-integration-tests</module>
<module>vaadin-testbench-integration-tests-junit5</module>
<module>vaadin-testbench-unit-shared</module>
<module>vaadin-testbench-unit</module>
<module>vaadin-testbench-unit-junit5</module>
</modules>
<repositories>
<repository>
Expand Down
8 changes: 1 addition & 7 deletions vaadin-testbench-core-junit5/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -242,14 +242,8 @@

<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-testbench-unit</artifactId>
<artifactId>vaadin-testbench-unit-junit5</artifactId>
<version>${project.version}</version>
<exclusions>
<exclusion>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
Expand Down
363 changes: 363 additions & 0 deletions vaadin-testbench-unit-junit5/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,363 @@
<?xml version="1.0" encoding="UTF-8"?>
<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>
<parent>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-testbench-parent</artifactId>
<version>9.0-SNAPSHOT</version>
</parent>
<artifactId>vaadin-testbench-unit-junit5</artifactId>
<packaging>jar</packaging>
<name>Vaadin Testbench UI Unit Test JUnit5</name>
<description>Vaadin Testbench UI Unit Tests JUnit5</description>
<url>http://vaadin.com</url>
<inceptionYear>2022</inceptionYear>

<repositories>
<repository>
<id>vaadin-prereleases</id>
<url>https://maven.vaadin.com/vaadin-prereleases/</url>
</repository>
</repositories>

<licenses>
<license>
<name>Commercial Vaadin Developer License version 4.0</name>
<url>https://vaadin.com/license/cvdl-4.0</url>
<distribution>manual</distribution>
</license>
</licenses>

<properties>
<kotlin.version>1.6.21</kotlin.version>
<dokka.version>1.6.21</dokka.version>
<vaadin.version>24.0-SNAPSHOT</vaadin.version>
<junit5.version>5.9.1</junit5.version>
</properties>

<profiles>
<profile>
<id>dokka-javadocs</id>
<activation>
<property>
<name>testbench.javadocs</name>
</property>
</activation>
<properties>
<maven.javadoc.skip>true</maven.javadoc.skip>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.jetbrains.dokka</groupId>
<artifactId>dokka-maven-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>javadoc</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>org.jetbrains.dokka</groupId>
<artifactId>dokka-maven-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>javadocJar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.2</version>
<configuration>
<archive>
<index>true</index>
<manifest>
<addClasspath>true</addClasspath>
<!-- Implementation-Title and Implementation-Version
come from the POM by default -->
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest>
<manifestEntries>
<!-- Package format version - do not
change -->
<Vaadin-Package-Version>1</Vaadin-Package-Version>
</manifestEntries>
</archive>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>

<plugins>
<!--
To compile projects that include Kotlin and Java source code, the Kotlin compiler should run before
the Java compiler.
That means that kotlin-maven-plugin definition must be placed before maven-compiler-plugin
-->
<plugin>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-plugin</artifactId>
<version>${kotlin.version}</version>
<executions>
<execution>
<id>compile</id>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<sourceDirs>
<sourceDir>${project.basedir}/src/main/kotlin</sourceDir>
<sourceDir>${project.basedir}/src/main/java</sourceDir>
</sourceDirs>
</configuration>
</execution>
<execution>
<id>test-compile</id>
<goals>
<goal>test-compile</goal>
</goals>
<configuration>
<sourceDirs>
<sourceDir>${project.basedir}/src/test/kotlin</sourceDir>
<sourceDir>${project.basedir}/src/test/java</sourceDir>
</sourceDirs>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.9.0</version>
<executions>
<!-- Replacing default-compile as it is treated specially by maven -->
<execution>
<id>default-compile</id>
<phase>none</phase>
</execution>
<!-- Replacing default-testCompile as it is treated specially by maven -->
<execution>
<id>default-testCompile</id>
<phase>none</phase>
</execution>
<execution>
<id>java-compile</id>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>java-test-compile</id>
<phase>test-compile</phase>
<goals>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.jetbrains.dokka</groupId>
<artifactId>dokka-maven-plugin</artifactId>
<version>${dokka.version}</version>
<configuration>
<jdkVersion>${maven.compiler.source}</jdkVersion>
<sourceDirectories>
<sourceDirectory>${project.basedir}/src/main/java</sourceDirectory>
<sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
</sourceDirectories>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.3.0</version>
<executions>
<execution>
<id>add-kotlin-sources-for-source-jar</id>
<phase>package</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>src/main/kotlin</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M7</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>3.0.0-M7</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.mycila</groupId>
<artifactId>license-maven-plugin</artifactId>
<version>2.6</version>
<configuration>
<basedir>${basedir}</basedir>
<header>${basedir}/src/license/cvdl4/header.txt</header>
<quiet>false</quiet>
<failIfMissing>true</failIfMissing>
<aggregate>false</aggregate>
<useDefaultExcludes>true</useDefaultExcludes>
<useDefaultMapping>true</useDefaultMapping>
<encoding>UTF-8</encoding>
<properties>
<year>${project.inceptionYear}</year>
</properties>
<excludes>
<exclude>target/**</exclude>
<exclude>**/*.xml</exclude>
<exclude>src/license/**/*</exclude>
<exclude>**/*.txt</exclude>
</excludes>
</configuration>
<executions>
<execution>
<goals>
<goal>format</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin</artifactId>
<version>${vaadin.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-spring</artifactId>
<version>${vaadin.version}</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>

<dependency>
<groupId>com.github.mvysny.dynatest</groupId>
<artifactId>dynatest</artifactId>
<version>0.24</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.mvysny.karibudsl</groupId>
<artifactId>karibu-dsl</artifactId>
<version>1.0.8</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-testbench-unit-shared</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>${junit5.version}</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>${junit5.version}</version>
</dependency>

<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-jdk8</artifactId>
<version>${kotlin.version}</version>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-reflect</artifactId>
<version>${kotlin.version}</version>
</dependency>


<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>6.0.0-M6</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>6.0.0-M7</version>
MarcinVaadin marked this conversation as resolved.
Show resolved Hide resolved
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
<version>6.0.0-M7</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>

</dependencies>

</project>
Loading