@Test
public void testStartBundle() throws Exception {

    Bundle bundle = Mockito.mock(Bundle.class);
    Mockito.when(context.getBundle(5)).thenReturn(bundle);
    mbean.startBundle(5);
    Mockito.verify(bundle).start();
    Mockito.reset(context);
    Mockito.when(context.getBundle(6)).thenReturn(bundle);
    Mockito.doThrow(new BundleException("")).when(bundle).start();
    try {
        mbean.startBundle(6);
        Assert.fail("Shouldn't go to this stage, BundleException was thrown");
    } catch (IOException ioe) {
        // expected
    }
    Mockito.when(context.getBundle(6)).thenReturn(null);
    try {
        mbean.startBundle(6);
        Assert.fail("IOException should be thrown");
    } catch (IOException e) {
        //expected
    }
}