示例#1
0
  @Test
  public void toString_() {
    MyServiceImpl bean = new MyServiceImpl();

    // with beanName, simple
    assertEquals("myFavoriteService:MyService", myService.toString());
    assertEquals("myFavoriteService:MyService", myService.getBeanDescription());
    assertEquals("myFavoriteService:MyService", myService.getBeanDescription(true));

    // with beanName, long
    assertEquals(
        "myFavoriteService:" + MyService.class.getName(), myService.getBeanDescription(false));

    // no beanName, simple
    assertEquals("MyService", bean.toString());
    assertEquals("MyService", bean.getBeanDescription());
    assertEquals("MyService", bean.getBeanDescription(true));

    // no beanName, long
    assertEquals(MyService.class.getName(), bean.getBeanDescription(false));

    // inner bean
    bean.setBeanName("(inner bean)111");
    assertEquals("MyService", bean.toString());
    assertEquals("MyService", bean.getBeanDescription());
    assertEquals("MyService", bean.getBeanDescription(true));
  }
示例#2
0
 @Test
 public void getBeanName() {
   assertEquals("myFavoriteService", myService.getBeanName());
 }
示例#3
0
 @Test
 public void assertInitialized() {
   myService.assertInitialized();
   assertTrue(myService.isInitialized());
 }
示例#4
0
 @Test
 public void getBeanInterface() {
   assertEquals(MyService.class, myService.getBeanInterface());
 }