Search in sources :

Example 1 with StubTransportListener

use of org.pentaho.test.platform.plugin.services.webservices.StubTransportListener in project pentaho-platform by pentaho.

the class AxisServiceExecutorTest method setUp.

@Before
public void setUp() throws Exception {
    StandaloneSession session = new StandaloneSession("test");
    StubServiceSetup serviceSetup = new StubServiceSetup();
    serviceSetup.setSession(session);
    AxisConfiguration axisCfg = serviceSetup.getAxisConfiguration();
    ConfigurationContext configContext = new ConfigurationContext(axisCfg);
    serviceSetup.loadServices();
    TransportInDescription tIn = new TransportInDescription(DEAFULT_TRANSPOT_PROTOCOL);
    StubTransportListener receiver = new StubTransportListener();
    tIn.setReceiver(receiver);
    axisCfg.addTransportIn(tIn);
    TransportOutDescription tOut = new TransportOutDescription(DEAFULT_TRANSPOT_PROTOCOL);
    StubTransportSender sender = new StubTransportSender();
    tOut.setSender(sender);
    axisCfg.addTransportOut(tOut);
    AxisWebServiceManager.currentAxisConfiguration = axisCfg;
    AxisWebServiceManager.currentAxisConfigContext = configContext;
    out = new ByteArrayOutputStream();
    IOutputHandler outputHandler = new SimpleOutputHandler(out, false);
    outputHandler.setMimeTypeListener(new MimeTypeListener());
    contentGenerator = new AxisServiceExecutor();
    contentGenerator.setOutputHandler(outputHandler);
    contentGenerator.setMessagesList(new ArrayList<String>());
    contentGenerator.setSession(session);
    contentGenerator.setUrlFactory(new SimpleUrlFactory(BASE_URL + "?"));
    assertNotNull("contentGenerator is null", contentGenerator);
    assertNotNull("Logger is null", contentGenerator.getLogger());
}
Also used : AxisConfiguration(org.apache.axis2.engine.AxisConfiguration) ConfigurationContext(org.apache.axis2.context.ConfigurationContext) StandaloneSession(org.pentaho.platform.engine.core.system.StandaloneSession) StubTransportSender(org.pentaho.test.platform.plugin.services.webservices.StubTransportSender) SimpleOutputHandler(org.pentaho.platform.engine.core.output.SimpleOutputHandler) TransportInDescription(org.apache.axis2.description.TransportInDescription) ByteArrayOutputStream(java.io.ByteArrayOutputStream) IOutputHandler(org.pentaho.platform.api.engine.IOutputHandler) StubServiceSetup(org.pentaho.test.platform.plugin.services.webservices.StubServiceSetup) MimeTypeListener(org.pentaho.test.platform.plugin.services.webservices.MimeTypeListener) SimpleUrlFactory(org.pentaho.platform.util.web.SimpleUrlFactory) StubTransportListener(org.pentaho.test.platform.plugin.services.webservices.StubTransportListener) TransportOutDescription(org.apache.axis2.description.TransportOutDescription) Before(org.junit.Before)

Aggregations

ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 ConfigurationContext (org.apache.axis2.context.ConfigurationContext)1 TransportInDescription (org.apache.axis2.description.TransportInDescription)1 TransportOutDescription (org.apache.axis2.description.TransportOutDescription)1 AxisConfiguration (org.apache.axis2.engine.AxisConfiguration)1 Before (org.junit.Before)1 IOutputHandler (org.pentaho.platform.api.engine.IOutputHandler)1 SimpleOutputHandler (org.pentaho.platform.engine.core.output.SimpleOutputHandler)1 StandaloneSession (org.pentaho.platform.engine.core.system.StandaloneSession)1 SimpleUrlFactory (org.pentaho.platform.util.web.SimpleUrlFactory)1 MimeTypeListener (org.pentaho.test.platform.plugin.services.webservices.MimeTypeListener)1 StubServiceSetup (org.pentaho.test.platform.plugin.services.webservices.StubServiceSetup)1 StubTransportListener (org.pentaho.test.platform.plugin.services.webservices.StubTransportListener)1 StubTransportSender (org.pentaho.test.platform.plugin.services.webservices.StubTransportSender)1