private static void initServer(final Properties props){ try{ final String className = props.getProperty(TEST_SERVER_CLASSNAME); if (className == null) { throw new IllegalArgumentException( "Must specify a test server by setting its class name using the system property \"" + TEST_SERVER_CLASSNAME + "\""); } final ClassLoader cl = getContextClassLoader(); final Class<?> testServerClass = Class.forName( className, true, cl ); server = (TestServer)testServerClass.newInstance(); server.init( props ); } catch (final Exception e){ if (warn) e.printStackTrace(); if (warn) System.out.println("Cannot instantiate or initialize the test server: "+e.getClass().getName()+" "+e.getMessage()); throw new RuntimeException("Cannot instantiate or initialize the test server: "+e.getClass().getName()+" "+e.getMessage(),e); } }
private static void initServer(Properties props){ try{ String className = props.getProperty(TEST_SERVER_CLASSNAME); if (className == null) { throw new IllegalArgumentException( "Must specify a test server by setting its class name using the system property \"" + TEST_SERVER_CLASSNAME + "\""); } ClassLoader cl = getContextClassLoader(); Class<?> testServerClass = Class.forName( className, true, cl ); server = (TestServer)testServerClass.newInstance(); server.init( props ); } catch (Exception e){ if (warn) e.printStackTrace(); if (warn) System.out.println("Cannot instantiate or initialize the test server: "+e.getClass().getName()+" "+e.getMessage()); throw new RuntimeException("Cannot instantiate or initialize the test server: "+e.getClass().getName()+" "+e.getMessage(),e); } }