Package com.volantis.mcs.eclipse.common

Examples of com.volantis.mcs.eclipse.common.PolicyAttributesDetails


    /**
     * Test that getAttributeNames() works as expected.
     */
    public void testGetAttributeNames() {
        PolicyAttributesDetails attrDetails =
                new PolicyAttributesDetails("imageComponent", true);
        PolicyProxyElementDetails pped =
                new PolicyProxyElementDetails("imageComponent");

        String [] expected = attrDetails.getAttributes();
        String [] actual = pped.getAttributeNames();

        assertEquals("Wrong number of attributes.", expected.length,
                actual.length);

View Full Code Here


    /**
     * Test isAttributeName() using a valid attribute name.
     */
    public void testIsAttributeNamePositive() {
        PolicyAttributesDetails attrDetails =
                new PolicyAttributesDetails("imageComponent", true);
        PolicyProxyElementDetails pped =
                new PolicyProxyElementDetails("imageComponent");

        String [] attrs = attrDetails.getAttributes();

        for(int i=0; i<attrs.length; i++) {
            assertTrue("\"" + attrs[i] + "\" is a valid attribute name.",
                    pped.isAttributeName(attrs[i]));
        }
View Full Code Here

    public void testBuildingComposite() throws Exception {
        final Shell shell = new Shell(SWT.NONE);
        AttributesComposite parent = new AttributesComposite(shell, SWT.NONE);

        AttributesDetails attributesDetails =
                new PolicyAttributesDetails("assetGroup", false);

        AttributesComposite result = AttributesCompositeBuilder.getSingleton().
                buildAttributesComposite(parent, attributesDetails,
                        (IProject) null, null);
View Full Code Here

        GridLayout layout = new GridLayout(2, false);
        final Composite container = new Composite(getShell(), SWT.DEFAULT);
        container.setLayout(layout);

        String[] filter = {"deviceName"};
        PolicyAttributesDetails attrDetails =
                new PolicyAttributesDetails("imageComponent",
                        new Filter(filter, Filter.EXCLUDE), true);
        final List list = new List(container, SWT.MULTI);
        final String[] attrs = attrDetails.getAttributes();
        for (int i = 0; i < attrs.length; i++) {
            list.add(attrs[i]);
        }

        final Composite fillerComposite = new Composite(container, SWT.NONE);
View Full Code Here

    /**
     * Test getPresentableValue() where there are specific presentable
     * values available.
     */
    public void testGetPresentableValuePositive() {
        PolicyAttributesDetails attributesDetails =
                new PolicyAttributesDetails("imageComponent", true);

        assertEquals("Incorrect presentable value", "GIF",
                attributesDetails.getPresentableValue("encoding", "gif"));
        assertEquals("Incorrect presentable value", "BMP",
                attributesDetails.getPresentableValue("encoding", "bmp"));
        assertEquals("Incorrect presentable value", "JPEG",
                attributesDetails.getPresentableValue("encoding", "jpeg"));
        assertEquals("Incorrect presentable value", "WBMP",
                attributesDetails.getPresentableValue("encoding", "wbmp"));
        assertEquals("Incorrect presentable value", "PJPEG",
                attributesDetails.getPresentableValue("encoding", "pjpeg"));
        assertEquals("Incorrect presentable value", "TIFF",
                attributesDetails.getPresentableValue("encoding", "tiff"));
        assertEquals("Incorrect presentable value", "VIDEOTEX",
                attributesDetails.getPresentableValue("encoding", "videotex"));
    }
View Full Code Here

    /**
     * Test that getPresentableValue() returns value when there is no
     * specific presentable value available.
     */
    public void testGetPresentableValueNegative() {
        PolicyAttributesDetails attributesDetails =
                new PolicyAttributesDetails("imageComponent", true);
        assertEquals("Incorrect presentable value",
                "24", attributesDetails.getPresentableValue("pixelDepth",
                        "24"));
    }
View Full Code Here

     * Ensures that the expected attributes are retrieved for a given
     * element name.
     */
    private void checkReturnedAttributes(List expected, String elementName,
                                         boolean childAttrs) {
        PolicyAttributesDetails attributesDetails =
                new PolicyAttributesDetails(elementName, childAttrs);

        String[] result = attributesDetails.getAttributes();

        assertNotNull(result);
        assertEquals("There should be " + expected.size() + " attributes.",
                expected.size(), result.length);

View Full Code Here

            "assetGroupName",
            "deviceName",
            "encoding",
        };

        PolicyAttributesDetails attributesDetails =
                new PolicyAttributesDetails("imageComponent",
                        new Filter(include, Filter.INCLUDE), true);

        String[] result = attributesDetails.getAttributes();

        assertNotNull(result);
        assertEquals("There should be 3 attributes.", 3,
                result.length);
View Full Code Here

            "deviceName",
            "encoding",
            "project"
        };

        PolicyAttributesDetails attributesDetails =
                new PolicyAttributesDetails("imageComponent",
                        new Filter(exclude, Filter.EXCLUDE), true);

        String[] result = attributesDetails.getAttributes();

        assertNotNull(result);
        assertEquals("There should be 10 attributes.", 10,
                result.length);
View Full Code Here

     * selection for a sample attribute - in this case the encoding
     * attribute of ImageAsset. In this case the selection is based on
     * a child attribute.
     */
    public void testGetChildAttributeValueSelectionPositive() {
        PolicyAttributesDetails attributesDetails =
                new PolicyAttributesDetails("imageComponent", true);

        Object[] encodings =
                attributesDetails.getAttributeValueSelection("encoding");

        assertNotNull(encodings);
        assertEquals("There should be 8 encodings.", 8, encodings.length);


View Full Code Here

TOP

Related Classes of com.volantis.mcs.eclipse.common.PolicyAttributesDetails

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.