Package demo.org.powermock.examples.tutorial.staticmocking.osgi

Examples of demo.org.powermock.examples.tutorial.staticmocking.osgi.ServiceRegistration


  /**
   * {@inheritDoc}
   */
  public long registerService(String name, Object serviceImplementation) {
    ServiceRegistration registerService = bundleContext.registerService(name, serviceImplementation, null);
    final long id = IdGenerator.generateNewId();
    serviceRegistrations.put(id, registerService);
    return id;
  }
View Full Code Here


  /**
   * {@inheritDoc}
   */
  public void unregisterService(long id) {
    final ServiceRegistration registration = serviceRegistrations.remove(id);
    if (registration == null) {
      throw new IllegalStateException("Registration with id " + id + " has already been removed or has never been registered");
    }
    registration.unregister();
  }
View Full Code Here

  /**
   * {@inheritDoc}
   */
  public long registerService(String name, Object serviceImplementation) {
    ServiceRegistration registerService = bundleContext.registerService(name, serviceImplementation, null);
    final long id = generateId();
    serviceRegistrations.put(id, registerService);
    return id;
  }
View Full Code Here

  /**
   * {@inheritDoc}
   */
  public void unregisterService(long id) {
    final ServiceRegistration registration = serviceRegistrations.remove(id);
    if (registration == null) {
      throw new IllegalStateException("Registration with id " + id + " has already been removed or has never been registered");
    }
    registration.unregister();
  }
View Full Code Here

    verifyAll();
    verify(tested);

    assertEquals(1, map.size());
    final ServiceRegistration serviceRegistration = map.get(expectedId);
    assertNotNull("The id " + actualId + " was not found in the mServiceRegistrations map.", serviceRegistration);
    assertSame(serviceRegistration, serviceRegistrationMock);
  }
View Full Code Here

TOP

Related Classes of demo.org.powermock.examples.tutorial.staticmocking.osgi.ServiceRegistration

Copyright © 2018 www.massapicom. 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.