Search in sources :

Example 1 with Scheme

use of org.apache.synapse.transport.http.conn.Scheme in project wso2-synapse by wso2.

the class BaseConfigurationTest method setUp.

@Before
public void setUp() throws Exception {
    Parameter portParam = new Parameter("port", PORT);
    portParam.setParameterElement(AXIOMUtil.stringToOM("<parameter name=\"port\" locked=\"false\">" + PORT + "</parameter>"));
    Parameter hostParam = new Parameter("hostname", HOST);
    transportInDescription.addParameter(portParam);
    transportInDescription.addParameter(hostParam);
    cfgCtx = new ConfigurationContext(new AxisConfiguration());
    cfgCtx.setServicePath("services");
    cfgCtx.setContextRoot("/");
    scheme = new Scheme(transportInDescription.getName(), PORT, false);
    metrics = new PassThroughTransportMetricsCollector(true, scheme.getName());
    baseConfiguration = new SourceConfiguration(cfgCtx, transportInDescription, scheme, PassThroughTestUtils.getWorkerPool(conf), metrics);
    baseConfiguration.build();
}
Also used : ConfigurationContext(org.apache.axis2.context.ConfigurationContext) AxisConfiguration(org.apache.axis2.engine.AxisConfiguration) Scheme(org.apache.synapse.transport.http.conn.Scheme) PassThroughTransportMetricsCollector(org.apache.synapse.transport.passthru.jmx.PassThroughTransportMetricsCollector) Parameter(org.apache.axis2.description.Parameter) Before(org.junit.Before)

Example 2 with Scheme

use of org.apache.synapse.transport.http.conn.Scheme in project wso2-synapse by wso2.

the class SourceConfigurationTest method setUp.

@Before
public void setUp() throws Exception {
    Parameter portParam = new Parameter("port", PORT);
    portParam.setParameterElement(AXIOMUtil.stringToOM("<parameter name=\"port\" locked=\"false\">" + PORT + "</parameter>"));
    Parameter hostParam = new Parameter("hostname", HOST);
    transportInDescription.addParameter(portParam);
    transportInDescription.addParameter(hostParam);
    cfgCtx = new ConfigurationContext(new AxisConfiguration());
    cfgCtx.setServicePath("services");
    cfgCtx.setContextRoot("/");
    scheme = new Scheme(transportInDescription.getName(), PORT, false);
    metrics = new PassThroughTransportMetricsCollector(true, scheme.getName());
    sourceConfiguration = new SourceConfiguration(cfgCtx, transportInDescription, scheme, PassThroughTestUtils.getWorkerPool(passThroughConfiguration), metrics);
    sourceConfiguration.build();
}
Also used : ConfigurationContext(org.apache.axis2.context.ConfigurationContext) AxisConfiguration(org.apache.axis2.engine.AxisConfiguration) Scheme(org.apache.synapse.transport.http.conn.Scheme) PassThroughTransportMetricsCollector(org.apache.synapse.transport.passthru.jmx.PassThroughTransportMetricsCollector) Parameter(org.apache.axis2.description.Parameter) Before(org.junit.Before)

Example 3 with Scheme

use of org.apache.synapse.transport.http.conn.Scheme in project wso2-synapse by wso2.

the class SourceConfigurationTest method testGetScheme.

@Test
public void testGetScheme() throws Exception {
    Scheme scheme = sourceConfiguration.getScheme();
    String expectedSchemeName = transportInDescription.getName();
    Assert.assertNotNull("ResponseFactory hasn't been initialized.", scheme);
    Assert.assertEquals("Scheme doesn't match with : " + expectedSchemeName, expectedSchemeName, scheme.getName());
}
Also used : Scheme(org.apache.synapse.transport.http.conn.Scheme) Test(org.junit.Test)

Aggregations

Scheme (org.apache.synapse.transport.http.conn.Scheme)3 ConfigurationContext (org.apache.axis2.context.ConfigurationContext)2 Parameter (org.apache.axis2.description.Parameter)2 AxisConfiguration (org.apache.axis2.engine.AxisConfiguration)2 PassThroughTransportMetricsCollector (org.apache.synapse.transport.passthru.jmx.PassThroughTransportMetricsCollector)2 Before (org.junit.Before)2 Test (org.junit.Test)1