Examples of TextAssetReference


Examples of com.volantis.mcs.protocols.assets.TextAssetReference

    /**
     * This test the method generateBooleanGrammar    
     */
    public void testGenerateBooleanGrammar() throws Exception {

        final TextAssetReference trueReference =
                new LiteralTextAssetReference("yes, yep, yeah");
       
        final TextAssetReference falseReference =
                new LiteralTextAssetReference("no, nope");
       
        TestMarinerPageContext context = new TestMarinerPageContext();
       
        ProtocolBuilder protocolBuilder = new ProtocolBuilder();
View Full Code Here

Examples of com.volantis.mcs.protocols.assets.TextAssetReference

     */
    public void testHelp() {
        ConcreteMenu item = MenuModelHelper.createMenu(false, testTitle);

        // Test getting a null help
        TextAssetReference testHelp = item.getHelp();
        assertNull("Should be no help", testHelp);

        // Test setting help
        TextAssetReference help = new LiteralTextAssetReference("Help Object");
        item.setHelp(help);

        // Test getting a non-null help
        testHelp = item.getHelp();
        assertNotNull("Should be a help", testHelp);
View Full Code Here

Examples of com.volantis.mcs.protocols.assets.TextAssetReference

     */
    public void testErrorMessage() {
        ConcreteMenu item = MenuModelHelper.createMenu(false, testTitle);

        // Test getting a null error
        TextAssetReference testError = item.getErrorMessage();
        assertNull("Should be no error message", testError);

        // Test setting error
        TextAssetReference error = new LiteralTextAssetReference(
                "Error Message Object");
        item.setErrorMessage(error);

        // Test getting a non-null error
        testError = item.getErrorMessage();
View Full Code Here

Examples of com.volantis.mcs.protocols.assets.TextAssetReference

     */
    public void testPrompt() {
        ConcreteMenu item = MenuModelHelper.createMenu(false, null);

        // Test getting a null prompt
        TextAssetReference testPrompt = item.getPrompt();
        assertNull("Should be no prompt", testPrompt);

        // Test setting a prompt
        TextAssetReference prompt = new LiteralTextAssetReference(
                "Prompt Object");
        item.setPrompt(prompt);

        // Test getting a non-null prompt
        testPrompt = item.getPrompt();
View Full Code Here

Examples of com.volantis.mcs.protocols.assets.TextAssetReference

     */
    public void testShortcut() {
        ConcreteMenuItem item = MenuModelHelper.createMenuItem(itemName);

        // Test getting a null prompt
        TextAssetReference testShortcut = item.getShortcut();
        assertNull("Should be no prompt", testShortcut);

        // Test setting a prompt
        String shortcut = "Shortcut Object";
        item.setShortcut(new LiteralTextAssetReference(shortcut));

        // Test getting a non-null prompt
        testShortcut = item.getShortcut();
        assertNotNull("Should be a prompt", testShortcut);
        assertEquals("Prompts should be the same", shortcut,
                testShortcut.getText(TextEncoding.PLAIN));
    }
View Full Code Here

Examples of com.volantis.mcs.protocols.assets.TextAssetReference

     */
    public void testPrompt() {
        ConcreteMenuItem item = MenuModelHelper.createMenuItem(itemName);

        // Test getting a null prompt
        TextAssetReference testPrompt = item.getPrompt();
        assertNull("Should be no prompt", testPrompt);

        // Test setting a prompt
        String prompt = "Prompt Object";
        item.setPrompt(new LiteralTextAssetReference(prompt));

        // Test getting a non-null prompt
        testPrompt = item.getPrompt();
        assertNotNull("Should be a prompt", testPrompt);
        assertEquals("Prompts should be the same", prompt,
                testPrompt.getText(TextEncoding.PLAIN));
    }
View Full Code Here

Examples of com.volantis.mcs.protocols.assets.TextAssetReference

                element.setStyles(styles);
            }
        }
        element.setAttribute("href", item.getHref().getURL());

        TextAssetReference text = item.getShortcut();
        String value;
        if (text != null && (value = text.getText(TextEncoding.PLAIN)) != null) {
            element.setAttribute("shortcut", value);
        }

        return true;
    }
View Full Code Here

Examples of com.volantis.mcs.protocols.assets.TextAssetReference

        LinkAssetReference reference = attributes.getHref();
        String value;
        if (reference != null && (value = reference.getURL()) != null) {
            element.setAttribute("href", value);
        }
        TextAssetReference text = attributes.getShortcut();
        if (text != null && (value = text.getText(TextEncoding.PLAIN)) != null) {
            element.setAttribute("shortcut", value);
        }
        if (attributes.getTitle() != null) {
            element.setAttribute("title", attributes.getTitle());
        }
View Full Code Here

Examples of com.volantis.mcs.protocols.assets.TextAssetReference

        policyMock.expects.getAlternatePolicy(PolicyType.TEXT)
                .returns(alternativeMock).any();

        ImageAssetReference test = createTestInstance(policyReferenceMock);
        TextAssetReference fallback = test.getTextFallback();
        assertNotNull("fallback should exist", fallback);
    }
View Full Code Here

Examples of com.volantis.mcs.protocols.assets.TextAssetReference

        policyMock.expects.getAlternatePolicy(PolicyType.TEXT)
                .returns(alternativeMock).any();

        ImageAssetReference test = createTestInstance(policyReferenceMock);
        TextAssetReference fallback = test.getTextFallback();
        assertNull("fallback should not exist", fallback);
    }
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.