Package org.springframework.scripting

Examples of org.springframework.scripting.ContextScriptBean


   */
  public void testCanPassInMoreThanOneProperty() {
    ApplicationContext ctx = new ClassPathXmlApplicationContext("groovy-multiple-properties.xml", getClass());
    TestBean tb = (TestBean) ctx.getBean("testBean");

    ContextScriptBean bean = (ContextScriptBean) ctx.getBean("bean");
    assertEquals("The first property ain't bein' injected.", "Sophie Marceau", bean.getName());
    assertEquals("The second property ain't bein' injected.", 31, bean.getAge());
    assertEquals(tb, bean.getTestBean());
    assertEquals(ctx, bean.getApplicationContext());

    ContextScriptBean bean2 = (ContextScriptBean) ctx.getBean("bean2");
    assertEquals(tb, bean2.getTestBean());
    assertEquals(ctx, bean2.getApplicationContext());

    try {
      ctx.getBean("bean3");
      fail("Should have thrown BeanCreationException");
    }
View Full Code Here


  @Test
  public void testCanPassInMoreThanOneProperty() {
    ApplicationContext ctx = new ClassPathXmlApplicationContext("groovy-multiple-properties.xml", getClass());
    TestBean tb = (TestBean) ctx.getBean("testBean");

    ContextScriptBean bean = (ContextScriptBean) ctx.getBean("bean");
    assertEquals("The first property ain't bein' injected.", "Sophie Marceau", bean.getName());
    assertEquals("The second property ain't bein' injected.", 31, bean.getAge());
    assertEquals(tb, bean.getTestBean());
    assertEquals(ctx, bean.getApplicationContext());

    ContextScriptBean bean2 = (ContextScriptBean) ctx.getBean("bean2");
    assertEquals(tb, bean2.getTestBean());
    assertEquals(ctx, bean2.getApplicationContext());

    try {
      ctx.getBean("bean3");
      fail("Should have thrown BeanCreationException");
    }
View Full Code Here

TOP

Related Classes of org.springframework.scripting.ContextScriptBean

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.