Examples of OsgiServiceLifecycleListenerAdapter


Examples of org.springframework.osgi.config.internal.adapter.OsgiServiceLifecycleListenerAdapter

    OverloadedCustomMethods.BIND_SERVICES = null;
    OverloadedCustomMethods.UNBIND_SERVICES = null;
  }

  public void testWrapperOverListener() throws Exception {
    listener = new OsgiServiceLifecycleListenerAdapter();
    listener.setBeanFactory(createMockBF(new JustListener()));
    listener.setTargetBeanName(BEAN_NAME);
    listener.afterPropertiesSet();

    assertEquals(0, JustListener.BIND_CALLS);
View Full Code Here

Examples of org.springframework.osgi.config.internal.adapter.OsgiServiceLifecycleListenerAdapter

    assertEquals(2, JustListener.UNBIND_CALLS);
    assertEquals(2, JustListener.BIND_CALLS);
  }

  public void testWrapperOverNoInvalidClass() throws Exception {
    listener = new OsgiServiceLifecycleListenerAdapter();
    listener.setTargetBeanName(BEAN_NAME);
    listener.setTarget(new Object());
    listener.setBeanFactory(createMockBF(new Object()));

    try {
View Full Code Here

Examples of org.springframework.osgi.config.internal.adapter.OsgiServiceLifecycleListenerAdapter

      // expected
    }
  }

  public void testWrapperWithIncorrectCustomMethodNames() throws Exception {
    listener = new OsgiServiceLifecycleListenerAdapter();
    listener.setTargetBeanName(BEAN_NAME);
    listener.setTarget(new Object());
    listener.setBindMethod("pop");
    listener.setUnbindMethod("corn");
View Full Code Here

Examples of org.springframework.osgi.config.internal.adapter.OsgiServiceLifecycleListenerAdapter

      // expected
    }
  }

  public void testWrapperWithCorrectCustomMethodNamesButIncorrectArgumentTypes() throws Exception {
    listener = new OsgiServiceLifecycleListenerAdapter();
    listener.setTarget(new CustomListener());
    listener.setBindMethod("wrongBind");
    listener.setUnbindMethod("wrongUnbind");

    assertEquals(0, CustomListener.BIND_CALLS);
View Full Code Here

Examples of org.springframework.osgi.config.internal.adapter.OsgiServiceLifecycleListenerAdapter

    assertEquals(0, CustomListener.UNBIND_CALLS);

  }

  public void testWrapperWithCustomMethods() throws Exception {
    listener = new OsgiServiceLifecycleListenerAdapter();
    listener.setBeanFactory(createMockBF(new CustomListener()));
    listener.setTargetBeanName(BEAN_NAME);
    listener.setBindMethod("myBind");
    listener.setUnbindMethod("myUnbind");
    listener.afterPropertiesSet();
View Full Code Here

Examples of org.springframework.osgi.config.internal.adapter.OsgiServiceLifecycleListenerAdapter

    assertEquals(2, CustomListener.BIND_CALLS);
    assertEquals(2, CustomListener.UNBIND_CALLS);
  }

  public void testWrapperWithCustomMethodsAndNullParameters() throws Exception {
    listener = new OsgiServiceLifecycleListenerAdapter();
    listener.setBeanFactory(createMockBF(new CustomListener()));
    listener.setTargetBeanName(BEAN_NAME);
    listener.setBindMethod("myBind");
    listener.setUnbindMethod("myUnbind");
    listener.afterPropertiesSet();
View Full Code Here

Examples of org.springframework.osgi.config.internal.adapter.OsgiServiceLifecycleListenerAdapter

    assertEquals("null services allowed", 1, CustomListener.UNBIND_CALLS);
  }

  public void testWrapperWithBothCustomAndInterfaceMethods() throws Exception {
    listener = new OsgiServiceLifecycleListenerAdapter();
    listener.setBeanFactory(createMockBF(new CustomAndListener()));
    listener.setTargetBeanName(BEAN_NAME);
    listener.setBindMethod("aBind");
    listener.setUnbindMethod("aUnbind");
    listener.afterPropertiesSet();
View Full Code Here

Examples of org.springframework.osgi.config.internal.adapter.OsgiServiceLifecycleListenerAdapter

    assertEquals(2, CustomAndListener.UNBIND_CALLS);

  }

  public void testWrapperWithCustomOverloadedMethodsAndDifferentServiceTypes() throws Exception {
    listener = new OsgiServiceLifecycleListenerAdapter();
    listener.setBeanFactory(createMockBF(new OverloadedCustomMethods()));
    listener.setTargetBeanName(BEAN_NAME);
    listener.setBindMethod("myBind");
    listener.setUnbindMethod("myUnbind");
    listener.afterPropertiesSet();
View Full Code Here

Examples of org.springframework.osgi.config.internal.adapter.OsgiServiceLifecycleListenerAdapter

    assertSame("incorrect call order", stringService, OverloadedCustomMethods.UNBIND_SERVICES.get(1));
    assertSame("incorrect call order", objService, OverloadedCustomMethods.UNBIND_SERVICES.get(2));
  }

  public void testExceptionOnListenerMethod() throws Exception {
    listener = new OsgiServiceLifecycleListenerAdapter();
    listener.setBeanFactory(createMockBF(new ExceptionListener()));
    listener.setTargetBeanName(BEAN_NAME);
    listener.setBindMethod("aBind");
    listener.setUnbindMethod("aUnbind");
    listener.afterPropertiesSet();
View Full Code Here

Examples of org.springframework.osgi.config.internal.adapter.OsgiServiceLifecycleListenerAdapter

    assertEquals(1, JustListener.BIND_CALLS);
    assertEquals(1, JustListener.UNBIND_CALLS);
  }

  public void testExceptionOnCustomMethods() throws Exception {
    listener = new OsgiServiceLifecycleListenerAdapter();
    listener.setBeanFactory(createMockBF(new ExceptionCustomListener()));
    listener.setTargetBeanName(BEAN_NAME);
    listener.setBindMethod("myBind");
    listener.setUnbindMethod("myUnbind");
    listener.afterPropertiesSet();
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.