use of org.apache.geode.cache.CacheFactory in project geode by apache.
the class DistributedSystemStatsJUnitTest method setUp.
@SuppressWarnings("deprecation")
@Before
public void setUp() throws Exception {
final Properties props = new Properties();
props.setProperty(MCAST_PORT, "0");
props.setProperty(ENABLE_TIME_STATISTICS, "true");
props.setProperty(STATISTIC_SAMPLING_ENABLED, "false");
props.setProperty(STATISTIC_SAMPLE_RATE, "60000");
props.setProperty(JMX_MANAGER, "true");
props.setProperty(JMX_MANAGER_START, "true");
// set JMX_MANAGER_UPDATE_RATE to practically an infinite value, so that
// LocalManager wont try to run ManagementTask
props.setProperty(JMX_MANAGER_UPDATE_RATE, "60000");
props.setProperty(JMX_MANAGER_PORT, "0");
this.system = (InternalDistributedSystem) DistributedSystem.connect(props);
assertNotNull(this.system.getStatSampler());
assertNotNull(this.system.getStatSampler().waitForSampleCollector(TIMEOUT));
this.cache = new CacheFactory().create();
}
use of org.apache.geode.cache.CacheFactory in project geode by apache.
the class IntegratedSecurityCacheLifecycleIntegrationTest method before.
@Before
public void before() {
securityService = IntegratedSecurityService.getSecurityService();
securityProps = new Properties();
securityProps.setProperty(SECURITY_MANAGER, SpySecurityManager.class.getName());
Properties props = new Properties();
props.putAll(securityProps);
props.setProperty(MCAST_PORT, "0");
props.setProperty(LOCATORS, "");
cache = new CacheFactory(props).create();
}
use of org.apache.geode.cache.CacheFactory in project geode by apache.
the class ClusterConfigWithEmbededLocatorDUnitTest method testEmbeddedLocator.
@Test
public void testEmbeddedLocator() throws Exception {
int locatorPort = AvailablePortHelper.getRandomAvailableTCPPort();
// locator started this way won't have cluster configuration running
locator.invoke(() -> {
new CacheFactory().set("name", this.getName() + ".server1").set("mcast-port", "0").set("log-level", "config").set("start-locator", "localhost[" + locatorPort + "]").create();
});
// when this server joins the above locator, it won't request the cluster config from the
// locator
// since DM.getAllHostedLocatorsWithSharedConfiguration() will return an empty list. This would
// execute without error
new CacheFactory().set("name", this.getName() + ".server2").set("mcast-port", "0").set("log-level", "config").set("locators", "localhost[" + locatorPort + "]").create();
}
use of org.apache.geode.cache.CacheFactory in project geode by apache.
the class SortedSetsJUnitTest method setUp.
@BeforeClass
public static void setUp() throws IOException {
rand = new Random();
CacheFactory cf = new CacheFactory();
// cf.set("log-file", "redis.log");
cf.set(LOG_LEVEL, "error");
cf.set(MCAST_PORT, "0");
cf.set(LOCATORS, "");
cache = cf.create();
port = AvailablePortHelper.getRandomAvailableTCPPort();
server = new GeodeRedisServer("localhost", port);
server.start();
jedis = new Jedis("localhost", port, 10000000);
}
use of org.apache.geode.cache.CacheFactory in project geode by apache.
the class DistTXReleasesOffHeapOnCloseJUnitTest method createCache.
@Override
protected void createCache() {
Properties props = new Properties();
props.setProperty(MCAST_PORT, "0");
props.setProperty(LOCATORS, "");
props.setProperty(ConfigurationProperties.OFF_HEAP_MEMORY_SIZE, "1m");
props.put(ConfigurationProperties.DISTRIBUTED_TRANSACTIONS, "true");
cache = new CacheFactory(props).create();
CacheTransactionManager txmgr = cache.getCacheTransactionManager();
assert (txmgr.isDistributed());
}
Aggregations