public Long getLongProperty( String propertyName ) { String number = getProperty( propertyName ); return number == null ? null : Long.parseLong( number ); }
public List<String> getStringList( String propertyPrefix ) { List<String> result = new ArrayList<>(); for ( int i = 0; ; i++ ) { String value = getProperty( propertyPrefix + i ); if ( value == null ) { return result; } result.add( value ); } }
/** * Retrieves as single object that is persisted with type encoding * * @param key The key for the propery * @return The object, of a supported type */ public TypeEncodedValue getTypeEncodedValue( String key ) { String typeEncoded = getProperty( key ); if ( typeEncoded != null ) { int typeSep = typeEncoded.indexOf( "|" ); String type = typeEncoded.substring( 0, typeSep ); String value = typeEncoded.substring( typeSep + 1 ); return new TypeEncodedValue( type, value ); } else { return null; } }
public File getFileProperty( String key ) { final String property = getProperty( key ); if ( property == null ) { return null; } TypeEncodedValue typeEncodedValue = new TypeEncodedValue( File.class.getName(), property ); return (File) typeEncodedValue.getDecodedValue(); }
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 ProviderConfiguration deserialize() final File reportsDirectory = new File( properties.getProperty( REPORTSDIRECTORY ) ); final String testNgVersion = properties.getProperty( TESTARTIFACT_VERSION ); final String testArtifactClassifier = properties.getProperty( TESTARTIFACT_CLASSIFIER ); properties.getBooleanProperty( FORKTESTSET_PREFER_TESTS_FROM_IN_STREAM ); final String requestedTest = properties.getProperty( REQUESTEDTEST ); final File sourceDirectory = properties.getFileProperty( SOURCE_DIRECTORY ); final String runOrder = properties.getProperty( RUN_ORDER ); final String runStatisticsFile = properties.getProperty( RUN_STATISTICS_FILE ); Shutdown shutdown = Shutdown.valueOf( properties.getProperty( SHUTDOWN ) ); String systemExitTimeoutAsString = properties.getProperty( SYSTEM_EXIT_TIMEOUT ); Integer systemExitTimeout = systemExitTimeoutAsString == null ? null : Integer.valueOf( systemExitTimeoutAsString );