Package org.apache.rave.model

Examples of org.apache.rave.model.StaticContent


    }

    @Override
    public String getContent(String key) {
        log.debug("getContent(" + key + ")");
        StaticContent content = contentMap.get(key);
        if (content == null) {
            throw new IllegalArgumentException("Invalid content key: " + key);
        }
        return content.getContent();
    }
View Full Code Here


    @Override
    public void refresh(String key) {
        log.debug("refresh(" + key + ")");
        //if the key exists in the content map, refresh it
        StaticContent item = contentMap.get(key);
        if (item != null) {
            refreshFromLocation(item);
        }
    }
View Full Code Here

            .replaceAll(VALID_URL3_TOKEN_2, VALID_URL3_TOKEN_2_REPLACEMENT);
    private StaticContent VALID_CONTENT_3;

    @Before
    public void setUp() throws URISyntaxException {
        VALID_CONTENT_1 = new StaticContent(VALID_URL1_ID, new URI(VALID_URL1), null);
        VALID_CONTENT_2 = new StaticContent(VALID_URL2_ID, new URI(VALID_URL2), null);
        VALID_CONTENT_3 = new StaticContent(VALID_URL3_ID, new URI(VALID_URL3), null);
       
        restTemplate = createNiceMock(RestTemplate.class);
    }
View Full Code Here

    public void getContent_validIdsWithReplacementTokens() throws URISyntaxException {
        //Setup our third content object to use the replacement feature and test for it
        Map<String, String> tokenReplacements = new HashMap<String, String>();
        tokenReplacements.put(VALID_URL3_TOKEN_1, VALID_URL3_TOKEN_1_REPLACEMENT);
        tokenReplacements.put(VALID_URL3_TOKEN_2, VALID_URL3_TOKEN_2_REPLACEMENT);
        VALID_CONTENT_3 = new StaticContent(VALID_URL3_ID, new URI(VALID_URL3), tokenReplacements);

        expectAllRestTemplateGetForObject();
        replay(restTemplate);

        DefaultStaticContentFetcherService service = new DefaultStaticContentFetcherService(restTemplate, Arrays.asList(VALID_CONTENT_1, VALID_CONTENT_2, VALID_CONTENT_3));
View Full Code Here

    }

    @Override
    public String getContent(String key) {
        log.debug("getContent(" + key + ")");
        StaticContent content = contentMap.get(key);
        if (content == null) {
            throw new IllegalArgumentException("Invalid content key: " + key);
        }
        return content.getContent();
    }
View Full Code Here

    @Override
    public void refresh(String key) {
        log.debug("refresh(" + key + ")");
        //if the key exists in the content map, refresh it
        StaticContent item = contentMap.get(key);
        if (item != null) {
            refreshFromLocation(item);
        }
    }
View Full Code Here

            .replaceAll(VALID_URL3_TOKEN_2, VALID_URL3_TOKEN_2_REPLACEMENT);
    private StaticContent VALID_CONTENT_3;

    @Before
    public void setUp() throws URISyntaxException {
        VALID_CONTENT_1 = new StaticContent(VALID_URL1_ID, new URI(VALID_URL1), null);
        VALID_CONTENT_2 = new StaticContent(VALID_URL2_ID, new URI(VALID_URL2), null);
        VALID_CONTENT_3 = new StaticContent(VALID_URL3_ID, new URI(VALID_URL3), null);

        restTemplate = createNiceMock(RestTemplate.class);
        consumer = createMock(StaticContentFetcherConsumer.class);
    }
View Full Code Here

    public void getContent_validIdsWithReplacementTokens() throws URISyntaxException {
        //Setup our third content object to use the replacement feature and test for it
        Map<String, String> tokenReplacements = new HashMap<String, String>();
        tokenReplacements.put(VALID_URL3_TOKEN_1, VALID_URL3_TOKEN_1_REPLACEMENT);
        tokenReplacements.put(VALID_URL3_TOKEN_2, VALID_URL3_TOKEN_2_REPLACEMENT);
        VALID_CONTENT_3 = new StaticContent(VALID_URL3_ID, new URI(VALID_URL3), tokenReplacements);

        expectAllRestTemplateGetForObject();
        replay(restTemplate);

        DefaultStaticContentFetcherService service = new DefaultStaticContentFetcherService(restTemplate, Arrays.asList(VALID_CONTENT_1, VALID_CONTENT_2, VALID_CONTENT_3));
View Full Code Here

TOP

Related Classes of org.apache.rave.model.StaticContent

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.