Class RemoteTestNG


  • public class RemoteTestNG
    extends java.lang.Object
    • Field Detail

      • 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_VERBOSE

        public static final java.lang.String PROPERTY_VERBOSE
        See Also:
        Constant Field Values
      • m_debug

        private static boolean m_debug
    • Constructor Detail

      • RemoteTestNG

        public RemoteTestNG()
    • 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.MF

        in 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()