Examples of BatchActionResult


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

    public void testSetBundleStartLevels() throws IOException {
        Bundle bundle = Mockito.mock(Bundle.class);
        Mockito.when(context.getBundle(2)).thenReturn(bundle);
        CompositeData data = mbean.setBundleStartLevels(new long[] { 2 }, new int[] { 2 });
        Mockito.verify(startLevel).setBundleStartLevel(bundle, 2);
        BatchActionResult batch = BatchActionResult.from(data);
        Assert.assertEquals(2, batch.getCompleted()[0]);
        Assert.assertTrue(batch.isSuccess());
        Assert.assertNull(batch.getError());
        Assert.assertNull(batch.getRemainingItems());

        CompositeData data2 = mbean.setBundleStartLevels(new long[] { 2 }, new int[] { 2, 4 });
        BatchActionResult batch2 = BatchActionResult.from(data2);
        Assert.assertNull(batch2.getCompleted());
        Assert.assertFalse(batch2.isSuccess());
        Assert.assertNotNull(batch2.getError());
        Assert.assertNull(batch2.getRemainingItems());

    }
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.