Package com.volantis.mcs.context

Examples of com.volantis.mcs.context.TestMarinerRequestContext


        assertTrue(o instanceof String);
        assertTrue(ENCODED.equals(o));
    }

    public void testInitializeEncodedURLs() throws Exception {
        TestMarinerRequestContext requestContext = new TestMarinerRequestContext();
        MultipartApplicationContext context = new MultipartApplicationContext(requestContext);
        assertNull("Before initialize, urls should be null",
                   context.getEncodedURLs());
        context.initializeEncodedURLs();
        assertNotNull("After initialize urls should be non-null",
View Full Code Here


    /**
     * Tests that when there is no aspect ratio width and height are not set
     * on the element.
     */
    public void testNoAspectRatio() throws Exception {
        TestMarinerRequestContext requestContext =
                createRequestContext(new ICSWithoutGIF(), "cj24", 250);

        // Create the urlc attribute for the image element implementation.
        ImageAttributes papiImageAttributes = new ImageAttributes();
        papiImageAttributes.
View Full Code Here

    /**
     * Tests that when there is an aspect ratio, width and height are set
     * on the element.
     */
    public void testAspectRatio() throws Exception {
        TestMarinerRequestContext requestContext =
                createRequestContext(new ICSWithoutGIF(), "cj24", 250);

        // Create the urlc attribute for the image element implementation.
        ImageAttributes papiImageAttributes = new ImageAttributes();
        papiImageAttributes.
View Full Code Here

    /**
     * Tests that when there is an aspect ratio and an existing width and
     * height on the element, then these values are not overridden.
     */
    public void testAspectRatioNoOverwrite() throws Exception {
        TestMarinerRequestContext requestContext =
                createRequestContext(new ICSWithoutGIF(), "cj24", 250);

        // Create the urlc attribute for the image element implementation.
        ImageAttributes papiImageAttributes = new ImageAttributes();
        papiImageAttributes.
View Full Code Here

    public void testAspectRatioRemoval() throws Exception {
        final String rule = "cj24";
        final PluggableAssetTranscoder transcoder = new ICSWithoutGIF();
        final int width = 369;
        final String urlc = "http://www.volantis.com/myImage.jpg?mcs.ar=5:4";
        TestMarinerRequestContext requestContext =
                createRequestContext(transcoder, rule, width);

        // Create the urlc attribute for the image element implementation.
        ImageAttributes papiImageAttributes = new ImageAttributes();
        papiImageAttributes.setUrlc(urlc);
View Full Code Here

     */
    private TestMarinerRequestContext createRequestContext(final PluggableAssetTranscoder transcoder,
                                                           final String rule,
                                                           final int deviceWidth)
            throws Exception {
        TestMarinerRequestContext requestContext =
                new TestMarinerRequestContext();

        final ApplicationContext appContext =
                new ApplicationContext(requestContext);
        appContext.setEncodingManager(new EncodingManager());

View Full Code Here

        }
    }

    protected MarinerPageContext createContexts(
        MultipartPackageHandler handler) throws Exception {
        TestMarinerRequestContext requestContext =
            new TestMarinerRequestContext();
        TestMarinerPageContext pageContext = new TestMarinerPageContext();
        pageContext.setVolantis(volantis);
        ApplicationContext appContext =
            new MultipartApplicationContext(requestContext);
        TestEnvironmentContext envContext =
            new TestEnvironmentContext(getClass().getName() + ".message");

        pageContext.pushRequestContext(requestContext);
        ContextInternals.setEnvironmentContext(requestContext, envContext);
        ContextInternals.setMarinerPageContext(requestContext, pageContext);
        ContextInternals.setApplicationContext(requestContext, appContext);
        appContext.setPackager(handler);
        appContext.setAssetURLRewriter(handler);
        appContext.getPackageResources().setContentType("multipart/mixed");
        appContext.setEncodingManager(encodingManager);
        envContext.setContextPathURL("http://localhost:" + port);
        requestContext.setCharacterEncoding("iso-8859-1");
        return pageContext;
    }
View Full Code Here

            final String value) throws PAPIException {
        // enable to informally test the claim in the comment above.
        // enableLog4jDebug();
       
        TestMarinerPageContext pageContext = new TestMarinerPageContext();
        MarinerRequestContext requestContext = new TestMarinerRequestContext();
        VolantisProtocol protocol = new VolantisProtocolStub() {
            public void writeOpenAnchor (
                    com.volantis.mcs.protocols.AnchorAttributes attributes) {
                assertEquals( "", value, attributes.getId());
            }
View Full Code Here

     * at all indicates that we ought to refactor this so each test just
     * sets up what it needs. Otherwise, we can have unintended side effects...
     */
    private void privateSetUp() {
        pageContext = new TestMarinerPageContext();
        requestContext = new TestMarinerRequestContext();
        ContextInternals.setMarinerPageContext(requestContext, pageContext);
        pageContext.pushRequestContext(requestContext);
        protocol.setMarinerPageContext(pageContext);
    }
View Full Code Here

    // Javadoc inherited
    public void testAddColumnIteratorPaneAttributes() throws Exception {
        // nb: column iterator pane attributes are now deprecated
        context = new TestMarinerPageContext();
        TestMarinerRequestContext requestContext =
                new TestMarinerRequestContext();
        ContextInternals.setMarinerPageContext(requestContext, context);
        context.pushRequestContext(requestContext);

        context.setDeviceName("Master");
        protocol.setMarinerPageContext(context);
View Full Code Here

TOP

Related Classes of com.volantis.mcs.context.TestMarinerRequestContext

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.