Package org.objectweb.celtix.context

Examples of org.objectweb.celtix.context.OutputStreamMessageContext


    }

    public void testContextWithOutputStream() {

        OutputStream outStream = EasyMock.createMock(OutputStream.class);
        OutputStreamMessageContext outctx = EasyMock.createMock(OutputStreamMessageContext.class);
       
        outctx.getOutputStream();
        org.easymock.EasyMock.expectLastCall().andReturn(outStream);

        StreamMessageContext ctx = new StreamMessageContextImpl(outctx);
       
        EasyMock.replay(outctx);
        assertSame(outStream, ctx.getOutputStream());
        EasyMock.verify(outctx);

        EasyMock.reset(outctx);
        OutputStream out2 = EasyMock.createMock(OutputStream.class);
        outctx.setOutputStream(out2);
        EasyMock.replay(outctx);
        ctx.setOutputStream(out2);

        EasyMock.verify(outctx);
    }
View Full Code Here


    }

   
    public void testContextWithOutputStreamInvokeInputStream() {

        OutputStreamMessageContext outctx = EasyMock.createMock(OutputStreamMessageContext.class);
        StreamMessageContext ctx = new StreamMessageContextImpl(outctx);

        try {
            ctx.getInputStream();
            fail("did not get expected exception");
View Full Code Here

        ClientTransport client = createClientTransport(factory, wsdlUrl, serviceName, portName);
        assertTrue("targetEndpoint address mismatch. Expected : " + address
                   + "  received : " + client.getTargetEndpoint(),
                   address.equals(client.getTargetEndpoint().getAddress().getValue()));

        OutputStreamMessageContext octx = null;
        byte outBytes[] = "Hello World!!!".getBytes();
        InputStreamMessageContext ictx = doClientInvoke(client, octx, outBytes, false);

        byte bytes[] = new byte[10000];
        int len = ictx.getInputStream().read(bytes);
View Full Code Here

        ClientTransport client = createClientTransport(factory, wsdlUrl, serviceName, portName);
       
        assertTrue("targetEndpoint address mismatch. Expected : " + address
                   + "  received : " + client.getTargetEndpoint(),
                   address.equals(client.getTargetEndpoint().getAddress().getValue()));
        OutputStreamMessageContext octx =
            client.createOutputStreamContext(new GenericMessageContext());
        client.finalPrepareOutputStreamContext(octx);
        byte outBytes[] = "Hello World!!!".getBytes();
        octx.getOutputStream().write(outBytes);
        client.invokeOneway(octx);
        Thread.sleep(500L);
        assertEquals(new String(outBytes),
                          serverRcvdInOneWayCall.substring(0, outBytes.length));
View Full Code Here

        ClientTransport client =
            createClientTransport(WSDL_URL, SERVICE_NAME, PORT_NAME, ADDRESS, decoupled);
        byte outBytes[] = "Hello World!!!".getBytes();

        long start = System.currentTimeMillis();
        OutputStreamMessageContext octx = doRequest(client, outBytes, true, decoupled);
        client.invokeOneway(octx);
        long stop = System.currentTimeMillis();

        octx = doRequest(client, outBytes, false, decoupled);
        client.invokeOneway(octx);
View Full Code Here

        server.deactivate();
        outBytes = "HelloWorld".getBytes();

        try {
            OutputStreamMessageContext octx = client.createOutputStreamContext(new GenericMessageContext());
            client.finalPrepareOutputStreamContext(octx);
            octx.getOutputStream().write(outBytes);
            octx.getOutputStream().close();
            InputStreamMessageContext ictx = client.invoke(octx);
            byte bytes[] = new byte[10000];
            int len = ictx.getInputStream().read(bytes);
            if (len != -1
                && new String(bytes, 0, len).indexOf("HTTP Status 503") == -1
View Full Code Here

        ClientTransport client =
            createClientTransport(WSDL_URL, SERVICE_NAME, PORT_NAME, ADDRESS, decoupled);
        byte outBytes[] = "Hello World!!!".getBytes();

        // wait then read without blocking
        OutputStreamMessageContext octx = doRequest(client, outBytes, true, decoupled);
        Future<InputStreamMessageContext> f = client.invokeAsync(octx, executor);
        assertNotNull(f);
        int i = 0;
        while (i < 10) {
            Thread.sleep(100);
View Full Code Here

    private void doRequestResponse(ClientTransport client,
                                   byte outBytes[],
                                   boolean initial,
                                   boolean decoupled)
        throws Exception {
        OutputStreamMessageContext octx = doRequest(client, outBytes, initial, decoupled);
        InputStreamMessageContext ictx = client.invoke(octx);
        doResponse(client, ictx, outBytes, decoupled);
    }
View Full Code Here

            if (initial) {
                EasyMock.verify(bus);
                EasyMock.verify(clientBinding);
            }
        }
        OutputStreamMessageContext octx = client.createOutputStreamContext(new GenericMessageContext());
        client.finalPrepareOutputStreamContext(octx);
        octx.getOutputStream().write(outBytes);
        return octx;
    }
View Full Code Here

        BindingContextUtils.storeDataBindingCallback(objectCtx, callback);

        Request request = new Request(this, getTransport(), objectCtx);

        try {
            OutputStreamMessageContext ostreamCtx = request.process(null);

            if (null != ostreamCtx) {

                InputStreamMessageContext responseContext = clientTransport().invoke(ostreamCtx);
                Response fullResponse = null;
View Full Code Here

TOP

Related Classes of org.objectweb.celtix.context.OutputStreamMessageContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.