Search in sources :

Example 1 with JobContextResource

use of org.apache.ignite.resources.JobContextResource in project ignite by apache.

the class GridClosureSerializationTest method testAttributesSerializationFailure.

/**
     * @throws Exception If failed.
     */
@SuppressWarnings({ "ThrowableResultOfMethodCallIgnored", "Convert2Lambda" })
public void testAttributesSerializationFailure() throws Exception {
    final IgniteEx ignite0 = grid(0);
    final IgniteEx ignite1 = grid(1);
    GridTestUtils.assertThrows(null, new Callable<Object>() {

        @JobContextResource
        private ComputeJobContext jobCtx;

        @Override
        public Object call() throws Exception {
            ignite1.compute(ignite1.cluster().forNode(ignite0.localNode())).call(new IgniteCallable<Object>() {

                @Override
                public Object call() throws Exception {
                    jobCtx.setAttribute("test-attr", new BrokenAttribute());
                    return null;
                }
            });
            return null;
        }
    }, IgniteException.class, null);
}
Also used : ComputeJobContext(org.apache.ignite.compute.ComputeJobContext) IgniteEx(org.apache.ignite.internal.IgniteEx) IgniteCallable(org.apache.ignite.lang.IgniteCallable) JobContextResource(org.apache.ignite.resources.JobContextResource) IgniteException(org.apache.ignite.IgniteException) IOException(java.io.IOException) BinaryObjectException(org.apache.ignite.binary.BinaryObjectException)

Aggregations

IOException (java.io.IOException)1 IgniteException (org.apache.ignite.IgniteException)1 BinaryObjectException (org.apache.ignite.binary.BinaryObjectException)1 ComputeJobContext (org.apache.ignite.compute.ComputeJobContext)1 IgniteEx (org.apache.ignite.internal.IgniteEx)1 IgniteCallable (org.apache.ignite.lang.IgniteCallable)1 JobContextResource (org.apache.ignite.resources.JobContextResource)1