Index: ../incubator-ignite/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAtomicEntryProcessorDeploymentSelfTest.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- ../incubator-ignite/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAtomicEntryProcessorDeploymentSelfTest.java (revision ec5706fff899b71c8f3a15a1476744004f876c6e) +++ ../incubator-ignite/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAtomicEntryProcessorDeploymentSelfTest.java (revision ) @@ -19,7 +19,9 @@ import java.util.HashSet; import java.util.Map; +import javax.cache.processor.EntryProcessorException; import javax.cache.processor.EntryProcessorResult; +import javax.cache.processor.MutableEntry; import org.apache.ignite.IgniteCache; import org.apache.ignite.cache.CacheAtomicityMode; import org.apache.ignite.cache.CacheEntryProcessor; @@ -32,6 +34,7 @@ import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder; import org.apache.ignite.testframework.config.GridTestProperties; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; +import org.springframework.expression.spel.standard.SpelCompiler; import static org.apache.ignite.cache.CacheAtomicityMode.ATOMIC; import static org.apache.ignite.cache.CacheMode.PARTITIONED; @@ -59,11 +62,11 @@ @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(gridName); - cfg.setClientMode(clientMode); +// cfg.setClientMode(clientMode); +// +// if (clientMode) +// cfg.setClassLoader(getExternalClassLoader()); - if (clientMode) - cfg.setClassLoader(getExternalClassLoader()); - cfg.setDeploymentMode(depMode); cfg.setCacheConfiguration(cacheConfiguration()); @@ -134,12 +137,16 @@ doTestInvoke(); } + private static ClassLoader ldr; + /** * @throws Exception In case of error. */ public void testInvokeAllDeployment() throws Exception { depMode = DeploymentMode.CONTINUOUS; + //ClassLoader cls = new SpelCompiler.ChildClassLoader(getClass().getClassLoader()); + doTestInvokeAll(); } @@ -152,31 +159,47 @@ doTestInvokeAll(); } + @Override public boolean isDebug() { + return true; + } + /** * @throws Exception In case of error. */ private void doTestInvoke() throws Exception { try { + Thread.currentThread().setContextClassLoader(ldr = getExternalClassLoader()); + clientMode = false; startGrid(0); clientMode = true; startGrid(1); - Class procCls = grid(1).configuration().getClassLoader().loadClass(getEntryProcessor()); - Class valCls = grid(1).configuration().getClassLoader().loadClass(TEST_VALUE); + //Class procCls = grid(1).configuration().getClassLoader().loadClass(getEntryProcessor()); + //Class valCls = grid(1).configuration().getClassLoader().loadClass(TEST_VALUE); - assertTrue(grid(1).configuration().isClientMode()); - assertFalse(grid(0).configuration().isClientMode()); +// assertTrue(grid(1).configuration().isClientMode()); +// assertFalse(grid(0).configuration().isClientMode()); IgniteCache cache = getCache(); - cache.put("key", valCls.newInstance()); + //cache.put("key", valCls.newInstance()); - Boolean res = (Boolean)cache.invoke("key", (CacheEntryProcessor)procCls.newInstance()); + //cache.invoke("key", (CacheEntryProcessor)ldr.loadClass(getEntryProcessor()).newInstance()); - assertTrue(res); + cache.invoke("key", new NONLOAD()); + cache.invoke("key", new CacheEntryProcessor() { + @Override public Object process(MutableEntry entry, Object... arguments) throws EntryProcessorException { + return null; + } + }); + + //Boolean res = (Boolean)cache.invoke("key", (CacheEntryProcessor)procCls.newInstance()); + + //assertTrue(res); + // Checks that get produces no exceptions. cache.get("key"); } @@ -199,8 +222,8 @@ Class procCls = grid(1).configuration().getClassLoader().loadClass(getEntryProcessor()); Class valCls = grid(1).configuration().getClassLoader().loadClass(TEST_VALUE); - assertTrue(grid(1).configuration().isClientMode()); - assertFalse(grid(0).configuration().isClientMode()); +// assertTrue(grid(1).configuration().isClientMode()); +// assertFalse(grid(0).configuration().isClientMode()); IgniteCache cache = getCache(); @@ -231,6 +254,12 @@ } finally { stopAllGrids(); + } + } + + public static class NONLOAD implements CacheEntryProcessor { + @Override public Object process(MutableEntry entry, Object... arguments) throws EntryProcessorException { + return null; } } }