-
Notifications
You must be signed in to change notification settings - Fork 7
feat: support testng 7.8 #128
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
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
187963e
feat: #127 support testng 7.8
xuqingtan 2cae6a3
ci: disable build with java8 as testng 7.6+ requires java11
xuqingtan cf43202
ci: bump version to 1.5.0-SNAPSHOT
xuqingtan 0fd15e1
feat: #127 support testng 7.8
xuqingtan 835e326
Revert "ci: bump version to 1.5.0-SNAPSHOT"
xuqingtan 0697cdf
Merge branch 'master' into fix/127
xuqingtan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| <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/maven-v4_0_0.xsd"> | ||
| <modelVersion>4.0.0</modelVersion> | ||
|
|
||
| <parent> | ||
| <groupId>org.testng.testng-remote</groupId> | ||
| <artifactId>testng-remote-parent</artifactId> | ||
| <version>1.4.1-SNAPSHOT</version> | ||
| </parent> | ||
|
|
||
| <artifactId>testng-remote7_8</artifactId> | ||
| <name>TestNG Remote for version [7.8.0, -)</name> | ||
|
|
||
| <properties> | ||
| <testng.version>7.8.0</testng.version> | ||
| </properties> | ||
|
|
||
| <dependencies> | ||
| <dependency> | ||
| <groupId>org.testng.testng-remote</groupId> | ||
| <artifactId>testng-remote</artifactId> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.testng</groupId> | ||
| <artifactId>testng</artifactId> | ||
| <version>${testng.version}</version> | ||
| <scope>provided</scope> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>com.google.auto.service</groupId> | ||
| <artifactId>auto-service</artifactId> | ||
| <optional>true</optional> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.testng.testng-remote</groupId> | ||
| <artifactId>testng-remote</artifactId> | ||
| <type>test-jar</type> | ||
| </dependency> | ||
| </dependencies> | ||
|
|
||
| <build> | ||
| <plugins> | ||
| <plugin> | ||
| <groupId>org.apache.maven.plugins</groupId> | ||
| <artifactId>maven-surefire-plugin</artifactId> | ||
| <configuration> | ||
| <systemPropertyVariables> | ||
| <test.resources.dir>${basedir}/../remote/target/test-classes</test.resources.dir> | ||
| </systemPropertyVariables> | ||
| </configuration> | ||
| </plugin> | ||
| </plugins> | ||
| </build> | ||
| </project> |
72 changes: 72 additions & 0 deletions
72
remote7_8/src/main/java/org/testng/remote/support/RemoteTestNG7_8.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| package org.testng.remote.support; | ||
|
|
||
| import org.testng.IClassListener; | ||
| import org.testng.IInvokedMethodListener; | ||
| import org.testng.ISuite; | ||
| import org.testng.ITestRunnerFactory; | ||
| import org.testng.SuiteRunner; | ||
| import org.testng.TestRunner; | ||
| import org.testng.remote.AbstractRemoteTestNG; | ||
| import org.testng.remote.strprotocol.MessageHub; | ||
| import org.testng.remote.strprotocol.RemoteTestListener; | ||
| import org.testng.reporters.JUnitXMLReporter; | ||
| import org.testng.reporters.TestHTMLReporter; | ||
| import org.testng.xml.XmlTest; | ||
|
|
||
| import java.util.Collection; | ||
| import java.util.List; | ||
|
|
||
| public class RemoteTestNG7_8 extends AbstractRemoteTestNG { | ||
|
|
||
| @Override | ||
| protected void initialize() { | ||
| initializeEverything(); | ||
| } | ||
|
|
||
| @Override | ||
| protected ITestRunnerFactory buildTestRunnerFactory() { | ||
| if(null == m_customTestRunnerFactory) { | ||
| m_customTestRunnerFactory= new ITestRunnerFactory() { | ||
| @Override | ||
| public TestRunner newTestRunner(ISuite suite, XmlTest xmlTest, | ||
| Collection<IInvokedMethodListener> listeners, List<IClassListener> classListeners) { | ||
| TestRunner runner = | ||
| new TestRunner(getConfiguration(), suite, xmlTest, | ||
| false /*skipFailedInvocationCounts */, | ||
| listeners, classListeners, (SuiteRunner) suite); | ||
| if (m_useDefaultListeners) { | ||
| runner.addListener(new TestHTMLReporter()); | ||
| runner.addListener(new JUnitXMLReporter()); | ||
| } | ||
|
|
||
| return runner; | ||
| } | ||
| }; | ||
| } | ||
|
|
||
| return m_customTestRunnerFactory; | ||
| } | ||
|
|
||
| @Override | ||
| protected ITestRunnerFactory createDelegatingTestRunnerFactory(ITestRunnerFactory trf, MessageHub smsh) { | ||
| return new DelegatingTestRunnerFactory(trf, smsh); | ||
| } | ||
|
|
||
| private static class DelegatingTestRunnerFactory implements ITestRunnerFactory { | ||
| private final ITestRunnerFactory m_delegateFactory; | ||
| private final MessageHub m_messageSender; | ||
|
|
||
| DelegatingTestRunnerFactory(ITestRunnerFactory trf, MessageHub smsh) { | ||
| m_delegateFactory= trf; | ||
| m_messageSender= smsh; | ||
| } | ||
|
|
||
| @Override | ||
| public TestRunner newTestRunner(ISuite suite, XmlTest test, | ||
| Collection<IInvokedMethodListener> listeners, List<IClassListener> classListeners) { | ||
| TestRunner tr = m_delegateFactory.newTestRunner(suite, test, listeners, classListeners); | ||
| tr.addListener(new RemoteTestListener(suite, test, m_messageSender)); | ||
| return tr; | ||
| } | ||
| } | ||
| } | ||
28 changes: 28 additions & 0 deletions
28
remote7_8/src/main/java/org/testng/remote/support/RemoteTestNGFactory7_8.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| package org.testng.remote.support; | ||
|
|
||
| import org.testng.remote.AbstractRemoteTestNGFactory; | ||
| import org.testng.remote.IRemoteTestNG; | ||
| import org.testng.shaded.osgi.framework.VersionRange; | ||
|
|
||
| import com.google.auto.service.AutoService; | ||
|
|
||
| @AutoService(RemoteTestNGFactory.class) | ||
| public class RemoteTestNGFactory7_8 extends AbstractRemoteTestNGFactory { | ||
|
|
||
| private static final VersionRange RANGE = new VersionRange("7.8"); | ||
|
|
||
| @Override | ||
| public IRemoteTestNG createRemoteTestNG() { | ||
| return new RemoteTestNG7_8(); | ||
| } | ||
|
|
||
| @Override | ||
| protected VersionRange getAcceptableVersions() { | ||
| return RANGE; | ||
| } | ||
|
|
||
| @Override | ||
| public int getOrder() { | ||
| return 7; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| package test.remote; | ||
|
|
||
| import org.testng.internal.Version; | ||
|
|
||
| public class Remote7_8_Test extends RemoteTest { | ||
|
|
||
| @Override | ||
| protected String getTestNGVersion() { | ||
| return Version.VERSION; | ||
| } | ||
|
|
||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.