本文整理汇总了Java中org.cassandraunit.utils.EmbeddedCassandraServerHelper.getNativeTransportPort方法的典型用法代码示例。如果您正苦于以下问题:Java EmbeddedCassandraServerHelper.getNativeTransportPort方法的具体用法?Java EmbeddedCassandraServerHelper.getNativeTransportPort怎么用?Java EmbeddedCassandraServerHelper.getNativeTransportPort使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.cassandraunit.utils.EmbeddedCassandraServerHelper
的用法示例。
在下文中一共展示了EmbeddedCassandraServerHelper.getNativeTransportPort方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: load
import org.cassandraunit.utils.EmbeddedCassandraServerHelper; //导入方法依赖的package包/类
@Override
protected void load() {
String hostIp = EmbeddedCassandraServerHelper.getHost();
int port = EmbeddedCassandraServerHelper.getNativeTransportPort();
cluster = new Cluster.Builder().addContactPoints(hostIp).withPort(port).withSocketOptions(getSocketOptions())
.build();
session = cluster.connect();
CQLDataLoader dataLoader = new CQLDataLoader(session);
dataSets.forEach(dataLoader::load);
session = dataLoader.getSession();
}
示例2: setupCassandra
import org.cassandraunit.utils.EmbeddedCassandraServerHelper; //导入方法依赖的package包/类
@BeforeClass
public static void setupCassandra() throws ConfigurationException, IOException, TTransportException, InterruptedException {
EmbeddedCassandraServerHelper.startEmbeddedCassandra(EmbeddedCassandraServerHelper.CASSANDRA_RNDPORT_YML_FILE);
binaryPort = EmbeddedCassandraServerHelper.getNativeTransportPort();
cluster = Cluster.builder()
.addContactPoints(CASSANDRA_HOSTS)
.withPort(binaryPort)
.withCredentials(username, password)
.build();
session = cluster.connect();
}
示例3: setupCassandra
import org.cassandraunit.utils.EmbeddedCassandraServerHelper; //导入方法依赖的package包/类
@BeforeClass
public static void setupCassandra() throws ConfigurationException, IOException, TTransportException, InterruptedException {
EmbeddedCassandraServerHelper.startEmbeddedCassandra(EmbeddedCassandraServerHelper.CASSANDRA_RNDPORT_YML_FILE);
binaryPort = EmbeddedCassandraServerHelper.getNativeTransportPort();
cluster = Cluster.builder().addContactPoints(CASSANDRA_HOSTS).withPort(binaryPort).withCredentials(username, password).build();
clusterHealth = new ClusterHealth(cluster);
session = cluster.connect();
}
示例4: setupCassandra
import org.cassandraunit.utils.EmbeddedCassandraServerHelper; //导入方法依赖的package包/类
@BeforeClass
public static void setupCassandra() throws ConfigurationException, IOException, TTransportException, InterruptedException {
EmbeddedCassandraServerHelper.startEmbeddedCassandra(EmbeddedCassandraServerHelper.CASSANDRA_RNDPORT_YML_FILE, 30000);
binaryPort = EmbeddedCassandraServerHelper.getNativeTransportPort();
cluster = Cluster.builder().addContactPoints(CASSANDRA_HOSTS).withPort(binaryPort).withCredentials(username, password).build();
session = cluster.connect();
}
示例5: before
import org.cassandraunit.utils.EmbeddedCassandraServerHelper; //导入方法依赖的package包/类
@Override
public void before() throws Throwable {
cassandraUnit = new MyCassandraCQLUnit(getDataSet(CASSANDRA_KEYSPACE, 1));
cassandraUnit.before();
host = EmbeddedCassandraServerHelper.getHost();
port = EmbeddedCassandraServerHelper.getNativeTransportPort();
}
示例6: load
import org.cassandraunit.utils.EmbeddedCassandraServerHelper; //导入方法依赖的package包/类
@Override
protected void load() {
String hostIp = EmbeddedCassandraServerHelper.getHost();
int port = EmbeddedCassandraServerHelper.getNativeTransportPort();
cluster = new Cluster.Builder().addContactPoints(hostIp).withPort(port).withSocketOptions(getSocketOptions())
.build();
session = cluster.connect();
CQLDataLoader dataLoader = new CQLDataLoader(session);
dataLoader.load(dataSet);
session = dataLoader.getSession();
}
示例7: setupCassandra
import org.cassandraunit.utils.EmbeddedCassandraServerHelper; //导入方法依赖的package包/类
public static void setupCassandra() throws ConfigurationException, IOException, TTransportException, InterruptedException {
EmbeddedCassandraServerHelper.startEmbeddedCassandra(EmbeddedCassandraServerHelper.CASSANDRA_RNDPORT_YML_FILE);
binaryPort = EmbeddedCassandraServerHelper.getNativeTransportPort();
cluster = Cluster.builder().addContactPoints(CASSANDRA_HOSTS).withPort(binaryPort).withCredentials(username, password).build();
session = cluster.connect();
}