Examples of PaneMock


Examples of com.volantis.mcs.layouts.PaneMock

                new StylingEngineMock("stylingEngineMock", expectations);

        final CanvasLayoutMock canvasLayoutMock =
                new CanvasLayoutMock("canvasLayoutMock", expectations);

        final PaneMock paneMock = LayoutTestHelper.createPaneMock(
                "paneMock", expectations, canvasLayoutMock);

        final StylesMock stylesMock =
                new StylesMock("stylesMock", expectations);
View Full Code Here

Examples of com.volantis.mcs.layouts.PaneMock

        // =====================================================================
        //   Create Mocks
        // =====================================================================

        final PaneMock paneMock = LayoutTestHelper.createPaneMock(
                "paneMock", expectations, canvasLayoutMock);

        final StyleSheetMock styleSheetMock =
                new StyleSheetMock("styleSheetMock", expectations);

        final StyleSheetCompilerMock styleSheetCompilerMock =
                new StyleSheetCompilerMock("styleSheetCompilerMock",
                                           expectations);

        final CompiledStyleSheetMock compiledStyleSheetMock =
                new CompiledStyleSheetMock("compiledStyleSheetMock",
                                           expectations);

        final FragmentMock fragmentMock = LayoutTestHelper.createFragmentMock(
                "fragmentMock", expectations, canvasLayoutMock);

        final InternalLayoutContentMock layoutContentMock =
                new InternalLayoutContentMock("layoutContentMock",
                        expectations);

        final StyleSheetActivatorMock styleSheetActivatorMock =
                new StyleSheetActivatorMock("styleSheetActivatorMock",
                        expectations);

        // =====================================================================
        //   Set Expectations
        // =====================================================================

        canvasLayoutMock.expects.getDefaultFragmentName()
                .returns("DEFAULT FRAGMENT").any();

        paneMock.expects.getEnclosingFragment().returns(fragmentMock).any();

        canvasLayoutMock.expects.getRootFormat().returns(paneMock).any();

        styleSheetBuilderMock.expects.build(canvasLayoutMock)
                .returns(styleSheetMock);

        styleSheetCompilerFactoryMock.expects.createStyleSheetCompiler()
                .returns(styleSheetCompilerMock);

        styleSheetCompilerMock.expects.compileStyleSheet(styleSheetMock).
                returns(compiledStyleSheetMock);

        deviceLayoutUpdaterMock.expects.update(canvasLayoutMock);

        layoutContentMock.expects.getLayout().returns(canvasLayoutMock).any();

        styleSheetActivatorMock.expects.activate(styleSheetMock);

        // =====================================================================
        //   Test Expectations
        // =====================================================================

        ActivatedLayoutContent activatedLayoutContent = (ActivatedLayoutContent)
                activator.activateLayoutContent(styleSheetActivatorMock,
                        layoutContentMock);

        assertEquals("Compiled Style Sheet", compiledStyleSheetMock,
                     activatedLayoutContent.getCompiledStyleSheet());

        RuntimeDeviceLayout runtimeDeviceLayout = new RuntimeLayoutAdapter(
                null, canvasLayoutMock, compiledStyleSheetMock,
                activatedLayoutContent.getContainerNameToFragments());

        final List fragments =
            runtimeDeviceLayout.getEnclosingFragments("paneMock");
        assertEquals(1, fragments.size());
        final LayoutContentActivator.ContainerPosition containerPosition =
            (LayoutContentActivator.ContainerPosition) fragments.get(0);

        assertEquals(paneMock.getEnclosingFragment(),
            containerPosition.getFragment());
        assertEquals(0, containerPosition.getIndex());
    }
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.