Package org.apache.tools.ant.types.Environment

Examples of org.apache.tools.ant.types.Environment.Variable


     * @param thePath The path
     * @return The created environment variable
     */
    protected final Variable createSysProperty(String theKey, Path thePath)
    {
        Variable var = new Variable();
        var.setKey(theKey);
        var.setPath(thePath);
        return var;
    }
View Full Code Here


     * @param theValue The value
     * @return The created environment variable
     */
    protected final Variable createSysProperty(String theKey, String theValue)
    {
        Variable var = new Variable();
        var.setKey(theKey);
        var.setValue(theValue);
        return var;
    }
View Full Code Here

            super.execute();
        }
        else
        {
            Container[] containers = this.containerSet.getContainers();
            Variable contextUrl = new Variable();
            contextUrl.setKey("cactus.contextURL");
            addSysproperty(contextUrl);

            AntTaskFactory antTaskFactory = new DefaultAntTaskFactory(
                getProject(), getTaskName(), getLocation(), getOwningTarget());
           
            for (int i = 0; i < containers.length; i++)
            {
                containers[i].setAntTaskFactory(antTaskFactory);
                containers[i].setLog(new AntLog(this));

                // Clone the DeployableFile instance as each container can
                // override default deployment properties (e.g. port, context
                // root, etc).
                DeployableFile thisDeployable = null;
                try
                {
                    thisDeployable = (DeployableFile) deployableFile.clone();
                }
                catch (CloneNotSupportedException e)
                {
                    throw new BuildException(e);
                }
                containers[i].setDeployableFile(thisDeployable);

                // Allow the container to override the default test context.
                // This is to support container extensions to the web.xml file.
                // Most containers allow defining the root context in these
                // extensions.
                if (containers[i].getTestContext() != null)
                {
                    thisDeployable.setTestContext(
                        containers[i].getTestContext());
                }              
               
                containers[i].setSystemProperties(
                    (Variable[]) this.systemProperties.toArray(
                        new Variable[0]));

                // Add extra classpath entries
                containers[i].setContainerClasspath(this.containerClasspath);
               
                if (containers[i].isEnabled())
                {
                    containers[i].init();
                    log("--------------------------------------------------"
                        + "---------------",
                        Project.MSG_INFO);
                    log("Running tests against " + containers[i].getName(),
                        Project.MSG_INFO);
                    log("--------------------------------------------------"
                        + "---------------",
                        Project.MSG_INFO);
                    contextUrl.setValue(
                        "http://localhost:" + containers[i].getPort() + "/"
                        + thisDeployable.getTestContext());
                    executeInContainer(containers[i], thisDeployable);
                }
            }
View Full Code Here

        ResourceBundle bundle = thePropertySet.readProperties();
        Enumeration keys = bundle.getKeys();
        while (keys.hasMoreElements())
        {
            String key = (String) keys.nextElement();
            Variable var = new Variable();
            var.setKey(key);
            var.setValue(bundle.getString(key));
            if (thePropertySet.isServer())
            {
                addCactusServerProperty(var);
            }
            else
View Full Code Here

     */
    private void addCactusClientProperty(String theKey, String theValue)
    {
        log("Adding Cactus client system property [" + theKey
            + "] with value [" + theValue + "]", Project.MSG_VERBOSE);
        Variable sysProperty = new Variable();
        sysProperty.setKey(theKey);
        sysProperty.setValue(theValue);
        super.addSysproperty(sysProperty);
    }
View Full Code Here

     * @param theKey The property name
     * @param theValue The property value
     */
    private void addCactusServerProperty(String theKey, String theValue)
    {
        Variable property = new Variable();
        property.setKey(theKey);
        property.setValue(theValue);
        addCactusServerProperty(property);
    }
View Full Code Here

  static void transferCoberturaDataFileProperty(Java task)
  {
    String coberturaProperty = System.getProperty("net.sourceforge.cobertura.datafile");
    if (coberturaProperty != null)
    {
      Variable sysproperty = new Variable();
      sysproperty.setKey("net.sourceforge.cobertura.datafile");
      sysproperty.setValue(coberturaProperty);
      task.addSysproperty(sysproperty);
    }
  }
View Full Code Here

    }
   
    private void setupLocalMaven()
    {
        // Set the required properties
        Variable classworldsConfProp = new Variable();
        classworldsConfProp.setKey( "classworlds.conf" );
        File classworldsPath = new File( mavenHome, "bin/m2.conf" );
        classworldsConfProp.setValue( classworldsPath.getAbsolutePath() );
        this.addSysproperty( classworldsConfProp );
       
        Variable mavenHomeProp = new Variable();
        mavenHomeProp.setKey( "maven.home" );
        mavenHomeProp.setValue( mavenHome.getAbsolutePath() );
        this.addSysproperty( mavenHomeProp );
       
        // Set the boot classpath
        FileSet bootDir = new FileSet();
        bootDir.setDir( new File ( mavenHome, "boot" ) );
View Full Code Here

   
    while(e.hasMoreElements()) {
      Object key=e.nextElement();
      Object value=p.get(key);
      
      Variable envvar=new Variable();
      envvar.setKey(key.toString());
      if(value!=null) {
        envvar.setValue(value.toString());
      }
      else {
        envvar.setValue("");
      }
      addEnv(envvar);
    }
   
  }
View Full Code Here

   
    // report execution environment
    System.out.println(getCommandLine().toString());
    Iterator vars=envvars.iterator();
    while(vars.hasNext()) {
      Variable v=(Variable) vars.next();
      System.out.println("envvar key="+v.getKey()+" value="+v.getValue());
    }
 
   
  }
View Full Code Here

TOP

Related Classes of org.apache.tools.ant.types.Environment.Variable

Copyright © 2018 www.massapicom. 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.