Examples of ITestBean


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

Examples of org.logicblaze.lingo.beans.ITestBean

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

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

Examples of org.logicblaze.lingo.beans.ITestBean

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

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

Examples of org.logicblaze.lingo.beans.ITestBean

        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

Examples of org.logicblaze.lingo.beans.ITestBean

        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

Examples of org.logicblaze.lingo.beans.ITestBean

        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

Examples of org.logicblaze.lingo.beans.ITestBean

        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

Examples of org.springframework.beans.ITestBean

    TestBean bean = (TestBean) this.beanFactory.getBean("customisedTestBean");
    assetTestBean(bean);
  }

  public void testProxyingDecorator() throws Exception {
    ITestBean bean = (ITestBean) this.beanFactory.getBean("debuggingTestBean");
    assetTestBean(bean);
    assertTrue(AopUtils.isAopProxy(bean));
    Advisor[] advisors = ((Advised) bean).getAdvisors();
    assertEquals("Incorrect number of advisors", 1, advisors.length);
    assertEquals("Incorrect advice class.", DebugInterceptor.class, advisors[0].getAdvice().getClass());
View Full Code Here

Examples of org.springframework.beans.ITestBean

    int count = (new PropertiesBeanDefinitionReader(lbf)).registerBeanDefinitions(p, PREFIX);
    assertTrue("2 beans registered, not " + count, count == 2);

    TestBean kerry = (TestBean) lbf.getBean("kerry", TestBean.class);
    assertTrue("Kerry name is Kerry", "Kerry".equals(kerry.getName()));
    ITestBean spouse = kerry.getSpouse();
    assertTrue("Kerry spouse is non null", spouse != null);
    assertTrue("Kerry spouse name is Rod", "Rod".equals(spouse.getName()));
  }
View Full Code Here

Examples of org.springframework.beans.ITestBean

    bw.setPropertyValues(pvs);
    assertTrue("spouse is non-null", tb.getSpouse() != null);
    assertTrue("spouse name is Kerry and age is 34",
        tb.getSpouse().getName().equals("Kerry") && tb.getSpouse().getAge() == 34);
    ITestBean spouse = tb.getSpouse();

    bw.setPropertyValues(pvs);
    assertSame("Should have remained same object", spouse, tb.getSpouse());
  }
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.