Package com.sun.jini.test.spec.iiop.util

Examples of com.sun.jini.test.spec.iiop.util.TestRemoteInterface


    public void run() throws Exception {
        int i;
        int res;
        IiopExporter ie = createIiopExporter();
        TestRemoteObject tro = new TestRemoteObject();
        TestRemoteInterface stub;
        logger.log(Level.FINE,
                "Invoke export method of constructed IiopExporter with "
                + tro + " object as a parameter.");
        stub = (TestRemoteInterface) ie.export(tro);

        // PASS
        logger.log(Level.FINE,
                "Export method did not throw any exceptions "
                + "as expected.");

        // connect stub to the ORB manually if needed
        if ((cType == NOARG_FACTORY) || useNullOrb) {
            connectStub(stub);
        }

        for (i = 0; i < 5; ++i) {
            res = stub.incr(i);

            // PASS
            logger.log(Level.FINE,
                    "Incr method with " + i + " as a parameter did not "
                    + " throw any exceptions as expected.");

            if (res != (i + 1)) {
                // FAIL
                throw new TestException(
                        "performed incr method invocation with " + i
                        + " as a parameter returned " + res
                        + " while " + (i + 1) + " is expected.");
            } else {
                // PASS
                logger.log(Level.FINE,
                        "Performed incr method with " + i
                        + " as a parameter returned " + res
                        + " as expected.");
            }
        }
        ie.unexport(true);

        // PASS
        logger.log(Level.FINE,
                "Unexport method did not throw any exceptions "
                + "as expected.");

        try {
            stub.incr(i);

            // FAIL
            throw new TestException(
                    "performed remote invocation of incr method after "
                    + "unexporting the object did not produce any "
View Full Code Here


        } else {
            // PASS
            logger.log(Level.FINE, "Method returned true as expected.");
        }
        IiopExporter ie3 = createIiopExporter();
        TestRemoteInterface stub = (TestRemoteInterface) ie3.export(tro);

        // bind stub to the ORB manually if needed
        if ((cType == NOARG_FACTORY) || useNullOrb) {
            connectStub(stub);
        }
        Unexporter u = new Unexporter(ie3, false);
        logger.log(Level.FINE,
                "Start thread which will invoke unexport method"
                + " of constructed IiopExporter3 with 'false' value...");
        u.start();
        stub.wait(new Integer(5000));
        uRes = u.getResult();

        if (!uRes) {
            // FAIL
            throw new TestException(
                    "performed unexport method invocation of constructed "
                    + "IiopExporter3 with 'false' value while remote "
                    + "call is in progress has returned false "
                    + "while true is expected.");
        } else {
            // PASS
            logger.log(Level.FINE, "Method returned true as expected.");
        }
        IiopExporter ie4 = createIiopExporter();
        stub = (TestRemoteInterface) ie4.export(tro);

        // bind stub to the ORB manually if needed
        if ((cType == NOARG_FACTORY) || useNullOrb) {
            connectStub(stub);
        }
        u = new Unexporter(ie4, true);
        logger.log(Level.FINE,
                "Start thread which will invoke unexport method"
                + " of constructed IiopExporter4 with 'true' value...");
        u.start();
        stub.wait(new Integer(5000));
        uRes = u.getResult();

        if (!uRes) {
            // FAIL
            throw new TestException(
View Full Code Here

     *
     */
    public void run() throws Exception {
        IiopExporter ie = createIiopExporter();
        TestRemoteObject tro = new TestRemoteObject("TestObject");
        TestRemoteInterface stub = (TestRemoteInterface) ie.export(tro);
        ORB o;

        if ((cType == NOARG_FACTORY) || useNullOrb) {
            // we used no-arg constructor or null orb
            try {
View Full Code Here

TOP

Related Classes of com.sun.jini.test.spec.iiop.util.TestRemoteInterface

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.