@Test
public void testToCompositeData() throws Exception {

    ServiceEvent event = mock(ServiceEvent.class);
    ServiceReference reference = mock(ServiceReference.class);
    Bundle bundle = mock(Bundle.class);
    
    when(event.getType()).thenReturn(ServiceEvent.REGISTERED);
    when(event.getServiceReference()).thenReturn(reference);
    when(reference.getProperty(Constants.SERVICE_ID)).thenReturn(new Long(44));
    when(reference.getProperty(Constants.OBJECTCLASS)).thenReturn(new String[] {"org.apache.aries.jmx.Mock"});
    when(reference.getBundle()).thenReturn(bundle);
    when(bundle.getBundleId()).thenReturn(new Long(1));
    when(bundle.getLocation()).thenReturn("string");
    when(bundle.getSymbolicName()).thenReturn("org.apache.aries.jmx.core");
    
    ServiceEventData eventData = new ServiceEventData(event);
    CompositeData data = eventData.toCompositeData();
    
    assertEquals(new Long(44), data.get(IDENTIFIER));
    assertEquals(new Long(1), data.get(BUNDLE_IDENTIFIER));
    assertEquals("string", data.get(BUNDLE_LOCATION));
    assertEquals("org.apache.aries.jmx.core", data.get(BUNDLE_SYMBOLIC_NAME));
    assertArrayEquals(new String[] {"org.apache.aries.jmx.Mock" }, (String[]) data.get(OBJECT_CLASS));
    assertEquals(ServiceEvent.REGISTERED, data.get(EVENT));
    
}