Search in sources :

Example 26 with ClientUserCodeDeploymentConfig

use of com.hazelcast.client.config.ClientUserCodeDeploymentConfig in project hazelcast by hazelcast.

the class ClientUserCodeDeploymentTest method testWithParentAndChildClassesWorksIndependentOfOrder_childFirst.

@Test
public void testWithParentAndChildClassesWorksIndependentOfOrder_childFirst() {
    ClientConfig clientConfig = new ClientConfig();
    ClientUserCodeDeploymentConfig clientUserCodeDeploymentConfig = new ClientUserCodeDeploymentConfig();
    clientUserCodeDeploymentConfig.addClass(SampleSubClass.class);
    clientUserCodeDeploymentConfig.addClass(SampleBaseClass.class);
    clientConfig.setUserCodeDeploymentConfig(clientUserCodeDeploymentConfig.setEnabled(true));
    factory.newHazelcastInstance(createNodeConfig());
    factory.newHazelcastClient(clientConfig);
}
Also used : 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 27 with ClientUserCodeDeploymentConfig

use of com.hazelcast.client.config.ClientUserCodeDeploymentConfig in project hazelcast by hazelcast.

the class ClientUserCodeDeploymentConfigTest method testConfigWithClass.

@Test
public void testConfigWithClass() throws ClassNotFoundException, IOException {
    ClientUserCodeDeploymentConfig config = new ClientUserCodeDeploymentConfig();
    config.setEnabled(true);
    config.addClass(IncrementingEntryProcessor.class);
    ClientUserCodeDeploymentService service = new ClientUserCodeDeploymentService(config, this.getClass().getClassLoader());
    service.start();
    List<Map.Entry<String, byte[]>> list = service.getClassDefinitionList();
    assertClassLoaded(list, IncrementingEntryProcessor.class.getName());
}
Also used : IncrementingEntryProcessor(usercodedeployment.IncrementingEntryProcessor) ClientUserCodeDeploymentService(com.hazelcast.client.impl.spi.impl.ClientUserCodeDeploymentService) ClientUserCodeDeploymentConfig(com.hazelcast.client.config.ClientUserCodeDeploymentConfig) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Aggregations

ClientUserCodeDeploymentConfig (com.hazelcast.client.config.ClientUserCodeDeploymentConfig)27 Test (org.junit.Test)24 QuickTest (com.hazelcast.test.annotation.QuickTest)23 ParallelJVMTest (com.hazelcast.test.annotation.ParallelJVMTest)22 ClientConfig (com.hazelcast.client.config.ClientConfig)14 ClientUserCodeDeploymentService (com.hazelcast.client.impl.spi.impl.ClientUserCodeDeploymentService)12 Config (com.hazelcast.config.Config)5 File (java.io.File)3 URL (java.net.URL)3 IncrementingEntryProcessor (usercodedeployment.IncrementingEntryProcessor)3 AttributeConfig (com.hazelcast.config.AttributeConfig)2 UserCodeDeploymentConfig (com.hazelcast.config.UserCodeDeploymentConfig)2 HazelcastException (com.hazelcast.core.HazelcastException)2 HazelcastInstance (com.hazelcast.core.HazelcastInstance)2 DomainClassWithInnerClass (usercodedeployment.DomainClassWithInnerClass)2 ClientDiscoverySpiTest (com.hazelcast.client.impl.spi.impl.discovery.ClientDiscoverySpiTest)1 SlowTest (com.hazelcast.test.annotation.SlowTest)1 Node (org.w3c.dom.Node)1 EntryProcessorWithAnonymousAndInner (usercodedeployment.EntryProcessorWithAnonymousAndInner)1 Person (usercodedeployment.Person)1