Package org.testng.remote
Class RemoteTestNG
- java.lang.Object
-
- org.testng.remote.RemoteTestNG
-
public class RemoteTestNG extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DEBUG_PORT
static java.lang.String
DEBUG_SUITE_DIRECTORY
static java.lang.String
DEBUG_SUITE_FILE
private static boolean
m_debug
static java.lang.String
PROPERTY_DEBUG
static java.lang.String
PROPERTY_VERBOSE
-
Constructor Summary
Constructors Constructor Description RemoteTestNG()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
dumpRevision()
private static Version
getTestNGVersion()
Get the version of TestNG on classpath.private static java.lang.String
getVersionFromClass()
use reflection to read org.testng.internal.Version.VERSION for reason of: 1.private static void
initAndRun(IRemoteTestNG remoteTestNg, java.lang.String[] args, org.testng.CommandLineArgs cla, RemoteArgs ra)
static boolean
isDebug()
static boolean
isVerbose()
static void
main(java.lang.String[] args)
private static void
p(java.lang.String s)
private static Version
parseVersionFromManifest()
Parse the version from MANIFEST.MFprivate static Version
parseVersionFromPom()
Parse the version from pom.properties.(package private) static Version
toVersion(java.lang.String strVer)
-
-
-
Field Detail
-
DEBUG_PORT
public static final java.lang.String DEBUG_PORT
- See Also:
- Constant Field Values
-
DEBUG_SUITE_FILE
public static final java.lang.String DEBUG_SUITE_FILE
- See Also:
- Constant Field Values
-
DEBUG_SUITE_DIRECTORY
public static final java.lang.String DEBUG_SUITE_DIRECTORY
-
PROPERTY_DEBUG
public static final java.lang.String PROPERTY_DEBUG
- See Also:
- Constant Field Values
-
PROPERTY_VERBOSE
public static final java.lang.String PROPERTY_VERBOSE
- See Also:
- Constant Field Values
-
m_debug
private static boolean m_debug
-
-
Method Detail
-
main
public static void main(java.lang.String[] args) throws com.beust.jcommander.ParameterException
- Throws:
com.beust.jcommander.ParameterException
-
getTestNGVersion
private static Version getTestNGVersion()
Get the version of TestNG on classpath.- Returns:
- the Version of TestNG
- Throws:
java.lang.RuntimeException
- if can't recognize the TestNG version on classpath.
-
getVersionFromClass
private static java.lang.String getVersionFromClass() throws java.lang.Exception
use reflection to read org.testng.internal.Version.VERSION for reason of:- 1. bypass the javac compile time constant substitution
- 2. org.testng.internal.Version is available since version 6.6
- Returns:
- Throws:
java.lang.Exception
-
parseVersionFromPom
private static Version parseVersionFromPom() throws java.lang.Exception
Parse the version from pom.properties.for testng version < 6.6, since ClassNotFound: org.testng.internal.Version, parse the version from 'META-INF/maven/org.testng/testng/pom.properties' of testng jar on classpath
- Returns:
- the testng version, or
null
if not found. - Throws:
java.lang.Exception
-
parseVersionFromManifest
private static Version parseVersionFromManifest() throws java.lang.Exception
Parse the version from MANIFEST.MFin PR https://github.com/cbeust/testng/pull/1124, `public static final String VERSION = "DEV-SNAPSHOT";`, method
#parseVersionFromClass()
can't get the exact version when launch the tests of TestNG itself in Eclipse, the workaround here is to parse the MANIFEST.MF to get the version.- Returns:
- the testng version, or
null
if not found. - Throws:
java.lang.Exception
-
initAndRun
private static void initAndRun(IRemoteTestNG remoteTestNg, java.lang.String[] args, org.testng.CommandLineArgs cla, RemoteArgs ra)
-
p
private static void p(java.lang.String s)
-
toVersion
static Version toVersion(java.lang.String strVer)
-
isVerbose
public static boolean isVerbose()
-
isDebug
public static boolean isDebug()
-
dumpRevision
public static void dumpRevision()
-
-