Package com.volantis.mcs.protocols

Examples of com.volantis.mcs.protocols.FormatReference


     * any separator rendering.
     */
    public void testSelectMenuItemGroupSeparatorExplicitTargeting()
            throws Exception {
        MenuSeparatorRendererSelector selector = createSelector();
        FormatReference pane = new FormatReference("pane",
                                                   NDimensionalIndex.
                                                   ZERO_DIMENSIONS);
        Menu menu;

        menu = createMenu(null, StylesBuilder.getCompleteStyles(
View Full Code Here


        super(name);
    }

    public void setUp()
    {
        formatReference = new FormatReference();
    }
View Full Code Here

    }

    public void testGetInstance()
    {
        NDimensionalIndex index = new NDimensionalIndex(new int[] {0, 1});
        formatReference = new FormatReference("stem", index);                           
        assertEquals("wrong fir returned", index, formatReference.getIndex());
    }
View Full Code Here

    }

    public void testGetStem()
    {
        NDimensionalIndex index = new NDimensionalIndex(new int[] {0, 1});
        formatReference = new FormatReference("stem", index);
        assertEquals("wrong stem returned", "stem", formatReference.getStem());
    }
View Full Code Here

    }

    public void testSetStem()
    {
        NDimensionalIndex index = new NDimensionalIndex(new int[] {0, 1});
        formatReference = new FormatReference("stem", index);
        formatReference.setStem("different");
        assertEquals("wrong stem returned", "different", formatReference.getStem());
    }
View Full Code Here

    public void testSetPane() throws Exception {
        doBuildDataMethodTest(new BuildDataMethodTester() {
            /**
             * Sample data for use in testing
             */
            FormatReference pane = new FormatReference(
                    "pane",
                    NDimensionalIndex.ZERO_DIMENSIONS);

            // javadoc inherited
            public void invoke() throws Exception {
View Full Code Here

     *
     */
    public void testCheckNestedPanes() throws Exception {

        // Test pane to use when calling checkNestedPanes
        FormatReference pane =
                new FormatReference("test-pane",
                                    NDimensionalIndex.ZERO_DIMENSIONS);

        // Build a one level menu
        MenuEntityCreation entities = new MenuEntityCreation();
        ConcreteMenu menu =
View Full Code Here

     * returns the correct format instance ref for a pane name.
     * Our pane name is of a smaller dimension than the number of dimensions
     * for this layout so it should be padded out with zeros
     */
    public void testParsePaneSmaller(){
        FormatReference fr;
        String paneName="beer.0.2.3";
        pane.setDimensions(5);
        fr = FormatReferenceParser.parsePane(paneName, context);
        assertTrue(fr.getStem().equals("beer"));
        int index[] = {0,2,3,0,0};
        assertEquals("instance not as",
                     new NDimensionalIndex(index, 3),
                     fr.getIndex());
    }
View Full Code Here

     * returns the correct format instance ref for a pane name.
     * Our pane name is of a larger dimension than the number of dimensions
     * for this layout so it should be truncated to 3
     */
    public void testParsePaneLarger(){
        FormatReference fr;
        String paneName="beer.0.2.3.4.5";
        pane.setDimensions(3);
        fr = FormatReferenceParser.parsePane(paneName, context);
        assertTrue(fr.getStem().equals("beer"));
        int index[] = {0,2,3};
        assertEquals("instance not as",
                     new NDimensionalIndex(index),
                     fr.getIndex());
    }
View Full Code Here

    /**
     * Make sure that things work correctly when no indices are specified and
     * the pane is not iterated
     */
    public void testParsePaneNoIndicesInEither() {
        FormatReference fr;
        String paneName="beer";
        pane.setDimensions(0);
        fr = FormatReferenceParser.parsePane(paneName, context);
        assertEquals("stem not as",
                     "beer",
                     fr.getStem());
        assertEquals("instance not as",
                     new NDimensionalIndex(new int[0]),
                     fr.getIndex());
    }
View Full Code Here

TOP

Related Classes of com.volantis.mcs.protocols.FormatReference

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.