Package org.codehaus.cargo.container.configuration

Examples of org.codehaus.cargo.container.configuration.LocalConfiguration


            tomcatHome = new File(tomcat5x);
        }
        //System.out.println("INFO: Tomcat home is " + tomcatHome);

        // (2) Create the Cargo Container instance wrapping our physical container
        LocalConfiguration configuration = (LocalConfiguration)
                new DefaultConfigurationFactory().createConfiguration(
                        "tomcat5x", ConfigurationType.STANDALONE);
        container = (InstalledLocalContainer)
                new DefaultContainerFactory().createContainer(
                        "tomcat5x", ContainerType.INSTALLED, configuration);
        container.setHome(tomcatHome);

        // (3) Statically deploy WAR(s)
        configuration.addDeployable(getWAR("struts-blank"));
        configuration.addDeployable(getWAR("struts-cookbook"));
        configuration.addDeployable(getWAR("struts-examples"));
        configuration.addDeployable(getWAR("struts-faces-example1"));
        configuration.addDeployable(getWAR("struts-faces-example2"));
        configuration.addDeployable(getWAR("struts-mailreader"));
        configuration.addDeployable(getWAR("struts-scripting-mailreader"));
        configuration.addDeployable(getWAR("struts-el-example"));

        configuration.setProperty(ServletPropertySet.PORT, port);

        // (4) Start the container
        container.start();
    }
View Full Code Here


    // TODO(jarcec): We should parametrize those paths, version, etc...
    // Source: http://cargo.codehaus.org/Functional+testing
    Installer installer = new ZipURLInstaller(new URL("http://archive.apache.org/dist/tomcat/tomcat-6/v6.0.36/bin/apache-tomcat-6.0.36.zip"));
    installer.install();

    LocalConfiguration configuration = (LocalConfiguration) new DefaultConfigurationFactory().createConfiguration("tomcat6x", ContainerType.INSTALLED, ConfigurationType.STANDALONE);
    container = (InstalledLocalContainer) new DefaultContainerFactory().createContainer("tomcat6x", ContainerType.INSTALLED, configuration);

    // Set home to our installed tomcat instance
    container.setHome(installer.getHome());

    // Store tomcat logs into file as they are quite handy for debugging
    container.setOutput(getTemporaryPath() + "/log/tomcat.log");

    // Propagate system properties to the container
    Map<String, String> map = new HashMap<String, String>((Map) System.getProperties());
    container.setSystemProperties(map);

    // Propagate Hadoop jars to the container classpath
    // In real world, they would be installed manually by user
    List<String> extraClassPath = new LinkedList<String>();
    String []classpath = System.getProperty("java.class.path").split(":");
    for(String jar : classpath) {
      if(jar.contains("hadoop-"|| // Hadoop jars
         jar.contains("commons-") || // Apache Commons libraries
         jar.contains("log4j-")   || // Log4j
         jar.contains("slf4j-")   || // Slf4j
         jar.contains("jackson-") || // Jackson
         jar.contains("derby")    || // Derby drivers
         jar.contains("avro-")    || // Avro
         jar.contains("mysql")    || // MySQL JDBC driver
         jar.contains("postgre"|| // PostgreSQL JDBC driver
         jar.contains("oracle")   || // Oracle driver
         jar.contains("terajdbc") || // Teradata driver
         jar.contains("tdgs")     || // Teradata driver
         jar.contains("nzjdbc")   || // Netezza driver
         jar.contains("sqljdbc"|| // Microsoft SQL Server driver
         jar.contains("google")      // Google libraries (guava, ...)
       ) {
        extraClassPath.add(jar);
      }
    }
    container.setExtraClasspath(extraClassPath.toArray(new String[extraClassPath.size()]));

    // Finally deploy Sqoop server war file
    configuration.addDeployable(new WAR("../server/target/sqoop.war"));

    // Start Sqoop server
    container.start();
  }
View Full Code Here

     * @param warLocation the war location
     * @return a container ready to start
     */
    protected InstalledLocalContainer getContainer(final String warLocation) {
        Deployable war = new WAR(warLocation);
        LocalConfiguration configuration = new Tomcat6xStandaloneLocalConfiguration(
                "target/tomcat6x");
        configuration.addDeployable(war);
        InstalledLocalContainer webapp = new Tomcat6xInstalledLocalContainer(
                configuration);
        webapp.setHome(System.getenv("CATALINA_HOME"));
        webapp.setOutput("target/cargo.log");
        return webapp;
View Full Code Here

                containerId, deployablePath, DeployableType.WAR);

        // Container configuration
        ConfigurationFactory configurationFactory = new DefaultConfigurationFactory();

        LocalConfiguration configuration = (LocalConfiguration) configurationFactory
                .createConfiguration(containerId, ConfigurationType.STANDALONE);

        // Find and (if provided) set the port to use for the container.
        String servletPort = System.getProperty("cargo.servlet.port");
        if (servletPort != null)
        {
            configuration.setProperty("cargo.servlet.port", servletPort);
            System.out.println("[INFO] servlet port: " + servletPort);
        }

        configuration.addDeployable(war);

        container = (InstalledLocalContainer) new DefaultContainerFactory()
                .createContainer(containerId, ContainerType.INSTALLED,
                        configuration);
View Full Code Here

            tomcatHome = new File(tomcat5x);
        }
        //System.out.println("INFO: Tomcat home is " + tomcatHome);

        // (2) Create the Cargo Container instance wrapping our physical container
        LocalConfiguration configuration = (LocalConfiguration)
                new DefaultConfigurationFactory().createConfiguration(
                        "tomcat5x", ConfigurationType.STANDALONE);
        container = (InstalledLocalContainer)
                new DefaultContainerFactory().createContainer(
                        "tomcat5x", ContainerType.INSTALLED, configuration);
        container.setHome(tomcatHome);

        // (3) Statically deploy WAR(s)
        configuration.addDeployable(getWAR("struts-blank"));
        configuration.addDeployable(getWAR("struts-cookbook"));
        configuration.addDeployable(getWAR("struts-examples"));
        configuration.addDeployable(getWAR("struts-faces-example1"));
        configuration.addDeployable(getWAR("struts-faces-example2"));
        configuration.addDeployable(getWAR("struts-mailreader"));
        configuration.addDeployable(getWAR("struts-scripting-mailreader"));
        configuration.addDeployable(getWAR("struts-el-example"));

        configuration.setProperty(ServletPropertySet.PORT, port);

        // (4) Start the container
        container.start();
    }
View Full Code Here

        // Container configuration
        ConfigurationFactory configurationFactory =
                new DefaultConfigurationFactory();

        LocalConfiguration configuration =
                (LocalConfiguration) configurationFactory.createConfiguration(
                        containerId,
                        ContainerType.INSTALLED,
                        ConfigurationType.STANDALONE);

        // Find and (if provided) set the port to use for the container.
        String servletPort = System.getProperty("cargo.servlet.port");
        if (servletPort != null) {
            configuration.setProperty("cargo.servlet.port", servletPort);
            System.out.println("[INFO] servlet port: " + servletPort);
        }

        configuration.addDeployable(war);

        container = (InstalledLocalContainer)
                new DefaultContainerFactory().createContainer(
                        containerId,
                        ContainerType.INSTALLED, configuration);
View Full Code Here

    protected void deploy() {
        // create configuration factory
        final ConfigurationFactory configurationFactory = new DefaultConfigurationFactory();

        // create JBoss configuration
        final LocalConfiguration configuration = (LocalConfiguration) configurationFactory.createConfiguration("jboss4x",
                ContainerType.INSTALLED, ConfigurationType.EXISTING, containerHome
                        + "server/" + configurationName);

        // setup configuration
        final StringBuilder args = new StringBuilder();
        for (final String arg : jvmArguments) {
            args.append(arg);
            args.append(" ");

            if (LOGGER.isInfoEnabled()) {
                LOGGER.info("Added JVM argument: " + arg);
            }
        }
        configuration.setProperty(GeneralPropertySet.JVMARGS, args.toString());
        configuration.setProperty(ServletPropertySet.PORT, containerPort.toString());

        /*
         * Iterate over all available deployable locations.
         */
        final Set<Entry<String, String>> entrySet = deployableLocations.entrySet();
View Full Code Here

    protected void deploy() {
        // create configuration factory
        final ConfigurationFactory configurationFactory = new DefaultConfigurationFactory();

        // create JBoss configuration
        final LocalConfiguration configuration = (LocalConfiguration) configurationFactory.createConfiguration(tomcatVersion,
                ContainerType.INSTALLED, ConfigurationType.EXISTING, containerHome);

        // setup configuration
        final StringBuilder args = new StringBuilder();
        for (final String arg : jvmArguments) {
            args.append(arg);
            args.append(" ");

            if (LOGGER.isInfoEnabled()) {
                LOGGER.info("Added JVM argument: " + arg);
            }
        }

        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug("== CONFIGURATION PROPERTIES ==");
            LOGGER.debug("CONTAINER PORT : " + containerPort);
            LOGGER.debug("AJP PORT       : " + ajpPort);
            LOGGER.debug("RMI PORT       : " + rmiPort);
        }

        configuration.setProperty(GeneralPropertySet.JVMARGS, args.toString());
        configuration.setProperty(ServletPropertySet.PORT, containerPort.toString());
        configuration.setProperty(TomcatPropertySet.AJP_PORT, ajpPort.toString());
        configuration.setProperty(GeneralPropertySet.RMI_PORT, rmiPort.toString());

        /*
         * Iterate over all available deployable locations.
         */
        final Set<Entry<String, String>> entrySet = deployableLocations.entrySet();
View Full Code Here

        // create configuration factory
        final ConfigurationFactory configurationFactory = new DefaultConfigurationFactory();

        // create JBoss configuration
        final LocalConfiguration configuration = (LocalConfiguration) configurationFactory.createConfiguration("jetty6x",
                ContainerType.INSTALLED, ConfigurationType.STANDALONE, containerHome
                + "cargo-conf/");

        // setup configuration
        final StringBuilder args = new StringBuilder();
        for (final String arg : jvmArguments) {
            args.append(arg);
            args.append(" ");

            if (LOGGER.isInfoEnabled()) {
                LOGGER.info("Added JVM argument: " + arg);
            }
        }
        configuration.setProperty(GeneralPropertySet.JVMARGS, args.toString());
        configuration.setProperty(ServletPropertySet.PORT, containerPort.toString());

        if (LOGGER.isInfoEnabled()) {
            LOGGER.info("Adding deployables..");
        }
View Full Code Here

    protected void deploy() {
        // create configuration factory
        final ConfigurationFactory configurationFactory = new DefaultConfigurationFactory();

        // create JOnas configuration
        final LocalConfiguration configuration = (LocalConfiguration) configurationFactory.createConfiguration("jonas4x",
                ContainerType.INSTALLED, ConfigurationType.EXISTING, containerHome);

        // setup configuration
        final StringBuilder args = new StringBuilder();
        for (final String arg : jvmArguments) {
            args.append(arg);
            args.append(" ");

            if (LOGGER.isInfoEnabled()) {
                LOGGER.info("Added JVM argument: " + arg);
            }
        }
        configuration.setProperty(GeneralPropertySet.JVMARGS, args.toString());
        configuration.setProperty(ServletPropertySet.PORT, containerPort.toString());

        /*
         * Iterate over all available deployable locations.
         */
        final Set<Entry<String, String>> entrySet = deployableLocations.entrySet();
View Full Code Here

TOP

Related Classes of org.codehaus.cargo.container.configuration.LocalConfiguration

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.