Examples of ITestBean


Examples of org.springframework.beans.ITestBean

    assertEquals("Incorrect number of advisors", 1, advisors.length);
    assertEquals("Incorrect advice class.", DebugInterceptor.class, advisors[0].getAdvice().getClass());
  }

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

Examples of org.springframework.beans.ITestBean

    assertTrue(drs.containsKey(DummyReferencer.class.getName() + "#1"));
    assertTrue(drs.containsKey(DummyReferencer.class.getName() + "#2"));
  }

  public void testFactoryNesting() {
    ITestBean father = (ITestBean) getBeanFactory().getBean("father");
    assertTrue("Bean from root context", father != null);

    TestBean rod = (TestBean) getBeanFactory().getBean("rod");
    assertTrue("Bean from child context", "Rod".equals(rod.getName()));
    assertTrue("Bean has external reference", rod.getSpouse() == father);
View Full Code Here

Examples of org.springframework.beans.ITestBean

    resetInterceptor();
  }

  public void testAutoProxiedLookup() {
    OverloadLookup olup = (OverloadLookup) applicationContext.getBean("autoProxiedOverload");
    ITestBean jenny = olup.newTestBean();
    assertEquals("Jenny", jenny.getName());
    assertEquals("foo", olup.testMethod());
    assertInterceptorCount(2);
  }
View Full Code Here

Examples of org.springframework.beans.ITestBean

    assertInterceptorCount(2);
  }

  public void testRegularlyProxiedLookup() {
    OverloadLookup olup = (OverloadLookup) applicationContext.getBean("regularlyProxiedOverload");
    ITestBean jenny = olup.newTestBean();
    assertEquals("Jenny", jenny.getName());
    assertEquals("foo", olup.testMethod());
    assertInterceptorCount(2);
  }
View Full Code Here

Examples of org.springframework.beans.ITestBean

    factory.setServiceUrl("http://localhosta/testbean");
    factory.afterPropertiesSet();

    assertTrue("Correct singleton value", factory.isSingleton());
    assertTrue(factory.getObject() instanceof ITestBean);
    ITestBean bean = (ITestBean) factory.getObject();

    try {
      bean.setName("test");
      fail("Should have thrown RemoteAccessException");
    }
    catch (RemoteAccessException ex) {
      // expected
    }
View Full Code Here

Examples of org.springframework.beans.ITestBean

    factory.setOverloadEnabled(true);
    factory.afterPropertiesSet();

    assertTrue("Correct singleton value", factory.isSingleton());
    assertTrue(factory.getObject() instanceof ITestBean);
    ITestBean bean = (ITestBean) factory.getObject();

    try {
      bean.setName("test");
      fail("Should have thrown RemoteAccessException");
    }
    catch (RemoteAccessException ex) {
      // expected
    }
View Full Code Here

Examples of org.springframework.beans.ITestBean

    factory.setPassword("bean");
    factory.setOverloadEnabled(true);
    factory.afterPropertiesSet();
    assertTrue("Correct singleton value", factory.isSingleton());
    assertTrue(factory.getObject() instanceof ITestBean);
    ITestBean bean = (ITestBean) factory.getObject();

    assertEquals(proxyFactory.user, "test");
    assertEquals(proxyFactory.password, "bean");
    assertTrue(proxyFactory.overloadEnabled);

    try {
      bean.setName("test");
      fail("Should have thrown RemoteAccessException");
    }
    catch (RemoteAccessException ex) {
      // expected
    }
View Full Code Here

Examples of org.springframework.beans.ITestBean

    factory.setServiceUrl("http://localhosta/testbean");
    factory.afterPropertiesSet();

    assertTrue("Correct singleton value", factory.isSingleton());
    assertTrue(factory.getObject() instanceof ITestBean);
    ITestBean bean = (ITestBean) factory.getObject();

    try {
      bean.setName("test");
      fail("Should have thrown RemoteAccessException");
    }
    catch (RemoteAccessException ex) {
      // expected
    }
View Full Code Here

Examples of org.springframework.beans.ITestBean

    factory.setOverloadEnabled(true);
    factory.afterPropertiesSet();

    assertTrue("Correct singleton value", factory.isSingleton());
    assertTrue(factory.getObject() instanceof ITestBean);
    ITestBean bean = (ITestBean) factory.getObject();

    try {
      bean.setName("test");
      fail("Should have thrown RemoteAccessException");
    }
    catch (RemoteAccessException ex) {
      // expected
    }
View Full Code Here

Examples of org.springframework.beans.ITestBean

    factory.setOverloadEnabled(true);
    factory.afterPropertiesSet();

    assertTrue("Correct singleton value", factory.isSingleton());
    assertTrue(factory.getObject() instanceof ITestBean);
    ITestBean bean = (ITestBean) factory.getObject();

    assertEquals(proxyFactory.user, "test");
    assertEquals(proxyFactory.password, "bean");
    assertTrue(proxyFactory.overloadEnabled);

    try {
      bean.setName("test");
      fail("Should have thrown RemoteAccessException");
    }
    catch (RemoteAccessException ex) {
      // expected
    }
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.