Package com.volantis.mcs.xdime

Examples of com.volantis.mcs.xdime.XDIMEContextInternal


    /**
     * set up the link element for testing
     * @throws XDIMEException
     */
    private void setupLink() throws XDIMEException {
        XDIMEContextInternal xdimeContext = getXDIMEContextInernal();

        LinkElement link = new LinkElement(xdimeContext);

        XDIMEAttributesImpl attributes = getXDIMEAttributes();

View Full Code Here


     * test the html element sets the mode to xdime 2
     * @throws XDIMEException
     */
    public void testHtmlModeForXDIME2() throws XDIMEException {

         XDIMEContextInternal xdimeContext =
                (XDIMEContextInternal) XDIMEContextFactory.getDefaultInstance()
                    .createXDIMEContext();

        HtmlElement html = new HtmlElement(xdimeContext);

        // In XDIME 2 the canvas is processed in the <html:body>.
        pageContextMock.expects.initialisedCanvas().returns(false);

        xdimeContext.setInitialRequestContext(requestContextMock);

        // todo: later: this should return a real project object so that we
        // can avoid using test specific code paths within the code.
        pageContextMock.expects.getCurrentProject().returns(null).any();

View Full Code Here

     * test the html element sets the mode to xdime CP
     * @throws XDIMEException
     */
    public void testHtmlModeForXDIMECP() throws XDIMEException {

         XDIMEContextInternal xdimeContext =
                (XDIMEContextInternal) XDIMEContextFactory.getDefaultInstance()
                    .createXDIMEContext();

        HtmlElement html = new HtmlElement(xdimeContext);

        // In XDIME CP the canvas is processed in the containing <cdm:canvas>.
        pageContextMock.expects.initialisedCanvas().returns(true);

        xdimeContext.setInitialRequestContext(requestContextMock);

        XDIMEResult result = html.callOpenOnProtocol(xdimeContext, null);

        assertTrue("xdime mode should be XDIMEMode.XDIME1",
                html.getXDIMEMode() == XDIMEMode.XDIMECP);
View Full Code Here

    protected void setUp() throws Exception {

        super.setUp();
        outputBufferStack = new Stack();

        final XDIMEContextInternal context = (XDIMEContextInternal)
            XDIMEContextFactory.getDefaultInstance().createXDIMEContext();
        final MarinerRequestContext requestContextMock =
            getMarinerRequestContextMock();

        context.setInitialRequestContext(requestContextMock);


        handler = new XDIMEContentHandler(
            null, context, XDIMEElementHandler.getDefaultInstance());
    }
View Full Code Here

     * @throws XDIMEException
     */
    private XDIMEContextInternal getXdimeContext(
            MarinerRequestContext requestContext) throws XDIMEException {

        XDIMEContextInternal xdimeContext =
                (XDIMEContextInternal) XDIMEContextFactory.getDefaultInstance()
                    .createXDIMEContext();

        xdimeContext.setInitialRequestContext(requestContext);
        xdimeContext.pushElement(createHTMLElement(xdimeContext));

        return xdimeContext;
    }
View Full Code Here

        initialise();

        MarinerRequestContext marinerRequestContext =
                getMarinerRequestContext();

        XDIMEContextInternal xdimeContext =
                getXdimeContext(marinerRequestContext);

        BodyElement body = new BodyElement(xdimeContext);

        XDIMEAttributes xdimeAttributes = getXDIMEAttributes();
View Full Code Here

     */
    public void testWithNoSelectOptions() throws XDIMEException {

        // callCloseOnProtocol assumes that callOpenOnProtocol and
        // initialiseAttributes will have been called first, so duplicate this
        XDIMEContextInternal context = prepareForCallCloseOnProtocol();

        AbstractXFSelectElementImpl selector = getSelectElementImpl(context);
        XFSelectAttributes attributes =
                (XFSelectAttributes)selector.getProtocolAttributes();
        assertEquals(0, attributes.getOptions().size());
View Full Code Here

    protected List doTest(String[] initialValues)
            throws XDIMEException {

        // callCloseOnProtocol assumes that callOpenOnProtocol and
        // initialiseAttributes will have been called first, so duplicate this
        XDIMEContextInternal context = prepareForCallCloseOnProtocol();

        AbstractXFSelectElementImpl selector = getSelectElementImpl(context);
        assertFalse(cachingDirectives.isEnabled());
        XFSelectAttributes attributes =
                (XFSelectAttributes)selector.getProtocolAttributes();
View Full Code Here

     */
    public void testCommonAttributes() throws XDIMEException {

        // callCloseOnProtocol assumes that callOpenOnProtocol and
        // initialiseAttributes will have been called first, so duplicate this
        XDIMEContextInternal context = prepareForCallCloseOnProtocol();

        String expectedTagName = getTagName();
        boolean expectedMultiple = getMultiple();
        AbstractXFSelectElementImpl selector = getSelectElementImpl(context);
        assertEquals(null, selector.initialValues);
View Full Code Here

    protected XDIMEContextInternal prepareForCallCloseOnProtocol()
            throws XDIMEException {

        // callCloseOnProtocol assumes that callOpenOnProtocol and
        // initialiseAttributes will have been called first, so duplicate this
        XDIMEContextInternal context = new XDIMEContextImpl();
        final XFormBuilder xFormBuilder = context.getXFormBuilder();
        final String modelID = "modelID";
        EmulatedXFormDescriptor fd = new EmulatedXFormDescriptor();
        xFormBuilder.addModel(modelID, fd);
        XDIMEAttributes attributes = new XDIMEAttributesImpl(getElementType());
        attributes.setValue("", XDIMEAttribute.ID.toString(), "controlID");
        attributes.setValue("", XDIMEAttribute.MODEL.toString(), modelID);
        xFormBuilder.registerControl(attributes);

        context.setInitialRequestContext(marinerRequestContextMock);

        return context;
    }
View Full Code Here

TOP

Related Classes of com.volantis.mcs.xdime.XDIMEContextInternal

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.