Package org.logicblaze.lingo.beans

Examples of org.logicblaze.lingo.beans.ITestBean


        pfb.setServiceInterface(ITestBean.class);
        pfb.setServiceUrl("http://myurl");

        pfb.setRequestor(createRequestor(getDestinationName()));
        configure(pfb);
        ITestBean proxy = (ITestBean) pfb.getObject();

        // lets force an exception by closing the session
        closeSession(pfb);
        try {
            proxy.setAge(50);
            fail("Should have thrown RemoteAccessException");
        }
        catch (RemoteAccessException ex) {
            // expected
            assertTrue(ex.getCause() instanceof JMSException);
View Full Code Here


                return invocation;
            }
        });
        configure(pfb);

        ITestBean proxy = (ITestBean) pfb.getObject();
        assertEquals("myname", proxy.getName());
        assertEquals(99, proxy.getAge());
    }
View Full Code Here

                return invocation;
            }
        });
        configure(pfb);

        ITestBean proxy = (ITestBean) pfb.getObject();
        assertEquals("myname", proxy.getName());
        assertEquals(99, proxy.getAge());
    }
View Full Code Here

        pfb.setServiceInterface(ITestBean.class);
        pfb.setServiceUrl(serviceUrl);
        pfb.setRequestor(createRequestor(getDestinationName()));
        configure(pfb);

        ITestBean proxy = (ITestBean) pfb.getObject();

        // shouldn't go through to remote service
        assertTrue(proxy.toString().indexOf("JMS invoker") != -1);
        assertTrue(proxy.toString().indexOf(serviceUrl) != -1);
        assertEquals(proxy.hashCode(), proxy.hashCode());
        assertTrue(proxy.equals(proxy));

        // lets force an exception by closing the session
        closeSession(pfb);
        try {
            proxy.setAge(50);
            fail("Should have thrown RemoteAccessException");
        }
        catch (RemoteAccessException ex) {
            // expected
            assertTrue(ex.getCause() instanceof JMSException);
View Full Code Here

        pfb.setServiceUrl("http://myurl");
        pfb.setRequestor(createRequestor(getDestinationName()));
        configure(pfb);


        ITestBean proxy = (ITestBean) pfb.getObject();
        assertEquals("myname", proxy.getName());
        assertEquals(99, proxy.getAge());
        proxy.setAge(50);

        System.out.println("getting name: " + proxy.getName());
        int age = proxy.getAge();
        System.out.println("got age: " + age);

        assertEquals("myname", proxy.getName());
        assertEquals(50, proxy.getAge());

        try {
            proxy.exceptional(new IllegalStateException());
            fail("Should have thrown IllegalStateException");
        }
        catch (IllegalStateException ex) {
            // expected
        }
        try {
            proxy.exceptional(new IllegalAccessException());
            fail("Should have thrown IllegalAccessException");
        }
        catch (IllegalAccessException ex) {
            // expected
        }
View Full Code Here

        pfb.setServiceInterface(ITestBean.class);
        pfb.setConnectionFactory(connectionFactory);
        pfb.setDestination(new ActiveMQQueue(getDestinationName()));
        configure(pfb);

        ITestBean proxy = (ITestBean) pfb.getObject();
        assertEquals("myname", proxy.getName());
        assertEquals(99, proxy.getAge());
        proxy.setAge(50);

        System.out.println("getting name: " + proxy.getName());
        int age = proxy.getAge();
        System.out.println("got age: " + age);

        assertEquals("myname", proxy.getName());
        assertEquals(50, proxy.getAge());
    }
View Full Code Here

        pfb.setServiceUrl("http://myurl");
        pfb.setRequestor(createRequestor(getDestinationName()));
        pfb.setRemoteInvocationFactory(new LingoRemoteInvocationFactory(new SimpleMetadataStrategy(true)));
        configure(pfb);

        ITestBean proxy = (ITestBean) pfb.getObject();
        assertEquals("myname", proxy.getName());
        assertEquals(99, proxy.getAge());
        proxy.setAge(50);

        System.out.println("getting name: " + proxy.getName());
        int age = proxy.getAge();
        System.out.println("got age: " + age);

        assertEquals("myname", proxy.getName());
        assertEquals(50, proxy.getAge());

        try {
            proxy.exceptional(new IllegalStateException());
            fail("Should have thrown IllegalStateException");
        }
        catch (IllegalStateException ex) {
            // expected
        }
        try {
            proxy.exceptional(new IllegalAccessException());
            fail("Should have thrown IllegalAccessException");
        }
        catch (IllegalAccessException ex) {
            // expected
        }
View Full Code Here

TOP

Related Classes of org.logicblaze.lingo.beans.ITestBean

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.