Package com.gemstone.gemfire.cache.wan

Examples of com.gemstone.gemfire.cache.wan.GatewayReceiver


  public void testAuto() throws Exception {
    assertNotNull("The 'Auto' GatewayReceiverFactoryBean was not properly configured and initialized!",
      autoGatewayReceiverFactory);
    assertTrue(autoGatewayReceiverFactory.isAutoStartup());

    GatewayReceiver autoGatewayReceiver = autoGatewayReceiverFactory.getObject();

    try {
      assertNotNull(autoGatewayReceiver);
      assertTrue(StringUtils.isEmpty(autoGatewayReceiver.getBindAddress()));
      assertEquals("neo", autoGatewayReceiver.getHost());
      assertEquals(15500, autoGatewayReceiver.getStartPort());
      assertEquals(25500, autoGatewayReceiver.getEndPort());
      assertEquals(10000, autoGatewayReceiver.getMaximumTimeBetweenPings());
      assertTrue(autoGatewayReceiver.isRunning());
      assertEquals(16384, autoGatewayReceiver.getSocketBufferSize());
    }
    finally {
      autoGatewayReceiver.stop();
    }
  }
View Full Code Here


    assertSame(ctx.getBean("transport-filter"), transportFilters.get(0));
  }

  @Test
  public void testGatewayReceiver() {
    GatewayReceiver gatewayReceiver = ctx.getBean("gateway-receiver", GatewayReceiver.class);

    assertNotNull(gatewayReceiver);
    assertEquals("192.168.0.1", gatewayReceiver.getBindAddress());
    assertEquals(12345, gatewayReceiver.getStartPort());
    assertEquals(23456, gatewayReceiver.getEndPort());
    assertEquals(3000, gatewayReceiver.getMaximumTimeBetweenPings());
    assertEquals(16536, gatewayReceiver.getSocketBufferSize());
  }
View Full Code Here

  public void testManual() throws Exception {
    assertNotNull("The 'Manual' GatewayReceiverFactoryBean was not properly configured and initialized!",
      manualGatewayReceiverFactory);
    assertFalse(manualGatewayReceiverFactory.isAutoStartup());

    GatewayReceiver manualGatewayReceiver = manualGatewayReceiverFactory.getObject();

    assertNotNull(manualGatewayReceiver);
    assertEquals("192.168.0.1", manualGatewayReceiver.getBindAddress());
    assertEquals("theOne", manualGatewayReceiver.getHost());
    assertEquals(100, manualGatewayReceiver.getStartPort());
    assertEquals(900, manualGatewayReceiver.getEndPort());
    assertEquals(1000, manualGatewayReceiver.getMaximumTimeBetweenPings());
    assertFalse(manualGatewayReceiver.isRunning());
    assertEquals(8192, manualGatewayReceiver.getSocketBufferSize());
  }
View Full Code Here

  public void testDefault() throws Exception {
    assertNotNull("The 'Default' GatewayReceiverFactoryBean was not properly configured and initialized!",
      defaultGatewayReceiverFactory);
    assertTrue(defaultGatewayReceiverFactory.isAutoStartup());

    GatewayReceiver defaultGatewayReceiver = defaultGatewayReceiverFactory.getObject();

    try {
      assertNotNull(defaultGatewayReceiver);
      assertTrue(StringUtils.isEmpty(defaultGatewayReceiver.getBindAddress()));
      assertEquals("skullbox", defaultGatewayReceiver.getHost());
      assertEquals(12345, defaultGatewayReceiver.getStartPort());
      assertEquals(54321, defaultGatewayReceiver.getEndPort());
      assertEquals(5000, defaultGatewayReceiver.getMaximumTimeBetweenPings());
      assertTrue(defaultGatewayReceiver.isRunning());
      assertEquals(32768, defaultGatewayReceiver.getSocketBufferSize());
    }
    finally {
      defaultGatewayReceiver.stop();
    }
  }
View Full Code Here

  /* (non-Javadoc)
   * @see com.gemstone.gemfire.cache.wan.GatewayReceiverFactory#create()
   */
  @Override
  public GatewayReceiver create() {
    GatewayReceiver gatewayReceiver = mock(GatewayReceiver.class);

    when(gatewayReceiver.getBindAddress()).thenReturn(this.bindAddress);
    when(gatewayReceiver.getEndPort()).thenReturn(this.endPort);
    when(gatewayReceiver.getGatewayTransportFilters()).thenReturn(this.gatewayTransportFilters);
    when(gatewayReceiver.getHost()).thenReturn(StringUtils.hasText(this.hostnameForSenders)
      ? this.hostnameForSenders : this.hostnameForClients);
    when(gatewayReceiver.getMaximumTimeBetweenPings()).thenReturn(this.maximumTimeBetweenPings);
    when(gatewayReceiver.getSocketBufferSize()).thenReturn(this.socketBufferSize);
    when(gatewayReceiver.getStartPort()).thenReturn(this.startPort);
    when(gatewayReceiver.isRunning()).thenAnswer(new Answer<Boolean>() {
      @Override
      public Boolean answer(InvocationOnMock invocation) throws Throwable {
        return running;
      }
    });
View Full Code Here

TOP

Related Classes of com.gemstone.gemfire.cache.wan.GatewayReceiver

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.