Package org.jboss.serial.data.proxy

Examples of org.jboss.serial.data.proxy.InterfaceForProxy


*/
public class ProxyTestCase extends TestCase {

    public void testJavaSerialization() throws Exception
    {
        InterfaceForProxy proxy = createProxy();

        assertEquals(6,proxy.doSomething());


        ByteArrayOutputStream byteout = new ByteArrayOutputStream();
        ObjectOutputStream out = new ObjectOutputStream (byteout);
        out.writeObject(proxy);
        out.flush();
        ObjectInputStream inp = new ObjectInputStream (new ByteArrayInputStream(byteout.toByteArray()));
        InterfaceForProxy proxy2 = (InterfaceForProxy)inp.readObject();
        assertEquals(6,proxy2.doSomething());
    }
View Full Code Here


        assertEquals(6,proxy2.doSomething());
    }

    public void testJBossSerialization() throws Exception
    {
        InterfaceForProxy proxy = createProxy();

        assertEquals(6,proxy.doSomething());


        ByteArrayOutputStream byteout = new ByteArrayOutputStream();
        JBossObjectOutputStream out = new JBossObjectOutputStream (byteout);
        out.writeObject(proxy);
        out.flush();
        JBossObjectInputStream inp = new JBossObjectInputStream (new ByteArrayInputStream(byteout.toByteArray()));
        InterfaceForProxy proxy2 = (InterfaceForProxy)inp.readObject();
        assertEquals(6,proxy2.doSomething());
    }
View Full Code Here

        assertEquals(2,proxyClass.doSomething());

        Class proxyClazz = Proxy.getProxyClass(Thread.currentThread().getContextClassLoader(),new Class[]{InterfaceForProxy.class});
        System.out.println(proxyClazz);

        InterfaceForProxy proxy = (InterfaceForProxy) Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(),new Class[]{InterfaceForProxy.class},new TestHandler(3,proxyClass));
        return proxy;
    }
View Full Code Here

*/
public class ProxyTestCase extends TestCase {

    public void testJavaSerialization() throws Exception
    {
        InterfaceForProxy proxy = createProxy();

        assertEquals(6,proxy.doSomething());


        ByteArrayOutputStream byteout = new ByteArrayOutputStream();
        ObjectOutputStream out = new ObjectOutputStream (byteout);
        out.writeObject(proxy);
        out.flush();
        ObjectInputStream inp = new ObjectInputStream (new ByteArrayInputStream(byteout.toByteArray()));
        InterfaceForProxy proxy2 = (InterfaceForProxy)inp.readObject();
        assertEquals(6,proxy2.doSomething());
    }
View Full Code Here

        assertEquals(6,proxy2.doSomething());
    }

    public void testJBossSerialization() throws Exception
    {
        InterfaceForProxy proxy = createProxy();

        assertEquals(6,proxy.doSomething());


        ByteArrayOutputStream byteout = new ByteArrayOutputStream();
        JBossObjectOutputStream out = new JBossObjectOutputStream (byteout);
        out.writeObject(proxy);
        out.flush();
        JBossObjectInputStream inp = new JBossObjectInputStream (new ByteArrayInputStream(byteout.toByteArray()));
        InterfaceForProxy proxy2 = (InterfaceForProxy)inp.readObject();
        assertEquals(6,proxy2.doSomething());
    }
View Full Code Here

        assertEquals(2,proxyClass.doSomething());

        Class proxyClazz = Proxy.getProxyClass(Thread.currentThread().getContextClassLoader(),new Class[]{InterfaceForProxy.class});
        System.out.println(proxyClazz);

        InterfaceForProxy proxy = (InterfaceForProxy) Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(),new Class[]{InterfaceForProxy.class},new TestHandler(3,proxyClass));
        return proxy;
    }
View Full Code Here

TOP

Related Classes of org.jboss.serial.data.proxy.InterfaceForProxy

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.