final ClassLoader createMergedClassLoader( Classpath cp ) throws SurefireExecutionException { return cp.createClassLoader( isChildDelegation(), isEnableAssertions(), "test" ); } }
private void setupBooter( String tmpDir, String dumpFileName, String surefirePropsFileName, String effectiveSystemPropertiesFileName ) throws IOException { BooterDeserializer booterDeserializer = new BooterDeserializer( createSurefirePropertiesIfFileExists( tmpDir, surefirePropsFileName ) ); // todo: print PID in debug console logger in version 2.21.2 pingScheduler = isDebugging() ? null : listenToShutdownCommands( booterDeserializer.getPluginPid() ); setSystemProperties( new File( tmpDir, effectiveSystemPropertiesFileName ) ); providerConfiguration = booterDeserializer.deserialize(); DumpErrorSingleton.getSingleton() .init( providerConfiguration.getReporterConfiguration().getReportsDirectory(), dumpFileName ); startupConfiguration = booterDeserializer.getProviderConfiguration(); systemExitTimeoutInSeconds = providerConfiguration.systemExitTimeout( DEFAULT_SYSTEM_EXIT_TIMEOUT_IN_SECONDS ); AbstractPathConfiguration classpathConfiguration = startupConfiguration.getClasspathConfiguration(); if ( classpathConfiguration.isClassPathConfig() ) { if ( startupConfiguration.isManifestOnlyJarRequestedAndUsable() ) { classpathConfiguration.toRealPath( ClasspathConfiguration.class ) .trickClassPathWhenManifestOnlyClasspath(); } startupConfiguration.writeSurefireTestClasspathProperty(); } ClassLoader classLoader = currentThread().getContextClassLoader(); classLoader.setDefaultAssertionStatus( classpathConfiguration.isEnableAssertions() ); boolean readTestsFromCommandReader = providerConfiguration.isReadTestsFromInStream(); testSet = createTestSet( providerConfiguration.getTestForFork(), readTestsFromCommandReader, classLoader ); }
properties.setClasspath( CLASSPATH, cp.getTestClasspath() ); properties.setClasspath( SUREFIRE_CLASSPATH, cp.getProviderClasspath() ); properties.setProperty( ENABLE_ASSERTIONS, toString( cp.isEnableAssertions() ) ); properties.setProperty( CHILD_DELEGATION, toString( cp.isChildDelegation() ) );
properties.setClasspath( CLASSPATH, cp.getTestClasspath() ); properties.setClasspath( SUREFIRE_CLASSPATH, cp.getProviderClasspath() ); properties.setProperty( ENABLE_ASSERTIONS, toString( cp.isEnableAssertions() ) ); properties.setProperty( CHILD_DELEGATION, toString( cp.isChildDelegation() ) );