Package test.component

Examples of test.component.FieldInject


  public static ApplicationContext applicationContext = DefaultApplicationContext
      .getInstance().load();

  @Test
  public void testFieldInject() {
    FieldInject fieldInject = applicationContext.getBean("fieldInject");
    Assert.assertThat(fieldInject.add(5, 4), is(9));
    Assert.assertThat(fieldInject.add2(5, 4), is(9));

    fieldInject = applicationContext.getBean(FieldInject.class);
    Assert.assertThat(fieldInject.add(5, 4), is(9));
    Assert.assertThat(fieldInject.add2(5, 4), is(9));
  }
View Full Code Here


//  private static Logger log = LoggerFactory.getLogger(TestAnnotationIoc.class);
  public static ApplicationContext applicationContext = new XmlApplicationContext("annotation-config.xml");
 
  @Test
  public void testFieldInject() {
    FieldInject fieldInject = applicationContext.getBean("fieldInject");
    Assert.assertThat(fieldInject.add(5, 4), is(9));
    Assert.assertThat(fieldInject.add2(5, 4), is(9));

    fieldInject = applicationContext.getBean(FieldInject.class);
    Assert.assertThat(fieldInject.add(5, 4), is(9));
    Assert.assertThat(fieldInject.add2(5, 4), is(9));
  }
View Full Code Here

TOP

Related Classes of test.component.FieldInject

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.