Examples of BatchInstallResult


Examples of org.apache.aries.jmx.codec.BatchInstallResult

        String[] locations = new String[] { "file:test.jar" };
        Bundle bundle = Mockito.mock(Bundle.class);
        Mockito.when(context.installBundle("file:test.jar")).thenReturn(bundle);
        Mockito.when(bundle.getBundleId()).thenReturn(Long.valueOf(2));
        CompositeData data = mbean.installBundles(locations);
        BatchInstallResult batch = BatchInstallResult.from(data);
        Assert.assertNotNull(batch);
        Assert.assertEquals(2, batch.getCompleted()[0]);
        Assert.assertTrue(batch.isSuccess());
        Assert.assertNull(batch.getError());
        Assert.assertNull(batch.getRemainingLocationItems());
        Mockito.reset(context);
        Mockito.when(context.installBundle("file:test.jar")).thenThrow(new BundleException("location doesn't exist"));

        /*
         * this one is not passing bug in api bundleInError should be String CompositeData data2 =
View Full Code Here

Examples of org.apache.aries.jmx.codec.BatchInstallResult

        Framework spiedMBean = Mockito.spy(mbean);
        InputStream stream = Mockito.mock(InputStream.class);
        Mockito.doReturn(stream).when(spiedMBean).createStream(Mockito.anyString());
        CompositeData data = spiedMBean.installBundlesFromURL(new String[] { "file:test.jar" }, new String[] { "test.jar" });
        Assert.assertNotNull(data);
        BatchInstallResult batch = BatchInstallResult.from(data);
        Assert.assertEquals(2, batch.getCompleted()[0]);
        Assert.assertTrue(batch.isSuccess());
        Assert.assertNull(batch.getError());
        Assert.assertNull(batch.getRemainingLocationItems());
        Mockito.reset(context);
        Mockito.when(spiedMBean.createStream(Mockito.anyString())).thenReturn(stream);
        Mockito.when(context.installBundle(Mockito.anyString(), Mockito.any(InputStream.class))).thenThrow(
                new BundleException("location doesn't exist"));
View Full Code Here

Examples of org.apache.aries.jmx.codec.BatchInstallResult

        String[] locations = new String[] { "file:test.jar" };
        Bundle bundle = Mockito.mock(Bundle.class);
        Mockito.when(context.installBundle("file:test.jar")).thenReturn(bundle);
        Mockito.when(bundle.getBundleId()).thenReturn(Long.valueOf(2));
        CompositeData data = mbean.installBundles(locations);
        BatchInstallResult batch = BatchInstallResult.from(data);
        Assert.assertNotNull(batch);
        Assert.assertEquals(2, batch.getCompleted()[0]);
        Assert.assertTrue(batch.isSuccess());
        Assert.assertNull(batch.getError());
        Assert.assertNull(batch.getRemainingLocationItems());
        Mockito.reset(context);
        Mockito.when(context.installBundle("file:test.jar")).thenThrow(new BundleException("location doesn't exist"));
        CompositeData data2 = mbean.installBundles(locations);
        BatchInstallResult batch2 = BatchInstallResult.from(data2);
        Assert.assertNotNull(batch2);
        Assert.assertNotNull(batch2.getCompleted());
        Assert.assertEquals(0, batch2.getCompleted().length);
        Assert.assertFalse(batch2.isSuccess());
        Assert.assertNotNull(batch2.getError());
        Assert.assertEquals("file:test.jar", batch2.getBundleInError());
        Assert.assertNotNull(batch2.getRemainingLocationItems());
        Assert.assertEquals(0, batch2.getRemainingLocationItems().length);
    }
View Full Code Here

Examples of org.apache.aries.jmx.codec.BatchInstallResult

        Framework spiedMBean = Mockito.spy(mbean);
        InputStream stream = Mockito.mock(InputStream.class);
        Mockito.doReturn(stream).when(spiedMBean).createStream(Mockito.anyString());
        CompositeData data = spiedMBean.installBundlesFromURL(new String[] { "file:test.jar" }, new String[] { "test.jar" });
        Assert.assertNotNull(data);
        BatchInstallResult batch = BatchInstallResult.from(data);
        Assert.assertEquals(2, batch.getCompleted()[0]);
        Assert.assertTrue(batch.isSuccess());
        Assert.assertNull(batch.getError());
        Assert.assertNull(batch.getRemainingLocationItems());
        Mockito.reset(context);
        Mockito.when(spiedMBean.createStream(Mockito.anyString())).thenReturn(stream);
        Mockito.when(context.installBundle(Mockito.anyString(), Mockito.any(InputStream.class))).thenThrow(
                new BundleException("location doesn't exist"));
        CompositeData data2 = spiedMBean.installBundlesFromURL(new String[] { "file:test.jar" }, new String[] { "test.jar" });
        BatchInstallResult batch2 = BatchInstallResult.from(data2);
        Assert.assertNotNull(batch2);
        Assert.assertNotNull(batch2.getCompleted());
        Assert.assertEquals(0, batch2.getCompleted().length);
        Assert.assertFalse(batch2.isSuccess());
        Assert.assertNotNull(batch2.getError());
        Assert.assertEquals("file:test.jar", batch2.getBundleInError());
        Assert.assertNotNull(batch2.getRemainingLocationItems());
        Assert.assertEquals(0, batch2.getRemainingLocationItems().length);    
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.