Search in sources :

Example 6 with TomcatParseBpmPlatformXmlStep

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

the class BpmPlatformXmlLocationTest method checkUrlAutoCompletion.

@Test
public void checkUrlAutoCompletion() throws NamingException, MalformedURLException {
    TomcatParseBpmPlatformXmlStep tomcatParseBpmPlatformXmlStep = new TomcatParseBpmPlatformXmlStep();
    String correctedUrl = tomcatParseBpmPlatformXmlStep.autoCompleteUrl(BPM_PLATFORM_XML_LOCATION_VALID_PATH_UNIX);
    assertEquals(BPM_PLATFORM_XML_LOCATION_VALID_PATH_UNIX + "/" + BPM_PLATFORM_XML_FILE, correctedUrl);
    correctedUrl = tomcatParseBpmPlatformXmlStep.autoCompleteUrl(BPM_PLATFORM_XML_LOCATION_VALID_PATH_UNIX + "/");
    assertEquals(BPM_PLATFORM_XML_LOCATION_VALID_PATH_UNIX + "/" + BPM_PLATFORM_XML_FILE, correctedUrl);
    correctedUrl = tomcatParseBpmPlatformXmlStep.autoCompleteUrl(BPM_PLATFORM_XML_LOCATION_VALID_PATH_WINDOWS);
    assertEquals(BPM_PLATFORM_XML_LOCATION_VALID_PATH_WINDOWS + "\\" + BPM_PLATFORM_XML_FILE, correctedUrl);
}
Also used : TomcatParseBpmPlatformXmlStep(org.camunda.bpm.container.impl.tomcat.deployment.TomcatParseBpmPlatformXmlStep) Test(org.junit.Test)

Example 7 with TomcatParseBpmPlatformXmlStep

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

the class BpmPlatformXmlLocationTest method checkValidBpmPlatformXmlResourceLocationForUrl.

@Test
public void checkValidBpmPlatformXmlResourceLocationForUrl() throws NamingException, MalformedURLException {
    TomcatParseBpmPlatformXmlStep tomcatParseBpmPlatformXmlStep = new TomcatParseBpmPlatformXmlStep();
    assertNull(tomcatParseBpmPlatformXmlStep.checkValidUrlLocation(BPM_PLATFORM_XML_FILE_ABSOLUTE_LOCATION));
    assertNull(tomcatParseBpmPlatformXmlStep.checkValidUrlLocation(BPM_PLATFORM_XML_LOCATION_FILE_INVALID_PATH_WINDOWS));
    assertNull(tomcatParseBpmPlatformXmlStep.checkValidUrlLocation(BPM_PLATFORM_XML_LOCATION_FILE_INVALID_PATH_UNIX));
    assertNull(tomcatParseBpmPlatformXmlStep.checkValidUrlLocation(BPM_PLATFORM_XML_LOCATION_VALID_PATH_WINDOWS));
    assertNull(tomcatParseBpmPlatformXmlStep.checkValidUrlLocation(BPM_PLATFORM_XML_LOCATION_VALID_PATH_UNIX));
    URL httpUrl = tomcatParseBpmPlatformXmlStep.checkValidUrlLocation(BPM_PLATFORM_XML_LOCATION_URL_HTTP_PROTOCOL);
    assertEquals(BPM_PLATFORM_XML_LOCATION_URL_HTTP_PROTOCOL, httpUrl.toString());
    URL httpsUrl = tomcatParseBpmPlatformXmlStep.checkValidUrlLocation(BPM_PLATFORM_XML_LOCATION_URL_HTTPS_PROTOCOL);
    assertEquals(BPM_PLATFORM_XML_LOCATION_URL_HTTPS_PROTOCOL, httpsUrl.toString());
}
Also used : TomcatParseBpmPlatformXmlStep(org.camunda.bpm.container.impl.tomcat.deployment.TomcatParseBpmPlatformXmlStep) URL(java.net.URL) Test(org.junit.Test)

Example 8 with TomcatParseBpmPlatformXmlStep

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

the class BpmPlatformXmlLocationTest method lookupBpmPlatformXml.

@Test
public void lookupBpmPlatformXml() 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().lookupBpmPlatformXml();
    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 9 with TomcatParseBpmPlatformXmlStep

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

the class BpmPlatformXmlLocationTest method checkValidBpmPlatformXmlResourceLocation.

@Test
public void checkValidBpmPlatformXmlResourceLocation() throws NamingException, MalformedURLException {
    URL url = new TomcatParseBpmPlatformXmlStep().checkValidBpmPlatformXmlResourceLocation(BPM_PLATFORM_XML_FILE_ABSOLUTE_LOCATION);
    assertEquals(new File(BPM_PLATFORM_XML_FILE_ABSOLUTE_LOCATION).toURI().toURL(), url);
}
Also used : TomcatParseBpmPlatformXmlStep(org.camunda.bpm.container.impl.tomcat.deployment.TomcatParseBpmPlatformXmlStep) File(java.io.File) URL(java.net.URL) Test(org.junit.Test)

Example 10 with TomcatParseBpmPlatformXmlStep

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

the class BpmPlatformXmlLocationTest method bpmPlatformXmlLocationNotRegisteredInJndi.

@Test
public void bpmPlatformXmlLocationNotRegisteredInJndi() throws NamingException {
    URL url = new TomcatParseBpmPlatformXmlStep().lookupBpmPlatformXmlLocationFromJndi();
    assertNull(url);
}
Also used : TomcatParseBpmPlatformXmlStep(org.camunda.bpm.container.impl.tomcat.deployment.TomcatParseBpmPlatformXmlStep) 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