@BeforeClass(groups = {"short", "long"}) public void beforeTestClass() { scassandra = TestUtils.createScassandraServer(); scassandra.start(); primingClient = scassandra.primingClient(); activityClient = scassandra.activityClient(); currentClient = scassandra.currentClient(); hostAddress = new InetSocketAddress(ip, scassandra.getBinaryPort()); }
scassandra.start(); List<Map<String, ?>> rows = Collections.<Map<String, ?>>singletonList(ImmutableMap.of("key", 1)); scassandra .primingClient() .prime( PrimingRequest.queryBuilder() Cluster.builder() .addContactPoint(TestUtils.ipOfNode(1)) .withPort(scassandra.getBinaryPort()) .withPoolingOptions( new PoolingOptions() } finally { if (cluster != null) cluster.close(); scassandra.stop();
private void primePeerRows(Scassandra scassandra, List<FakeHost> otherHosts) throws UnknownHostException { PrimingClient primingClient = PrimingClient.builder().withHost(ipOfNode(1)).withPort(scassandra.getAdminPort()).build();
@BeforeMethod(groups = "short") public void beforeMethod() { cluster = Cluster.builder() .addContactPoints(scassandras.address(1).getAddress()) .withPort(scassandras.getBinaryPort()) .withRetryPolicy(FallthroughRetryPolicy.INSTANCE) .build(); session = cluster.connect(); host1 = TestUtils.findHost(cluster, 1); errors = cluster.getMetrics().getErrorMetrics(); for (Scassandra node : scassandras.nodes()) { node.primingClient().clearAllPrimes(); node.activityClient().clearAllRecordedActivity(); } }
scassandra.node(1).activityClient().retrievePreparedStatementPreparations(); scassandra.node(1).activityClient().clearAllRecordedActivity(); scassandra.node(1).stop(); assertThat(cluster).host(1).goesDownWithin(10, TimeUnit.SECONDS); scassandra.node(1).start(); assertThat(cluster).host(1).comesUpWithin(60, TimeUnit.SECONDS); preparationOne = scassandra.node(1).activityClient().retrievePreparedStatementPreparations(); if (expectReprepare) { if (i == maxTries) throw e; scassandra.node(1).activityClient().clearAllRecordedActivity();
@AfterMethod(groups = "short", alwaysRun = true) public void afterMethod() { for (Scassandra node : scassandras.nodes()) { node.primingClient().clearAllPrimes(); } if (cluster != null) cluster.close(); }
public void clearActivityLog() { for (Scassandra node : sCluster.nodes()) { node.activityClient().clearAllRecordedActivity(); } }
scassandra.start(); int port = scassandra.getBinaryPort(); .withPort(scassandra.getBinaryPort()) .addContactPoints( ipOfNode(1), if (cluster != null) cluster.close(); for (FakeHost fakeHost : failingHosts) fakeHost.stop(); if (scassandra != null) scassandra.stop();
public void stop() { logger.debug("Stopping ScassandraCluster."); for (Scassandra node : instances) { node.stop(); } }
Cluster.builder() .addContactPoints(hostAddress.getAddress()) .withPort(scassandra.getBinaryPort()) .withPoolingOptions( new PoolingOptions() .primingClient() .prime(queryBuilder().withQuery("ping").withThen(then().withFixedDelay(8675309999L)));
.contains("Query error") .contains(ip) .contains(Integer.toString(scassandra.getBinaryPort())) .contains(query) .contains(expectedException.getName());
public void init() { for (Map.Entry<Integer, List<Scassandra>> dc : dcNodeMap.entrySet()) { for (Scassandra node : dc.getValue()) { node.start(); primeMetadata(node); } } }
scassandra.node(1).currentClient().closeConnection(CLOSE, controlSocket);
public PrimingClient primingClient() { return scassandra.primingClient(); }
public void clearActivityLog() { for (Scassandra node : sCluster.nodes()) { node.activityClient().clearAllRecordedActivity(); } }
scassandra.node(1).activityClient().retrievePreparedStatementPreparations(); scassandra.node(1).activityClient().clearAllRecordedActivity(); scassandra.node(1).stop(); assertThat(cluster).host(1).goesDownWithin(10, TimeUnit.SECONDS); scassandra.node(1).start(); assertThat(cluster).host(1).comesUpWithin(60, TimeUnit.SECONDS); preparationOne = scassandra.node(1).activityClient().retrievePreparedStatementPreparations(); if (expectReprepare) { if (i == maxTries) throw e; scassandra.node(1).activityClient().clearAllRecordedActivity();
scassandra.start(); int port = scassandra.getBinaryPort(); .withPort(scassandra.getBinaryPort()) .addContactPoints( ipOfNode(1), if (cluster != null) cluster.close(); for (FakeHost fakeHost : failingHosts) fakeHost.stop(); if (scassandra != null) scassandra.stop();
@BeforeMethod(groups = "short") public void beforeMethod() { cluster = Cluster.builder() .addContactPoints(scassandras.address(1).getAddress()) .withPort(scassandras.getBinaryPort()) .withRetryPolicy(FallthroughRetryPolicy.INSTANCE) .build(); session = cluster.connect(); host1 = TestUtils.findHost(cluster, 1); errors = cluster.getMetrics().getErrorMetrics(); for (Scassandra node : scassandras.nodes()) { node.primingClient().clearAllPrimes(); node.activityClient().clearAllRecordedActivity(); } }
@AfterClass(groups = {"short", "long"}) public void afterTestClass() { if (scassandra != null) scassandra.stop(); }