Examples of DOMProtocolMock


Examples of com.volantis.mcs.protocols.DOMProtocolMock

    public void testDuplicates() {
        final AssetResolverMock assetResolverMock =
            new AssetResolverMock("AssetResolverMock", expectations);

        final DOMProtocolMock protocolMock =
            new DOMProtocolMock("DOMProtocolMock", expectations,
                new DefaultProtocolSupportFactory(), null);
        protocolMock.expects.pushHeadBuffer().any();
        final List scriptAttributesList = new LinkedList();
        protocolMock.fuzzy.writeOpenScript(mockFactory.expectsAny()).does(
            new MethodAction() {
                public Object perform(MethodActionEvent event) {
                    scriptAttributesList.add(event.getArguments()[0]);
                    return null;
                }
            }).any();
        protocolMock.fuzzy.writeCloseScript(mockFactory.expectsAny()).returns().any();
        protocolMock.expects.popHeadBuffer().any();
        protocolMock.expects.getDOMFactory().returns(
            DOMFactory.getDefaultInstance()).any();
        final PageHead pageHead = new PageHead();
        pageHead.setOutputBufferFactory(
            new DOMOutputBufferFactory(DOMFactory.getDefaultInstance()));
        protocolMock.expects.getPageHead().returns(pageHead).any();
        protocolMock.fuzzy.createScriptElement(
            mockFactory.expectsInstanceOf(ScriptAttributes.class)).does(
                new MethodAction(){
                    public Object perform(final MethodActionEvent event)
                            throws Throwable {
                        final ScriptAttributes attributes =
                            (ScriptAttributes) event.getArguments()[0];
                        final Element scriptElement =
                            protocolMock.getDOMFactory().createElement("script");
                        scriptElement.setAttribute("charset",
                            attributes.getCharSet());
                        scriptElement.setAttribute("language",
                            attributes.getLanguage());
                        scriptElement.setAttribute("src",
View Full Code Here

Examples of com.volantis.mcs.protocols.DOMProtocolMock

        //   Set Expectations
        // ===================================================================
        psfMock.expects.getDOMFactory().returns(domFactoryMock);
        protocolConfigMock.expects.getValidationHelper().returns(null).any();

        DOMProtocolMock protocol = new DOMProtocolMock(
                "protocol", expectations, psfMock, protocolConfigMock);

        protocol.expects.getProtocolConfiguration().returns(configuration).any();
        configuration.fuzzy.optimisationWouldLoseImportantStyles(
                mockFactory.expectsInstanceOf(Element.class))
View Full Code Here

Examples of com.volantis.mcs.protocols.DOMProtocolMock

                                     boolean convertPercentagesToPixels)
            throws Throwable {

        ProtocolSupportFactory factory = new DefaultProtocolSupportFactory();

        DOMProtocolMock protocolMock = new DOMProtocolMock(
                "protocolMock", expectations, factory, null);

        TransformationConfigurationMock transformationConfigurationMock =
                new TransformationConfigurationMock(
                        "transformationConfigurationMock", expectations);
View Full Code Here

Examples of com.volantis.mcs.protocols.DOMProtocolMock

        RuntimeProjectMock projectMock = new RuntimeProjectMock(
                "project", expectations);
        PolicyReferenceFactoryMock policyRefFactoryMock = new PolicyReferenceFactoryMock(
                "policyRefFactory", expectations);

        final DOMProtocolMock protocolMock =
            new DOMProtocolMock("DOMProtocolMock", expectations,
                new DefaultProtocolSupportFactory(), null);

        pageCtxMock
            .expects.getProtocol()
            .returns(protocolMock).any();
View Full Code Here

Examples of com.volantis.mcs.protocols.DOMProtocolMock

                        expectations);

        protocolConfigurationMock.expects.getCssVersion().returns(
                cssVersionMock).any();

        final DOMProtocolMock domProtocolMock = new DOMProtocolMock(
                "domProtocol", expectations,
                protocolSupportFactoryMock, protocolConfigurationMock);

        domProtocolMock.expects.getProtocolConfiguration().returns(
                protocolConfigurationMock).any();
View Full Code Here

Examples of com.volantis.mcs.protocols.DOMProtocolMock

        super.setUp();
        protocolConfig = new ProtocolConfigurationMock("protocolConfig",
                expectations);
        psf = new ProtocolSupportFactoryMock("psf", expectations);
        psf.expects.getDOMFactory().returns(null);
        protocol = new DOMProtocolMock("protocol", expectations, psf,
                protocolConfig);
        events = new EventAttributes();
        TEST_FD = new EmulatedXFormDescriptor();
        TEST_FD.setContainingFormName(MODEL_ID);
        TEST_FD2 = new EmulatedXFormDescriptor();
View Full Code Here

Examples of com.volantis.mcs.protocols.DOMProtocolMock

                new EmulatedXFormDescriptorMock("fd", expectations);

        // These expectations must be set before the DOMProtocolMock is created.
        psf.expects.getDOMFactory().returns(domFactory);
        configuration.expects.getValidationHelper().returns(null).any();
        DOMProtocolMock protocol = new DOMProtocolMock("protocol",
                expectations, psf, configuration);
        protocol.expects.getDocument().returns(dom).any();
        // Configure the emulator, and run the tests.
        emulator.firstControl = firstControl;
        emulator.lastControl = lastControl;
View Full Code Here

Examples of com.volantis.mcs.protocols.DOMProtocolMock

                new EmulatedXFormDescriptorMock("fd", expectations);

        // These expectations must be set before the DOMProtocolMock is created.
        psf.expects.getDOMFactory().returns(domFactory);
        configuration.expects.getValidationHelper().returns(null).any();
        DOMProtocolMock protocol = new DOMProtocolMock("protocol",
                expectations, psf, configuration);
        protocol.expects.getDocument().returns(dom).any();
        // Configure the emulator, and run the tests.
        emulator.firstControl = firstControl;
        emulator.lastControl = lastControl;
View Full Code Here

Examples of com.volantis.mcs.protocols.DOMProtocolMock

                new DOMOutputBufferMock("buffer", expectations);

        // These expectations must be set before the DOMProtocolMock is created.
        psf.expects.getDOMFactory().returns(domFactory);
        configuration.expects.getValidationHelper().returns(null).any();
        DOMProtocolMock protocol = new DOMProtocolMock("protocol",
                expectations, psf, configuration);

        // Set expectations.
        protocol.expects.createXFormEmulationElement(FORM_NAME, fd).
                returns(emulatedXFormElement);
View Full Code Here

Examples of com.volantis.mcs.protocols.DOMProtocolMock

                new DOMOutputBufferMock("buffer", expectations);

        // These expectations must be set before the DOMProtocolMock is created.
        psf.expects.getDOMFactory().returns(domFactory);
        configuration.expects.getValidationHelper().returns(null).any();
        DOMProtocolMock protocol = new DOMProtocolMock("protocol",
                expectations, psf, configuration);

        // Set expectations.
        protocol.expects.createXFormEmulationElement(FORM_NAME, fd).
                returns(emulatedXFormElement);
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.