Search in sources :

Example 1 with EntryProcessorWithAnonymousAndInner

use of usercodedeployment.EntryProcessorWithAnonymousAndInner in project hazelcast by hazelcast.

the class ClientUserCodeDeploymentTest method testWithMultipleMembers_anonymousAndInnerClasses.

@Test
public void testWithMultipleMembers_anonymousAndInnerClasses() {
    ClientConfig clientConfig = new ClientConfig();
    ClientUserCodeDeploymentConfig clientUserCodeDeploymentConfig = new ClientUserCodeDeploymentConfig();
    clientUserCodeDeploymentConfig.addJar("EntryProcessorWithAnonymousAndInner.jar");
    clientConfig.setUserCodeDeploymentConfig(clientUserCodeDeploymentConfig.setEnabled(true));
    Config config = createNodeConfig();
    factory.newHazelcastInstance(config);
    HazelcastInstance client = factory.newHazelcastClient(clientConfig);
    factory.newHazelcastInstance(config);
    assertCodeDeploymentWorking(client, new EntryProcessorWithAnonymousAndInner());
}
Also used : HazelcastInstance(com.hazelcast.core.HazelcastInstance) AttributeConfig(com.hazelcast.config.AttributeConfig) UserCodeDeploymentConfig(com.hazelcast.config.UserCodeDeploymentConfig) ClientConfig(com.hazelcast.client.config.ClientConfig) ClientUserCodeDeploymentConfig(com.hazelcast.client.config.ClientUserCodeDeploymentConfig) Config(com.hazelcast.config.Config) EntryProcessorWithAnonymousAndInner(usercodedeployment.EntryProcessorWithAnonymousAndInner) ClientConfig(com.hazelcast.client.config.ClientConfig) ClientUserCodeDeploymentConfig(com.hazelcast.client.config.ClientUserCodeDeploymentConfig) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 2 with EntryProcessorWithAnonymousAndInner

use of usercodedeployment.EntryProcessorWithAnonymousAndInner in project hazelcast by hazelcast.

the class UserCodeDeploymentBasicTest method givenSomeMemberCanAccessTheEP_whenTheEPIsFilteredLocally_thenItWillBeLoadedOverNetwork_anonymousInnerClasses.

@Test
public void givenSomeMemberCanAccessTheEP_whenTheEPIsFilteredLocally_thenItWillBeLoadedOverNetwork_anonymousInnerClasses() {
    Config i1Config = new Config();
    i1Config.getUserCodeDeploymentConfig().setEnabled(true).setClassCacheMode(classCacheMode);
    Config i2Config = new Config();
    FilteringClassLoader filteringCL = new FilteringClassLoader(singletonList("usercodedeployment"), null);
    i2Config.setClassLoader(filteringCL);
    i2Config.getUserCodeDeploymentConfig().setEnabled(true).setClassCacheMode(classCacheMode);
    EntryProcessorWithAnonymousAndInner incrementingEntryProcessor = new EntryProcessorWithAnonymousAndInner();
    executeSimpleTestScenario(i1Config, i2Config, incrementingEntryProcessor);
}
Also used : UserCodeDeploymentConfig(com.hazelcast.config.UserCodeDeploymentConfig) Config(com.hazelcast.config.Config) EntryProcessorWithAnonymousAndInner(usercodedeployment.EntryProcessorWithAnonymousAndInner) FilteringClassLoader(com.hazelcast.internal.util.FilteringClassLoader) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Aggregations

Config (com.hazelcast.config.Config)2 UserCodeDeploymentConfig (com.hazelcast.config.UserCodeDeploymentConfig)2 ParallelJVMTest (com.hazelcast.test.annotation.ParallelJVMTest)2 QuickTest (com.hazelcast.test.annotation.QuickTest)2 Test (org.junit.Test)2 EntryProcessorWithAnonymousAndInner (usercodedeployment.EntryProcessorWithAnonymousAndInner)2 ClientConfig (com.hazelcast.client.config.ClientConfig)1 ClientUserCodeDeploymentConfig (com.hazelcast.client.config.ClientUserCodeDeploymentConfig)1 AttributeConfig (com.hazelcast.config.AttributeConfig)1 HazelcastInstance (com.hazelcast.core.HazelcastInstance)1 FilteringClassLoader (com.hazelcast.internal.util.FilteringClassLoader)1