use of org.apache.ignite.util.antgar.IgniteDeploymentGarAntTask in project ignite by apache.
the class GridToolsSelfTest method testAntGarTaskToString.
/**
* @throws Exception If failed.
*/
public void testAntGarTaskToString() throws Exception {
String tmpDirName = GridTestProperties.getProperty("ant.gar.tmpdir");
String srcDirName = GridTestProperties.getProperty("ant.gar.srcdir");
String baseDirName = tmpDirName + File.separator + System.currentTimeMillis() + "_6";
String metaDirName = baseDirName + File.separator + "META-INF";
String garFileName = baseDirName + ".gar";
// Make base and META-INF dir.
boolean mkdir = new File(baseDirName).mkdirs();
assert mkdir;
mkdir = new File(metaDirName).mkdirs();
assert mkdir;
// Copy files to basedir
U.copy(new File(srcDirName), new File(baseDirName), true);
IgniteDeploymentGarAntTask garTask = new IgniteDeploymentGarAntTask();
Project garProject = new Project();
garProject.setName("Gar test project");
garTask.setDestFile(new File(garFileName));
garTask.setBasedir(new File(garFileName));
garTask.setProject(garProject);
garTask.setDescrdir(new File(garFileName));
garTask.toString();
}
use of org.apache.ignite.util.antgar.IgniteDeploymentGarAntTask in project ignite by apache.
the class GridToolsSelfTest method testAntGarTaskWithFileBaseDir.
/**
* @throws Exception If failed.
*/
public void testAntGarTaskWithFileBaseDir() throws Exception {
String tmpDirName = GridTestProperties.getProperty("ant.gar.tmpdir");
String srcDirName = GridTestProperties.getProperty("ant.gar.srcdir");
String baseDirName = tmpDirName + File.separator + System.currentTimeMillis() + "_5";
String metaDirName = baseDirName + File.separator + "META-INF";
String garFileName = baseDirName + ".gar";
// Make base and META-INF dir.
boolean mkdir = new File(baseDirName).mkdirs();
assert mkdir;
mkdir = new File(metaDirName).mkdirs();
assert mkdir;
// Copy files to basedir
U.copy(new File(srcDirName), new File(baseDirName), true);
IgniteDeploymentGarAntTask garTask = new IgniteDeploymentGarAntTask();
Project garProject = new Project();
garProject.setName("Gar test project");
garTask.setDestFile(new File(garFileName));
garTask.setBasedir(new File(garFileName));
garTask.setProject(garProject);
garTask.setDescrdir(new File(garFileName));
try {
garTask.execute();
assert false;
} catch (BuildException e) {
if (log().isInfoEnabled())
log().info(e.getMessage());
}
}
use of org.apache.ignite.util.antgar.IgniteDeploymentGarAntTask in project ignite by apache.
the class GridToolsSelfTest method testAntGarTaskWithDirDescriptor.
/**
* @throws Exception If failed.
*/
public void testAntGarTaskWithDirDescriptor() throws Exception {
String tmpDirName = GridTestProperties.getProperty("ant.gar.tmpdir");
String srcDirName = GridTestProperties.getProperty("ant.gar.srcdir");
String baseDirName = tmpDirName + File.separator + System.currentTimeMillis() + "_3";
String metaDirName = baseDirName + File.separator + "META-INF";
String garFileName = baseDirName + ".gar";
// Make base and META-INF dir.
boolean mkdir = new File(baseDirName).mkdirs();
assert mkdir;
mkdir = new File(metaDirName).mkdirs();
assert mkdir;
// Copy files to basedir
U.copy(new File(srcDirName), new File(baseDirName), true);
IgniteDeploymentGarAntTask garTask = new IgniteDeploymentGarAntTask();
Project garProject = new Project();
garProject.setName("Gar test project");
garTask.setDestFile(new File(garFileName));
garTask.setBasedir(new File(baseDirName));
garTask.setProject(garProject);
garTask.setDescrdir(new File(garFileName));
try {
garTask.execute();
assert false;
} catch (BuildException e) {
if (log().isInfoEnabled())
log().info(e.getMessage());
}
}
Aggregations