Package org.apache.karaf.admin

Examples of org.apache.karaf.admin.AdminService


    }
   
    public void testDoPostCreate() throws Exception {
        InstanceSettings is =
            new InstanceSettings(1234, 5678, null, null, Collections.singletonList("http://someURL"), Arrays.asList("abc", "def"));
        AdminService adminService = EasyMock.createMock(AdminService.class);
        EasyMock.expect(adminService.createInstance("instance1", is)).andReturn(null);
        EasyMock.expect(adminService.getInstances()).andReturn(new Instance[] {}).anyTimes();
        EasyMock.replay(adminService);
       
        AdminPlugin ap = new AdminPlugin();
        ap.setAdminService(adminService);
View Full Code Here


       
        final Instance inst = EasyMock.createMock(Instance.class);
        EasyMock.expect(inst.getPid()).andReturn(42);
        EasyMock.replay(inst);

        AdminService as = EasyMock.createMock(AdminService.class);
        EasyMock.expect(as.createInstance("t1", is)).andReturn(inst);
        EasyMock.replay(as);
       
        AdminServiceMBeanImpl ab = new AdminServiceMBeanImpl();
        ab.setAdminService(as);
        Assert.assertSame(as, ab.getAdminService());
View Full Code Here

   
    public void testCreateInstance2() throws Exception {
        final InstanceSettings is = new InstanceSettings(0, 0, null, null,
                Collections.<String>emptyList(), Collections.<String>emptyList());
       
        AdminService as = EasyMock.createMock(AdminService.class);
        EasyMock.expect(as.createInstance("t1", is)).andReturn(null);
        EasyMock.replay(as);
       
        AdminServiceMBeanImpl ab = new AdminServiceMBeanImpl();
        ab.setAdminService(as);
        Assert.assertSame(as, ab.getAdminService());
View Full Code Here

        EasyMock.replay(i1);
        Instance i2 = EasyMock.createNiceMock(Instance.class);
        EasyMock.expect(i2.getName()).andReturn("i2");
        EasyMock.replay(i2);
       
        AdminService as = EasyMock.createMock(AdminService.class);
        EasyMock.expect(as.getInstances()).andReturn(new Instance [] {i1, i2});
        EasyMock.replay(as);

        AdminServiceMBeanImpl ab = new AdminServiceMBeanImpl();
        ab.setAdminService(as);
       
View Full Code Here

        Instance inst = EasyMock.createMock(Instance.class);
        inst.start("-x -y -z");
        EasyMock.expectLastCall();
        EasyMock.replay(inst);

        AdminService as = EasyMock.createMock(AdminService.class);
        EasyMock.expect(as.getInstance("test instance")).andReturn(inst);
        EasyMock.replay(as);

        AdminServiceMBeanImpl ab = new AdminServiceMBeanImpl();
        ab.setAdminService(as);
        Assert.assertSame(as, ab.getAdminService());
View Full Code Here

        Instance inst = EasyMock.createMock(Instance.class);
        inst.start(null);
        EasyMock.expectLastCall();
        EasyMock.replay(inst);

        AdminService as = EasyMock.createMock(AdminService.class);
        EasyMock.expect(as.getInstance("test instance")).andReturn(inst);
        EasyMock.replay(as);

        AdminServiceMBeanImpl ab = new AdminServiceMBeanImpl();
        ab.setAdminService(as);
        Assert.assertSame(as, ab.getAdminService());
View Full Code Here

        Instance inst = EasyMock.createMock(Instance.class);
        inst.stop();
        EasyMock.expectLastCall();
        EasyMock.replay(inst);

        AdminService as = EasyMock.createMock(AdminService.class);
        EasyMock.expect(as.getInstance("test instance")).andReturn(inst);
        EasyMock.replay(as);
       
        AdminServiceMBeanImpl ab = new AdminServiceMBeanImpl();
        ab.setAdminService(as);
        Assert.assertSame(as, ab.getAdminService());
View Full Code Here

        Instance inst = EasyMock.createMock(Instance.class);
        inst.destroy();
        EasyMock.expectLastCall();
        EasyMock.replay(inst);

        AdminService as = EasyMock.createMock(AdminService.class);
        EasyMock.expect(as.getInstance("test instance")).andReturn(inst);
        EasyMock.replay(as);
       
        AdminServiceMBeanImpl ab = new AdminServiceMBeanImpl();
        ab.setAdminService(as);
        Assert.assertSame(as, ab.getAdminService());
View Full Code Here

        Instance inst = EasyMock.createMock(Instance.class);
        inst.changeSshPort(7788);
        EasyMock.expectLastCall();
        EasyMock.replay(inst);

        AdminService as = EasyMock.createMock(AdminService.class);
        EasyMock.expect(as.getInstance("test instance")).andReturn(inst);
        EasyMock.replay(as);
       
        AdminServiceMBeanImpl ab = new AdminServiceMBeanImpl();
        ab.setAdminService(as);
        Assert.assertSame(as, ab.getAdminService());
View Full Code Here

        Instance inst = EasyMock.createMock(Instance.class);
        inst.changeRmiRegistryPort(1123);
        EasyMock.expectLastCall();
        EasyMock.replay(inst);
       
        AdminService as = EasyMock.createMock(AdminService.class);
        EasyMock.expect(as.getInstance("test instance")).andReturn(inst);
        EasyMock.replay(as);
       
        AdminServiceMBeanImpl ab = new AdminServiceMBeanImpl();
        ab.setAdminService(as);
        Assert.assertSame(as, ab.getAdminService());
View Full Code Here

TOP

Related Classes of org.apache.karaf.admin.AdminService

Copyright © 2018 www.massapicom. 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.