public ServerSetup [ ] build ( Properties properties ) { List < ServerSetup > serverSetups = new ArrayList <> ( ) ; String hostname = properties . getProperty ( "greenmail.hostname" , ServerSetup . getLocalHostAddress ( ) ) ; long serverStartupTimeout = Long . parseLong ( properties . getProperty ( "greenmail.startup.timeout" , "-1" ) ) ; // Default setups addDefaultSetups ( hostname , properties , serverSetups ) ; // Default setups for test addTestSetups ( hostname , properties , serverSetups ) ; // Default setups for ( String protocol : ServerSetup . PROTOCOLS ) { addSetup ( hostname , protocol , properties , serverSetups ) ; } for ( ServerSetup setup : serverSetups ) { if ( properties . containsKey ( GREENMAIL_VERBOSE ) ) { setup . setVerbose ( true ) ; } if ( serverStartupTimeout >= 0L ) { setup . setServerStartupTimeout ( serverStartupTimeout ) ; } } return serverSetups . toArray ( new ServerSetup [ serverSetups . size ( ) ] ) ; }
Creates a server setup based on provided properties .