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

Examples of com.sun.jini.test.spec.activation.util.RemoteMethodSetInterface


        fup = new MethodSetProxy(logger);
        aid = new FakeActivationID(logger);
        ActivatableInvocationHandler handler2 = new
                ActivatableInvocationHandler(aid, fup);
        RemoteMethodSetInterface fakeProxy = (RemoteMethodSetInterface)
                Proxy.newProxyInstance(
                        RemoteMethodSetInterface.class.getClassLoader(),
                        new Class[] {RemoteMethodSetInterface.class},
                        handler2);
        ActivationID aid2 = new FakeActivationID(logger, fakeProxy, true);
        // handler does not have an underlying proxy - activation will
        // be performed
        handler = new ActivatableInvocationHandler(aid2, null);
        RemoteMethodSetInterface fi = (RemoteMethodSetInterface)
                Proxy.newProxyInstance(
                        RemoteMethodSetInterface.class.getClassLoader(),
                        new Class[] {RemoteMethodSetInterface.class},
                        handler);
        fi.voidReturn();
        cp = handler.getCurrentProxy();
        assertion(cp.equals(fup));
    }
View Full Code Here


        FakeActivationID aid = new FakeActivationID(null);
        MethodSetProxy fup = new MethodSetProxy(logger);
        InvocationHandler handler =
                new ActivatableInvocationHandler(aid, fup);
        RemoteMethodSetInterface fi = (RemoteMethodSetInterface)
                Proxy.newProxyInstance(
                        RemoteMethodSetInterface.class.getClassLoader(),
                        new Class[] {RemoteMethodSetInterface.class},
                        handler);
        fup.setInt(100);
        fi.voidReturn();
        assertion(fi.intReturn() == 110);

        fup.setInt(200);
        i = 1000;
        o = new Object();
        fi.voidReturn(i, o);
        assertion(fi.intReturn() == 1220);

        fup.setInt(300);
        i = 2000;
        fi.voidReturn(i);
        assertion(fi.intReturn() == 2330);

        o = new Object();
        fup.setObject(o);
        assertion(fi.objectReturn().equals(o));

        i = Integer.MIN_VALUE;
        fup.setInt(i);
        o = new Object();
        fup.setObject(o);
        assertion(fi.objectReturn(o, i).equals(o));

        i = i + 1;
        assertion(fi.objectReturn(i).equals(new Integer(i)));

        i = i + 1;
        fup.setInt(i);
        assertion(fi.intReturn() == i);

        i = i + 1;
        o = new Object();
        assertion(fi.intReturn(i, o) == i);

        i = i + 1;
        assertion(fi.intReturn(i) == i);

        Object[] objectArray = new Object[] {
            o, fup };
        assertion(Arrays.equals(fi.objectArrayReturn(objectArray),
                objectArray));

        byte b = Byte.MAX_VALUE;
        assertion(fi.byteReturn(b) == b);

        long l = Long.MAX_VALUE;
        assertion(fi.longReturn(l) == l);

        double d = Double.MAX_VALUE;
        assertion(fi.doubleReturn(d) == d);

        boolean bo = true;
        assertion(fi.booleanReturn(bo) == bo);

        char c = 'a';
        assertion(fi.charReturn(c) == c);

        short s = Short.MAX_VALUE;
        assertion(fi.shortReturn(s) == s);

        float f = Float.MAX_VALUE;
        assertion(fi.floatReturn(f) == f);
    }
View Full Code Here

        ActivationID aid = new FakeActivationID(logger);
        MethodSetProxy fup = new MethodSetProxy(logger);
        InvocationHandler handler2 = new ActivatableInvocationHandler(aid,
                fup);
        RemoteMethodSetInterface fakeProxy = (RemoteMethodSetInterface)
                Proxy.newProxyInstance(
                        RemoteMethodSetInterface.class.getClassLoader(),
                        new Class[] {RemoteMethodSetInterface.class},
                        handler2);
        ActivationID aid2 = new FakeActivationID(logger, fakeProxy, true);
        InvocationHandler handler = new ActivatableInvocationHandler(aid2,
                null);
        RemoteMethodSetInterface fi = (RemoteMethodSetInterface)
                Proxy.newProxyInstance(
                        RemoteMethodSetInterface.class.getClassLoader(),
                        new Class[] {RemoteMethodSetInterface.class},
                        handler);

        fup.setInt(100);
        fi.voidReturn();
        assertion(fi.intReturn() == 110);

        fup.setInt(200);
        i = 1000;
        o = new Object();
        fi.voidReturn(i, o);
        assertion(fi.intReturn() == 1220);

        fup.setInt(300);
        i = 2000;
        fi.voidReturn(i);
        assertion(fi.intReturn() == 2330);

        o = new Object();
        fup.setObject(o);
        assertion(fi.objectReturn().equals(o));

        i = Integer.MIN_VALUE;
        fup.setInt(i);
        o = new Object();
        fup.setObject(o);
        assertion(fi.objectReturn(o, i).equals(o));

        i = i + 1;
        assertion(fi.objectReturn(i).equals(new Integer(i)));

        i = i + 1;
        fup.setInt(i);
        assertion(fi.intReturn() == i);

        i = i + 1;
        o = new Object();
        assertion(fi.intReturn(i, o) == i);

        i = i + 1;
        assertion(fi.intReturn(i) == i);
        Object[] objectArray = new Object[] {
            o, fup };
        assertion(Arrays.equals(fi.objectArrayReturn(objectArray),
                objectArray));

        byte b = Byte.MAX_VALUE;
        assertion(fi.byteReturn(b) == b);

        long l = Long.MAX_VALUE;
        assertion(fi.longReturn(l) == l);

        double d = Double.MAX_VALUE;
        assertion(fi.doubleReturn(d) == d);

        boolean bo = true;
        assertion(fi.booleanReturn(bo) == bo);

        char c = 'a';
        assertion(fi.charReturn(c) == c);

        short s = Short.MAX_VALUE;
        assertion(fi.shortReturn(s) == s);

        float f = Float.MAX_VALUE;
        assertion(fi.floatReturn(f) == f);
    }
View Full Code Here

TOP

Related Classes of com.sun.jini.test.spec.activation.util.RemoteMethodSetInterface

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.