Search in sources :

Example 11 with GridTestExternalClassLoader

use of org.apache.ignite.testframework.GridTestExternalClassLoader in project ignite by apache.

the class DeploymentClassLoaderCallableTest method runJob0.

/**
 * @param ignite Ignite instance.
 * @param timeout Timeout.
 * @throws Exception If failed.
 */
private void runJob0(Ignite ignite, long timeout) throws Exception {
    ClassLoader testClassLoader = new GridTestExternalClassLoader(new URL[] { new URL(GridTestProperties.getProperty("p2p.uri.cls")) }, RUN_CLS1, RUN_CLS2);
    Constructor ctor = testClassLoader.loadClass(RUN_CLS).getConstructor();
    ignite.compute().withTimeout(timeout).broadcast((IgniteCallable<?>) ctor.newInstance());
}
Also used : Constructor(java.lang.reflect.Constructor) GridTestExternalClassLoader(org.apache.ignite.testframework.GridTestExternalClassLoader) GridTestExternalClassLoader(org.apache.ignite.testframework.GridTestExternalClassLoader) URL(java.net.URL)

Example 12 with GridTestExternalClassLoader

use of org.apache.ignite.testframework.GridTestExternalClassLoader in project ignite by apache.

the class DeploymentClassLoaderCallableTest method runJob2.

/**
 * @param ignite Ignite instance.
 * @param timeout Timeout.
 * @throws Exception If failed.
 */
private void runJob2(Ignite ignite, long timeout) throws Exception {
    ClassLoader testClassLoader = new GridTestExternalClassLoader(new URL[] { new URL(GridTestProperties.getProperty("p2p.uri.cls")) }, RUN_CLS, RUN_CLS1);
    Constructor ctor = testClassLoader.loadClass(RUN_CLS2).getConstructor();
    ignite.compute().withTimeout(timeout).broadcast((IgniteCallable<?>) ctor.newInstance());
}
Also used : Constructor(java.lang.reflect.Constructor) GridTestExternalClassLoader(org.apache.ignite.testframework.GridTestExternalClassLoader) GridTestExternalClassLoader(org.apache.ignite.testframework.GridTestExternalClassLoader) URL(java.net.URL)

Example 13 with GridTestExternalClassLoader

use of org.apache.ignite.testframework.GridTestExternalClassLoader in project ignite by apache.

the class DeploymentClassLoaderCallableTest method runJob1.

/**
 * @param ignite Ignite instance.
 * @param timeout Timeout.
 * @throws Exception If failed.
 */
private void runJob1(Ignite ignite, long timeout) throws Exception {
    ClassLoader testClassLoader1 = new GridTestExternalClassLoader(new URL[] { new URL(GridTestProperties.getProperty("p2p.uri.cls")) }, RUN_CLS, RUN_CLS2);
    Constructor ctor = testClassLoader1.loadClass(RUN_CLS1).getConstructor();
    ignite.compute().withTimeout(timeout).broadcast((IgniteCallable<?>) ctor.newInstance());
}
Also used : Constructor(java.lang.reflect.Constructor) GridTestExternalClassLoader(org.apache.ignite.testframework.GridTestExternalClassLoader) GridTestExternalClassLoader(org.apache.ignite.testframework.GridTestExternalClassLoader) URL(java.net.URL)

Example 14 with GridTestExternalClassLoader

use of org.apache.ignite.testframework.GridTestExternalClassLoader in project ignite by apache.

the class IgniteServiceDeployment2ClassLoadersDefaultMarshallerTest method beforeTestsStarted.

/**
 * {@inheritDoc}
 */
@Override
protected void beforeTestsStarted() throws Exception {
    extClsLdr1 = new GridTestExternalClassLoader(URLS, NOOP_SERVICE_2_CLS_NAME);
    extClsLdr2 = new GridTestExternalClassLoader(URLS, NOOP_SERVICE_CLS_NAME);
}
Also used : GridTestExternalClassLoader(org.apache.ignite.testframework.GridTestExternalClassLoader)

Aggregations

GridTestExternalClassLoader (org.apache.ignite.testframework.GridTestExternalClassLoader)14 URL (java.net.URL)11 Ignite (org.apache.ignite.Ignite)9 Event (org.apache.ignite.events.Event)4 Constructor (java.lang.reflect.Constructor)3 CountDownLatch (java.util.concurrent.CountDownLatch)3 DeploymentEvent (org.apache.ignite.events.DeploymentEvent)3 IgniteException (org.apache.ignite.IgniteException)2 URLClassLoader (java.net.URLClassLoader)1 CacheConfiguration (org.apache.ignite.configuration.CacheConfiguration)1 IgniteConfiguration (org.apache.ignite.configuration.IgniteConfiguration)1 PAX (org.apache.ignite.internal.util.typedef.PAX)1 TcpDiscoverySpi (org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)1 IgniteIgnore (org.apache.ignite.testsuites.IgniteIgnore)1