use of usercodedeployment.DomainClassWithInnerClass in project hazelcast by hazelcast.
the class UserCodeDeploymentBasicTest method testInnerClassFetchedFirst_thenMainClassFetchedFromRemote.
@Test
public void testInnerClassFetchedFirst_thenMainClassFetchedFromRemote() {
Config i1Config = new Config();
i1Config.getUserCodeDeploymentConfig().setEnabled(true).setClassCacheMode(classCacheMode);
Config filteredConfig = new Config();
FilteringClassLoader filteringCL = new FilteringClassLoader(singletonList("usercodedeployment"), null);
filteredConfig.setClassLoader(filteringCL);
filteredConfig.getUserCodeDeploymentConfig().setEnabled(true).setClassCacheMode(classCacheMode);
HazelcastInstance instanceWithClasses = factory.newHazelcastInstance(i1Config);
HazelcastInstance instanceWithoutTheClasses = factory.newHazelcastInstance(filteredConfig);
IMap<Object, Object> map = instanceWithClasses.getMap("test");
DomainClassWithInnerClass mainDomainObject = new DomainClassWithInnerClass(new DomainClassWithInnerClass.InnerClass(2));
map.put("main", mainDomainObject);
DomainClassWithInnerClass.InnerClass innerObject = new DomainClassWithInnerClass.InnerClass(1);
map.put("inner", innerObject);
IMap<Object, Object> map2 = instanceWithoutTheClasses.getMap("test");
map2.get("inner");
map2.get("main");
}
use of usercodedeployment.DomainClassWithInnerClass in project hazelcast by hazelcast.
the class UserCodeDeploymentBasicTest method testMainClassFetchedFirst_thenInnerlassFetchedFromRemote.
@Test
public void testMainClassFetchedFirst_thenInnerlassFetchedFromRemote() {
Config i1Config = new Config();
i1Config.getUserCodeDeploymentConfig().setEnabled(true).setClassCacheMode(classCacheMode);
Config filteredConfig = new Config();
FilteringClassLoader filteringCL = new FilteringClassLoader(singletonList("usercodedeployment"), null);
filteredConfig.setClassLoader(filteringCL);
filteredConfig.getUserCodeDeploymentConfig().setEnabled(true).setClassCacheMode(classCacheMode);
HazelcastInstance instanceWithClasses = factory.newHazelcastInstance(i1Config);
HazelcastInstance instanceWithoutTheClasses = factory.newHazelcastInstance(filteredConfig);
IMap<Object, Object> map = instanceWithClasses.getMap("test");
DomainClassWithInnerClass mainDomainObject = new DomainClassWithInnerClass(new DomainClassWithInnerClass.InnerClass(2));
map.put("main", mainDomainObject);
DomainClassWithInnerClass.InnerClass innerObject = new DomainClassWithInnerClass.InnerClass(1);
map.put("inner", innerObject);
IMap<Object, Object> map2 = instanceWithoutTheClasses.getMap("test");
map2.get("main");
map2.get("inner");
}
Aggregations