Examples of Java


Examples of aQute.bnd.osgi.Clazz.JAVA

                                                        // be
                                                        // there
                                                        // already
      ) {

        JAVA highest = ees.last();
        Attrs attrs = new Attrs();

        String filter = doEEProfiles(highest);

        attrs.put(Constants.FILTER_DIRECTIVE, filter);
View Full Code Here

Examples of com.jigen.ant.Java

      StringBuffer sb = new StringBuffer();
     
      switch(runnable.getType())
      {
      case JAVA:
        Java java = runnable.getJava();
       
        sb.append("#!/bin/bash\n");
        sb.append("\n");
        sb.append("BASEDIR=$(dirname $0)/..\n");
        sb.append("\n");
        sb.append("if [ \"$(echo $BASEDIR | cut -c1)\" != \"/\" ]; then BASEDIR=$PWD/$BASEDIR; fi\n");
        sb.append("\n");
        sb.append("JAVAHOME=:[JAVAHOME]\n");
        sb.append("\n");
        sb.append("JAVAOPTS=" + (java.getJavaOpts() == null ? "" : java.getJavaOpts()) + "\n");
        sb.append("\n");
        sb.append("DEFAULTPARAMS=" + (java.getParams() == null ? "" : java.getParams()) + "\n");
        sb.append("\n");
       
        if (java.getJar() == null)
        {
          sb.append("CLASSPATH=\n");
         
          for (File classpathElem : runnable.getJava().getClasspath())
            sb.append("CLASSPATH=$CLASSPATH:$BASEDIR/lib/" + classpathElem.getName() + "\n");
         
          sb.append("\n");
          sb.append("MAINCLASS=" + java.getClass1() + "\n");
          sb.append("\n");
          sb.append("( cd $BASEDIR; $JAVAHOME/bin/java $JAVAOPTS -cp $CLASSPATH $MAINCLASS $DEFAULTPARAMS $* )\n");
        }
        else
        {
          sb.append("MAINJAR=" + java.getJar() + "\n");
          sb.append("\n");
          sb.append("( cd $BASEDIR; $JAVAHOME/bin/java $JAVAOPTS -jar $MAINJAR $DEFAULTPARAMS $* )\n");
        }
       
        sb.append("\n");
 
View Full Code Here

Examples of org.apache.falcon.oozie.workflow.JAVA

        System.out.println("actions = " + actions);

        ACTION replicationActionNode = (ACTION) actions.get(4);
        Assert.assertEquals(replicationActionNode.getName(), "replication");

        JAVA replication = replicationActionNode.getJava();
        List<String> args = replication.getArg();
        Assert.assertEquals(args.size(), 11);

        HashMap<String, String> props = new HashMap<String, String>();
        for (Property prop : coord.getAction().getWorkflow().getConfiguration().getProperty()) {
            props.put(prop.getName(), prop.getValue());
View Full Code Here

Examples of org.apache.falcon.oozie.workflow.JAVA

        System.out.println("actions = " + actions);

        ACTION replicationActionNode = (ACTION) actions.get(4);
        Assert.assertEquals(replicationActionNode.getName(), "replication");

        JAVA replication = replicationActionNode.getJava();
        List<String> args = replication.getArg();
        Assert.assertEquals(args.size(), 13);

        HashMap<String, String> props = new HashMap<String, String>();
        for (Property prop : coord.getAction().getWorkflow().getConfiguration().getProperty()) {
            props.put(prop.getName(), prop.getValue());
View Full Code Here

Examples of org.apache.tools.ant.taskdefs.Java

            throw new MojoExecutionException("Geronimo installation directory does not exist: " + geronimoHomeStr);
        }

        log.info("Starting Geronimo client...");
       
        Java java = (Java)createTask("java");
        java.setJar(new File(geronimoHome, "bin/client.jar"));
        java.setDir(geronimoHome);
        java.setFailonerror(true);
        java.setFork(true);
       
        if (timeout > 0) {
            java.setTimeout(new Long(timeout * 1000));
        }

        if (maximumMemory != null) {
            java.setMaxmemory(maximumMemory);
        }

        // Set the properties which we pass to the JVM from the startup script
        setSystemProperty(java, "org.apache.geronimo.base.dir", geronimoHome);
        setSystemProperty(java, "java.io.tmpdir", new File(geronimoHome, "var/temp"));
        setSystemProperty(java, "java.endorsed.dirs", appendSystemPath("java.endorsed.dirs", new File(geronimoHome, "lib/endorsed")));
        setSystemProperty(java, "java.ext.dirs", appendSystemPath("java.ext.dirs", new File(geronimoHome, "lib/ext")));
       
        java.createArg().setValue(moduleId);

        for (int i=0;arg != null && i<arg.length;i++) {
            java.createArg().setValue(arg[i]);
        }
      
        if (logOutput) {
            File file = getLogFile();
            FileUtils.forceMkdir(file.getParentFile());
       
            log.info("Redirecting output to: " + file);
           
            java.setOutput(file);
        }
       
        java.execute();
    }
View Full Code Here

Examples of org.apache.tools.ant.taskdefs.Java

      configuration.log();

      File runnerFile = generateTestRunnerFromTemplate(configuration.getWorkingDir());
      File finalFile = new File(configuration.getWorkingDir().getAbsolutePath() + File.separatorChar + SWF_FILENAME);
     
      Java compilationTask = createJavaTask(runnerFile, finalFile);
      LoggingUtil.log("Compiling test classes: [" + configuration.getTestSources().getCanonicalClasses(", ") + "]", true);
      LoggingUtil.log(compilationTask.getCommandLine().describeCommand());
     
      if(compilationTask.executeJava() != 0)
      {
         throw new BuildException("Compilation failed:\n" + project.getProperty("MXMLC_ERROR"));
      }
     
      return finalFile;
View Full Code Here

Examples of org.apache.tools.ant.taskdefs.Java

   private int getSDKVersion()
   {
      String outputProperty = "SDK_VERSION";
     
      //Execute mxmlc to find SDK version number
      Java task = new Java();
      task.setFork(true);
      task.setFailonerror(true);
      task.setJar(new File(mxmlcPath));
      task.setProject(project);
      task.setDir(project.getBaseDir());
      task.setOutputproperty(outputProperty);
     
      Argument versionArgument = task.createArg();
      versionArgument.setValue("--version");
     
      task.execute();
     
      //Parse version number and return as int
      String output = project.getProperty(outputProperty);
      int prefixIndex = output.indexOf("Version ");
      int version = Integer.parseInt(output.substring(prefixIndex + 8, prefixIndex + 9));
View Full Code Here

Examples of org.apache.tools.ant.taskdefs.Java

  
   private Java createJavaTask(File runnerFile, File finalFile)
   {
      String frameworksPath = configuration.getFlexHome().getAbsolutePath() + File.separatorChar + FRAMEWORKS_RELATIVE_PATH;
     
      Java task = new Java();
      task.setFork(true);
      task.setFailonerror(true);
      task.setJar(new File(mxmlcPath));
      task.setProject(project);
      task.setDir(project.getBaseDir());
      task.setMaxmemory("256M"); //MXMLC needs to eat
      task.setErrorProperty("MXMLC_ERROR");
     
      Argument flexLibArgument = task.createArg();
      flexLibArgument.setLine("+flexlib \"" + frameworksPath + "\"");
     
      if(configuration.getPlayer().equals("air"))
      {
         Argument airConfigArgument = task.createArg();
         airConfigArgument.setValue("+configname=air");
      }
     
      Argument outputFile = task.createArg();
      outputFile.setLine("-output \"" + finalFile.getAbsolutePath() + "\"");
     
      Argument sourcePath = task.createArg();
      sourcePath.setLine("-source-path " + configuration.getSources().getPathElements(" ") + " " + configuration.getTestSources().getPathElements(" "));
     
      determineLibraryPath( task );
    
      determineLoadConfigArgument( task );
      
      Argument debug = task.createArg();
      debug.setLine( "-debug=" + configuration.getDebug() );

      Argument headlessServer = task.createArg();
      headlessServer.setLine("-headless-server=true");
     
     
      Argument mainFile = task.createArg();
      mainFile.setValue(runnerFile.getAbsolutePath());
     
      return task;
   }
View Full Code Here

Examples of org.apache.tools.ant.taskdefs.Java

   private double getVersion()
   {
      String outputProperty = "AIR_VERSION";

      //Execute mxmlc to find SDK version number
      Java task = new Java();
      task.setFork(true);
      task.setFailonerror(true);
      task.setJar(new File(getProject().getProperty("FLEX_HOME") + File.separatorChar + ADT_JAR_PATH));
      task.setProject(getProject());
      task.setDir(getProject().getBaseDir());
      task.setOutputproperty(outputProperty);

      Argument versionArgument = task.createArg();
      versionArgument.setValue("-version");

      task.execute();
      double version = parseAdtVersionNumber( getProject().getProperty(outputProperty) );
      LoggingUtil.log("Found AIR version: " + version);
      return version;
   }
View Full Code Here

Examples of org.apache.tools.ant.taskdefs.Java

            throw new MojoExecutionException("Geronimo installation directory does not exist: " + geronimoHomeStr);
        }

        log.info("Starting Geronimo client...");

        Java java = (Java)createTask("java");
        java.setJar(new File(geronimoHome, "bin/client.jar"));
        java.setDir(geronimoHome);
        java.setFailonerror(true);
        java.setFork(true);

        if (javaVirtualMachine != null) {
            if (!javaVirtualMachine.exists()) {
                throw new MojoExecutionException("Java virtual machine is not valid: " + javaVirtualMachine);
            }
           
            log.info("Using Java virtual machine: " + javaVirtualMachine);
            java.setJvm(javaVirtualMachine.getCanonicalPath());
        }
       
        if (timeout > 0) {
            java.setTimeout(new Long(timeout * 1000));
        }

        if (maximumMemory != null) {
            java.setMaxmemory(maximumMemory);
        }

        // Set the properties which we pass to the JVM from the startup script
        setSystemProperty(java, "org.apache.geronimo.base.dir", geronimoHome);
        setSystemProperty(java, "java.io.tmpdir", "var/temp");
        setSystemProperty(java, "java.endorsed.dirs", prefixSystemPath("java.endorsed.dirs", new File(geronimoHome, "lib/endorsed")));
        setSystemProperty(java, "java.ext.dirs", prefixSystemPath("java.ext.dirs", new File(geronimoHome, "lib/ext")));

        java.createArg().setValue(moduleId);

        for (int i=0;arg != null && i<arg.length;i++) {
            java.createArg().setValue(arg[i]);
        }

        if (logOutput) {
            File file = getLogFile();
            FileUtils.forceMkdir(file.getParentFile());

            log.info("Redirecting output to: " + file);

            java.setOutput(file);
        }

        java.execute();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.