use of org.junit.BeforeClass in project cassandra by apache.
the class CQLMetricsTest method setup.
@BeforeClass()
public static void setup() throws ConfigurationException, IOException {
Schema.instance.clear();
cassandra = new EmbeddedCassandraService();
cassandra.start();
cluster = Cluster.builder().addContactPoint("127.0.0.1").withPort(DatabaseDescriptor.getNativeTransportPort()).build();
session = cluster.connect();
session.execute("CREATE KEYSPACE IF NOT EXISTS junit WITH replication = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };");
session.execute("CREATE TABLE IF NOT EXISTS junit.metricstest (id int PRIMARY KEY, val text);");
}
use of org.junit.BeforeClass in project cassandra by apache.
the class MessagePayloadTest method makeCqlQueryHandlerAccessible.
@BeforeClass
public static void makeCqlQueryHandlerAccessible() {
try {
cqlQueryHandlerField = ClientState.class.getDeclaredField("cqlQueryHandler");
cqlQueryHandlerField.setAccessible(true);
Field modifiersField = Field.class.getDeclaredField("modifiers");
modifiersAccessible = modifiersField.isAccessible();
modifiersField.setAccessible(true);
modifiersField.setInt(cqlQueryHandlerField, cqlQueryHandlerField.getModifiers() & ~Modifier.FINAL);
} catch (IllegalAccessException | NoSuchFieldException e) {
throw new RuntimeException(e);
}
}
use of org.junit.BeforeClass in project cassandra by apache.
the class StorageServiceServerTest method setUp.
@BeforeClass
public static void setUp() throws ConfigurationException {
DatabaseDescriptor.daemonInitialization();
IEndpointSnitch snitch = new PropertyFileSnitch();
DatabaseDescriptor.setEndpointSnitch(snitch);
Keyspace.setInitialized();
}
use of org.junit.BeforeClass in project cassandra by apache.
the class SerializationsTest method defineSchema.
@BeforeClass
public static void defineSchema() throws Exception {
DatabaseDescriptor.daemonInitialization();
partitionerSwitcher = Util.switchPartitioner(RandomPartitioner.instance);
RANDOM_UUID = UUID.fromString("b5c3d033-75aa-4c2f-a819-947aac7a0c54");
FULL_RANGE = new Range<>(Util.testPartitioner().getMinimumToken(), Util.testPartitioner().getMinimumToken());
DESC = new RepairJobDesc(RANDOM_UUID, RANDOM_UUID, "Keyspace1", "Standard1", Arrays.asList(FULL_RANGE));
}
use of org.junit.BeforeClass in project cassandra by apache.
the class StorageProxyTest method beforeClass.
@BeforeClass
public static void beforeClass() throws Throwable {
DatabaseDescriptor.daemonInitialization();
DatabaseDescriptor.getHintsDirectory().mkdir();
TokenMetadata tmd = StorageService.instance.getTokenMetadata();
tmd.updateNormalToken(token("1"), InetAddress.getByName("127.0.0.1"));
tmd.updateNormalToken(token("6"), InetAddress.getByName("127.0.0.6"));
}
Aggregations