/** @throws Exception If failed. */
  public void testBeanInjectionUsingConfiguration() throws Exception {
    BeanFactory factory = new AnnotationConfigApplicationContext(TestCfgConfiguration.class);

    TestInjectionLifecycleBean bean1 = (TestInjectionLifecycleBean) factory.getBean("bean1");
    TestInjectionLifecycleBean bean2 = (TestInjectionLifecycleBean) factory.getBean("bean2");

    bean1.checkState();
    bean2.checkState();
  }
  /** @throws Exception If failed. */
  public void testBeanInjectionUsingConfigPath() throws Exception {
    new AnnotationConfigApplicationContext(TestPathConfiguration.class);

    Ignite grid = IgnitionEx.grid("springInjectionTest");

    IgniteConfiguration cfg = grid.configuration();

    LifecycleBean[] beans = cfg.getLifecycleBeans();

    assertEquals(2, beans.length);

    TestInjectionLifecycleBean bean1 = (TestInjectionLifecycleBean) beans[0];
    TestInjectionLifecycleBean bean2 = (TestInjectionLifecycleBean) beans[1];

    bean1.checkState();
    bean2.checkState();
  }