Package com.volantis.mcs.utilities

Examples of com.volantis.mcs.utilities.MarinerURL


    public void testRewriteAssetURL()
        throws Exception {
        AssetURLRewriterManager aurm =
            new LocalAssetURLRewriterManager(LocalCustomAssetURLRewriter.class.
                                             getName());
        MarinerURL originalURL;
        MarinerURL expectedURL;
        MarinerURL actualURL;

        originalURL = new MarinerURL("http://www.volantis.com/example.jsp;" +
                                     "jsessionid=1234?" +
                                     "inherit=inherit&override=original");
        expectedURL = new MarinerURL(originalURL);
        expectedURL.setParameterValue("default", "default");
        expectedURL.setParameterValue("override", "override");
        expectedURL.setParameterValue("custom", "custom");
        expectedURL.setParameterValue("override", "overridden");

        actualURL = aurm.rewriteAssetURL(null, null, null, originalURL);

        assertEquals("rewritten asset URL not as",
                     expectedURL.getExternalForm(),
                     actualURL.getExternalForm());
    }
View Full Code Here


        characteristics.setMaxPageSize(maxPageSize);

        DissectionContext dissectionContext = new MyDissectionContext();

        DocumentInformationImpl docInfo = new DocumentInformationImpl();
        docInfo.setDocumentURL(new MarinerURL("hello.xml"));

        DissectedDocument intermediateDocument = (DissectedDocumentImpl)
            dissector.createDissectedDocument(dissectionContext, characteristics, inputDocument,
                                              urlManager, docInfo);
View Full Code Here

        final InternalDeviceMock deviceMock =
                new InternalDeviceMock("deviceMock", expectations);

        pageContextMock.expects.getRequestURL(false)
                .returns(new MarinerURL("defaultSegment"));
        pageContextMock.expects.getDevice().returns(deviceMock).any();
        deviceMock.expects.getPolicyValue("aggregation").returns("false").any();

        String link = protocol.getRewrittenLinkFromObject(reference, true);
View Full Code Here

        MarinerPageContextMock pageContext =
                new MarinerPageContextMock("pageContext", expectations);
        EnvironmentContextMock envContext =
                new EnvironmentContextMock("envContext", expectations);
        MarinerURL contextPathURL = new MarinerURL(contextPathString);
        protocol.setMarinerPageContext(pageContext);
        MarinerURL requestURL = new MarinerURL(requestPath);
        FormDataManagerMock fdm = new FormDataManagerMock("fdm", expectations);
        SessionFormDataMock formData = new SessionFormDataMock(
                "formData", expectations, formSpecifier, fd);

        // Set expectations.
View Full Code Here

     * MarinerRequestContext,Asset,AssetGroup,MarinerURL ) for the
     * com.volantis.mcs.runtime.DefaultAssetURLRewriter class.
     */
    public void testRewriteAssetURLDynamicVisual() throws Exception {
        AssetGroup assetGroup = new AssetGroup("Default Group");
        MarinerURL url = new MarinerURL("http://test.com:8080/this=that");

        // Asset construction
        String value = "Dynamic Value";
        DynamicVisualAsset asset = new DynamicVisualAsset();
        asset.setEncoding(DynamicVisualAsset.TV);
View Full Code Here

     * Test the rewriting with a text asset and complete url
     */
    public void testRewriteAssetURLTextAsset() throws Exception {
        AssetGroup assetGroup = new AssetGroup("Default Group");
        assetGroup.setProject(createProject("/base"));
        MarinerURL url = new MarinerURL("http://test.com:8080/this=that");

        TextAsset asset = new TextAsset("TestText");
        String expected = url.getExternalForm();

        doRewriterTest(asset, assetGroup, url, expected);
    }
View Full Code Here

        // Asset group must not be null!
        AssetGroup assetGroup = new AssetGroup("Default Group");
        assetGroup.setProject(createProject("/base"));
        assetGroup.setPrefixURL("http://prefix/");

        MarinerURL url = new MarinerURL("this=that");
        TextAsset asset = new TextAsset("TestText");
        String expected = assetGroup.getPrefixURL() + url.getExternalForm();

        doRewriterTest(asset, assetGroup, url, expected);
    }
View Full Code Here

    public void testRewriteAssetURLCompleteURLNoBaseURL() throws Exception {
        // Asset group must not be null!
        AssetGroup assetGroup = new AssetGroup("Default Group");
        assetGroup.setProject(createProject("/base"));

        MarinerURL url = new MarinerURL("http://test.com/this=that");
        TextAsset asset = new TextAsset("TestText");
        String expected = url.getExternalForm();

        // Test if this is a server side URL.
        assetGroup.setLocationType(AssetGroup.ON_SERVER);
        doRewriterTest(asset, assetGroup, url, expected);

        // Test non-relative path
        assetGroup.setLocationType(AssetGroup.ON_DEVICE);
        url = new MarinerURL("http://test.com/this=that");
        doRewriterTest(asset, assetGroup, url, expected);

        // Test if this is a client side URL.
        // This has been changed to being a device to ensure it is tested
        // as client side and not resolved to a full URL.  The test mcs-config
        // includes an absolute asset base URL for testing combinations of
        // rewrites and the previous code of using ON_SERVER failed. For
        // reader info rather than JavaDoc as this is a normal comment:
        // @see testRelativeAndAbsolutePaths()
        // @see com.volantis.testtools.config.ConfigFileBuilder.DEFAULT_ASSET_BASE_URL
        assetGroup.setLocationType(AssetGroup.ON_DEVICE);
        url = new MarinerURL("/test/this=that");
        expected = url.getExternalForm();
        doRewriterTest(asset, assetGroup, url, expected);
    }
View Full Code Here

     */
    public void testRewriteAssetURLConvertibleImage() throws Exception {
        AssetGroup assetGroup = new AssetGroup("Default Group");
        assetGroup.setProject(createProject("/base"));

        MarinerURL url = new MarinerURL("http://host.com/this=that");
        ConvertibleImageAsset asset = new ConvertibleImageAsset("Test");
        asset.setEncoding(ConvertibleImageAsset.PNG);
        asset.setValue("/image.gif");
        asset.setPixelDepth(16);
        String expected = "http://host.com/gp16/this=that?" +
View Full Code Here

     * Test the rewriting with a chart asset.
     */
    public void testRewriteAssetURLChartAsset() throws Exception {

        String strURL = "http://host.com/this=that";
        MarinerURL url = new MarinerURL(strURL);
        ChartAsset asset = new ChartAsset("Test");
        String expected = strURL;

        doRewriterTest(asset, null, url, expected);
    }
View Full Code Here

TOP

Related Classes of com.volantis.mcs.utilities.MarinerURL

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.