Search in sources :

Example 11 with ClientUserCodeDeploymentService

use of com.hazelcast.client.impl.spi.impl.ClientUserCodeDeploymentService in project hazelcast by hazelcast.

the class ClientUserCodeDeploymentConfigTest method testConfigWithFileDoesNotExist.

@Test(expected = FileNotFoundException.class)
public void testConfigWithFileDoesNotExist() throws ClassNotFoundException, IOException {
    ClientUserCodeDeploymentConfig config = new ClientUserCodeDeploymentConfig();
    config.setEnabled(true);
    ClassLoader classLoader = getClass().getClassLoader();
    File file = new File("/wrongPath/IncrementingEntryProcessor.jar");
    config.addJar(file);
    ClientUserCodeDeploymentService service = new ClientUserCodeDeploymentService(config, classLoader);
    service.start();
}
Also used : ClientUserCodeDeploymentService(com.hazelcast.client.impl.spi.impl.ClientUserCodeDeploymentService) File(java.io.File) ClientUserCodeDeploymentConfig(com.hazelcast.client.config.ClientUserCodeDeploymentConfig) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 12 with ClientUserCodeDeploymentService

use of com.hazelcast.client.impl.spi.impl.ClientUserCodeDeploymentService 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)12 ClientUserCodeDeploymentService (com.hazelcast.client.impl.spi.impl.ClientUserCodeDeploymentService)12 ParallelJVMTest (com.hazelcast.test.annotation.ParallelJVMTest)12 QuickTest (com.hazelcast.test.annotation.QuickTest)12 Test (org.junit.Test)12 File (java.io.File)3 URL (java.net.URL)3 IncrementingEntryProcessor (usercodedeployment.IncrementingEntryProcessor)3