use of com.google.cloud.servicedirectory.v1.Service in project webtools.servertools by eclipse.
the class XmlTestCase method testDefaultServerXml55.
/**
* Test reading of the default server.xml provided by the
* current Tomcat 5.5 release (20).
*/
public void testDefaultServerXml55() {
Server server = getXml40Server("default.serverxml.55");
assertNotNull(server);
// Check contents of XML
String port = server.getPort();
assertEquals("8005", port);
assertEquals(server.getListenerCount(), 4);
Listener listener = server.getListener(0);
assertNotNull(listener);
assertEquals("org.apache.catalina.core.AprLifecycleListener", listener.getClassName());
listener = server.getListener(1);
assertNotNull(listener);
assertEquals("org.apache.catalina.mbeans.ServerLifecycleListener", listener.getClassName());
listener = server.getListener(2);
assertNotNull(listener);
assertEquals("org.apache.catalina.mbeans.GlobalResourcesLifecycleListener", listener.getClassName());
listener = server.getListener(3);
assertNotNull(listener);
assertEquals("org.apache.catalina.storeconfig.StoreConfigLifecycleListener", listener.getClassName());
assertEquals(server.getServiceCount(), 1);
Service service = server.getService(0);
assertNotNull(service);
assertEquals("Catalina", service.getName());
assertEquals(2, service.getConnectorCount());
Connector connector = service.getConnector(0);
assertNotNull(connector);
assertEquals("8080", connector.getPort());
assertNull(connector.getProtocol());
connector = service.getConnector(1);
assertNotNull(connector);
assertEquals("8009", connector.getPort());
assertEquals("AJP/1.3", connector.getProtocol());
Engine engine = service.getEngine();
assertNotNull(engine);
assertEquals("Catalina", engine.getName());
assertEquals("localhost", engine.getDefaultHost());
assertEquals(1, engine.getHostCount());
Host host = engine.getHost(0);
assertNotNull(host);
assertEquals("localhost", host.getName());
assertEquals("webapps", host.getAppBase());
assertEquals("true", host.getAttributeValue("unpackWARs"));
assertEquals("true", host.getAttributeValue("autoDeploy"));
assertEquals(0, host.getContextCount());
}
use of com.google.cloud.servicedirectory.v1.Service in project webtools.servertools by eclipse.
the class XmlTestCase method testDefaultServerXml60.
/**
* Test reading of the default server.xml provided by the
* current Tomcat 6.0 release.
*/
public void testDefaultServerXml60() {
Server server = getXml40Server("default.serverxml.60");
assertNotNull(server);
// Check contents of XML
String port = server.getPort();
assertEquals("8005", port);
assertEquals(4, server.getListenerCount());
Listener listener = server.getListener(0);
assertNotNull(listener);
assertEquals("org.apache.catalina.core.AprLifecycleListener", listener.getClassName());
listener = server.getListener(1);
assertNotNull(listener);
assertEquals("org.apache.catalina.core.JasperListener", listener.getClassName());
listener = server.getListener(2);
assertNotNull(listener);
assertEquals("org.apache.catalina.mbeans.ServerLifecycleListener", listener.getClassName());
listener = server.getListener(3);
assertNotNull(listener);
assertEquals("org.apache.catalina.mbeans.GlobalResourcesLifecycleListener", listener.getClassName());
assertEquals(1, server.getServiceCount());
Service service = server.getService(0);
assertNotNull(service);
assertEquals("Catalina", service.getName());
assertEquals(2, service.getConnectorCount());
Connector connector = service.getConnector(0);
assertNotNull(connector);
assertEquals("8080", connector.getPort());
assertEquals("HTTP/1.1", connector.getProtocol());
connector = service.getConnector(1);
assertNotNull(connector);
assertEquals("8009", connector.getPort());
assertEquals("AJP/1.3", connector.getProtocol());
Engine engine = service.getEngine();
assertNotNull(engine);
assertEquals("Catalina", engine.getName());
assertEquals("localhost", engine.getDefaultHost());
assertEquals(1, engine.getHostCount());
Host host = engine.getHost(0);
assertNotNull(host);
assertEquals("localhost", host.getName());
assertEquals("webapps", host.getAppBase());
assertEquals("true", host.getAttributeValue("unpackWARs"));
assertEquals("true", host.getAttributeValue("autoDeploy"));
assertEquals(0, host.getContextCount());
}
use of com.google.cloud.servicedirectory.v1.Service 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);
}
use of com.google.cloud.servicedirectory.v1.Service in project netvirt by opendaylight.
the class PolicyAceFlowProgrammer method getPolicyAceFlowWrapper.
private Optional<PolicyAceFlowWrapper> getPolicyAceFlowWrapper(Matches matches) {
IngressInterface ingressInterface = matches.augmentation(IngressInterface.class);
if (ingressInterface != null) {
Optional<PolicyAceFlowWrapper> interfaceFlowOpt = getIngressInterfaceFlow(ingressInterface);
if (interfaceFlowOpt.isPresent()) {
return interfaceFlowOpt;
}
}
Service service = matches.augmentation(Service.class);
if (service != null) {
Optional<PolicyAceFlowWrapper> serviceFlowOpt = getPolicyServiceFlow(service);
if (serviceFlowOpt.isPresent()) {
return serviceFlowOpt;
}
}
return Optional.empty();
}
use of com.google.cloud.servicedirectory.v1.Service in project axis-axis2-java-core by apache.
the class WSDL20ToAllAxisServicesBuilder method populateAllServices.
/**
* Public method to access the wsdl 2.0 file and create a List of AxisService objects.
* For each endpoint on each service in the wsdl, an AxisService object is created and
* added to the List. The name of the AxisService is changed from the service name
* to the the following: <service name>#<endpoint name>. Note that the endpoint name
* is not unique to a wsdl 2.0 file. Multiple services in the file may have endpoints
* with the same name. Therefore the name of the AxisService needs to be a combination
* of service/endpoint name to be unique to the wsdl.
*
* @return A List containing one AxisService object for each port in the wsdl file.
* The name of the AxisService is modified to uniquely represent the service/endpoint
* pair. The format of the name is "<wsdl service name>#<wsdl endpoint name>"
* @throws AxisFault
*/
public List<AxisService> populateAllServices() throws AxisFault {
try {
if (log.isDebugEnabled()) {
log.debug("Entry: populateAllServices");
}
// setup contains code with gathers non-service specific info
setup();
// from the WSDL. This only needs to be done once per WSDL.
if (description == null) {
if (log.isDebugEnabled()) {
log.debug("Exit: populateAllServices. wsdl description is null!");
}
// can't go any further without the wsdl
return null;
}
Service[] services = description.getServices();
for (int i = 0; i < services.length; i++) {
Service service = services[i];
// set the serviceName on the parent to setup call to populateService
serviceName = service.getName();
this.axisService = new AxisService();
AxisService retAxisService = populateService();
if (retAxisService != null) {
axisServices.add(retAxisService);
}
// end if axisService was returned
}
// end for all ports of a service
if (log.isDebugEnabled()) {
log.debug("Exit: populateAllServices.");
}
return axisServices;
} catch (AxisFault e) {
// just rethrow any AxisFaults
throw e;
} catch (Exception e) {
if (log.isDebugEnabled()) {
log.debug("populateAllServices caught Exception. Converting to AxisFault. " + e.toString());
}
throw AxisFault.makeFault(e);
}
}
Aggregations