Examples of FakeInputStream


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

        logger.log(Level.FINE,"");

        // OutboundRequest.getResponseInputStream.read throws IOException

        fakeRequest.setResponseInputStream(
            new FakeInputStream(new IOException(),0));
        request = boe.newCall(InvocationConstraints.EMPTY).next();
        try {
            boe.executeCall(request);
            throw new AssertionError("executeCall() should fail");
        } catch (IOException ignore) {
        }

        logger.log(Level.FINE,"=================================");
        logger.log(Level.FINE,"test case " + (counter++)
            + ": reading response input stream returns -1 (EOF)");
        logger.log(Level.FINE,"");

        // OutboundRequest.getResponseInputStream.read returns -1

        iterator.init();
        fakeRequest.setResponseInputStream(new FakeInputStream(null,-1));

        request = boe.newCall(InvocationConstraints.EMPTY).next();
        try {
            boe.executeCall(request);
            throw new AssertionError("executeCall() should fail");
View Full Code Here

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

        logger.log(Level.FINE,"test case " + (counter++)
            + ": reading response input stream returns 0x00");
        logger.log(Level.FINE,"");

        iterator.init();
        fakeRequest.setResponseInputStream(new FakeInputStream(null,0x00));
        request = boe.newCall(InvocationConstraints.EMPTY).next();
        assertion(
            boe.executeCall(request) instanceof NoSuchObjectException);

        logger.log(Level.FINE,"=================================");
        logger.log(Level.FINE,"test case " + (counter++)
            + ": reading response input stream returns 0x01");
        logger.log(Level.FINE,"");

        iterator.init();
        fakeRequest.setResponseInputStream(new FakeInputStream(null,0x01));
        request = boe.newCall(InvocationConstraints.EMPTY).next();
        assertion(boe.executeCall(request) == null);

        logger.log(Level.FINE,"=================================");
        logger.log(Level.FINE,"test case " + (counter++)
            + ": reading response input stream returns 0x02");
        logger.log(Level.FINE,"");

        iterator.init();
        fakeRequest.setResponseInputStream(new FakeInputStream(null,0x02));
        request = boe.newCall(InvocationConstraints.EMPTY).next();
        assertion(
            boe.executeCall(request) instanceof UnmarshalException);
    }
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.