Examples of OsgiServiceRegistrationListenerAdapter


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

    CustomListener.UNREG_PROPS = null;
    props = null;
  }

  public void testWrapperOverListener() throws Exception {
    listener = new OsgiServiceRegistrationListenerAdapter();
    listener.setTarget(new JustListener());
    listener.setBeanFactory(createMockBF());
    listener.afterPropertiesSet();

    Object service = new Object();
View Full Code Here

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

    assertEquals(2, JustListener.UNREG_CALLS);
    assertEquals(2, JustListener.REG_CALLS);
  }

  public void testWrapperOverNoInvalidClass() throws Exception {
    listener = new OsgiServiceRegistrationListenerAdapter();
    listener.setTarget(new Object());
    try {
      listener.afterPropertiesSet();
      fail("should have thrown exception");
    }
View Full Code Here

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

      // expected
    }
  }

  public void testWrapperWithIncorrectCustomMethodNames() throws Exception {
    listener = new OsgiServiceRegistrationListenerAdapter();
    listener.setTarget(new Object());
    listener.setRegistrationMethod("pop");
    listener.setUnregistrationMethod("corn");

    try {
View Full Code Here

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

      // expected
    }
  }

  public void testWrapperWithCorrectCustomMethodNamesButIncorrectArgumentTypes() throws Exception {
    listener = new OsgiServiceRegistrationListenerAdapter();
    listener.setTarget(new CustomListener());
    listener.setRegistrationMethod("wrongReg");
    listener.setUnregistrationMethod("wrongUnreg");

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

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

    assertEquals(0, CustomListener.UNREG_CALLS);

  }

  public void testWrapperWithCustomMethods() throws Exception {
    listener = new OsgiServiceRegistrationListenerAdapter();
    listener.setTarget(new CustomListener());
    listener.setRegistrationMethod("myReg");
    listener.setUnregistrationMethod("myUnreg");
    listener.setBeanFactory(createMockBF());
    listener.afterPropertiesSet();
View Full Code Here

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

    assertEquals(2, CustomListener.REG_CALLS);
    assertEquals(2, CustomListener.UNREG_CALLS);
  }

  public void testWrapperWithCustomMethodsAndNullProperties() throws Exception {
    listener = new OsgiServiceRegistrationListenerAdapter();
    listener.setTarget(new CustomListener());
    listener.setRegistrationMethod("myReg");
    listener.setUnregistrationMethod("myUnreg");
    listener.setBeanFactory(createMockBF());
    listener.afterPropertiesSet();
View Full Code Here

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

    assertEquals("null properties allowed", 1, CustomListener.UNREG_CALLS);
  }

  public void testWrapperWithBothCustomAndInterfaceMethods() throws Exception {
    listener = new OsgiServiceRegistrationListenerAdapter();
    listener.setTarget(new CustomAndListener());
    listener.setRegistrationMethod("aReg");
    listener.setUnregistrationMethod("aUnreg");
    listener.setBeanFactory(createMockBF());
    listener.afterPropertiesSet();
View Full Code Here

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

    assertEquals(2, CustomAndListener.UNREG_CALLS);

  }

  public void testExceptionOnListenerMethod() throws Exception {
    listener = new OsgiServiceRegistrationListenerAdapter();
    listener.setTarget(new ExceptionListener());
    listener.setRegistrationMethod("aReg");
    listener.setUnregistrationMethod("aUnreg");
    listener.setBeanFactory(createMockBF());
    listener.afterPropertiesSet();
View Full Code Here

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

    assertEquals(1, JustListener.REG_CALLS);
    assertEquals(1, JustListener.UNREG_CALLS);
  }

  public void testExceptionOnCustomMethods() throws Exception {
    listener = new OsgiServiceRegistrationListenerAdapter(
      );
    listener.setTarget(new ExceptionCustomListener());
    listener.setRegistrationMethod("myReg");
    listener.setUnregistrationMethod("myUnreg");
    listener.setBeanFactory(createMockBF());
View Full Code Here

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

    assertEquals(1, ExceptionCustomListener.REG_CALLS);
    assertEquals(1, ExceptionCustomListener.UNREG_CALLS);
  }

  public void testStandardListenerWithListeningMethodsSpecifiedAsCustomOnes() throws Exception {
    listener = new OsgiServiceRegistrationListenerAdapter();
    listener.setTarget(new JustListener());
    listener.setRegistrationMethod("registered");
    listener.setUnregistrationMethod("unregistered");
    listener.setBeanFactory(createMockBF());
    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.