Skip to content

Commit a435b22

Browse files
authored
[junit4] implement with a rule instead of inheritance (#326)
* [junit4] deprecate the superclass and implement with a rule * [junit4] remove obsolete code and tests * [junit4] update tags and custom data and build name * [junit4] Use a builder instead of all the constructors
1 parent 6e9aa99 commit a435b22

30 files changed

+733
-620
lines changed

.github/workflows/java.yml

+2
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ jobs:
9191
- name: Remove driver directories
9292
run: |
9393
sudo rm -rf $CHROMEWEBDRIVER $EDGEWEBDRIVER $GECKOWEBDRIVER
94+
- name: Install main bindings snapshot
95+
run: cd java/main && mvn clean package install -DskipTests -Dgpg.skip=true
9496
- name: Test with Maven
9597
env:
9698
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}

java/junit4/pom.xml

+184-167
Original file line numberDiff line numberDiff line change
@@ -2,178 +2,195 @@
22
<project xmlns="http://maven.apache.org/POM/4.0.0"
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
44
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5-
<modelVersion>4.0.0</modelVersion>
5+
<modelVersion>4.0.0</modelVersion>
66

7-
<groupId>com.saucelabs</groupId>
8-
<artifactId>saucebindings-junit4</artifactId>
9-
<version>1.6.0-SNAPSHOT</version>
10-
<name>SauceBindings JUnit4</name>
11-
<description>Provides tools for interacting with SauceLabs with JUnit 4</description>
12-
<url>https://opensource.saucelabs.com/sauce_bindings</url>
13-
<licenses>
14-
<license>
15-
<name>MIT License</name>
16-
<url>https://www.opensource.org/licenses/mit-license.php</url>
17-
<distribution>repo</distribution>
18-
</license>
19-
</licenses>
7+
<groupId>com.saucelabs</groupId>
8+
<artifactId>saucebindings-junit4</artifactId>
9+
<version>${saucebindings-junit4.version}</version>
10+
<name>SauceBindings JUnit4</name>
11+
<description>Provides tools for interacting with SauceLabs with JUnit 4</description>
12+
<url>https://opensource.saucelabs.com/sauce_bindings</url>
13+
<licenses>
14+
<license>
15+
<name>MIT License</name>
16+
<url>https://www.opensource.org/licenses/mit-license.php</url>
17+
<distribution>repo</distribution>
18+
</license>
19+
</licenses>
2020

21-
<organization>
22-
<name>Sauce Labs</name>
23-
<url>https://www.saucelabs.com/</url>
24-
</organization>
25-
<developers>
26-
<developer>
27-
<name>Titus Fortner</name>
28-
<email>[email protected]</email>
29-
<organization>Sauce Labs</organization>
30-
<organizationUrl>https://www.saucelabs.com/</organizationUrl>
31-
</developer>
32-
<developer>
33-
<name>Nikolay Advolodkin</name>
34-
<email>[email protected]</email>
35-
<organization>Sauce Labs</organization>
36-
<organizationUrl>https://www.saucelabs.com/</organizationUrl>
37-
</developer>
38-
</developers>
21+
<organization>
22+
<name>Sauce Labs</name>
23+
<url>https://www.saucelabs.com/</url>
24+
</organization>
25+
<developers>
26+
<developer>
27+
<name>Titus Fortner</name>
28+
<email>[email protected]</email>
29+
<organization>Sauce Labs</organization>
30+
<organizationUrl>https://www.saucelabs.com/</organizationUrl>
31+
</developer>
32+
<developer>
33+
<name>Nikolay Advolodkin</name>
34+
<email>[email protected]</email>
35+
<organization>Sauce Labs</organization>
36+
<organizationUrl>https://www.saucelabs.com/</organizationUrl>
37+
</developer>
38+
</developers>
3939

40-
<scm>
41-
<connection>scm:git:git://github.com/saucelabs/sauce_bindings.git</connection>
42-
<developerConnection>scm:git:[email protected]:saucelabs/sauce_bindings.git</developerConnection>
43-
<url>[email protected]:saucelabs/sauce_bindings.git</url>
44-
<tag>HEAD</tag>
45-
</scm>
40+
<scm>
41+
<connection>scm:git:git://github.com/saucelabs/sauce_bindings.git</connection>
42+
<developerConnection>scm:git:[email protected]:saucelabs/sauce_bindings.git</developerConnection>
43+
<url>[email protected]:saucelabs/sauce_bindings.git</url>
44+
<tag>HEAD</tag>
45+
</scm>
4646

47-
<properties>
48-
<maven.compiler.source>11</maven.compiler.source>
49-
<maven.compiler.target>11</maven.compiler.target>
50-
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
51-
</properties>
47+
<properties>
48+
<saucebindings-junit4.version>2.0.0-beta.1-SNAPSHOT</saucebindings-junit4.version>
49+
<surefire.parallel>8</surefire.parallel>
50+
<maven.compiler.source>11</maven.compiler.source>
51+
<maven.compiler.target>11</maven.compiler.target>
52+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
53+
</properties>
5254

53-
<dependencies>
54-
<dependency>
55-
<groupId>com.saucelabs</groupId>
56-
<artifactId>sauce_bindings</artifactId>
57-
<version>1.5.0</version>
58-
</dependency>
59-
<dependency>
60-
<groupId>junit</groupId>
61-
<artifactId>junit</artifactId>
62-
<version>4.13.2</version>
63-
</dependency>
64-
</dependencies>
55+
<dependencies>
56+
<dependency>
57+
<groupId>com.saucelabs</groupId>
58+
<artifactId>sauce_bindings</artifactId>
59+
<version>2.0.0-beta.1-SNAPSHOT</version>
60+
</dependency>
61+
<dependency>
62+
<groupId>junit</groupId>
63+
<artifactId>junit</artifactId>
64+
<version>4.13.2</version>
65+
</dependency>
66+
<dependency>
67+
<groupId>org.projectlombok</groupId>
68+
<artifactId>lombok</artifactId>
69+
<version>1.18.30</version>
70+
<scope>provided</scope>
71+
</dependency>
72+
</dependencies>
6573

66-
<build>
67-
<plugins>
68-
<plugin>
69-
<artifactId>maven-source-plugin</artifactId>
70-
<version>3.0.0</version>
71-
<executions>
72-
<execution>
73-
<id>attach-sources</id>
74-
<phase>verify</phase>
75-
<goals>
76-
<goal>jar-no-fork</goal>
77-
</goals>
78-
</execution>
79-
</executions>
80-
</plugin>
81-
<plugin>
82-
<groupId>org.apache.maven.plugins</groupId>
83-
<artifactId>maven-surefire-plugin</artifactId>
84-
<version>2.22.1</version>
85-
<configuration>
86-
<parallel>all</parallel>
87-
<threadCountMethods>50</threadCountMethods>
88-
<useUnlimitedThreads>true</useUnlimitedThreads>
89-
<redirectTestOutputToFile>false</redirectTestOutputToFile>
90-
</configuration>
91-
</plugin>
92-
<plugin>
93-
<groupId>org.apache.maven.plugins</groupId>
94-
<artifactId>maven-gpg-plugin</artifactId>
95-
<version>1.6</version>
96-
<configuration>
97-
<gpgArguments>
98-
<arg>--pinentry-mode</arg>
99-
<arg>loopback</arg>
100-
</gpgArguments>
101-
</configuration>
102-
<executions>
103-
<execution>
104-
<id>sign-artifacts</id>
105-
<phase>verify</phase>
106-
<goals>
107-
<goal>sign</goal>
108-
</goals>
109-
</execution>
110-
</executions>
111-
</plugin>
112-
<plugin>
113-
<groupId>org.sonatype.plugins</groupId>
114-
<artifactId>nexus-staging-maven-plugin</artifactId>
115-
<version>1.6.7</version>
116-
<extensions>true</extensions>
117-
<configuration>
118-
<serverId>ossrh</serverId>
119-
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
120-
<autoReleaseAfterClose>true</autoReleaseAfterClose>
121-
</configuration>
122-
</plugin>
123-
<plugin>
124-
<groupId>org.apache.maven.plugins</groupId>
125-
<artifactId>maven-release-plugin</artifactId>
126-
<version>2.5.3</version>
127-
<configuration>
128-
<goals>deploy nexus-staging:release</goals>
129-
<autoVersionSubmodules>true</autoVersionSubmodules>
130-
<useReleaseProfile>false</useReleaseProfile>
131-
<releaseProfiles>release</releaseProfiles>
132-
<goals>deploy</goals>
133-
</configuration>
134-
<dependencies>
135-
<dependency>
136-
<groupId>org.apache.maven.scm</groupId>
137-
<artifactId>maven-scm-provider-gitexe</artifactId>
138-
<version>2.1.0</version>
139-
</dependency>
140-
</dependencies>
141-
</plugin>
142-
<plugin>
143-
<groupId>org.apache.maven.plugins</groupId>
144-
<artifactId>maven-scm-plugin</artifactId>
145-
<version>1.9.4</version>
146-
</plugin>
147-
<plugin>
148-
<groupId>org.apache.maven.plugins</groupId>
149-
<artifactId>maven-javadoc-plugin</artifactId>
150-
<version>3.2.0</version>
151-
<executions>
152-
<execution>
153-
<id>attach-javadocs</id>
154-
<goals>
155-
<goal>jar</goal>
156-
</goals>
157-
</execution>
158-
</executions>
159-
<configuration>
160-
<source>8</source>
161-
<javadocExecutable>${java.home}/bin/javadoc</javadocExecutable>
162-
</configuration>
163-
</plugin>
164-
</plugins>
165-
</build>
74+
<build>
75+
<resources>
76+
<resource>
77+
<directory>src/main/resources</directory>
78+
<filtering>true</filtering>
79+
</resource>
80+
</resources>
81+
<plugins>
82+
<plugin>
83+
<artifactId>maven-source-plugin</artifactId>
84+
<version>3.0.0</version>
85+
<executions>
86+
<execution>
87+
<id>attach-sources</id>
88+
<phase>verify</phase>
89+
<goals>
90+
<goal>jar-no-fork</goal>
91+
</goals>
92+
</execution>
93+
</executions>
94+
</plugin>
95+
<plugin>
96+
<groupId>org.apache.maven.plugins</groupId>
97+
<artifactId>maven-surefire-plugin</artifactId>
98+
<version>2.22.1</version>
99+
<configuration>
100+
<includes>
101+
<include>**/*Example.java</include>
102+
</includes>
103+
<parallel>all</parallel>
104+
<threadCountMethods>${surefire.parallel}</threadCountMethods>
105+
<useUnlimitedThreads>true</useUnlimitedThreads>
106+
<redirectTestOutputToFile>false</redirectTestOutputToFile>
107+
</configuration>
108+
</plugin>
109+
<plugin>
110+
<groupId>org.apache.maven.plugins</groupId>
111+
<artifactId>maven-gpg-plugin</artifactId>
112+
<version>1.6</version>
113+
<configuration>
114+
<gpgArguments>
115+
<arg>--pinentry-mode</arg>
116+
<arg>loopback</arg>
117+
</gpgArguments>
118+
</configuration>
119+
<executions>
120+
<execution>
121+
<id>sign-artifacts</id>
122+
<phase>verify</phase>
123+
<goals>
124+
<goal>sign</goal>
125+
</goals>
126+
</execution>
127+
</executions>
128+
</plugin>
129+
<plugin>
130+
<groupId>org.sonatype.plugins</groupId>
131+
<artifactId>nexus-staging-maven-plugin</artifactId>
132+
<version>1.6.7</version>
133+
<extensions>true</extensions>
134+
<configuration>
135+
<serverId>ossrh</serverId>
136+
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
137+
<autoReleaseAfterClose>true</autoReleaseAfterClose>
138+
</configuration>
139+
</plugin>
140+
<plugin>
141+
<groupId>org.apache.maven.plugins</groupId>
142+
<artifactId>maven-release-plugin</artifactId>
143+
<version>2.5.3</version>
144+
<configuration>
145+
<goals>deploy nexus-staging:release</goals>
146+
<autoVersionSubmodules>true</autoVersionSubmodules>
147+
<useReleaseProfile>false</useReleaseProfile>
148+
<releaseProfiles>release</releaseProfiles>
149+
<goals>deploy</goals>
150+
</configuration>
151+
<dependencies>
152+
<dependency>
153+
<groupId>org.apache.maven.scm</groupId>
154+
<artifactId>maven-scm-provider-gitexe</artifactId>
155+
<version>2.0.1</version>
156+
</dependency>
157+
</dependencies>
158+
</plugin>
159+
<plugin>
160+
<groupId>org.apache.maven.plugins</groupId>
161+
<artifactId>maven-scm-plugin</artifactId>
162+
<version>1.9.4</version>
163+
</plugin>
164+
<plugin>
165+
<groupId>org.apache.maven.plugins</groupId>
166+
<artifactId>maven-javadoc-plugin</artifactId>
167+
<version>3.2.0</version>
168+
<executions>
169+
<execution>
170+
<id>attach-javadocs</id>
171+
<goals>
172+
<goal>jar</goal>
173+
</goals>
174+
</execution>
175+
</executions>
176+
<configuration>
177+
<source>8</source>
178+
<javadocExecutable>${java.home}/bin/javadoc</javadocExecutable>
179+
</configuration>
180+
</plugin>
181+
</plugins>
182+
</build>
166183

167-
<distributionManagement>
168-
<snapshotRepository>
169-
<id>ossrh</id>
170-
<name>Nexus Release Repository</name>
171-
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
172-
</snapshotRepository>
173-
<repository>
174-
<id>ossrh</id>
175-
<name>Nexus Release Repository</name>
176-
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
177-
</repository>
178-
</distributionManagement>
184+
<distributionManagement>
185+
<snapshotRepository>
186+
<id>ossrh</id>
187+
<name>Nexus Release Repository</name>
188+
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
189+
</snapshotRepository>
190+
<repository>
191+
<id>ossrh</id>
192+
<name>Nexus Release Repository</name>
193+
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
194+
</repository>
195+
</distributionManagement>
179196
</project>

0 commit comments

Comments
 (0)