use of org.apache.geode.cache.CacheFactory in project geode by apache.
the class OffHeapIndexJUnitTest method setUp.
@Before
public void setUp() {
Properties props = new Properties();
props.setProperty(LOCATORS, "");
props.setProperty(MCAST_PORT, "0");
props.setProperty(ConfigurationProperties.OFF_HEAP_MEMORY_SIZE, "100m");
this.gfc = (GemFireCacheImpl) new CacheFactory(props).create();
}
use of org.apache.geode.cache.CacheFactory in project geode by apache.
the class OffHeapLRURecoveryRegressionTest method createCache.
private GemFireCacheImpl createCache() {
Properties props = new Properties();
props.setProperty(LOCATORS, "");
props.setProperty(MCAST_PORT, "0");
props.setProperty(ConfigurationProperties.OFF_HEAP_MEMORY_SIZE, "20m");
GemFireCacheImpl result = (GemFireCacheImpl) new CacheFactory(props).create();
result.getResourceManager().setEvictionOffHeapPercentage(50.0f);
return result;
}
use of org.apache.geode.cache.CacheFactory in project geode by apache.
the class MBeanStatsTestCase method setUp.
@SuppressWarnings("deprecation")
@Before
public void setUp() throws Exception {
// System.setProperty("gemfire.stats.debug.debugSampleCollector", "true");
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");
this.system = (InternalDistributedSystem) DistributedSystem.connect(props);
assertNotNull(this.system.getStatSampler());
assertNotNull(this.system.getStatSampler().waitForSampleCollector(TIMEOUT));
new CacheFactory().create();
init();
sample();
}
use of org.apache.geode.cache.CacheFactory in project geode by apache.
the class TypedJsonJUnitTest method testPDXObject.
@Test
public void testPDXObject() {
final Properties props = new Properties();
props.setProperty(MCAST_PORT, "0");
DistributedSystem.connect(props);
Cache cache = new CacheFactory().create();
PdxInstanceFactory pf = PdxInstanceFactoryImpl.newCreator("Portfolio", false);
Portfolio p = new Portfolio(2);
pf.writeInt("ID", 111);
pf.writeString("status", "active");
pf.writeString("secId", "IBM");
pf.writeObject("portfolio", p);
PdxInstance pi = pf.create();
TypedJson tJsonObj = new TypedJson(RESULT, pi);
System.out.println(tJsonObj);
cache.close();
}
use of org.apache.geode.cache.CacheFactory in project geode by apache.
the class TypedJsonJUnitTest method testNestedPDXObject.
@Test
public void testNestedPDXObject() {
final Properties props = new Properties();
props.setProperty(MCAST_PORT, "0");
DistributedSystem.connect(props);
Cache cache = new CacheFactory().create();
PdxInstanceFactory pf = PdxInstanceFactoryImpl.newCreator("Portfolio", false);
pf.writeInt("ID", 111);
pf.writeString("status", "active");
pf.writeString("secId", "IBM");
PdxInstance pi = pf.create();
PDXContainer cont = new PDXContainer(1);
cont.setPi(pi);
TypedJson tJsonObj = new TypedJson(RESULT, cont);
System.out.println(tJsonObj);
cache.close();
}
Aggregations