use of org.junit.BeforeClass in project agera by google.
the class HttpFunctionsTest method onlyOnce.
@BeforeClass
public static void onlyOnce() throws Throwable {
mockHttpURLConnection = mock(HttpURLConnection.class);
URL.setURLStreamHandlerFactory(new URLStreamHandlerFactory() {
@Override
public URLStreamHandler createURLStreamHandler(final String s) {
return s.equals(TEST_PROTOCOL) ? new URLStreamHandler() {
@Override
protected URLConnection openConnection(final URL url) throws IOException {
return mockHttpURLConnection;
}
} : null;
}
});
}
use of org.junit.BeforeClass in project Gaffer by gchq.
the class AccumuloRangeIDRetrieverTest method setup.
@BeforeClass
public static void setup() throws StoreException, IOException {
byteEntityStore = new MockAccumuloStore();
gaffer1KeyStore = new MockAccumuloStore();
byteEntityStore.initialise(schema, PROPERTIES);
gaffer1KeyStore.initialise(schema, CLASSIC_PROPERTIES);
defaultView = new View.Builder().edge(TestGroups.EDGE).entity(TestGroups.ENTITY).build();
setupGraph(byteEntityStore, numEntries);
setupGraph(gaffer1KeyStore, numEntries);
}
use of org.junit.BeforeClass in project Gaffer by gchq.
the class GetElementsWithinSetHandlerTest method setup.
@BeforeClass
public static void setup() throws StoreException, IOException {
byteEntityStore = new SingleUseMockAccumuloStore();
gaffer1KeyStore = new SingleUseMockAccumuloStore();
}
use of org.junit.BeforeClass in project hazelcast by hazelcast.
the class CacheReadQuorumTest method initialize.
@BeforeClass
public static void initialize() throws Exception {
CacheSimpleConfig cacheConfig = new CacheSimpleConfig();
cacheConfig.setName(CACHE_NAME_PREFIX + "*");
cacheConfig.setQuorumName(QUORUM_ID);
QuorumConfig quorumConfig = new QuorumConfig();
quorumConfig.setName(QUORUM_ID);
quorumConfig.setType(QuorumType.READ);
quorumConfig.setEnabled(true);
quorumConfig.setSize(3);
PartitionedCluster cluster = new PartitionedCluster(new TestHazelcastInstanceFactory()).partitionFiveMembersThreeAndTwo(cacheConfig, quorumConfig);
cachingProvider1 = HazelcastServerCachingProvider.createCachingProvider(cluster.h1);
cachingProvider2 = HazelcastServerCachingProvider.createCachingProvider(cluster.h2);
cachingProvider3 = HazelcastServerCachingProvider.createCachingProvider(cluster.h3);
cachingProvider4 = HazelcastServerCachingProvider.createCachingProvider(cluster.h4);
cachingProvider5 = HazelcastServerCachingProvider.createCachingProvider(cluster.h5);
}
use of org.junit.BeforeClass in project hazelcast by hazelcast.
the class CacheReadWriteQuorumTest method initialize.
@BeforeClass
public static void initialize() throws Exception {
CacheSimpleConfig cacheConfig = new CacheSimpleConfig();
cacheConfig.setName(CACHE_NAME_PREFIX + "*");
cacheConfig.setQuorumName(QUORUM_ID);
QuorumConfig quorumConfig = new QuorumConfig();
quorumConfig.setName(QUORUM_ID);
quorumConfig.setType(QuorumType.READ_WRITE);
quorumConfig.setEnabled(true);
quorumConfig.setSize(3);
PartitionedCluster cluster = new PartitionedCluster(new TestHazelcastInstanceFactory()).partitionFiveMembersThreeAndTwo(cacheConfig, quorumConfig);
cachingProvider1 = HazelcastServerCachingProvider.createCachingProvider(cluster.h1);
cachingProvider2 = HazelcastServerCachingProvider.createCachingProvider(cluster.h2);
cachingProvider3 = HazelcastServerCachingProvider.createCachingProvider(cluster.h3);
cachingProvider4 = HazelcastServerCachingProvider.createCachingProvider(cluster.h4);
cachingProvider5 = HazelcastServerCachingProvider.createCachingProvider(cluster.h5);
}
Aggregations