use of com.hazelcast.jet.impl.deployment.LoadPersonIsolated.LoadPersonIsolatedMetaSupplier in project hazelcast-jet by hazelcast.
the class AbstractDeploymentTest method testDeployment_whenJarAddedAsResource_thenClassesAvailableOnClassLoader.
@Test
public void testDeployment_whenJarAddedAsResource_thenClassesAvailableOnClassLoader() throws Throwable {
createCluster();
DAG dag = new DAG();
dag.newVertex("load class", new LoadPersonIsolatedMetaSupplier());
JetInstance jetInstance = getJetInstance();
JobConfig jobConfig = new JobConfig();
jobConfig.addJar(this.getClass().getResource("/deployment/sample-pojo-1.0-person.jar"));
executeAndPeel(jetInstance.newJob(dag, jobConfig));
}
use of com.hazelcast.jet.impl.deployment.LoadPersonIsolated.LoadPersonIsolatedMetaSupplier in project hazelcast-jet by hazelcast.
the class AbstractDeploymentTest method testDeployment_whenClassAddedAsResource_thenClassAvailableOnClassLoader.
@Test
public void testDeployment_whenClassAddedAsResource_thenClassAvailableOnClassLoader() throws Throwable {
createCluster();
DAG dag = new DAG();
dag.newVertex("create and print person", new LoadPersonIsolatedMetaSupplier());
JobConfig jobConfig = new JobConfig();
URL classUrl = this.getClass().getResource("/cp1/");
URLClassLoader urlClassLoader = new URLClassLoader(new URL[] { classUrl }, null);
Class<?> appearance = urlClassLoader.loadClass("com.sample.pojo.person.Person$Appereance");
jobConfig.addClass(appearance);
executeAndPeel(getJetInstance().newJob(dag, jobConfig));
}
Aggregations