Package com.alibaba.wasp.util

Examples of com.alibaba.wasp.util.MockFServerServices


      table = createPlan.getTable();
      TableSchemaCacheReader.getService(conf).createTable(table);
      reader.addSchema(table.getTableName(), table);
    }
    EntityGroupInfo egi = new EntityGroupInfo(table.getTableName(), null, null);
    MockFServerServices service = new MockFServerServices();
    eg = new EntityGroup(conf, egi, table, service);
    NullStorageServices storageServices = new NullStorageServices();
    eg.setStorageServices(storageServices);
    eg.initialize();
  }
View Full Code Here


   */
  @Test
  public void testYankingEntityGroupFromUnderIt() throws IOException,
      NodeExistsException, KeeperException {
    final Server server = new MockServer(WTU);
    final FServerServices rss = new MockFServerServices();

    FTable htd = TEST_FTD;
    final EntityGroupInfo egi = TEST_EGI;
    EntityGroup entityGroup = EntityGroup.createEntityGroup(egi,
        WTU.getConfiguration(), htd, rss);
View Full Code Here

  }

  @Test
  public void testFailedOpenEntityGroup() throws Exception {
    Server server = new MockServer(WTU);
    FServerServices rsServices = new MockFServerServices();

    // Create it OFFLINE, which is what it expects
    ZKAssign.createNodeOffline(server.getZooKeeper(), TEST_EGI,
        server.getServerName());
View Full Code Here

  }

  @Test
  public void testFailedUpdateMeta() throws Exception {
    Server server = new MockServer(WTU);
    FServerServices rsServices = new MockFServerServices();

    // Create it OFFLINE, which is what it expects
    ZKAssign.createNodeOffline(server.getZooKeeper(), TEST_EGI,
        server.getServerName());
View Full Code Here

   */
  @Test
  public void testFailedCommitAborts() throws IOException, NodeExistsException,
      KeeperException {
    final Server server = new MockServer(WTU, false);
    final FServerServices rss = new MockFServerServices();
    FTable wtd = TEST_FTD;
    final EntityGroupInfo egi = new EntityGroupInfo(wtd.getTableName(),
        FConstants.EMPTY_END_ROW, FConstants.EMPTY_END_ROW);
    EntityGroup entityGroup = EntityGroup.createEntityGroup(egi,
        WTU.getConfiguration(), wtd, rss);
    try {
      assertNotNull(entityGroup);
      // Spy on the entityGroup so can throw exception when close is called.
      EntityGroup spy = Mockito.spy(entityGroup);
      final boolean abort = false;
      Mockito.when(spy.close(abort)).thenThrow(
          new RuntimeException("Mocked failed close!"));
      rss.addToOnlineEntityGroups(spy);
      assertFalse(server.isStopped());
      CloseEntityGroupHandler handler = new CloseEntityGroupHandler(server,
          rss, egi, false, false, -1, EventType.M_FSERVER_CLOSE_ENTITYGROUP);
      boolean throwable = false;
      try {
View Full Code Here

   */
  @Test
  public void testZKClosingNodeVersionMismatch() throws IOException,
      NodeExistsException, KeeperException, DeserializationException {
    final Server server = new MockServer(WTU);
    final MockFServerServices rss = new MockFServerServices();

    FTable ftd = TEST_FTD;
    final EntityGroupInfo egi = TEST_EGI;

    // open a entityGroup first so that it can be closed later
View Full Code Here

   */
  @Test
  public void testCloseEntityGroup() throws IOException, NodeExistsException,
      KeeperException, DeserializationException {
    final Server server = new MockServer(WTU);
    final MockFServerServices rss = new MockFServerServices();
    FTable htd = TEST_FTD;
    EntityGroupInfo egi = TEST_EGI;
    openEntityGroup(server, rss, htd, egi);
    int versionOfClosingNode = ZKAssign.createNodeClosing(
        server.getZooKeeper(), egi, server.getServerName());
View Full Code Here

TOP

Related Classes of com.alibaba.wasp.util.MockFServerServices

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.