Examples of XDIMEContextInternal


Examples of com.volantis.mcs.xdime.XDIMEContextInternal

     * @throws XDIMEException if there was a problem running the test.
     */
    public void testCallOpenOnProtocolWithInvalidEvent() throws XDIMEException {

        // Create test objects.
        XDIMEContextInternal context =
                prepareEnvironment("domActivate", submissionID);

        // Run test.
        XFSetValueElementImpl setValue = new XFSetValueElementImpl(context);
        try {
View Full Code Here

Examples of com.volantis.mcs.xdime.XDIMEContextInternal

     */
    public void testCallOpenOnProtocolWithNonExistentReferee()
            throws XDIMEException {

        // Create test objects.
        XDIMEContextInternal context = prepareEnvironment("DOMActivate", "ref1");

        // Run test.
        XFSetValueElementImpl setValue = new XFSetValueElementImpl(context);
        setValue.callOpenOnProtocol(context, attributes);
    }
View Full Code Here

Examples of com.volantis.mcs.xdime.XDIMEContextInternal

     * @throws XDIMEException if there was a problem running the test.
     */
    public void testCallOpenOnProtocol() throws XDIMEException {

        // Create test objects.
        XDIMEContextInternal context =
                prepareEnvironment("DOMActivate", submissionID);

        // Run test.
        XFSetValueElementImpl setValue = new XFSetValueElementImpl(context);
        setValue.callOpenOnProtocol(context, attributes);
View Full Code Here

Examples of com.volantis.mcs.xdime.XDIMEContextInternal

     */
    public void testCallCloseOnProtocol() throws XDIMEException {
        // Create test objects.
        DataHandlingStrategyMock strategy =
                new DataHandlingStrategyMock("strategy", expectations);
        XDIMEContextInternal context =
                prepareEnvironment("DOMActivate", submissionID);

        // Set expectations.
        requestContext.expects.getEnvironmentContext().returns(envContext);
        envContext.expects.getCachingDirectives().returns(null);
        strategy.expects.getCharacterData().returns(VALUE_FROM_BODY);

        XFSubmitElementImpl submitElement = new XFSubmitElementImpl(context);
        XFActionAttributes attributes =
                (XFActionAttributes) submitElement.getProtocolAttributes();
        FieldDescriptor fd = new FieldDescriptor();
        attributes.setFieldDescriptor(fd);
        context.pushElement(submitElement);

        // Run test.
        XFSetValueElementImpl setValue =
                new XFSetValueElementImpl(context, strategy);
        setValue.callCloseOnProtocol(context);
View Full Code Here

Examples of com.volantis.mcs.xdime.XDIMEContextInternal

     */
    public void testBodyValueOverridesAttributeValue() throws XDIMEException {
        // Create test objects.
        DataHandlingStrategyMock strategy =
                new DataHandlingStrategyMock("strategy", expectations);
        XDIMEContextInternal context =
                prepareEnvironment("DOMActivate", submissionID);

        // Set expectations.
        requestContext.expects.getEnvironmentContext().returns(envContext);
        envContext.expects.getCachingDirectives().returns(null);
        strategy.expects.getCharacterData().returns(VALUE_FROM_BODY);

        XFSubmitElementImpl submitElement = new XFSubmitElementImpl(context);
        XFActionAttributes actionAttributes =
                (XFActionAttributes) submitElement.getProtocolAttributes();
        FieldDescriptor fd = new FieldDescriptor();
        actionAttributes.setFieldDescriptor(fd);
        context.pushElement(submitElement);

        // Run test.
        assertNull(actionAttributes.getInitial());
        assertNull(actionAttributes.getValue());
        assertNull(actionAttributes.getFieldDescriptor().getInitialValue());
View Full Code Here

Examples of com.volantis.mcs.xdime.XDIMEContextInternal

     */
    public void testAttributeValueUsedWhenNoBodyValue() throws XDIMEException {
        // Create test objects.
        DataHandlingStrategyMock strategy =
                new DataHandlingStrategyMock("strategy", expectations);
        XDIMEContextInternal context =
                prepareEnvironment("DOMActivate", submissionID);

        // Set expectations.
        requestContext.expects.getEnvironmentContext().returns(envContext);
        envContext.expects.getCachingDirectives().returns(null);
        strategy.expects.getCharacterData().returns(null);

        XFSubmitElementImpl submitElement = new XFSubmitElementImpl(context);
        XFActionAttributes actionAttributes =
                (XFActionAttributes) submitElement.getProtocolAttributes();
        FieldDescriptor fd = new FieldDescriptor();
        actionAttributes.setFieldDescriptor(fd);
        context.pushElement(submitElement);

        // Run test.
        assertNull(actionAttributes.getInitial());
        assertNull(actionAttributes.getValue());
        assertNull(actionAttributes.getFieldDescriptor().getInitialValue());
View Full Code Here

Examples of com.volantis.mcs.xdime.XDIMEContextInternal

    public void testCallCloseOnProtocolWithInvalidParent()
            throws XDIMEException {
        // Create test objects.
        DataHandlingStrategyMock strategy =
                new DataHandlingStrategyMock("strategy", expectations);
        XDIMEContextInternal context =
                prepareEnvironment("DOMActivate", submissionID);

        // Set expectations.
        requestContext.expects.getEnvironmentContext().returns(envContext);
        envContext.expects.getCachingDirectives().returns(null);
        strategy.expects.getCharacterData().returns(VALUE_FROM_BODY);

        XFormsControlElement parent = new XFSecretElementImpl(context);
        context.pushElement(parent);

        // Run test.
        XFSetValueElementImpl setValue =
                new XFSetValueElementImpl(context, strategy);
        try {
View Full Code Here

Examples of com.volantis.mcs.xdime.XDIMEContextInternal

    protected XDIMEContextInternal prepareEnvironment(
            String eventName,
            String referencedSubmission)
            throws XDIMEException {

        XDIMEContextInternal context = new XDIMEContextImpl();
        final XFormBuilder xFormBuilder = context.getXFormBuilder();
        EmulatedXFormDescriptor fd = new EmulatedXFormDescriptor();
        xFormBuilder.addModel(MODEL_ID, fd);
        context.setInitialRequestContext(requestContext);

        attributes = new XDIMEAttributesImpl(XFormElements.SETVALUE);
        attributes.setValue(XDIMESchemata.XML_EVENTS_NAMESPACE, "event", eventName);
        attributes.setValue("", XDIMEAttribute.REF.toString(), referencedSubmission);
        attributes.setValue("", XDIMEAttribute.VALUE.toString(), VALUE_FROM_ATTRIBUTE);
View Full Code Here

Examples of com.volantis.mcs.xdime.XDIMEContextInternal

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

        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

Examples of com.volantis.mcs.xdime.XDIMEContextInternal

     * @throws XDIMEException
     */
    private XDIMEContextInternal getXDIMEContextInernal()
            throws XDIMEException{

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

        xdimeContext.setInitialRequestContext(
                getMarinerRequestContext());

        htmlElement = createHTMLElement(xdimeContext);

        xdimeContext.pushElement(htmlElement);
        xdimeContext.pushElement(createHeadElement(xdimeContext));
        xdimeContext.pushElement(createTitleElement(xdimeContext));

        return xdimeContext;
    }
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.