Package com.gemstone.gemfire.cache.wan

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


  @Override
  public void start() {
    if (!ObjectUtils.isEmpty(gatewaySenders)) {
      synchronized (gatewaySenders) {
        for (Object obj : gatewaySenders) {
          GatewaySender gatewaySender = (GatewaySender) obj;
          if (!(gatewaySender.isManualStart() || gatewaySender.isRunning())) {
            gatewaySender.start();
          }
        }
      }
    }
    this.running = true;
View Full Code Here


  }

  protected GatewaySenderFactory createMockGatewaySenderFactory(final String gatewaySenderName,
      final int remoteDistributedSystemId) {
    GatewaySenderFactory mockGatewaySenderFactory = mock(GatewaySenderFactory.class);
    GatewaySender mockGatewaySender = mock(GatewaySender.class);

    when(mockGatewaySender.getId()).thenReturn(gatewaySenderName);
    when(mockGatewaySender.getRemoteDSId()).thenReturn(remoteDistributedSystemId);
    when(mockGatewaySenderFactory.create(eq(gatewaySenderName), eq(remoteDistributedSystemId)))
      .thenReturn(mockGatewaySender);

    return mockGatewaySenderFactory;
  }
View Full Code Here

    factoryBean.setDispatcherThreads(8);
    factoryBean.doInit();

    verifyExpectations(factoryBean, mockGatewaySenderFactory);

    GatewaySender gatewaySender = factoryBean.getObject();

    assertNotNull(gatewaySender);
    assertEquals("g0", gatewaySender.getId());
    assertEquals(69, gatewaySender.getRemoteDSId());
  }
View Full Code Here

    factoryBean.setParallel(true);
    factoryBean.doInit();

    verifyExpectations(factoryBean, mockGatewaySenderFactory);

    GatewaySender gatewaySender = factoryBean.getObject();

    assertNotNull(gatewaySender);
    assertEquals("g1", gatewaySender.getId());
    assertEquals(69, gatewaySender.getRemoteDSId());
  }
View Full Code Here

    factoryBean.setDispatcherThreads(1);
    factoryBean.doInit();

    verifyExpectations(factoryBean, mockGatewaySenderFactory);

    GatewaySender gatewaySender = factoryBean.getObject();

    assertNotNull(gatewaySender);
    assertEquals("g4", gatewaySender.getId());
    assertEquals(21, gatewaySender.getRemoteDSId());
  }
View Full Code Here

    factoryBean.setDispatcherThreads(1);
    factoryBean.doInit();

    verifyExpectations(factoryBean, mockGatewaySenderFactory);

    GatewaySender gatewaySender = factoryBean.getObject();

    assertNotNull(gatewaySender);
    assertEquals("g5", gatewaySender.getId());
    assertEquals(42, gatewaySender.getRemoteDSId());
  }
View Full Code Here

    factoryBean.setDiskStoreRef("queueOverflowDiskStore");
    factoryBean.doInit();

    verifyExpectations(factoryBean, mockGatewaySenderFactory);

    GatewaySender gatewaySender = factoryBean.getObject();

    assertNotNull(gatewaySender);
    assertEquals("g6", gatewaySender.getId());
    assertEquals(51, gatewaySender.getRemoteDSId());
  }
View Full Code Here

    factoryBean.setDiskSynchronous(true);
    factoryBean.doInit();

    verifyExpectations(factoryBean, mockGatewaySenderFactory);

    GatewaySender gatewaySender = factoryBean.getObject();

    assertNotNull(gatewaySender);
    assertEquals("g7", gatewaySender.getId());
    assertEquals(51, gatewaySender.getRemoteDSId());
  }
View Full Code Here

    Object[] gatewaySenders = TestUtils.readField("gatewaySenders", regionFactoryBean);

    assertNotNull(gatewaySenders);
    assertEquals(2, gatewaySenders.length);

    GatewaySender gatewaySender = (GatewaySender) gatewaySenders[0];

    assertNotNull(gatewaySender);
    assertEquals(1, gatewaySender.getRemoteDSId());
    assertEquals(false, gatewaySender.isManualStart());
    assertEquals(true, gatewaySender.isRunning());
    assertEquals(10, gatewaySender.getAlertThreshold());
    assertEquals(11, gatewaySender.getBatchSize());
    assertEquals(3000, gatewaySender.getBatchTimeInterval());
    assertEquals(2, gatewaySender.getDispatcherThreads());
    assertEquals("diskstore", gatewaySender.getDiskStoreName());
    assertEquals(true, gatewaySender.isDiskSynchronous());
    assertTrue(gatewaySender.isBatchConflationEnabled());
    assertEquals(50, gatewaySender.getMaximumQueueMemory());
    assertEquals(OrderPolicy.THREAD, gatewaySender.getOrderPolicy());
    assertTrue(gatewaySender.isPersistenceEnabled());
    assertFalse(gatewaySender.isParallel());
    assertEquals(16536, gatewaySender.getSocketBufferSize());
    assertEquals(3000, gatewaySender.getSocketReadTimeout());

    List<GatewayEventFilter> eventFilters = gatewaySender.getGatewayEventFilters();

    assertNotNull(eventFilters);
    assertEquals(1, eventFilters.size());
    assertTrue(eventFilters.get(0) instanceof TestEventFilter);

    List<GatewayTransportFilter> transportFilters = gatewaySender.getGatewayTransportFilters();

    assertNotNull(transportFilters);
    assertEquals(1, transportFilters.size());
    assertTrue(transportFilters.get(0) instanceof TestTransportFilter);
  }
View Full Code Here

    return this;
  }

  @Override
  public GatewaySender create(final String name, final int remoteSystemId) {
    GatewaySender gatewaySender = mock(GatewaySender.class);

    when(gatewaySender.getId()).thenReturn(name);
    when(gatewaySender.getRemoteDSId()).thenReturn(remoteSystemId);
    when(gatewaySender.getAlertThreshold()).thenReturn(this.alertThreshold);
    when(gatewaySender.getGatewayEventFilters()).thenReturn(this.eventFilters);
    when(gatewaySender.getGatewayEventSubstitutionFilter()).thenReturn(gatewayEventSubstitutionFilter);
    when(gatewaySender.getGatewayTransportFilters()).thenReturn(this.transportFilters);
    when(gatewaySender.isManualStart()).thenReturn(this.manualStart);
    when(gatewaySender.getSocketBufferSize()).thenReturn(this.socketBufferSize);
    when(gatewaySender.getSocketReadTimeout()).thenReturn(this.socketReadTimeout);
    when(gatewaySender.isBatchConflationEnabled()).thenReturn(this.batchConflationEnabled);
    when(gatewaySender.getBatchSize()).thenReturn(this.batchSize);
    when(gatewaySender.getBatchTimeInterval()).thenReturn(this.batchTimeInterval);
    when(gatewaySender.getDiskStoreName()).thenReturn(this.diskStoreName);
    when(gatewaySender.isDiskSynchronous()).thenReturn(this.diskSynchronous);
    when(gatewaySender.getDispatcherThreads()).thenReturn(this.dispatcherThreads);
    when(gatewaySender.getMaximumQueueMemory()).thenReturn(this.maxQueueMemory);
    when(gatewaySender.isParallel()).thenReturn(this.parallel);
    when(gatewaySender.isPersistenceEnabled()).thenReturn(this.persistenceEnabled);
    when(gatewaySender.getOrderPolicy()).thenReturn(this.orderPolicy);
    when(gatewaySender.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.GatewaySender

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.