Search in sources :

Example 6 with IgniteDeploymentGarAntTask

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();
}
Also used : Project(org.apache.tools.ant.Project) IgniteDeploymentGarAntTask(org.apache.ignite.util.antgar.IgniteDeploymentGarAntTask) File(java.io.File) ZipFile(java.util.zip.ZipFile)

Example 7 with IgniteDeploymentGarAntTask

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());
    }
}
Also used : Project(org.apache.tools.ant.Project) IgniteDeploymentGarAntTask(org.apache.ignite.util.antgar.IgniteDeploymentGarAntTask) BuildException(org.apache.tools.ant.BuildException) File(java.io.File) ZipFile(java.util.zip.ZipFile)

Example 8 with IgniteDeploymentGarAntTask

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());
    }
}
Also used : Project(org.apache.tools.ant.Project) IgniteDeploymentGarAntTask(org.apache.ignite.util.antgar.IgniteDeploymentGarAntTask) BuildException(org.apache.tools.ant.BuildException) File(java.io.File) ZipFile(java.util.zip.ZipFile)

Aggregations

File (java.io.File)8 IgniteDeploymentGarAntTask (org.apache.ignite.util.antgar.IgniteDeploymentGarAntTask)8 Project (org.apache.tools.ant.Project)8 ZipFile (java.util.zip.ZipFile)7 BuildException (org.apache.tools.ant.BuildException)4 IgniteCheckedException (org.apache.ignite.IgniteCheckedException)1 GridAbsPredicateX (org.apache.ignite.internal.util.lang.GridAbsPredicateX)1