Package com.volantis.mcs.devices.policy.values

Examples of com.volantis.mcs.devices.policy.values.PolicyValue


        // Create the factory
        PolicyValueFactory factory = new DefaultPolicyValueFactory(accessor);

        // Call the creation method on the factory
        PolicyValue value = factory.createPolicyValue(device, "policyname");

        // Check test outcome
        assertNotNull("Policy value should exist", value);
        assertTrue("Based on test setup expected a TextPolicyValue",
                   value instanceof TextPolicyValue);
        assertEquals("text value incorrect", "Policy Value",
                value.getAsString());
    }
View Full Code Here


        // Create the factory
        PolicyValueFactory factory = new DefaultPolicyValueFactory(accessor);

        // Call the creation method on the factory
        PolicyValue value = factory.createPolicyValue(device, "policyname");

        // Check test outcome
        assertNull("Policy value should not exist", value);
    }
View Full Code Here

        // Create the factory
        PolicyValueFactory factory = new DefaultPolicyValueFactory(accessor);

        // Call the creation method on the factory
        PolicyValue value = factory.createPolicyValue(device, "policyname");

        // Check test outcome
        assertNotNull("Policy value should exist", value);
        assertTrue("Based on test setup expected a OrderedSetPolicyValue",
                   value instanceof OrderedSetPolicyValue);
View Full Code Here

        // Create the factory
        PolicyValueFactory factory = new DefaultPolicyValueFactory(accessor);

        // Call the creation method on the factory
        PolicyValue value = factory.createPolicyValue(device, "policyname");

        // Check test outcome
        assertNotNull("Policy value should exist", value);
        assertTrue("Based on test setup expected a StructurePolicyValue",
                   value instanceof StructurePolicyValue);
        StructurePolicyValue structureValue = (StructurePolicyValue) value;
        Map fields = structureValue.getFieldValuesAsMap();
        assertNotNull("Should be a map of values", fields);
        assertEquals("Should be 4 items in the map", fields.size(), 4);

        PolicyValue value1 = (PolicyValue) fields.get("field1");
        assertNotNull("field1 should not be null", value1);
        PolicyValue value2 = (PolicyValue) fields.get("field2");
        assertNotNull("field2 should not be null", value2);
        PolicyValue value3 = (PolicyValue) fields.get("field3");
        assertNotNull("field3 should not be null", value3);
        PolicyValue value4 = (PolicyValue) fields.get("field4");
        assertNull("field4 should be null", value4);

        assertTrue("field1 should be text value",
                value1 instanceof TextPolicyValue);
        assertTrue("field2 should be boolean value",
View Full Code Here

        if (!(type instanceof SimplePolicyType)) {
            throw new IllegalArgumentException(
                    "Sets can only contain SimplePolicyValues");
        }

        PolicyValue newValue = null;

        // Clean off any whitespace that occurred because of the tokenising
        item = item.trim();
       
        // Create the new value
View Full Code Here

                String deviceName = "Master";

                Device device = repository.getDevice(deviceName);
                assertEquals("Name should match: ", deviceName, device.getName());

                PolicyValue value = device.getRealPolicyValue("realvidinpage");
                assertNotNull(value);
            }
        });
    }
View Full Code Here

        }
        if (policyName == null) {
            throw new IllegalArgumentException("Cannot be null: policyName");
        }

        PolicyValue value = null;

        try {
            PolicyDescriptor descriptor =
                    policyDescriptorAccessor.getPolicyDescriptor(
                            policyName, Locale.getDefault());
View Full Code Here

     * @throws DeviceRepositoryException if the given value is not of the
     * specified policy type.
     */
    private PolicyValue createPolicyValue(String policyValue, PolicyType type)
            throws DeviceRepositoryException {
        PolicyValue value = null;

        if (type instanceof SimplePolicyType) {
            value = createSimplePolicyValue(policyValue, (SimplePolicyType) type);
        } else if (type instanceof CompositePolicyType) {
            if (type instanceof OrderedSetPolicyType) {
View Full Code Here

TOP

Related Classes of com.volantis.mcs.devices.policy.values.PolicyValue

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.