@Test
public void testGetConfigurations() throws Exception {

 
    org.osgi.service.cm.ConfigurationAdmin admin = mock(org.osgi.service.cm.ConfigurationAdmin.class);
    String factoryPid = "org.apache.aries.jmx.factory.mock";
    String filter = "(" + org.osgi.service.cm.ConfigurationAdmin.SERVICE_FACTORYPID + "=org.apache.aries.jmx.factory.mock)";
    String location = "../location";
    
    Configuration a = mock(Configuration.class);
    when(a.getPid()).thenReturn(factoryPid + "-2160133952674-0");
    when(a.getBundleLocation()).thenReturn(location);
    Configuration b = mock(Configuration.class);
    when(b.getPid()).thenReturn(factoryPid + "-1260133982371-1");
    when(b.getBundleLocation()).thenReturn(location);
    
    when(admin.listConfigurations(filter)).thenReturn(new Configuration[] { a, b});
    
    ConfigurationAdmin mbean = new ConfigurationAdmin(admin);
    String[][] result = mbean.getConfigurations(filter);
    assertEquals(2, result.length);
    assertArrayEquals(new String[]{ factoryPid + "-2160133952674-0", location }, result[0] );
    assertArrayEquals(new String[]{ factoryPid + "-1260133982371-1", location }, result[1] );
    
}