Package com.volantis.mcs.utilities

Examples of com.volantis.mcs.utilities.MarinerURL


        // Create and store CSS Cache Entry.
        final CacheIdentity identity =
            cssCache.store(new CSSCacheEntry(entity, timeToLive));

        MarinerURL baseURL = getBaseURL();
        baseURL.setParameterValue("key", identity.getBase64KeyAsString());

        final String sessionType = configuration.getCssSessionType();
        if (sessionType != null && StyleSheetConfiguration.INCLUDE_SESSION_ID.equals(sessionType)) {
            baseURL = context.getSessionURLRewriter().mapToExternalURL(
                    context.getRequestContext(), baseURL);
        }
        String url = baseURL.getExternalForm();
        if (logger.isDebugEnabled()) {
            logger.debug("Generated CSS is accessible from: " + url);

        }
View Full Code Here


     * Get the base URL for the CSS servlet.
     *
     * @return The base URL for the CSS servlet.
     */
    private MarinerURL getBaseURL() {
        MarinerURL baseURL = configuration.getBaseURL();
        if (baseURL == null) {
            baseURL = new MarinerURL(contextPathURL, "CSSServlet");
        } else {
            baseURL = new MarinerURL(baseURL);
        }
        return baseURL;
    }
View Full Code Here

     *
     * @throws Exception If any test fails.
     */
    public void testBaseURL() throws Exception {
        RuntimeProject project = createNewProject(baseURLString, false);
        MarinerURL url = project.getAssetsBaseURL();
        assertNotNull("URL should exist", url);
        assertEquals("Project and test URLs should match",
                url, new MarinerURL(baseURLString));
    }
View Full Code Here

     *
     * @throws Exception If any test fails.
     */
    public void testAudioPrefixURL() throws Exception {
        RuntimeProject project = createNewProject(baseURLString, false);
        MarinerURL url = project.getPrefixURL(VariantType.AUDIO);
        assertNotNull("URL should exist", url);
        assertEquals("Project and test URLs should match",
                url, new MarinerURL(audioPrefixString));
    }
View Full Code Here

     *
     * @throws Exception If any test fails.
     */
    public void testDynamicVisualPrefixURL() throws Exception {
        RuntimeProject project = createNewProject(baseURLString, false);
        MarinerURL url = project.getPrefixURL(VariantType.VIDEO);
        assertNotNull("URL should exist", url);
        assertEquals("Project and test URLs should match",
                url, new MarinerURL(dynamicVisualPrefixString));
    }
View Full Code Here

     *
     * @throws Exception If any test fails.
     */
    public void testImagePrefixURL() throws Exception {
        RuntimeProject project = createNewProject(baseURLString, false);
        MarinerURL url = project.getPrefixURL(VariantType.IMAGE);
        assertNotNull("URL should exist", url);
        assertEquals("Project and test URLs should match",
                url, new MarinerURL(imagePrefixString));
    }
View Full Code Here

     *
     * @throws Exception If any test fails.
     */
    public void testScriptPrefixURL() throws Exception {
        RuntimeProject project = createNewProject(baseURLString, false);
        MarinerURL url = project.getPrefixURL(VariantType.SCRIPT);
        assertNotNull("URL should exist", url);
        assertEquals("Project and test URLs should match",
                url, new MarinerURL(scriptPrefixString));
    }
View Full Code Here

     *
     * @throws Exception If any test fails.
     */
    public void testTextPrefixURL() throws Exception {
        RuntimeProject project = createNewProject(baseURLString, false);
        MarinerURL url = project.getPrefixURL(VariantType.TEXT);
        assertNotNull("URL should exist", url);
        assertEquals("Project and test URLs should match",
                url, new MarinerURL(textPrefixString));
    }
View Full Code Here

     * Ensure that making a project relative path works.
     */
    public void testMakeProjectRelative() {
        RuntimeProject project = createNewProject(baseURLString, false);
        assertEquals("/c/d.mimg", project.makeProjectRelativePath(
                new MarinerURL("file:/a/b/c/d.mimg"), true));
    }
View Full Code Here

     * Ensure that making a project relative path fails.
     */
    public void testMakeProjectRelativeFailed() {
        RuntimeProject project = createNewProject(baseURLString, false);
        try {
            project.makeProjectRelativePath(new MarinerURL("file:/b/c/d.mimg"), true);
            fail("Should fail to create project relative path");
        } catch (IllegalArgumentException 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.