org.junit.internal.runners.InitializationError#org.pentaho.di.core.KettleClientEnvironment源码实例Demo

下面列出了org.junit.internal.runners.InitializationError#org.pentaho.di.core.KettleClientEnvironment 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

@BeforeClass
public static void setUpBeforeClass() throws Exception {
  KettleClientEnvironment.init();
  dbMap.put( DatabaseInterface.class, DBMockIface.class.getName() );
  dbMap.put( InfobrightDatabaseMeta.class, InfobrightDatabaseMeta.class.getName() );

  PluginRegistry preg = PluginRegistry.getInstance();

  PluginInterface mockDbPlugin = mock( PluginInterface.class );
  when( mockDbPlugin.matches( anyString() ) ).thenReturn( true );
  when( mockDbPlugin.isNativePlugin() ).thenReturn( true );
  when( mockDbPlugin.getMainType() ).thenAnswer( (Answer<Class<?>>) invocation -> DatabaseInterface.class );

  when( mockDbPlugin.getPluginType() ).thenAnswer(
    (Answer<Class<? extends PluginTypeInterface>>) invocation -> DatabasePluginType.class );

  when( mockDbPlugin.getIds() ).thenReturn( new String[] { "Oracle", "mock-db-id" } );
  when( mockDbPlugin.getName() ).thenReturn( "mock-db-name" );
  when( mockDbPlugin.getClassMap() ).thenReturn( dbMap );

  preg.registerPlugin( DatabasePluginType.class, mockDbPlugin );
}
 
源代码2 项目: pentaho-kettle   文件: CapabilityManagerDialog.java
public static void main( String[] args ) {

    Display display = new Display(  );
    try {
      KettleEnvironment.init();

      PropsUI.init( display, Props.TYPE_PROPERTIES_SPOON );

      KettleLogStore
          .init( PropsUI.getInstance().getMaxNrLinesInLog(), PropsUI.getInstance().getMaxLogLineTimeoutMinutes() );

    } catch ( KettleException e ) {
      e.printStackTrace();
    }

    KettleClientEnvironment.getInstance().setClient( KettleClientEnvironment.ClientType.SPOON );
    Shell shell = new Shell( display, SWT.DIALOG_TRIM );
    shell.open();
    CapabilityManagerDialog capabilityManagerDialog = new CapabilityManagerDialog( shell );
    capabilityManagerDialog.open();
    while ( !shell.isDisposed() ) {
      if ( !display.readAndDispatch() ) {
        display.sleep();
      }
    }
  }
 
源代码3 项目: pentaho-kettle   文件: RestorePDIEnvironment.java
void defaultInit() throws Throwable {
  // make sure static class initializers are correctly initialized
  // re-init
  cleanUp();
  KettleClientEnvironment.init();

  // initialize some classes, this will fail if some tests init this classes before any PDI init()
  // the best thing to do is to invoke this ClassRule in every test
  Class.forName( Database.class.getName() );
  Class.forName( Timestamp.class.getName() );
  Class.forName( ValueMetaBase.class.getName() );
  Class.forName( SimpleTimestampFormat.class.getName() );
  Class.forName( SimpleDateFormat.class.getName() );
  Class.forName( XMLHandler.class.getName() );
  Class.forName( LogChannel.class.getName() );
  DatabaseMeta.init();
  ExtensionPointMap.getInstance().reInitialize();
  KettleVFS.getInstance().reset(); // reinit
}
 
源代码4 项目: pentaho-kettle   文件: RestorePDIEnvironment.java
void cleanUp() {
    KettleClientEnvironment.reset();
    PluginRegistry.getInstance().reset();
    MetricsRegistry.getInstance().reset();
    ExtensionPointMap.getInstance().reset();
    if ( KettleLogStore.isInitialized() ) {
      KettleLogStore.getInstance().reset();
    }
    KettleLogStore.setLogChannelInterfaceFactory( new LogChannelFactory() );
    if ( Props.isInitialized() ) {
      Props.getInstance().reset();
    }
    KettleVFS.getInstance().reset();
    XMLHandlerCache.getInstance().clear();
    ValueMetaFactory.pluginRegistry = PluginRegistry.getInstance();
    // under no circumstance reset the LoggingRegistry
//    LoggingRegistry.getInstance().reset();
  }
 
源代码5 项目: pentaho-kettle   文件: RepositoryCleanupUtil.java
/**
 * Use REST API to authenticate provided credentials
 * 
 * @throws Exception
 */
@VisibleForTesting
void authenticateLoginCredentials() throws Exception {
  KettleClientEnvironment.init();

  if ( client == null ) {
    ClientConfig clientConfig = new DefaultClientConfig();
    clientConfig.getFeatures().put( JSONConfiguration.FEATURE_POJO_MAPPING, Boolean.TRUE );
    client = Client.create( clientConfig );
    client.addFilter( new HTTPBasicAuthFilter( username, Encr.decryptPasswordOptionallyEncrypted( password ) ) );
  }

  WebResource resource = client.resource( url + AUTHENTICATION + AdministerSecurityAction.NAME );
  String response = resource.get( String.class );

  if ( !response.equals( "true" ) ) {
    throw new Exception( Messages.getInstance().getString( "REPOSITORY_CLEANUP_UTIL.ERROR_0012.ACCESS_DENIED" ) );
  }
}
 
源代码6 项目: pentaho-pdi-dataset   文件: TransUnitTestTest.java
@Override
protected void setUp() throws Exception {
  KettleClientEnvironment.init();
  metaStore = new MemoryMetaStore();

  inputs = new ArrayList<TransUnitTestSetLocation>();
  inputs.add( new TransUnitTestSetLocation( "input-step1", "data-set-name1",
    Arrays.asList(
      new TransUnitTestFieldMapping( "fieldA", "setFieldA" ),
      new TransUnitTestFieldMapping( "fieldB", "setFieldB" ),
      new TransUnitTestFieldMapping( "fieldC", "setFieldC" )
    ), Arrays.asList( "order1", "order2", "order3" ) ) );
  inputs.add( new TransUnitTestSetLocation( "input-step2", "data-set-name2",
    Arrays.asList(
      new TransUnitTestFieldMapping( "fieldX", "setFieldX" ),
      new TransUnitTestFieldMapping( "fieldY", "setFieldY" ),
      new TransUnitTestFieldMapping( "fieldW", "setFieldW" ),
      new TransUnitTestFieldMapping( "fieldZ", "setFieldZ" )
    ), Arrays.asList( "order1", "order2", "order3", "order4" ) ) );

  goldens = new ArrayList<TransUnitTestSetLocation>();

  List<TransUnitTestTweak> tweaks = new ArrayList<TransUnitTestTweak>();
  tweaks.add( new TransUnitTestTweak( TransTweak.NONE, "step1" ) );
  tweaks.add( new TransUnitTestTweak( TransTweak.BYPASS_STEP, "step2" ) );
  tweaks.add( new TransUnitTestTweak( TransTweak.REMOVE_STEP, "step3" ) );

  test = new TransUnitTest( NAME, DESCRIPTION,
    null, null, "sometrans.ktr",
    inputs,
    goldens,
    tweaks,
    TestType.UNIT_TEST,
    null, new ArrayList<TransUnitTestDatabaseReplacement>(),
    false
  );
}
 
源代码7 项目: pentaho-pdi-dataset   文件: DataSetTest.java
@Override
protected void setUp() throws Exception {
  KettleClientEnvironment.init();
  metaStore = new MemoryMetaStore();
  databaseMeta = new DatabaseMeta( "dataset", "H2", "JDBC", null, "/tmp/datasets", null, null, null );
  dataSetGroup = new DataSetGroup( GROUP_TYPE, GROUP_NAME, GROUP_DESC, databaseMeta, GROUP_SCHEMA );

  List<DataSetField> fields = new ArrayList<>();
  for ( int i = 0; i < NR_FIELDS; i++ ) {
    fields.add( new DataSetField( "field" + i, "column" + i, ValueMetaInterface.TYPE_STRING, 50, 0, "comment" + i, null ) );
  }
  dataSet = new DataSet( NAME, DESC, dataSetGroup, TABLE, fields );
}
 
@Before
public void setup() throws Exception {
  KettleClientEnvironment.init();
  KettleLogStore.init();
  DBCache.getInstance().setInactive();

  TransConfiguration transConfig = new TransConfiguration( new TransMeta(), new TransExecutionConfiguration() );
  transXml = TransConfiguration.fromXML( transConfig.getXML() ).getXML();

  visitorServices.add( new MockVisitorService() );

  pentahoMapReduceJobBuilder =
    new PentahoMapReduceJobBuilderImpl( namedCluster, hadoopShim, logChannelInterface, variableSpace,
      pluginInterface, vfsPluginDirectory, pmrProperties, transFactory, pmrArchiveGetter, visitorServices );
}
 
源代码9 项目: pentaho-kettle   文件: LdapSslProtocolIT.java
@Test
public void testResolvingPathVariables() throws KettleException {
  String hostConcrete = "host_concrete";
  String portConcrete = "12345";
  String trustStorePath = "${KETTLE_SSL_PATH}";
  String trustStorePathResolved = "/home/test_path";
  String trustStorePassword = "TEST_PASSWORD";

  when( mockLdapMeta.getHost() ).thenReturn( hostConcrete );
  when( mockLdapMeta.getPort() ).thenReturn( portConcrete );
  when( mockLdapMeta.getDerefAliases() ).thenReturn( "always" );
  when( mockLdapMeta.getReferrals() ).thenReturn( "follow" );
  when( mockLdapMeta.isUseCertificate() ).thenReturn( true );
  when( mockLdapMeta.isTrustAllCertificates() ).thenReturn( true );
  when( mockLdapMeta.getTrustStorePath() ).thenReturn( trustStorePath );
  when( mockLdapMeta.getTrustStorePassword() ).thenReturn( trustStorePassword );

  when( mockVariableSpace.environmentSubstitute( eq( hostConcrete ) ) ).thenReturn( hostConcrete );
  when( mockVariableSpace.environmentSubstitute( eq( portConcrete ) ) ).thenReturn( portConcrete );
  when( mockVariableSpace.environmentSubstitute( eq( trustStorePath ) ) ).thenReturn( trustStorePathResolved );
  when( mockVariableSpace.environmentSubstitute( eq( trustStorePassword ) ) ).thenReturn( trustStorePassword );

  KettleClientEnvironment.init();
  TestableLdapProtocol testableLdapProtocol =
          new TestableLdapProtocol( mockLogChannelInterface, mockVariableSpace, mockLdapMeta, null );
  testableLdapProtocol.connect( null, null );
  assertEquals( trustStorePathResolved, testableLdapProtocol.trustStorePath );
}
 
源代码10 项目: pentaho-kettle   文件: LdapSslProtocolIT.java
@Test
public void testResolvingPasswordVariables() throws KettleException {
  String hostConcrete = "host_concrete";
  String portConcrete = "12345";
  String trustStorePath = "/home/test_path";
  String trustStorePassword = "${PASSWORD_VARIABLE}";
  String trustStorePasswordResolved = "TEST_PASSWORD_VALUE";

  when( mockLdapMeta.getHost() ).thenReturn( hostConcrete );
  when( mockLdapMeta.getPort() ).thenReturn( portConcrete );
  when( mockLdapMeta.getDerefAliases() ).thenReturn( "always" );
  when( mockLdapMeta.getReferrals() ).thenReturn( "follow" );
  when( mockLdapMeta.isUseCertificate() ).thenReturn( true );
  when( mockLdapMeta.isTrustAllCertificates() ).thenReturn( true );
  when( mockLdapMeta.getTrustStorePath() ).thenReturn( trustStorePath );
  when( mockLdapMeta.getTrustStorePassword() ).thenReturn( trustStorePassword );

  when( mockVariableSpace.environmentSubstitute( eq( hostConcrete ) ) ).thenReturn( hostConcrete );
  when( mockVariableSpace.environmentSubstitute( eq( portConcrete ) ) ).thenReturn( portConcrete );
  when( mockVariableSpace.environmentSubstitute( eq( trustStorePath ) ) ).thenReturn( trustStorePath );
  when( mockVariableSpace.environmentSubstitute( eq( trustStorePassword ) ) ).thenReturn( trustStorePasswordResolved );

  KettleClientEnvironment.init();
  TestableLdapProtocol testableLdapProtocol =
          new TestableLdapProtocol( mockLogChannelInterface, mockVariableSpace, mockLdapMeta, null );
  testableLdapProtocol.connect( null, null );
  assertEquals( trustStorePasswordResolved, testableLdapProtocol.trustStorePassword );
}
 
源代码11 项目: pentaho-kettle   文件: LdapSslProtocolIT.java
@Test
public void testResolvingPasswordAndDecryptVariables() throws KettleException {
  String hostConcrete = "host_concrete";
  String portConcrete = "12345";
  String trustStorePath = "/home/test_path";
  String trustStorePassword = "${PASSWORD_VARIABLE}";
  String trustStorePasswordResolved = "Encrypted 2be98afc86aa7f2e4cb79ff228dc6fa8c"; //original value 123456


  when( mockLdapMeta.getHost() ).thenReturn( hostConcrete );
  when( mockLdapMeta.getPort() ).thenReturn( portConcrete );
  when( mockLdapMeta.getDerefAliases() ).thenReturn( "always" );
  when( mockLdapMeta.getReferrals() ).thenReturn( "follow" );
  when( mockLdapMeta.isUseCertificate() ).thenReturn( true );
  when( mockLdapMeta.isTrustAllCertificates() ).thenReturn( true );
  when( mockLdapMeta.getTrustStorePath() ).thenReturn( trustStorePath );
  when( mockLdapMeta.getTrustStorePassword() ).thenReturn( trustStorePassword );

  when( mockVariableSpace.environmentSubstitute( eq( hostConcrete ) ) ).thenReturn( hostConcrete );
  when( mockVariableSpace.environmentSubstitute( eq( portConcrete ) ) ).thenReturn( portConcrete );
  when( mockVariableSpace.environmentSubstitute( eq( trustStorePath ) ) ).thenReturn( trustStorePath );
  when( mockVariableSpace.environmentSubstitute( eq( trustStorePassword ) ) ).thenReturn( trustStorePasswordResolved );

  KettleClientEnvironment.init();
  TestableLdapProtocol testableLdapProtocol =
          new TestableLdapProtocol( mockLogChannelInterface, mockVariableSpace, mockLdapMeta, null );
  testableLdapProtocol.connect( null, null );
  assertEquals( "123456", testableLdapProtocol.trustStorePassword );
}
 
源代码12 项目: pentaho-kettle   文件: Carte.java
/**
 * Checks that Carte is running and if so, shuts down the Carte server
 *
 * @param hostname
 * @param port
 * @param username
 * @param password
 * @throws ParseException
 * @throws CarteCommandException
 */
@VisibleForTesting
static void callStopCarteRestService( String hostname, String port, String username, String password )
  throws ParseException, CarteCommandException {
  // get information about the remote connection
  try {
    KettleClientEnvironment.init();

    ClientConfig clientConfig = new DefaultClientConfig();
    clientConfig.getFeatures().put( JSONConfiguration.FEATURE_POJO_MAPPING, Boolean.TRUE );
    Client client = Client.create( clientConfig );

    client.addFilter( new HTTPBasicAuthFilter( username, Encr.decryptPasswordOptionallyEncrypted( password ) ) );

    // check if the user can access the carte server. Don't really need this call but may want to check it's output at
    // some point
    String contextURL = "http://" + hostname + ":" + port + "/kettle";
    WebResource resource = client.resource( contextURL + "/status/?xml=Y" );
    String response = resource.get( String.class );
    if ( response == null || !response.contains( "<serverstatus>" ) ) {
      throw new Carte.CarteCommandException( BaseMessages.getString( PKG, "Carte.Error.NoServerFound", hostname, ""
          + port ) );
    }

    // This is the call that matters
    resource = client.resource( contextURL + "/stopCarte" );
    response = resource.get( String.class );
    if ( response == null || !response.contains( "Shutting Down" ) ) {
      throw new Carte.CarteCommandException( BaseMessages.getString( PKG, "Carte.Error.NoShutdown", hostname, ""
          + port ) );
    }
  } catch ( Exception e ) {
    throw new Carte.CarteCommandException( BaseMessages.getString( PKG, "Carte.Error.NoServerFound", hostname, ""
        + port ), e );
  }
}
 
源代码13 项目: pentaho-kettle   文件: JobEntryJobIT.java
@BeforeClass
public static void init() throws Exception {
  KettleClientEnvironment.init();
  PluginRegistry.addPluginType( StepPluginType.getInstance() );
  PluginRegistry.init();
  if ( !Props.isInitialized() ) {
    Props.init( 0 );
  }
}
 
源代码14 项目: pentaho-kettle   文件: ConstantIT.java
@BeforeClass
public static void init() throws Exception {
  KettleClientEnvironment.init();
  PluginRegistry.addPluginType( StepPluginType.getInstance() );
  PluginRegistry.init();
  if ( !Props.isInitialized() ) {
    Props.init( 0 );
  }
}
 
源代码15 项目: pentaho-kettle   文件: PropertyOutputIT.java
@Before
public void setUp() throws Exception {
  KettleClientEnvironment.init();
  PluginRegistry.addPluginType( StepPluginType.getInstance() );
  PluginRegistry.init();
  if ( !Props.isInitialized() ) {
    Props.init( 0 );
  }
}
 
源代码16 项目: pentaho-kettle   文件: TextFileInputIT.java
@BeforeClass
public static void init() throws Exception {
  KettleClientEnvironment.init();
  PluginRegistry.addPluginType( StepPluginType.getInstance() );
  PluginRegistry.init();
  if ( !Props.isInitialized() ) {
    Props.init( 0 );
  }
}
 
源代码17 项目: pentaho-kettle   文件: SafeStopTest.java
@BeforeClass
public static void init() throws Exception {
  KettleClientEnvironment.init();
  PluginRegistry.addPluginType( StepPluginType.getInstance() );
  PluginRegistry.init();
  if ( !Props.isInitialized() ) {
    Props.init( 0 );
  }
}
 
@BeforeClass
public static void init() throws Exception {
  KettleClientEnvironment.init();
  PluginRegistry.addPluginType( StepPluginType.getInstance() );
  PluginRegistry.init();
  if ( !Props.isInitialized() ) {
    Props.init( 0 );
  }
}
 
源代码19 项目: pentaho-kettle   文件: TransMetaConverterTest.java
@BeforeClass
public static void init() throws Exception {
  KettleClientEnvironment.init();
  PluginRegistry.addPluginType( StepPluginType.getInstance() );
  PluginRegistry.init();
  if ( !Props.isInitialized() ) {
    Props.init( 0 );
  }
}
 
源代码20 项目: pentaho-kettle   文件: SubtransExecutorTest.java
@BeforeClass
public static void init() throws Exception {
  KettleClientEnvironment.init();
  PluginRegistry.addPluginType( StepPluginType.getInstance() );
  PluginRegistry.init();
  if ( !Props.isInitialized() ) {
    Props.init( 0 );
  }
}
 
源代码21 项目: pentaho-kettle   文件: LoadFileInputTest.java
@BeforeClass
public static void setupBeforeClass() throws KettleException {
  if ( Const.isWindows() ) {
    wasEncoding = System.getProperty( "file.encoding" );
    fiddleWithDefaultCharset( "utf8" );
  }
  KettleClientEnvironment.init();
}
 
源代码22 项目: pentaho-kettle   文件: Translator2.java
public static void main( String[] args ) throws Exception {

    if ( args.length != 2 ) {
      System.err.println( "Usage: Translator <translator.xml> <path-to-source>" );
      System.err.println( "Example:" );
      System.err.println( "sh translator.sh translator.xml ." );
      System.exit( 1 );
    }

    KettleClientEnvironment.init();

    String configFile = args[0];
    String sourceFolder = args[1];

    Display display = new Display();
    LogChannelInterface log = new LogChannel( APP_NAME );
    PropsUI.init( display, Props.TYPE_PROPERTIES_SPOON );

    Translator2 translator = new Translator2( display );
    translator.loadConfiguration( configFile, sourceFolder );
    translator.open();

    try {
      while ( !display.isDisposed() ) {
        if ( !display.readAndDispatch() ) {
          display.sleep();
        }
      }
    } catch ( Throwable e ) {
      log.logError( BaseMessages.getString( PKG, "i18n.UnexpectedError", e.getMessage() ) );
      log.logError( Const.getStackTracker( e ) );
    }
  }
 
@BeforeClass
public static void setupBeforeClass() throws Exception {
  pool = ClassPool.getDefault();
  pool.insertClassPath( new ClassClassPath( ExtensionPointIntegrationTest.class ) );
  for ( KettleExtensionPoint ep : KettleExtensionPoint.values() ) {
    ExtensionPointPluginType.getInstance().registerCustom( createClassRuntime( ep ),
        "custom", "id" + ep.id, ep.id, "no description", null );
  }

  KettleClientEnvironment.init();
}
 
源代码24 项目: pentaho-kettle   文件: BaseDatabaseMetaTest.java
@Before
public void setupOnce() throws Exception {
  nativeMeta = new ConcreteBaseDatabaseMeta();
  nativeMeta.setAccessType( DatabaseMeta.TYPE_ACCESS_NATIVE );
  odbcMeta = new ConcreteBaseDatabaseMeta();
  nativeMeta.setAccessType( DatabaseMeta.TYPE_ACCESS_ODBC );
  jndiMeta = new ConcreteBaseDatabaseMeta();
  KettleClientEnvironment.init();
}
 
源代码25 项目: pentaho-kettle   文件: DatabaseMetaTest.java
@BeforeClass
public static void setUpOnce() throws KettlePluginException, KettleException {
  // Register Natives to create a default DatabaseMeta
  DatabasePluginType.getInstance().searchPlugins();
  ValueMetaPluginType.getInstance().searchPlugins();
  KettleClientEnvironment.init();
}
 
源代码26 项目: pentaho-kettle   文件: AS400DatabaseMetaTest.java
@Before
public void setupOnce() throws Exception {
  nativeMeta = new AS400DatabaseMeta();
  nativeMeta.setAccessType( DatabaseMeta.TYPE_ACCESS_NATIVE );
  odbcMeta = new AS400DatabaseMeta();
  odbcMeta.setAccessType( DatabaseMeta.TYPE_ACCESS_ODBC );
  KettleClientEnvironment.init();
}
 
源代码27 项目: pentaho-kettle   文件: OracleDatabaseMetaTest.java
@Before
public void setupOnce() throws Exception {
  nativeMeta = new OracleDatabaseMeta();
  odbcMeta = new OracleDatabaseMeta();
  ociMeta = new OracleDatabaseMeta();
  nativeMeta.setAccessType( DatabaseMeta.TYPE_ACCESS_NATIVE );
  odbcMeta.setAccessType( DatabaseMeta.TYPE_ACCESS_ODBC );
  ociMeta.setAccessType( DatabaseMeta.TYPE_ACCESS_OCI );
  //nativeMeta.setSupportsTimestampDataType( true );
  KettleClientEnvironment.init();
}
 
源代码28 项目: pentaho-kettle   文件: OracleRDBDatabaseMetaTest.java
@Before
public void setupOnce() throws Exception {
  nativeMeta = new OracleRDBDatabaseMeta();
  odbcMeta = new OracleRDBDatabaseMeta();
  jndiMeta = new OracleRDBDatabaseMeta();
  nativeMeta.setAccessType( DatabaseMeta.TYPE_ACCESS_NATIVE );
  odbcMeta.setAccessType( DatabaseMeta.TYPE_ACCESS_ODBC );
  jndiMeta.setAccessType( DatabaseMeta.TYPE_ACCESS_JNDI );
  KettleClientEnvironment.init();
}
 
源代码29 项目: pentaho-kettle   文件: XMLOutputMetaTest.java
@BeforeClass
public static void setUp() throws Exception {
  if ( !KettleClientEnvironment.isInitialized() ) {
    KettleClientEnvironment.init();
  }

}
 
源代码30 项目: pentaho-kettle   文件: SlaveDelegateTest.java
@Before
public void setup() throws KettleException {
  KettleClientEnvironment.init();
  mockPurRepository = mock( PurRepository.class );
  slaveDelegate = new SlaveDelegate( mockPurRepository );

  mockSlaveServer = mock( SlaveServer.class );
  when( mockSlaveServer.getHostname() ).thenReturn( PROP_HOST_NAME_VALUE );
  when( mockSlaveServer.getUsername() ).thenReturn( PROP_USERNAME_VALUE );
  when( mockSlaveServer.getPassword() ).thenReturn( PROP_PASSWORD_VALUE );
  when( mockSlaveServer.getPort() ).thenReturn( PROP_PORT_VALUE );
  when( mockSlaveServer.getProxyHostname() ).thenReturn( PROP_PROXY_HOST_NAME_VALUE );
  when( mockSlaveServer.getProxyPort() ).thenReturn( PROP_PROXY_PORT_VALUE );
  when( mockSlaveServer.getWebAppName() ).thenReturn( PROP_WEBAPP_NAME_VALUE );
  when( mockSlaveServer.getNonProxyHosts() ).thenReturn( PROP_NON_PROXY_HOSTS_VALUE );
  when( mockSlaveServer.isMaster() ).thenReturn( PROP_MASTER_VALUE );
  when( mockSlaveServer.isSslMode() ).thenReturn( PROP_USE_HTTPS_PROTOCOL_VALUE );

  mockDataNode = mock( DataNode.class, RETURNS_DEEP_STUBS );
  when( mockDataNode.hasProperty( SlaveDelegate.PROP_HOST_NAME ) ).thenReturn( true );
  when( mockDataNode.getProperty( SlaveDelegate.PROP_HOST_NAME ).getString() ).thenReturn( PROP_HOST_NAME_VALUE );
  when( mockDataNode.hasProperty( SlaveDelegate.PROP_USERNAME ) ).thenReturn( true );
  when( mockDataNode.getProperty( SlaveDelegate.PROP_USERNAME ).getString() ).thenReturn( PROP_USERNAME_VALUE );
  when( mockDataNode.hasProperty( SlaveDelegate.PROP_PASSWORD ) ).thenReturn( true );
  when( mockDataNode.getProperty( SlaveDelegate.PROP_PASSWORD ).getString() ).thenReturn( PROP_PASSWORD_VALUE );
  when( mockDataNode.hasProperty( SlaveDelegate.PROP_PORT ) ).thenReturn( true );
  when( mockDataNode.getProperty( SlaveDelegate.PROP_PORT ).getString() ).thenReturn( PROP_PORT_VALUE );
  when( mockDataNode.hasProperty( SlaveDelegate.PROP_PROXY_HOST_NAME ) ).thenReturn( true );
  when( mockDataNode.getProperty( SlaveDelegate.PROP_PROXY_HOST_NAME ).getString() ).thenReturn( PROP_PROXY_HOST_NAME_VALUE );
  when( mockDataNode.hasProperty( SlaveDelegate.PROP_PROXY_PORT ) ).thenReturn( true );
  when( mockDataNode.getProperty( SlaveDelegate.PROP_PROXY_PORT ).getString() ).thenReturn( PROP_PROXY_PORT_VALUE );
  when( mockDataNode.hasProperty( SlaveDelegate.PROP_WEBAPP_NAME ) ).thenReturn( true );
  when( mockDataNode.getProperty( SlaveDelegate.PROP_WEBAPP_NAME ).getString() ).thenReturn( PROP_WEBAPP_NAME_VALUE );
  when( mockDataNode.hasProperty( SlaveDelegate.PROP_NON_PROXY_HOSTS ) ).thenReturn( true );
  when( mockDataNode.getProperty( SlaveDelegate.PROP_NON_PROXY_HOSTS ).getString() ).thenReturn( PROP_NON_PROXY_HOSTS_VALUE );
  when( mockDataNode.hasProperty( SlaveDelegate.PROP_MASTER ) ).thenReturn( true );
  when( mockDataNode.getProperty( SlaveDelegate.PROP_MASTER ).getBoolean() ).thenReturn( PROP_MASTER_VALUE );
  when( mockDataNode.hasProperty( SlaveDelegate.PROP_USE_HTTPS_PROTOCOL ) ).thenReturn( true );
  when( mockDataNode.getProperty( SlaveDelegate.PROP_USE_HTTPS_PROTOCOL ).getBoolean() ).thenReturn( PROP_USE_HTTPS_PROTOCOL_VALUE );
}