/** * {@inheritDoc} */ @Override protected void activateLogging(LocalContainer container) { getLogger().info("Jetty8x log configuration not implemented", this.getClass().getName()); }
/** * {@inheritDoc} */ @Override protected void activateLogging(LocalContainer container) { getLogger().info("Jetty6x log configuration not implemented", this.getClass().getName()); }
/** * {@inheritDoc} */ @Override protected void activateLogging(LocalContainer container) { getLogger().info("Jetty8x log configuration not implemented", this.getClass().getName()); }
/** * {@inheritDoc} */ @Override protected void activateLogging(LocalContainer container) { getLogger().info("Jetty7x log configuration not implemented", this.getClass().getName()); }
/** * {@inheritDoc} */ @Override protected void activateLogging(LocalContainer container) { getLogger().info("Jetty9x log configuration not implemented", this.getClass().getName()); }
/** * {@inheritDoc} */ @Override protected void activateLogging(LocalContainer container) { getLogger().info("Jetty9x log configuration not implemented", this.getClass().getName()); }
/** * {@inheritDoc} */ @Override protected void activateLogging(LocalContainer container) { getLogger().info("Jetty7x log configuration not implemented", this.getClass().getName()); }
/** * {@inheritDoc} */ @Override protected void activateLogging(LocalContainer container) { getLogger().info("Jetty6x log configuration not implemented", this.getClass().getName()); }
/** * {@inheritDoc} */ @Override public void redeploy(Deployable deployable) { try { undeploy(deployable); } catch (Throwable t) { getLogger().info("The undeployment phase of the redeploy action has failed: " + t.toString(), this.getClass().getName()); } deploy(deployable); } }
/** * {@inheritDoc} */ @Override public void restart() { try { stop(); } catch (Throwable t) { getLogger().info("The stop phase of the restart action has failed: " + t.toString(), this.getClass().getName()); } start(); }
/** * Unpacks the zip file containing the container files. * @throws IOException If the ZIP file is broken */ private void unpack() throws IOException { File targetDir = new File(getExtractDir()); File sourceFile = new File(getDownloadDir(), getSourceFileName()); getLogger().info( "Installing container [" + sourceFile + "] in [" + targetDir.getPath() + "]", getClass().getName()); Expand expandTask = createExpandTask(); expandTask.setSrc(sourceFile); expandTask.setDest(targetDir); expandTask.execute(); if (!targetDir.isDirectory()) { throw new IOException("The file [" + sourceFile + "] is broken"); } }
/** * Adds deployments on startup arg line. Only available in the Hollow Swarm mode. * */ protected void addDeployables() { if (isHollowSwarm() && !getConfiguration().getDeployables().isEmpty()) { getLogger().info("Deploying to Hollow Swarm.", getClass().getCanonicalName()); for (Deployable deployable : getConfiguration().getDeployables()) { swarmJvmLauncher.addAppArgument(new File(deployable.getFile())); } } }
/** * {@inheritDoc} */ @Override public void deploy(Deployable deployable) { String file = deployable.getFile(); getLogger().info("Deploying [" + file + "]", this.getClass().getName()); try { getTomcatManager().deploy(getPath(deployable), getVersion(deployable), new FileInputStream(file), false, null); } catch (IOException|TomcatManagerException exception) { throw new ContainerException("Failed to deploy [" + file + "]", exception); } }
/** * {@inheritDoc} deploys files by sending WLST script to WebLogic server. * * @see org.codehaus.cargo.container.spi.deployer.AbstractDeployer#deploy(org.codehaus.cargo.container.deployable.Deployable) */ @Override public void deploy(Deployable deployable) { WebLogicWlstConfiguration configuration = (WebLogicWlstConfiguration) weblogicContainer.getConfiguration(); // script for deploying deployable to WebLogic using WLST List<ScriptCommand> configurationScript = new ArrayList<ScriptCommand>(); configurationScript.add(configuration.getConfigurationFactory().readDomainOnlineScript()); configurationScript.add(configuration.getConfigurationFactory(). deployDeployableOnlineScript(deployable)); configurationScript.add(configuration.getConfigurationFactory(). updateDomainOnlineScript()); getLogger().info("Deploying application " + deployable.getName() + " to WebLogic domain.", this.getClass().getName()); weblogicContainer.executeScript(configurationScript); }
/** * {@inheritDoc} */ @Override public void deploy(Deployable deployable) { String file = deployable.getFile(); getLogger().info("Deploying [" + file + "]", this.getClass().getName()); try { getTomcatManager().deploy(getPath(deployable), getVersion(deployable), new FileInputStream(file), false, null); } catch (IOException|TomcatManagerException exception) { throw new ContainerException("Failed to deploy [" + file + "]", exception); } }
/** * {@inheritDoc} undeploys files by sending WLST script to WebLogic server. * * @see org.codehaus.cargo.container.spi.deployer.AbstractDeployer#undeploy(org.codehaus.cargo.container.deployable.Deployable) */ @Override public void undeploy(Deployable deployable) { WebLogicWlstConfiguration configuration = (WebLogicWlstConfiguration) weblogicContainer.getConfiguration(); List<ScriptCommand> configurationScript = new ArrayList<ScriptCommand>(); configurationScript.add(configuration.getConfigurationFactory().readDomainOnlineScript()); configurationScript.add(configuration.getConfigurationFactory(). undeployDeployableOnlineScript(deployable)); configurationScript.add(configuration.getConfigurationFactory(). updateDomainOnlineScript()); getLogger().info("Undeploying application " + deployable.getName() + " from WebLogic domain.", this.getClass().getName()); weblogicContainer.executeScript(configurationScript); } }
/** * {@inheritDoc} undeploys files by sending WLST script to WebLogic server. * * @see org.codehaus.cargo.container.spi.deployer.AbstractDeployer#undeploy(org.codehaus.cargo.container.deployable.Deployable) */ @Override public void undeploy(Deployable deployable) { WebLogicWlstConfiguration configuration = (WebLogicWlstConfiguration) weblogicContainer.getConfiguration(); List<ScriptCommand> configurationScript = new ArrayList<ScriptCommand>(); configurationScript.add(configuration.getConfigurationFactory().readDomainOnlineScript()); configurationScript.add(configuration.getConfigurationFactory(). undeployDeployableOnlineScript(deployable)); configurationScript.add(configuration.getConfigurationFactory(). updateDomainOnlineScript()); getLogger().info("Undeploying application " + deployable.getName() + " from WebLogic domain.", this.getClass().getName()); weblogicContainer.executeScript(configurationScript); } }
@Override public void run() { try { if (container != null && (org.codehaus.cargo.container.State.STARTED == container.getState() || org.codehaus.cargo.container.State.STARTING == container.getState())) { log.info("Stopping container...",""); container.stop(); } } catch (Exception e) { log.warn("Failed stopping the container", ""); } } });
/** * {@inheritDoc} */ @Override protected void setUp() throws Exception { getLogger().info("Starting test [" + getName() + "]", this.getClass().getName()); // Set up the thread context classloader for embedded containers. We're doing this here // instead of in the constructor as this needs to be set for each single test as otherwise // the different embedded containers will conflict with each other. if (getTestData().containerType == ContainerType.EMBEDDED) { EmbeddedContainerClasspathResolver resolver = new EmbeddedContainerClasspathResolver(); this.classLoader = resolver.resolveDependencies(testData.containerId, installContainer()); if (this.classLoader != null) { Thread.currentThread().setContextClassLoader(this.classLoader); } } }
/** * {@inheritDoc}. For JBoss container the target is the <code>deployments</code> directory. */ @Override public String getDeployableDir(Deployable deployable) { String altDeployDir = getContainer().getConfiguration(). getPropertyValue(JBossPropertySet.ALTERNATIVE_DEPLOYMENT_DIR); if (altDeployDir != null && !"".equals(altDeployDir)) { getContainer().getLogger().info("Using non-default deployment target directory " + altDeployDir, this.getClass().getName()); return getFileHandler().append(getContainer().getConfiguration().getHome(), altDeployDir); } else { return getFileHandler().append(getContainer(). getConfiguration().getHome(), "deployments"); } }