Examples of ProfileState


Examples of io.fabric8.api.mxbean.ProfileState

        version10 = VersionBuilder.Factory.create("1.0").addProfiles(Arrays.asList(prfA, prfB)).getVersion();

        ProfileManagement impl = Mockito.mock(ProfileManagement.class);
        Mockito.when(impl.getVersions()).thenReturn(Arrays.asList("1.0"));
        Mockito.when(impl.getVersion("1.0")).thenReturn(new VersionState(version10));
        Mockito.when(impl.getProfile("1.0", "prfA")).thenReturn(new ProfileState(prfA));
        Mockito.when(impl.getProfile("1.0", "prfB")).thenReturn(new ProfileState(prfB));
       
        server = ManagementFactory.getPlatformMBeanServer();
        StandardMBean mxbean = new StandardMBean(impl, ProfileManagement.class, true);
        server.registerMBean(mxbean, ProfileManagement.OBJECT_NAME);
        proxy = JMX.newMXBeanProxy(server, ProfileManagement.OBJECT_NAME, ProfileManagement.class);
View Full Code Here

Examples of io.fabric8.api.mxbean.ProfileState

    @Test
    public void testPlainGetProfile() throws Exception {
        Object[] params = new Object[] {"1.0", "prfB"};
        String[] signature = new String[]{ String.class.getName(), String.class.getName()};
        CompositeData cdata = (CompositeData) server.invoke(ProfileManagement.OBJECT_NAME, "getProfile", params, signature);
        ProfileState prfB = (ProfileState) OpenTypeGenerator.fromOpenData(cdata.getCompositeType(), ProfileState.class.getClassLoader(), cdata);
        Assert.assertEquals(version10.getProfile("prfB"), prfB.toProfile());
    }
View Full Code Here

Examples of io.fabric8.api.mxbean.ProfileState

    }

    @Test
    public void testProfileStateRoundTrip() throws Exception {
        CompositeType ctype = getProfileStateType();
        ProfileState prfB = new ProfileState(version10.getProfile("prfB"));
        ClassLoader classLoader = prfB.getClass().getClassLoader();
        CompositeData cdata = (CompositeData) OpenTypeGenerator.toOpenData(ctype, prfB);
        ProfileState result = (ProfileState) OpenTypeGenerator.fromOpenData(ctype, classLoader, cdata);
        Assert.assertEquals(prfB, result);
       
        Object json = JSONTypeGenerator.toJSON(cdata);
        cdata = (CompositeData) JSONTypeGenerator.toOpenData(ctype, classLoader, json);
        result = (ProfileState) OpenTypeGenerator.fromOpenData(ctype, classLoader, cdata);
View Full Code Here

Examples of io.fabric8.api.mxbean.ProfileState

        // [FABRIC-1172] Jolokia exec operations fail on WildFly
        Assume.assumeFalse(getRuntimeType() == RuntimeType.WILDFLY);
       
        ProfileBuilder pbA10 = ProfileBuilder.Factory.create("1.0", "prfA");
        pbA10.addConfiguration("pidA", Collections.singletonMap("keyA", "valA"));
        ProfileState prfA = getProxy().createProfile(new ProfileState(pbA10.getProfile()));
        try {
            Assert.assertEquals("prfA", prfA.getId());
            Assert.assertEquals("1.0", prfA.getVersion());
            Assert.assertTrue(prfA.getAttributes().isEmpty());
            Assert.assertEquals("valA", prfA.getConfiguration("pidA").get("keyA"));
           
            // getProfile
            Assert.assertEquals(prfA, getProxy().getProfile("1.0", "prfA"));

            // updateProfile
            prfA = getProxy().getProfile("1.0", "prfA");
            pbA10 = ProfileBuilder.Factory.createFrom(prfA.toProfile());
            pbA10.addConfiguration("pidB", "keyB", "valB");
            prfA = getProxy().updateProfile(new ProfileState(pbA10.getProfile()));
            Assert.assertEquals("prfA", prfA.getId());
            Assert.assertEquals("1.0", prfA.getVersion());
            Assert.assertTrue(prfA.getAttributes().isEmpty());
            Assert.assertEquals("valA", prfA.getConfiguration("pidA").get("keyA"));
            Assert.assertEquals("valB", prfA.getConfiguration("pidB").get("keyB"));
        } finally {
            getProxy().deleteProfile("1.0", "prfA", false);
        }
    }
View Full Code Here

Examples of io.fabric8.api.mxbean.ProfileState

    }

    @Override
    public ProfileState createProfile(ProfileState profileState) {
        Profile profile = getProfileManager().createProfile(profileState.toProfile());
        return new ProfileState(profile);
    }
View Full Code Here

Examples of io.fabric8.api.mxbean.ProfileState

    }

    @Override
    public ProfileState getProfile(String versionId, String profileId) {
        Profile profile = getProfileManager().getProfile(versionId, profileId);
        return profile != null ? new ProfileState(profile) : null;
    }
View Full Code Here

Examples of io.fabric8.api.mxbean.ProfileState

    }

    @Override
    public ProfileState updateProfile(ProfileState profileState) {
        Profile profile = getProfileManager().updateProfile(profileState.toProfile());
        return new ProfileState(profile);
    }
View Full Code Here

Examples of uk.gov.nationalarchives.droid.profile.ProfileState

    private abstract static class AbstractState implements ProfileStateMachine {
    }

    private static boolean allProfilesExportable(Collection<ProfileForm> profiles) {
        for (ProfileForm profile : profiles) {
            final ProfileState state = profile.getProfile().getState();
            if (!(state.equals(ProfileState.STOPPED) || state.equals(ProfileState.FINISHED))) {
                return false;
            }
        }
        return true;
    }
View Full Code Here

Examples of uk.gov.nationalarchives.droid.profile.ProfileState

        }
        return isReportable;
    }
   
    private static boolean isFilterable(ProfileForm profile) {
        final ProfileState state = profile.getProfile().getState();
        if (state.equals(ProfileState.STOPPED) || state.equals(ProfileState.FINISHED)) {
            return true;
        }
        return false;

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