Class ServiceLoaderHelper


  • public final class ServiceLoaderHelper
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private ServiceLoaderHelper()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      private static void fail​(java.lang.Class<?> service, java.lang.String msg)  
      private static void fail​(java.lang.Class<?> service, java.net.URL u, int line, java.lang.String msg)  
      static RemoteTestNGFactory getFirst​(Version version)  
      static RemoteTestNGFactory getFirstQuietly​(java.lang.String version)  
      static RemoteTestNGFactory getFirstQuietly​(Version version)
      Get the first RemoteTestNGFactory on classpath.
      private static int parseLine​(java.lang.Class<?> service, java.net.URL u, java.io.BufferedReader r, int lc, java.util.List<java.lang.String> names)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ServiceLoaderHelper

        private ServiceLoaderHelper()
    • Method Detail

      • getFirstQuietly

        public static RemoteTestNGFactory getFirstQuietly​(java.lang.String version)
      • getFirstQuietly

        public static RemoteTestNGFactory getFirstQuietly​(Version version)
        Get the first RemoteTestNGFactory on classpath.

        this implementation is diff with getFirst(Version) that it scans the JARs on the classpath, and parse the services file manually.

        Parameters:
        version -
        Returns:
        Throws:
        org.testng.TestNGException - if not found
      • parseLine

        private static int parseLine​(java.lang.Class<?> service,
                                     java.net.URL u,
                                     java.io.BufferedReader r,
                                     int lc,
                                     java.util.List<java.lang.String> names)
                              throws java.io.IOException,
                                     java.util.ServiceConfigurationError
        Throws:
        java.io.IOException
        java.util.ServiceConfigurationError
      • fail

        private static void fail​(java.lang.Class<?> service,
                                 java.lang.String msg)
                          throws java.util.ServiceConfigurationError
        Throws:
        java.util.ServiceConfigurationError
      • fail

        private static void fail​(java.lang.Class<?> service,
                                 java.net.URL u,
                                 int line,
                                 java.lang.String msg)
                          throws java.util.ServiceConfigurationError
        Throws:
        java.util.ServiceConfigurationError