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

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


     * @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


    }
   
    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

            super.execute();
        }
        else
        {
            CargoElement[] cargoElements = this.containerSet.getCargos();
            Variable contextUrl = new Variable();
            contextUrl.setKey("cactus.contextURL");

            addSysproperty(contextUrl);

            for (int i = 0; i < cargoElements.length; i++)
            {
                CargoElement element = (CargoElement) cargoElements[i];
                Container container = element.getCargoContainer();
                ContainerWrapper wrapper = new ContainerWrapper(container);
                wrapper.setLogger(new AntLogger(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);
                }

                // 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.
                wrapper.setSystemProperties(this.systemProperties);

                // Add extra classpath entries
                if (containerClasspath != null)
                {
                    wrapper.setContainerClasspath(this.containerClasspath
                        .list());
                }
               
                if (wrapper.isEnabled())
                {
                    wrapper.init();
                    log("--------------------------------------------------"
                        + "---------------", Project.MSG_INFO);
                    log("Running tests against " + wrapper.getName()
                        + " @ " + wrapper.getBaseURL(),
                        Project.MSG_INFO);
                    log("--------------------------------------------------"
                        + "---------------", Project.MSG_INFO);
                    contextUrl.setValue(wrapper.getBaseURL() + "/"
                        + thisDeployable.getTestContext());
                    executeInContainer(wrapper, 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

                    "You must specify the test report directory");

        }


        Variable contextUrlVar = new Variable();
        contextUrlVar.setKey("cactus.contextURL");
        if (this.contextURL != null)
        {
           contextUrlVar.setValue(this.contextURL);
        }
        else
        {
            contextUrlVar.setValue("http://" + this.serverName + ":"
                    + this.servletPort
                    + "/" + deployableFile.getTestContext());
        }

        addSysproperty(contextUrlVar);
View Full Code Here

    {
        String filterRedirectorMapping = deployableFile
                .getFilterRedirectorMapping();
        if (filterRedirectorMapping != null)
        {
            Variable filterRedirectorVar = new Variable();
            filterRedirectorVar.setKey("cactus.filterRedirectorName");
            filterRedirectorVar.setValue(filterRedirectorMapping
                    .substring(1));
            addSysproperty(filterRedirectorVar);
        }
        else
        {
            log("No mapping of the filter redirector found",
                    Project.MSG_VERBOSE);
        }

        String jspRedirectorMapping = deployableFile.getJspRedirectorMapping();
        if (jspRedirectorMapping != null)
        {
            Variable jspRedirectorVar = new Variable();
            jspRedirectorVar.setKey("cactus.jspRedirectorName");
            jspRedirectorVar.setValue(jspRedirectorMapping.substring(1));
            addSysproperty(jspRedirectorVar);
        }
        else
        {
            log("No mapping of the JSP redirector found",
                    Project.MSG_VERBOSE);
        }

        String servletRedirectorMapping = deployableFile
                .getServletRedirectorMapping();
        if (servletRedirectorMapping != null)
        {
            Variable servletRedirectorVar = new Variable();
            servletRedirectorVar.setKey("cactus.servletRedirectorName");
            servletRedirectorVar.setValue(servletRedirectorMapping
                    .substring(1));
            addSysproperty(servletRedirectorVar);
        }
        else
        {
View Full Code Here

        }
        Enumeration keys = bundle.getKeys();
        while (keys.hasMoreElements())
        {
            String key = (String) keys.nextElement();
            Variable var = new Variable();
            var.setKey(key);
            var.setValue(bundle.getString(key));
            super.addSysproperty(var);

        }

    }
View Full Code Here

      // Add certain properties to allow identification of the forked JVM from within
      // the subprocess. This can be used for policy files etc.
      final File cwd = getWorkingDirectory(slaveInfo);

      Variable v = new Variable();
      v.setKey(CHILDVM_SYSPROP_CWD);
      v.setFile(cwd.getAbsoluteFile());
      commandline.addSysproperty(v);

      v = new Variable();
      v.setKey(SysGlobals.CHILDVM_SYSPROP_JVM_ID);
      v.setValue(Integer.toString(slaveInfo.id));
      commandline.addSysproperty(v);

      v = new Variable();
      v.setKey(SysGlobals.CHILDVM_SYSPROP_JVM_COUNT);
      v.setValue(Integer.toString(slaveInfo.slaves));
      commandline.addSysproperty(v);

      final Execute execute = new Execute();
      execute.setCommandline(commandline.getCommandline());
      execute.setVMLauncher(true);
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.