use of org.apache.ignite.spi.deployment.DeploymentResource in project ignite by apache.
the class GridUriDeploymentMd5CheckSelfTest method testMd5DirectoryCheck.
/**
* Test skipping fresh deployment of .gar directories with equal content.
*
* @throws Exception if failed.
*/
public void testMd5DirectoryCheck() throws Exception {
undeployCntr.set(0);
DeploymentResource task = getSpi().findResource("GridUriDeploymentTestWithNameTask6");
assert task == null;
U.copy(getGarDir(), new File(getDeployDir(), "uri1.gar"), true);
Thread.sleep(500);
task = getSpi().findResource("GridUriDeploymentTestWithNameTask6");
assert task != null;
assert undeployCntr.get() == 0;
U.copy(getGarDir(), new File(getDeployDir(), "uri2.gar"), true);
Thread.sleep(500);
task = getSpi().findResource("GridUriDeploymentTestWithNameTask6");
assert task != null;
assert undeployCntr.get() == 0;
U.delete(getGarDir());
U.delete(new File(getDeployDir(), "uri1.gar"));
U.delete(new File(getDeployDir(), "uri2.gar"));
}
use of org.apache.ignite.spi.deployment.DeploymentResource in project ignite by apache.
the class GridUriDeploymentMd5CheckSelfTest method testMd5FileCheck.
/**
* Test skipping fresh deployment of duplicated .gar files.
*
* @throws Exception if failed.
*/
public void testMd5FileCheck() throws Exception {
undeployCntr.set(0);
DeploymentResource task = getSpi().findResource("GridUriDeploymentTestWithNameTask7");
assert task == null;
U.copy(getGarFile(), new File(getDeployDir(), "uri1.gar"), true);
Thread.sleep(500);
task = getSpi().findResource("GridUriDeploymentTestWithNameTask7");
assert task != null;
assert undeployCntr.get() == 0;
U.copy(getGarFile(), new File(getDeployDir(), "uri2.gar"), true);
Thread.sleep(500);
task = getSpi().findResource("GridUriDeploymentTestWithNameTask7");
assert task != null;
assert undeployCntr.get() == 0;
}
use of org.apache.ignite.spi.deployment.DeploymentResource in project ignite by apache.
the class GridUriDeploymentSimpleSelfTest method testSimpleDeployTwoTasks.
/**
* @throws Exception If failed.
*/
public void testSimpleDeployTwoTasks() throws Exception {
UriDeploymentSpi spi = getSpi();
spi.register(TestTask.class.getClassLoader(), TestTask.class);
spi.register(TestTaskWithName.class.getClassLoader(), TestTaskWithName.class);
DeploymentResource task1 = spi.findResource("TestTaskWithName");
DeploymentResource task2 = spi.findResource(TestTask.class.getName());
assert task1 != null;
assert task1.getResourceClass() == TestTaskWithName.class;
assert spi.findResource(TestTaskWithName.class.getName()) != null;
assert task2 != null;
assert task2.getResourceClass() == TestTask.class;
assert spi.findResource("TestTask") == null;
spi.unregister("TestTaskWithName");
assert spi.findResource("TestTaskWithName") == null;
spi.unregister(TestTask.class.getName());
assert spi.findResource(TestTask.class.getName()) == null;
}
use of org.apache.ignite.spi.deployment.DeploymentResource in project ignite by apache.
the class GridUriDeploymentAbstractSelfTest method checkNoTask.
/**
* @param taskName name of unavailable task.
* @throws Exception if failed.
*/
protected void checkNoTask(String taskName) throws Exception {
assert taskName != null;
DeploymentResource task = getSpi().findResource(taskName);
assert task == null;
info("Not deployed task [task=" + task + ']');
}
use of org.apache.ignite.spi.deployment.DeploymentResource in project ignite by apache.
the class GridUriDeploymentSimpleSelfTest method testSimpleDeploy.
/**
* @throws Exception If failed.
*/
public void testSimpleDeploy() throws Exception {
UriDeploymentSpi spi = getSpi();
spi.register(TestTask.class.getClassLoader(), TestTask.class);
DeploymentResource task = spi.findResource(TestTask.class.getName());
assert task != null;
assert task.getResourceClass() == TestTask.class;
assert spi.findResource("TestTaskWithName") == null;
spi.unregister(TestTask.class.getName());
assert spi.findResource(TestTask.class.getName()) == null;
}
Aggregations