Examples of FakeInboundRequest


Examples of com.sun.jini.test.spec.jeri.util.FakeInboundRequest

    // inherit javadoc
    public void run() throws Exception {
        try {

            // setup infrastructure needed by test
            request = new FakeInboundRequest(null);
            InvocationConstraints constraints = InvocationConstraints.EMPTY;
            Object[] args = {};
            Object retVal = new Object();
            Throwable exc = new Exception();
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
View Full Code Here

Examples of com.sun.jini.test.spec.jeri.util.FakeInboundRequest

        // initialize FakeRemoteImpl
        impl.setFakeMethodException(
            new FakeArgument(new IOException(),null));

        // initialize FakeInboundRequest
        request = new FakeInboundRequest(methodHash,nullArgs,0x00,0x00);

        // call dispatch and verify the proper result
        dispatcher.dispatch(impl,request,context);
        response = request.getResponseStream();
        assertion(response.read() == 0x02);
        MarshalInputStream mis = new MarshalInputStream(
            response,null,false,null,new ArrayList());
        assertion(mis.read() == -1);

        // iterate over test cases
        for (int i = 0; i < cases.length; i++) {
            logger.log(Level.FINE,"=================================");
            Throwable marshalThrowException = cases[i];
            logger.log(Level.FINE,"test case " + (counter++)
                + ": " + marshalThrowException);
            logger.log(Level.FINE,"");

            // initialize FakeBasicInvocationDispatcher
            dispatcher.setMarshalThrowException(marshalThrowException);

            // initialize FakeRemoteImpl
            impl.setFakeMethodException(new RemoteException());

            // initialize FakeInboundRequest
            request = new FakeInboundRequest(methodHash,nullArgs,0x00,0x00);

            // call dispatch and verify the proper result
            dispatcher.dispatch(impl,request,context);
            response = request.getResponseStream();
            assertion(response.read() == 0x02);
View Full Code Here

Examples of com.sun.jini.test.spec.jeri.util.FakeInboundRequest

        // initialize FakeRemoteImpl
        impl.setFakeMethodReturn(
            new FakeArgument(new IOException(),null));

        // initialize FakeInboundRequest
        request = new FakeInboundRequest(methodHash,nullArgs,0x00,0x00);

        // call dispatch and verify the proper result
        dispatcher.dispatch(impl,request,context);
        response = request.getResponseStream();
        assertion(response.read() == 0x01);
        MarshalInputStream mis = new MarshalInputStream(
            response,null,false,null,new ArrayList());
        assertion(mis.read() == -1);

        // iterate over test cases
        for (int i = 0; i < cases.length; i++) {
            logger.log(Level.FINE,"=================================");
            Throwable marshalReturnException = cases[i];
            logger.log(Level.FINE,"test case " + (counter++)
                + ": marshalReturn exception: " + marshalReturnException);
            logger.log(Level.FINE,"");

            // initialize FakeBasicInvocationDispatcher
            dispatcher.setMarshalReturnException(
                marshalReturnException);

            // initialize FakeInboundRequest
            request = new FakeInboundRequest(methodHash,nullArgs,0x00,0x00);

            // call dispatch and verify the proper result
            dispatcher.dispatch(impl,request,context);
            response = request.getResponseStream();
            assertion(response.read() == 0x01);
View Full Code Here

Examples of com.sun.jini.test.spec.jeri.util.FakeInboundRequest

        logger.log(Level.FINE,"test case " + (counter++)
            + ": exception reading first byte");
        logger.log(Level.FINE,"");

        // initialize FakeInboundRequest
        request = new FakeInboundRequest(null);

        // call dispatch and verify the proper result
        dispatcher.dispatch(impl,request,context);
        response = request.getResponseStream();
        assertion(response.read() == -1);
        assertion(request.isAbortCalled());

        // iterate over test cases
        for (int i = 0; i < cases.length; i++) {
            logger.log(Level.FINE,"=================================");
            byte firstRequestByte = cases[i];
            logger.log(Level.FINE,"test case " + (counter++)
                + ": " + firstRequestByte);
            logger.log(Level.FINE,"");

            // initialize FakeInboundRequest
            request = new FakeInboundRequest(0,null,firstRequestByte,0x00);

            // call dispatch and verify the proper result
            dispatcher.dispatch(impl,request,context);
            response = request.getResponseStream();
            assertion(response.read() == 0x00);
View Full Code Here

Examples of com.sun.jini.test.spec.jeri.util.FakeInboundRequest

            // initialize FakeBasicInvocationDispatcher
            dispatcher.setCreateMarshalInputStreamException(
                createMarshalInputStreamException);

            // initialize FakeInboundRequest
            request = new FakeInboundRequest(0,null,0x00,0x00);

            // call dispatch and verify the proper result
            dispatcher.dispatch(impl,request,context);
            response = request.getResponseStream();
            assertion(response.read() == 0x02);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.