Package org.objectweb.celtix.context

Examples of org.objectweb.celtix.context.StreamMessageContext


        InputStreamMessageContext inctx = EasyMock.createMock(InputStreamMessageContext.class);
       
        inctx.getInputStream();
        org.easymock.EasyMock.expectLastCall().andReturn(inStream);

        StreamMessageContext ctx = new StreamMessageContextImpl(inctx);
       
        EasyMock.replay(inctx);
        assertSame(inStream, ctx.getInputStream());
        EasyMock.verify(inctx);

        EasyMock.reset(inctx);
        InputStream in2 = EasyMock.createMock(InputStream.class);
        inctx.setInputStream(in2);
        EasyMock.replay(inctx);
        ctx.setInputStream(in2);

        EasyMock.verify(inctx);

    }
View Full Code Here


        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");
        } catch (IllegalStateException ex) {
            // expected
        }

        try {
            ctx.setInputStream(EasyMock.createMock(InputStream.class));
            fail("did not get expected exception");
        } catch (IllegalStateException ex) {
            // expected
        }
    }
View Full Code Here


    public void testContextWithInputStreamInvokeOutputStream() {

        InputStreamMessageContext inctx = EasyMock.createMock(InputStreamMessageContext.class);
        StreamMessageContext ctx = new StreamMessageContextImpl(inctx);

        try {
            ctx.getOutputStream();
            fail("did not get expected exception");
        } catch (IllegalStateException ex) {
            // expected
        }

        try {
            ctx.setOutputStream(EasyMock.createMock(OutputStream.class));
            fail("did not get expected exception");
        } catch (IllegalStateException ex) {
            // expected
        }
    }
View Full Code Here

TOP

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

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.