Examples of PushContentRule


Examples of org.apache.hivemind.schema.rules.PushContentRule

    private void enterPushContent(String elementName)
    {
        ElementModelImpl elementModel = (ElementModelImpl) peekObject();

        PushContentRule rule = new PushContentRule();

        push(elementName, rule, STATE_NO_CONTENT);

        checkAttributes();
View Full Code Here

Examples of org.apache.hivemind.schema.rules.PushContentRule

        ElementImpl element = new ElementImpl();
        element.setElementName("myelement");

        element.setContent("${flintstone}");

        PushContentRule rule = new PushContentRule();

        SchemaProcessor mockProcessor = (SchemaProcessor) control.getMock();

        mockProcessor.getContentTranslator();
        control.setReturnValue(new NullTranslator());

        mockProcessor.getContributingModule();

        MockControl moduleControl = newControl(Module.class);
        Module mockModule = (Module) moduleControl.getMock();

        control.setReturnValue(mockModule);
       
        MockControl symbolExpanderControl = newControl(SymbolExpander.class);
        SymbolExpander symbolExpander = (SymbolExpander) symbolExpanderControl.getMock();
       
        mockProcessor.getSymbolExpander();
        control.setReturnValue(symbolExpander);

        symbolExpander.expandSymbols("${flintstone}", element.getLocation());
        symbolExpanderControl.setReturnValue("FLINTSTONE");
       
        mockProcessor.getContributingModule();
        control.setReturnValue(mockModule);

        mockProcessor.push("FLINTSTONE");
        mockProcessor.pop();

        control.setReturnValue("FLINTSTONE");

        replayControls();

        rule.begin(mockProcessor, element);
        rule.end(mockProcessor, element);

        verifyControls();
    }
View Full Code Here

Examples of org.apache.hivemind.schema.rules.PushContentRule

    private void enterPushContent(String elementName)
    {
        ElementModelImpl elementModel = (ElementModelImpl) peekObject();

        PushContentRule rule = new PushContentRule();

        push(elementName, rule, STATE_NO_CONTENT);

        checkAttributes();
View Full Code Here

Examples of org.apache.hivemind.schema.rules.PushContentRule

        ElementImpl element = new ElementImpl();
        element.setElementName("myelement");

        element.setContent("${flintstone}");

        PushContentRule rule = new PushContentRule();

        SchemaProcessor mockProcessor = (SchemaProcessor) control.getMock();

        mockProcessor.getContentTranslator();
        control.setReturnValue(new NullTranslator());

        mockProcessor.getContributingModule();

        MockControl moduleControl = newControl(Module.class);
        Module mockModule = (Module) moduleControl.getMock();

        control.setReturnValue(mockModule, 2);

        mockModule.expandSymbols("${flintstone}", element.getLocation());
        moduleControl.setReturnValue("FLINTSTONE");

        mockProcessor.push("FLINTSTONE");
        mockProcessor.pop();

        control.setReturnValue("FLINTSTONE");

        replayControls();

        rule.begin(mockProcessor, element);
        rule.end(mockProcessor, element);

        verifyControls();
    }
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.