Examples of OsgiServiceLifecycleListenerAdapter


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

    assertEquals(1, ExceptionCustomListener.BIND_CALLS);
    assertEquals("should have called overloaded method with type Object", 1, ExceptionCustomListener.UNBIND_CALLS);
  }

  public void testStandardListenerWithListeningMethodsSpecifiedAsCustomOnes() throws Exception {
    listener = new OsgiServiceLifecycleListenerAdapter();
    listener.setBeanFactory(createMockBF(new JustListener()));
    listener.setTargetBeanName(BEAN_NAME);
    listener.setBindMethod("bind");
    listener.setUnbindMethod("unbind");
    listener.afterPropertiesSet();
View Full Code Here

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

    listener.bind(service, null);
    assertEquals(4, JustListener.BIND_CALLS);
  }

  public void testListenerWithOverloadedTypesAndMultipleParameterTypes() throws Exception {
    listener = new OsgiServiceLifecycleListenerAdapter();
    listener.setBeanFactory(createMockBF(new DictionaryAndMapCustomListener()));
    listener.setTargetBeanName(BEAN_NAME);
    listener.setBindMethod("bind");
    listener.setUnbindMethod("unbind");
    listener.afterPropertiesSet();
View Full Code Here

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

    assertEquals(1, JustListener.BIND_CALLS);
    assertEquals("only one unbind method should be called", 1, JustListener.UNBIND_CALLS);
  }

  public void testOverridingMethodsDiscovery() throws Exception {
    listener = new OsgiServiceLifecycleListenerAdapter();
    listener.setBeanFactory(createMockBF(new OverridingMethodListener()));
    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(1, CustomListener.UNBIND_CALLS);

  }

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

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

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

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

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

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

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

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

    assertEquals(0, JustListener.UNBIND_CALLS);

  }

  public void testCustomServiceRefUnbind() throws Exception {
    listener = new OsgiServiceLifecycleListenerAdapter();
    listener.setBeanFactory(createMockBF(new CustomServiceRefListener()));
    listener.setTargetBeanName(BEAN_NAME);
    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.