@Test public void testWebsocketVersion() throws KettleException { props.setProperty( "KETTLE_AEL_PDI_DAEMON_VERSION", "2.0" ); when( meta.getVariable( "engine" ) ).thenReturn( "spark" ); when( meta.getVariable( "engine.host" ) ).thenReturn( "hostname" ); when( meta.getVariable( "engine.port" ) ).thenReturn( "8080" ); when( meta.nrTransHops() ).thenReturn( 0 ); when( meta.getTransHop( 0 ) ).thenReturn( transHopMeta ); when( meta.realClone( false ) ).thenReturn( meta ); when( transHopMeta.isEnabled() ).thenReturn( false ); transSupplier = new TransSupplier( meta, log, fallbackSupplier ); Trans transRet = transSupplier.get(); assertTrue( transRet instanceof TransWebSocketEngineAdapter ); }
public Trans get() { if ( Utils.isEmpty( transMeta.getVariable( "engine" ) ) ) { log.logBasic( "Using legacy execution engine" ); return fallbackSupplier.get(); } Variables variables = new Variables(); variables.initializeVariablesFrom( null ); String protocol = transMeta.getVariable( "engine.protocol" ); String host = transMeta.getVariable( "engine.host" ); String port = transMeta.getVariable( "engine.port" ); boolean ssl = "https".equalsIgnoreCase( protocol ) || "wss".equalsIgnoreCase( protocol ); return new TransWebSocketEngineAdapter( transMeta, host, port, ssl ); }
TransSupplier implements Supplier<Trans> { public Trans get() { if ( Utils.isEmpty( transMeta.getVariable( "engine" ) ) ) { log.logBasic( "Using legacy execution engine" ); return fallbackSupplier.get(); } Variables variables = new Variables(); variables.initializeVariablesFrom( null ); String protocol = transMeta.getVariable( "engine.protocol" ); String host = transMeta.getVariable( "engine.host" ); String port = transMeta.getVariable( "engine.port" ); boolean ssl = "https".equalsIgnoreCase( protocol ) || "wss".equalsIgnoreCase( protocol ); return new TransWebSocketEngineAdapter( transMeta, host, port, ssl ); } }
TransSupplier implements Supplier<Trans> { public Trans get() { if ( Utils.isEmpty( transMeta.getVariable( "engine" ) ) ) { log.logBasic( "Using legacy execution engine" ); return fallbackSupplier.get(); } Variables variables = new Variables(); variables.initializeVariablesFrom( null ); String protocol = transMeta.getVariable( "engine.protocol" ); String host = transMeta.getVariable( "engine.host" ); String port = transMeta.getVariable( "engine.port" ); boolean ssl = "https".equalsIgnoreCase( protocol ) || "wss".equalsIgnoreCase( protocol ); return new TransWebSocketEngineAdapter( transMeta, host, port, ssl ); } TransSupplier( TransMeta transMeta, LogChannelInterface log, Supplier<Trans> fallbackSupplier ); }
TransSupplier implements Supplier<Trans> { public Trans get() { if ( Utils.isEmpty( transMeta.getVariable( "engine" ) ) ) { log.logBasic( "Using legacy execution engine" ); return fallbackSupplier.get(); } Variables variables = new Variables(); variables.initializeVariablesFrom( null ); String protocol = transMeta.getVariable( "engine.protocol" ); String host = transMeta.getVariable( "engine.host" ); String port = transMeta.getVariable( "engine.port" ); boolean ssl = "https".equalsIgnoreCase( protocol ) || "wss".equalsIgnoreCase( protocol ); return new TransWebSocketEngineAdapter( transMeta, host, port, ssl ); } TransSupplier( TransMeta transMeta, LogChannelInterface log, Supplier<Trans> fallbackSupplier ); Trans get(); }
TransSupplier implements Supplier<Trans> { public Trans get() { if ( Utils.isEmpty( transMeta.getVariable( "engine" ) ) ) { log.logBasic( "Using legacy execution engine" ); return fallbackSupplier.get(); } Variables variables = new Variables(); variables.initializeVariablesFrom( null ); String protocol = transMeta.getVariable( "engine.protocol" ); String host = transMeta.getVariable( "engine.host" ); String port = transMeta.getVariable( "engine.port" ); boolean ssl = "https".equalsIgnoreCase( protocol ) || "wss".equalsIgnoreCase( protocol ); return new TransWebSocketEngineAdapter( transMeta, host, port, ssl ); } TransSupplier( TransMeta transMeta, LogChannelInterface log, Supplier<Trans> fallbackSupplier ); Trans get();  }