Package com.github.youtube.vitess.jdbc.bson

Source Code of com.github.youtube.vitess.jdbc.bson.VtoccBsonBlockingRpcChannelTest

package com.github.youtube.vitess.jdbc.bson;

import static org.junit.Assert.assertNotNull;

import com.google.inject.Guice;
import com.google.protobuf.Message;

import com.github.youtube.vitess.jdbc.bson.VtoccBsonBlockingRpcChannel.Factory;
import com.github.youtube.vitess.jdbc.vtocc.QueryService.SessionParams;

import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

/**
* Test for {@link com.github.youtube.vitess.jdbc.bson.VtoccBsonBlockingRpcChannel}.
*/

@RunWith(JUnit4.class)
public class VtoccBsonBlockingRpcChannelTest {

  /**
   * Manual test.
   *
   * Requires {@code vtoccServerSpec} system property and a running vtocc server. Must be manually
   * enabled and run.
   *
   * Example: {@code -DvtoccServerSpec=localhost:1610}
   */
  @Test
  @Ignore
  public void testWithParentServer() throws Exception {
    Factory channelFactory = Guice.createInjector().getInstance(Factory.class);

    VtoccBsonBlockingRpcChannel channel =
        channelFactory.create(System.getProperty("vtoccServerSpec"));

    Message response = channel.callBlockingMethod("GetSessionId",
        SessionParams.newBuilder().setKeyspace("test_keyspace").setShard("0").build());

    assertNotNull(response);
  }

}
TOP

Related Classes of com.github.youtube.vitess.jdbc.bson.VtoccBsonBlockingRpcChannelTest

TOP
Copyright © 2018 www.massapi.com. 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.