public StartupConfiguration getProviderConfiguration() { boolean useSystemClassLoader = properties.getBooleanProperty( USESYSTEMCLASSLOADER ); boolean useManifestOnlyJar = properties.getBooleanProperty( USEMANIFESTONLYJAR ); String providerConfiguration = properties.getProperty( PROVIDER_CONFIGURATION ); ClassLoaderConfiguration classLoaderConfiguration = new ClassLoaderConfiguration( useSystemClassLoader, useManifestOnlyJar ); ClasspathConfiguration classpathConfiguration = new ClasspathConfiguration( properties ); return StartupConfiguration.inForkedVm( providerConfiguration, classpathConfiguration, classLoaderConfiguration ); } }
public ClassLoader createMergedClassLoader() throws SurefireExecutionException { Collection<String> modulePath = getModularClasspath().getModulePath(); return createMergedClassLoader( join( getInprocTestClasspath(), new Classpath( modulePath ) ) ); }
public void writeSurefireTestClasspathProperty() { getClasspathConfiguration().getTestClasspath().writeToSystemProperty( SUREFIRE_TEST_CLASSPATH ); } }
private void insertToListeners( Command cmd ) { MasterProcessCommand expectedCommandType = cmd.getCommandType(); for ( BiProperty<MasterProcessCommand, CommandListener> listenerWrapper : CommandReader.this.listeners ) { MasterProcessCommand commandType = listenerWrapper.getP1(); CommandListener listener = listenerWrapper.getP2(); if ( commandType == null || commandType == expectedCommandType ) { listener.update( cmd ); } } }
final ClassLoader createMergedClassLoader( Classpath cp ) throws SurefireExecutionException { return cp.createClassLoader( isChildDelegation(), isEnableAssertions(), "test" ); } }
final Classpath getInprocTestClasspath() { return join( getInprocClasspath(), getTestClasspath() ); }
Classpath getClasspath( String prefix ) { List<String> elements = getStringList( prefix ); return new Classpath( elements ); }
@Override public void testSetStarting( TestSetReportEntry report ) { encodeAndWriteToTarget( toString( BOOTERCODE_TESTSET_STARTING, report, testSetChannelId ) ); }
public static void setSystemProperties( File file ) throws IOException { PropertiesWrapper p = loadProperties( file ); p.setAsSystemProperties(); }
private Object createTestSet( TypeEncodedValue forkedTestSet, boolean readTestsFromCommandReader, ClassLoader cl ) { if ( forkedTestSet != null ) { return forkedTestSet.getDecodedValue( cl ); } else if ( readTestsFromCommandReader ) { return new LazyTestsToRun( originalOut ); } return null; }
boolean canUse() { final ProcessInfo ppi = parentProcessInfo; return ppi == null ? IS_OS_WINDOWS || IS_OS_UNIX && canExecuteUnixPs() : ppi.canUse(); }
/** * The iterator can be used only in one Thread. * Two simultaneous instances are not allowed for sake of only one {@link #nextCommandNotifier}. * * @param originalOutStream original stream in current JVM process * @return Iterator with test classes lazily loaded as commands from the main process */ Iterable<String> getIterableClasses( PrintStream originalOutStream ) { return new ClassesIterable( originalOutStream ); }
static MasterProcessCommand resolve( int id ) { for ( MasterProcessCommand command : values() ) { if ( id == command.id ) { return command; } } return null; }
@Override public void println( byte[] buf, int off, int len ) { writeTestOutput( buf, off, len, true ); } }
private void insertToListeners( Command cmd ) { MasterProcessCommand expectedCommandType = cmd.getCommandType(); for ( BiProperty<MasterProcessCommand, CommandListener> listenerWrapper : CommandReader.this.listeners ) { MasterProcessCommand commandType = listenerWrapper.getP1(); CommandListener listener = listenerWrapper.getP2(); if ( commandType == null || commandType == expectedCommandType ) { listener.update( cmd ); } } }
@Override public void testSetCompleted( TestSetReportEntry report ) { encodeAndWriteToTarget( toString( BOOTERCODE_TESTSET_COMPLETED, report, testSetChannelId ) ); }
@Override public void testFailed( ReportEntry report ) { encodeAndWriteToTarget( toString( BOOTERCODE_TEST_FAILED, report, testSetChannelId ) ); }
@Override public void testSkipped( ReportEntry report ) { encodeAndWriteToTarget( toString( BOOTERCODE_TEST_SKIPPED, report, testSetChannelId ) ); }