Search in sources :

Example 1 with GridDeploymentStore

use of org.apache.ignite.internal.managers.deployment.GridDeploymentStore in project ignite by apache.

the class ClassLoadingProblemExceptionTest method doTest.

/**
 * @param spoilDeploymentBeforePrepare Test the check on preparing message.
 * @param spoilMsgOnSnd Test the check on receiving message.
 * @param eExp Exception expected.
 * @throws Exception If failed.
 */
private void doTest(boolean spoilDeploymentBeforePrepare, boolean spoilMsgOnSnd, Class<? extends Throwable> eExp) throws Exception {
    this.spoilDeploymentBeforePrepare = spoilDeploymentBeforePrepare;
    this.spoilMsgOnSnd = spoilMsgOnSnd;
    this.exceptionThrown.set(null);
    IgniteEx crd = (IgniteEx) startGridsMultiThreaded(1);
    crd.getOrCreateCache(CACHE_NAME);
    IgniteEx client1 = startGrid(CLIENT_1);
    IgniteEx client2 = startGrid(CLIENT_2);
    awaitPartitionMapExchange();
    GridDeploymentManager deploymentMgr = client2.context().deploy();
    GridDeploymentStore store = GridTestUtils.getFieldValue(deploymentMgr, "locStore");
    GridTestUtils.setFieldValue(deploymentMgr, "locStore", new GridDeploymentTestStore(store));
    client1.compute(client1.cluster().forRemotes()).execute(new P2PDeploymentLongRunningTask(), null);
    if (exceptionThrown.get() != null)
        exceptionThrown.get().printStackTrace();
    assertTrue("Wrong exception: " + exceptionThrown.get(), exceptionThrown.get() == null && eExp == null || X.hasCause(exceptionThrown.get(), eExp));
}
Also used : IgniteEx(org.apache.ignite.internal.IgniteEx) GridDeploymentManager(org.apache.ignite.internal.managers.deployment.GridDeploymentManager) GridDeploymentStore(org.apache.ignite.internal.managers.deployment.GridDeploymentStore)

Aggregations

IgniteEx (org.apache.ignite.internal.IgniteEx)1 GridDeploymentManager (org.apache.ignite.internal.managers.deployment.GridDeploymentManager)1 GridDeploymentStore (org.apache.ignite.internal.managers.deployment.GridDeploymentStore)1