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 8e1a8af commit 7152198
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
4 changes: 2 additions & 2 deletions remote/src/main/java/org/testng/remote/RemoteArgs.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
import com.beust.jcommander.Parameter;

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

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

Expand Down
18 changes: 14 additions & 4 deletions remote/src/main/java/org/testng/remote/RemoteTestNG.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,19 @@ public static void main(String[] args) throws ParameterException {
IRemoteTestNG remoteTestNg = factory.createRemoteTestNG();
remoteTestNg.dontExit(ra.dontExit);

m_debug = ra.debug;
remoteTestNg.setDebug(ra.debug);
boolean debug = ra.debug;
try {
Field debugField = CommandLineArgs.class.getDeclaredField("debug");
if (debugField.getBoolean(cla)) {
debug = true;
}
} catch (NoSuchFieldException | IllegalAccessException e) {
if (isDebug()) {
e.printStackTrace();
}
}
m_debug = debug;
remoteTestNg.setDebug(debug);
remoteTestNg.setAck(ra.ack);

initAndRun(remoteTestNg, args, cla, ra);
Expand Down Expand Up @@ -275,8 +286,7 @@ static Version toVersion(String strVer) {
}

public static boolean isVerbose() {
boolean result = System.getProperty(PROPERTY_VERBOSE) != null || isDebug();
return result;
return System.getProperty(PROPERTY_VERBOSE) != null || isDebug();
}

public static boolean isDebug() {
Expand Down

0 comments on commit 7152198

Please sign in to comment.