Search in sources :

Example 1 with TomcatParseBpmPlatformXmlStep

use of org.camunda.bpm.container.impl.tomcat.deployment.TomcatParseBpmPlatformXmlStep in project camunda-bpm-platform by camunda.

the class TomcatBpmPlatformBootstrap method deployBpmPlatform.

protected void deployBpmPlatform(LifecycleEvent event) {
    final StandardServer server = (StandardServer) event.getSource();
    containerDelegate.getServiceContainer().createDeploymentOperation("deploy BPM platform").addAttachment(TomcatAttachments.SERVER, server).addStep(new TomcatParseBpmPlatformXmlStep()).addStep(new DiscoverBpmPlatformPluginsStep()).addStep(new StartManagedThreadPoolStep()).addStep(new StartJobExecutorStep()).addStep(new PlatformXmlStartProcessEnginesStep()).execute();
    LOG.camundaBpmPlatformSuccessfullyStarted(server.getServerInfo());
}
Also used : StartJobExecutorStep(org.camunda.bpm.container.impl.deployment.jobexecutor.StartJobExecutorStep) DiscoverBpmPlatformPluginsStep(org.camunda.bpm.container.impl.deployment.DiscoverBpmPlatformPluginsStep) StandardServer(org.apache.catalina.core.StandardServer) PlatformXmlStartProcessEnginesStep(org.camunda.bpm.container.impl.deployment.PlatformXmlStartProcessEnginesStep) StartManagedThreadPoolStep(org.camunda.bpm.container.impl.deployment.jobexecutor.StartManagedThreadPoolStep) TomcatParseBpmPlatformXmlStep(org.camunda.bpm.container.impl.tomcat.deployment.TomcatParseBpmPlatformXmlStep)

Example 2 with TomcatParseBpmPlatformXmlStep

use of org.camunda.bpm.container.impl.tomcat.deployment.TomcatParseBpmPlatformXmlStep in project camunda-bpm-platform by camunda.

the class BpmPlatformXmlLocationTest method getBpmPlatformXmlLocationFromJndi.

@Test
public void getBpmPlatformXmlLocationFromJndi() throws NamingException, MalformedURLException {
    Context context = new InitialContext();
    context.bind("java:comp/env/" + BPM_PLATFORM_XML_LOCATION, BPM_PLATFORM_XML_FILE_ABSOLUTE_LOCATION);
    URL url = new TomcatParseBpmPlatformXmlStep().lookupBpmPlatformXmlLocationFromJndi();
    assertEquals(new File(BPM_PLATFORM_XML_FILE_ABSOLUTE_LOCATION).toURI().toURL(), url);
}
Also used : InitialContext(javax.naming.InitialContext) SimpleNamingContext(org.springframework.mock.jndi.SimpleNamingContext) Context(javax.naming.Context) TomcatParseBpmPlatformXmlStep(org.camunda.bpm.container.impl.tomcat.deployment.TomcatParseBpmPlatformXmlStep) File(java.io.File) InitialContext(javax.naming.InitialContext) URL(java.net.URL) Test(org.junit.Test)

Example 3 with TomcatParseBpmPlatformXmlStep

use of org.camunda.bpm.container.impl.tomcat.deployment.TomcatParseBpmPlatformXmlStep in project camunda-bpm-platform by camunda.

the class BpmPlatformXmlLocationTest method getBpmPlatformXmlFromCatalinaConfDirectory.

@Test
public void getBpmPlatformXmlFromCatalinaConfDirectory() throws MalformedURLException {
    System.setProperty(CATALINA_HOME, BPM_PLATFORM_XML_LOCATION_PARENT_DIR);
    try {
        URL url = new TomcatParseBpmPlatformXmlStep().lookupBpmPlatformXmlFromCatalinaConfDirectory();
        assertEquals(new File(BPM_PLATFORM_XML_FILE_ABSOLUTE_LOCATION).toURI().toURL(), url);
    } finally {
        System.clearProperty(CATALINA_HOME);
    }
}
Also used : TomcatParseBpmPlatformXmlStep(org.camunda.bpm.container.impl.tomcat.deployment.TomcatParseBpmPlatformXmlStep) File(java.io.File) URL(java.net.URL) Test(org.junit.Test)

Example 4 with TomcatParseBpmPlatformXmlStep

use of org.camunda.bpm.container.impl.tomcat.deployment.TomcatParseBpmPlatformXmlStep in project camunda-bpm-platform by camunda.

the class BpmPlatformXmlLocationTest method getBpmPlatformXmlFromSystemPropertyAsFileLocation.

@Test
public void getBpmPlatformXmlFromSystemPropertyAsFileLocation() throws MalformedURLException {
    try {
        System.setProperty(BPM_PLATFORM_XML_SYSTEM_PROPERTY, BPM_PLATFORM_XML_FILE_ABSOLUTE_LOCATION);
        URL url = new TomcatParseBpmPlatformXmlStep().lookupBpmPlatformXmlLocationFromEnvironmentVariable();
        assertEquals(new File(BPM_PLATFORM_XML_FILE_ABSOLUTE_LOCATION).toURI().toURL(), url);
    } finally {
        System.clearProperty(BPM_PLATFORM_XML_SYSTEM_PROPERTY);
    }
}
Also used : TomcatParseBpmPlatformXmlStep(org.camunda.bpm.container.impl.tomcat.deployment.TomcatParseBpmPlatformXmlStep) File(java.io.File) URL(java.net.URL) Test(org.junit.Test)

Example 5 with TomcatParseBpmPlatformXmlStep

use of org.camunda.bpm.container.impl.tomcat.deployment.TomcatParseBpmPlatformXmlStep in project camunda-bpm-platform by camunda.

the class BpmPlatformXmlLocationTest method checkValidBpmPlatformXmlResourceLocationForFile.

@Test
public void checkValidBpmPlatformXmlResourceLocationForFile() throws NamingException, MalformedURLException {
    TomcatParseBpmPlatformXmlStep tomcatParseBpmPlatformXmlStep = new TomcatParseBpmPlatformXmlStep();
    URL url = tomcatParseBpmPlatformXmlStep.checkValidFileLocation(BPM_PLATFORM_XML_LOCATION_RELATIVE_PATH);
    assertNull("Relative path is invalid.", url);
    url = tomcatParseBpmPlatformXmlStep.checkValidFileLocation(BPM_PLATFORM_XML_FILE_ABSOLUTE_LOCATION);
    assertEquals(new File(BPM_PLATFORM_XML_FILE_ABSOLUTE_LOCATION).toURI().toURL(), url);
    url = tomcatParseBpmPlatformXmlStep.checkValidFileLocation(BPM_PLATFORM_XML_LOCATION_FILE_INVALID_PATH_WINDOWS);
    assertNull("Path is invalid.", url);
    assertNull(tomcatParseBpmPlatformXmlStep.checkValidFileLocation(BPM_PLATFORM_XML_LOCATION_URL_HTTP_PROTOCOL));
    assertNull(tomcatParseBpmPlatformXmlStep.checkValidFileLocation(BPM_PLATFORM_XML_LOCATION_URL_HTTPS_PROTOCOL));
}
Also used : TomcatParseBpmPlatformXmlStep(org.camunda.bpm.container.impl.tomcat.deployment.TomcatParseBpmPlatformXmlStep) File(java.io.File) URL(java.net.URL) Test(org.junit.Test)

Aggregations

TomcatParseBpmPlatformXmlStep (org.camunda.bpm.container.impl.tomcat.deployment.TomcatParseBpmPlatformXmlStep)12 Test (org.junit.Test)11 URL (java.net.URL)10 File (java.io.File)6 Context (javax.naming.Context)2 InitialContext (javax.naming.InitialContext)2 SimpleNamingContext (org.springframework.mock.jndi.SimpleNamingContext)2 StandardServer (org.apache.catalina.core.StandardServer)1 DiscoverBpmPlatformPluginsStep (org.camunda.bpm.container.impl.deployment.DiscoverBpmPlatformPluginsStep)1 PlatformXmlStartProcessEnginesStep (org.camunda.bpm.container.impl.deployment.PlatformXmlStartProcessEnginesStep)1 StartJobExecutorStep (org.camunda.bpm.container.impl.deployment.jobexecutor.StartJobExecutorStep)1 StartManagedThreadPoolStep (org.camunda.bpm.container.impl.deployment.jobexecutor.StartManagedThreadPoolStep)1