Skip to content

Commit

Permalink
feat: incorporate with the deprecated api cleanup per upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
missedone committed Jan 15, 2024
1 parent b9834b4 commit bcb6626
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion remote/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<name>TestNG Remote</name>

<properties>
<testng.version>6.5.1</testng.version>
<testng.version>7.10.0-SNAPSHOT</testng.version>
</properties>

<dependencies>
Expand Down
10 changes: 9 additions & 1 deletion remote/src/main/java/org/testng/remote/RemoteArgs.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,16 @@
import com.beust.jcommander.Parameter;

public class RemoteArgs {
public static final String DEBUG = "-debug";
@Parameter(names = DEBUG, hidden = true, description = "Used to debug TestNG")
public Boolean debug = Boolean.FALSE;

public static final String HOST = "-host";
@Parameter(names = HOST, description = "The host", hidden = true)
public String host;

public static final String PORT = "-serport";
@Parameter(names = PORT, description = "The port for the serialization protocol")
@Parameter(names = PORT, required = true, description = "The port for the serialization protocol")
public Integer serPort;

public static final String PROTOCOL = "-protocol";
Expand Down
15 changes: 5 additions & 10 deletions remote/src/main/java/org/testng/remote/RemoteTestNG.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,9 @@ public static void main(String[] args) throws ParameterException {

IRemoteTestNG remoteTestNg = factory.createRemoteTestNG();
remoteTestNg.dontExit(ra.dontExit);
if (cla.port != null && ra.serPort != null) {
throw new TestNGException("Can only specify one of " + CommandLineArgs.PORT
+ " and " + RemoteArgs.PORT);
}
m_debug = cla.debug;
remoteTestNg.setDebug(cla.debug);

m_debug = ra.debug;
remoteTestNg.setDebug(ra.debug);
remoteTestNg.setAck(ra.ack);

initAndRun(remoteTestNg, args, cla, ra);
Expand Down Expand Up @@ -226,17 +223,15 @@ private static Version parseVersionFromManifest() throws Exception {
private static void initAndRun(IRemoteTestNG remoteTestNg, String[] args, CommandLineArgs cla, RemoteArgs ra) {
if (m_debug) {
// In debug mode, override the port and the XML file to a fixed location
cla.port = Integer.parseInt(DEBUG_PORT);
ra.serPort = cla.port;
ra.serPort = Integer.parseInt(DEBUG_PORT);
cla.suiteFiles = Arrays.asList(new String[] {
DEBUG_SUITE_DIRECTORY + DEBUG_SUITE_FILE
});
}
remoteTestNg.configure(cla);
remoteTestNg.setHost(cla.host);
remoteTestNg.setHost(ra.host);
remoteTestNg.setSerPort(ra.serPort);
remoteTestNg.setProtocol(ra.protocol);
remoteTestNg.setPort(cla.port);
if (isVerbose()) {
StringBuilder sb = new StringBuilder("Invoked with ");
for (String s : args) {
Expand Down

0 comments on commit bcb6626

Please sign in to comment.