Skip to content

Commit 53c3515

Browse files
authored
[testng] implement as a test listener instead of requiring inheritance (#331)
* [testng] implement as a test listener instead of requiring inheritance * [testng] delete deprecated classes and prep for 2.0 beta * [testng] revamp the listener to take the configuration information as part of startSession instead of requiring static setters * [testng] revamp listener again to use a SessionContext class to do the heavy lifting * [testng] need to support any superclass setting the listener
1 parent a435b22 commit 53c3515

26 files changed

+755
-644
lines changed

.github/workflows/java.yml

+2
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,8 @@ jobs:
138138
- name: Remove driver directories
139139
run: |
140140
sudo rm -rf $CHROMEWEBDRIVER $EDGEWEBDRIVER $GECKOWEBDRIVER
141+
- name: Install main bindings snapshot
142+
run: cd java/main && mvn clean package install -DskipTests -Dgpg.skip=true
141143
- name: Test with Maven
142144
env:
143145
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}

java/testng/pom.xml

+205-166
Original file line numberDiff line numberDiff line change
@@ -2,178 +2,217 @@
22
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
33
xmlns="http://maven.apache.org/POM/4.0.0"
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-testng</artifactId>
9-
<version>1.6.0-SNAPSHOT</version>
10-
<name>SauceBindings TestNG</name>
11-
<description>Provides tools for interacting with SauceLabs with TestNG</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-testng</artifactId>
9+
<version>${saucebindings-testng.version}</version>
10+
<name>SauceBindings TestNG</name>
11+
<description>Provides tools for interacting with SauceLabs with TestNG</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>http://www.saucelabs.com/</url>
24-
</organization>
21+
<organization>
22+
<name>Sauce Labs</name>
23+
<url>http://www.saucelabs.com/</url>
24+
</organization>
2525

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

41-
<properties>
42-
<maven.compiler.source>11</maven.compiler.source>
43-
<maven.compiler.target>11</maven.compiler.target>
44-
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
45-
</properties>
41+
<properties>
42+
<saucebindings-testng.version>2.0.0-beta.1-SNAPSHOT</saucebindings-testng.version>
43+
<surefire.parallel>8</surefire.parallel>
44+
<maven.compiler.source>11</maven.compiler.source>
45+
<maven.compiler.target>11</maven.compiler.target>
46+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
47+
</properties>
4648

47-
<scm>
48-
<connection>scm:git:git://github.com/saucelabs/sauce_bindings.git</connection>
49-
<developerConnection>scm:git:[email protected]:saucelabs/sauce_bindings.git</developerConnection>
50-
<url>[email protected]:saucelabs/sauce_bindings.git</url>
51-
<tag>HEAD</tag>
52-
</scm>
49+
<scm>
50+
<connection>scm:git:git://github.com/saucelabs/sauce_bindings.git</connection>
51+
<developerConnection>scm:git:[email protected]:saucelabs/sauce_bindings.git</developerConnection>
52+
<url>[email protected]:saucelabs/sauce_bindings.git</url>
53+
<tag>HEAD</tag>
54+
</scm>
5355

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

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

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>
206+
<distributionManagement>
207+
<snapshotRepository>
208+
<id>ossrh</id>
209+
<name>Nexus Release Repository</name>
210+
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
211+
</snapshotRepository>
212+
<repository>
213+
<id>ossrh</id>
214+
<name>Nexus Release Repository</name>
215+
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
216+
</repository>
217+
</distributionManagement>
179218
</project>

0 commit comments

Comments
 (0)