public ClassLoader createMergedClassLoader() throws SurefireExecutionException { Collection<String> modulePath = getModularClasspath().getModulePath(); return createMergedClassLoader( join( getInprocTestClasspath(), new Classpath( modulePath ) ) ); }
@Override protected void resolveClasspath( @Nonnull OutputStreamFlushableCommandline cli, @Nonnull String startClass, @Nonnull StartupConfiguration config ) throws SurefireBooterForkException { try { AbstractPathConfiguration pathConfig = config.getClasspathConfiguration(); ModularClasspathConfiguration modularClasspathConfiguration = pathConfig.toRealPath( ModularClasspathConfiguration.class ); ModularClasspath modularClasspath = modularClasspathConfiguration.getModularClasspath(); File descriptor = modularClasspath.getModuleDescriptor(); List<String> modulePath = modularClasspath.getModulePath(); Collection<String> packages = modularClasspath.getPackages(); File patchFile = modularClasspath.getPatchFile(); List<String> classpath = toCompleteClasspath( config ); File argsFile = createArgsFile( descriptor, modulePath, classpath, packages, patchFile, startClass ); cli.createArg().setValue( "@" + escapeToPlatformPath( argsFile.getAbsolutePath() ) ); } catch ( IOException e ) { throw new SurefireBooterForkException( "Error creating args file", e ); } }
@Override protected void resolveClasspath( @Nonnull OutputStreamFlushableCommandline cli, @Nonnull String startClass, @Nonnull StartupConfiguration config, @Nonnull File dumpLogDirectory ) throws SurefireBooterForkException { try { AbstractPathConfiguration pathConfig = config.getClasspathConfiguration(); ModularClasspathConfiguration modularClasspathConfiguration = pathConfig.toRealPath( ModularClasspathConfiguration.class ); ModularClasspath modularClasspath = modularClasspathConfiguration.getModularClasspath(); File descriptor = modularClasspath.getModuleDescriptor(); List<String> modulePath = modularClasspath.getModulePath(); Collection<String> packages = modularClasspath.getPackages(); File patchFile = modularClasspath.getPatchFile(); List<String> classpath = toCompleteClasspath( config ); File argsFile = createArgsFile( descriptor, modulePath, classpath, packages, patchFile, startClass ); cli.createArg().setValue( "@" + escapeToPlatformPath( argsFile.getAbsolutePath() ) ); } catch ( IOException e ) { String error = "Error creating args file"; InPluginProcessDumpSingleton.getSingleton() .dumpException( e, error, dumpLogDirectory ); throw new SurefireBooterForkException( error, e ); } }