/** */ public GridP2PClassLoadingSelfTest() { super(/*start grid*/false); tstClsLdr = new GridTestClassLoader( Collections.singletonMap("org/apache/ignite/p2p/p2p.properties", "resource=loaded"), GridP2PTestTask.class.getName(), GridP2PTestJob.class.getName() ); }
@Override public Object call() throws Exception { GridTestClassLoader classLoader = new GridTestClassLoader( InternalExecutor.class.getName(), MarshallerContextImpl.class.getName(), MarshallerContextImpl.CombinedMap.class.getName(), MappingStoreTask.class.getName(), MarshallerMappingFileStore.class.getName(), MarshallerMappingTransport.class.getName() ); Thread.currentThread().setContextClassLoader(classLoader); Class clazz = classLoader.loadClass(InternalExecutor.class.getName()); Object internelExecutor = clazz.newInstance(); clazz.getMethod("executeTest", GridTestLog4jLogger.class, GridKernalContext.class) .invoke(internelExecutor, log, ctx); return null; } }, THREADS);
/** * Tests marshal classes * * @throws Exception If test failed. */ @Test public void testExternalClassesMarshalling() throws Exception { ClassLoader tstClsLdr = new GridTestClassLoader( Collections.singletonMap("org/apache/ignite/p2p/p2p.properties", "resource=loaded"), getClass().getClassLoader(), GridP2PTestTask.class.getName(), GridP2PTestJob.class.getName() ); ComputeTask<?, ?> inTask = (ComputeTask<?, ?>)tstClsLdr.loadClass(GridP2PTestTask.class.getName()). newInstance(); byte[] buf = marsh.marshal(inTask); ComputeTask<?, ?> outTask = marsh.unmarshal(buf, tstClsLdr); assert inTask != outTask; assert inTask.getClass().equals(outTask.getClass()); }
new GridTestClassLoader( Collections.EMPTY_MAP, getClass().getClassLoader(), GridP2PRemoteTestTask.class.getName(), GridP2PRemoteTestJob.class.getName() new GridTestClassLoader( Collections.EMPTY_MAP, getClass().getClassLoader(), GridP2PRemoteTestTask1.class.getName(), GridP2PRemoteTestJob.class.getName());
new GridTestClassLoader( Collections.<String, String>emptyMap(), getClass().getClassLoader(), GridP2PRemoteTestTask.class.getName(), GridP2PRemoteTestTask1.class.getName(),
Ignite ignite = startGrid(1); ClassLoader ldr1 = new GridTestClassLoader( Collections.singletonMap("testResource", "1"), getClass().getClassLoader(), EXCLUDE_CLASSES); ClassLoader ldr2 = new GridTestClassLoader( Collections.singletonMap("testResource", "2"), getClass().getClassLoader(),
ClassLoader ldr1 = new GridTestClassLoader( Collections.singletonMap("testResource", "1"), getClass().getClassLoader(), ClassLoader ldr2 = new GridTestClassLoader( Collections.singletonMap("testResource", "2"), getClass().getClassLoader(),
ClassLoader ldr1 = new GridTestClassLoader( Collections.singletonMap("testResource", "1"), getClass().getClassLoader()); ClassLoader ldr2 = new GridTestClassLoader( Collections.singletonMap("testResource", "2"), getClass().getClassLoader(),
ignite2 = startGrid(2); ClassLoader ldr1 = new GridTestClassLoader( Collections.singletonMap("testResource", "1"), getClass().getClassLoader(), ); ClassLoader ldr2 = new GridTestClassLoader( Collections.singletonMap("testResource", "2"), getClass().getClassLoader(),
ignite2 = startGrid(2); ClassLoader ldr1 = new GridTestClassLoader( Collections.singletonMap("testResource", "1"), getClass().getClassLoader(), ); ClassLoader ldr2 = new GridTestClassLoader( Collections.singletonMap("testResource", "2"), getClass().getClassLoader(),
Ignite ignite2 = startGrid(2); ClassLoader tstClsLdr = new GridTestClassLoader(GridP2PTestTask.class.getName(), GridP2PTestJob.class.getName());
); ClassLoader ldr1 = new GridTestClassLoader( Collections.singletonMap("testResource", "1"), getClass().getClassLoader(), EXCLUDE_CLASSES); ClassLoader ldr2 = new GridTestClassLoader( Collections.singletonMap("testResource", "2"), getClass().getClassLoader(),
Ignite ignite2 = startGrid(2); ClassLoader ldr = new GridTestClassLoader( Collections.singletonMap("org/apache/ignite/p2p/p2p.properties", "resource=loaded"), GridP2PTestTask.class.getName(),