@Test
public void testListInformation() throws Exception {

    org.osgi.service.provisioning.ProvisioningService provService = mock(org.osgi.service.provisioning.ProvisioningService.class);
    ProvisioningService mbean = new ProvisioningService(provService);
    
    Dictionary<String, Object> info = new Hashtable<String, Object>();
    info.put(PROVISIONING_AGENT_CONFIG, new byte[] { 20, 30, 40 });
    info.put(PROVISIONING_SPID, "x.test");
    info.put(PROVISIONING_REFERENCE, "rsh://0.0.0.0/provX");
    info.put(PROVISIONING_RSH_SECRET, new byte[] { 15, 25, 35 });
    info.put(PROVISIONING_UPDATE_COUNT, 1);
    
    when(provService.getInformation()).thenReturn(info);
    
    TabularData provData = mbean.listInformation();
    assertNotNull(provData);
    assertEquals(PROPERTIES_TYPE, provData.getTabularType());
    assertEquals(5, provData.values().size());
    PropertyData<byte[]> agentConfig = PropertyData.from(provData.get(new Object[]{ PROVISIONING_AGENT_CONFIG }));
    assertArrayEquals(new byte[] { 20, 30, 40 }, agentConfig.getValue());
    PropertyData<String> spid = PropertyData.from(provData.get(new Object[] { PROVISIONING_SPID }));
    assertEquals("x.test", spid.getValue());
    PropertyData<String> ref = PropertyData.from(provData.get(new Object[] { PROVISIONING_REFERENCE }));
    assertEquals("rsh://0.0.0.0/provX", ref.getValue());
    PropertyData<byte[]> sec = PropertyData.from(provData.get(new Object[] { PROVISIONING_RSH_SECRET }));
    assertArrayEquals(new byte[] { 15, 25, 35 }, sec.getValue());
    PropertyData<Integer> count = PropertyData.from(provData.get(new Object[] { PROVISIONING_UPDATE_COUNT }));
    assertEquals(new Integer(1), count.getValue());
    
}