Search in sources :

Example 66 with Context

use of com.google.cloud.dialogflow.v2.Context in project webtools.servertools by eclipse.

the class XmlTestCase method testServerInstance50.

/**
 * Test reading of the default server.xml provided by the
 * current Tomcat 5.0 release using ServerInstance.
 */
public void testServerInstance50() {
    Server server = getXml40Server("default.serverxml.50");
    assertNotNull(server);
    ServerInstance si = new ServerInstance(server, null, null);
    assertEquals(2, server.getListenerCount());
    Listener[] listeners = si.getListeners();
    assertEquals("org.apache.catalina.mbeans.ServerLifecycleListener", listeners[0].getClassName());
    assertEquals("org.apache.catalina.mbeans.GlobalResourcesLifecycleListener", listeners[1].getClassName());
    Service service = si.getService();
    assertNotNull(service);
    assertEquals("Catalina", service.getName());
    assertEquals("8080", si.getConnector(0).getPort());
    assertNull(si.getConnector(0).getProtocol());
    assertEquals("8009", si.getConnector(1).getPort());
    assertEquals("AJP/1.3", si.getConnector(1).getProtocol());
    Connector[] connectors = si.getConnectors();
    assertEquals(2, connectors.length);
    assertEquals("8080", connectors[0].getPort());
    assertNull(connectors[0].getProtocol());
    assertEquals("8009", connectors[1].getPort());
    assertEquals("AJP/1.3", connectors[1].getProtocol());
    Engine engine = si.getEngine();
    assertNotNull(engine);
    assertEquals("Catalina", engine.getName());
    assertEquals("localhost", engine.getDefaultHost());
    Host host = si.getHost();
    assertNotNull(host);
    assertEquals("localhost", host.getName());
    assertEquals("webapps", host.getAppBase());
    assertEquals("true", host.getAttributeValue("unpackWARs"));
    assertEquals("true", host.getAttributeValue("autoDeploy"));
    Context[] contexts = si.getContexts();
    assertEquals(0, contexts.length);
}
Also used : Context(org.eclipse.jst.server.tomcat.core.internal.xml.server40.Context) Connector(org.eclipse.jst.server.tomcat.core.internal.xml.server40.Connector) Listener(org.eclipse.jst.server.tomcat.core.internal.xml.server40.Listener) Server(org.eclipse.jst.server.tomcat.core.internal.xml.server40.Server) Service(org.eclipse.jst.server.tomcat.core.internal.xml.server40.Service) Host(org.eclipse.jst.server.tomcat.core.internal.xml.server40.Host) ServerInstance(org.eclipse.jst.server.tomcat.core.internal.xml.server40.ServerInstance) Engine(org.eclipse.jst.server.tomcat.core.internal.xml.server40.Engine)

Example 67 with Context

use of com.google.cloud.dialogflow.v2.Context in project webtools.servertools by eclipse.

the class Tomcat32TestConfiguration method verifyPublishedModule.

protected void verifyPublishedModule(IPath baseDir, IModule module) throws Exception {
    Tomcat32TestConfiguration config = new Tomcat32TestConfiguration(null);
    config.load(baseDir.append("conf"), null);
    ServerInstance serverInstance = config.getServerInstance();
    Context context = serverInstance.getContext(module.getName());
    String deployDir = getTomcatServer().getDeployDirectory();
    if ("webapps".equals(deployDir)) {
        assertEquals("webapps/" + module.getName(), context.getDocBase());
    } else {
        assertEquals(getTomcatServerBehaviour().getModuleDeployDirectory(module).toOSString(), context.getDocBase());
    }
    verifyPublishedModuleFiles(module);
}
Also used : Context(org.eclipse.jst.server.tomcat.core.internal.xml.server32.Context) ServerInstance(org.eclipse.jst.server.tomcat.core.internal.xml.server32.ServerInstance)

Example 68 with Context

use of com.google.cloud.dialogflow.v2.Context in project webtools.servertools by eclipse.

the class Tomcat41TestConfiguration method verifyPublishedModule.

protected void verifyPublishedModule(IPath baseDir, IModule module) throws Exception {
    Tomcat41TestConfiguration config = new Tomcat41TestConfiguration(null);
    config.load(baseDir.append("conf"), null);
    ServerInstance serverInstance = config.getServerInstance();
    Context context = serverInstance.getContext(module.getName());
    String deployDir = getTomcatServer().getDeployDirectory();
    if ("webapps".equals(deployDir)) {
        assertEquals(module.getName(), context.getDocBase());
    } else {
        assertEquals(getTomcatServerBehaviour().getModuleDeployDirectory(module).toOSString(), context.getDocBase());
    }
    verifyPublishedModuleFiles(module);
}
Also used : Context(org.eclipse.jst.server.tomcat.core.internal.xml.server40.Context) ServerInstance(org.eclipse.jst.server.tomcat.core.internal.xml.server40.ServerInstance)

Example 69 with Context

use of com.google.cloud.dialogflow.v2.Context in project webtools.servertools by eclipse.

the class Tomcat50TestConfiguration method verifyPublishedModule.

protected void verifyPublishedModule(IPath baseDir, IModule module) throws Exception {
    Tomcat50TestConfiguration config = new Tomcat50TestConfiguration(null);
    config.load(baseDir.append("conf"), null);
    ServerInstance serverInstance = config.getServerInstance();
    Context context = serverInstance.getContext(module.getName());
    String deployDir = getTomcatServer().getDeployDirectory();
    if ("webapps".equals(deployDir)) {
        assertEquals(module.getName(), context.getDocBase());
    } else {
        assertEquals(getTomcatServerBehaviour().getModuleDeployDirectory(module).toOSString(), context.getDocBase());
    }
    verifyPublishedModuleFiles(module);
}
Also used : Context(org.eclipse.jst.server.tomcat.core.internal.xml.server40.Context) ServerInstance(org.eclipse.jst.server.tomcat.core.internal.xml.server40.ServerInstance)

Example 70 with Context

use of com.google.cloud.dialogflow.v2.Context in project webtools.servertools by eclipse.

the class Tomcat70TestConfiguration method verifyPublishedModule.

protected void verifyPublishedModule(IPath baseDir, IModule module) throws Exception {
    Tomcat70TestConfiguration config = new Tomcat70TestConfiguration(null);
    config.load(baseDir.append("conf"), null);
    ServerInstance serverInstance = config.getServerInstance();
    Context context = serverInstance.getContext(module.getName());
    String deployDir = getTomcatServer().getDeployDirectory();
    if ("webapps".equals(deployDir)) {
        assertEquals(module.getName(), context.getDocBase());
    } else {
        assertEquals(getTomcatServerBehaviour().getModuleDeployDirectory(module).toOSString(), context.getDocBase());
    }
    verifyPublishedModuleFiles(module);
}
Also used : Context(org.eclipse.jst.server.tomcat.core.internal.xml.server40.Context) ServerInstance(org.eclipse.jst.server.tomcat.core.internal.xml.server40.ServerInstance)

Aggregations

Context (org.eclipse.jst.server.tomcat.core.internal.xml.server40.Context)58 Context (com.microsoft.z3.Context)39 CoreException (org.eclipse.core.runtime.CoreException)34 Context (org.osate.aadl2.Context)31 BoolExpr (com.microsoft.z3.BoolExpr)25 ArrayList (java.util.ArrayList)18 HashMap (java.util.HashMap)18 Test (org.junit.Test)18 ServerInstance (org.eclipse.jst.server.tomcat.core.internal.xml.server40.ServerInstance)17 List (java.util.List)16 Map (java.util.Map)15 Solver (com.microsoft.z3.Solver)13 File (java.io.File)13 IOException (java.io.IOException)11 IPath (org.eclipse.core.runtime.IPath)11 IStatus (org.eclipse.core.runtime.IStatus)11 Status (org.eclipse.core.runtime.Status)11 Factory (org.eclipse.jst.server.tomcat.core.internal.xml.Factory)11 Feature (org.osate.aadl2.Feature)11 FileNotFoundException (java.io.FileNotFoundException)10