當前位置: 首頁>>代碼示例>>Java>>正文


Java SiteMapGeneratorConfigurationImpl類代碼示例

本文整理匯總了Java中org.broadleafcommerce.common.sitemap.domain.SiteMapGeneratorConfigurationImpl的典型用法代碼示例。如果您正苦於以下問題:Java SiteMapGeneratorConfigurationImpl類的具體用法?Java SiteMapGeneratorConfigurationImpl怎麽用?Java SiteMapGeneratorConfigurationImpl使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


SiteMapGeneratorConfigurationImpl類屬於org.broadleafcommerce.common.sitemap.domain包,在下文中一共展示了SiteMapGeneratorConfigurationImpl類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: testPageSiteMapGenerator

import org.broadleafcommerce.common.sitemap.domain.SiteMapGeneratorConfigurationImpl; //導入依賴的package包/類
@Test
public void testPageSiteMapGenerator() throws SiteMapException, IOException {

    Page p1 = new PageImpl();
    p1.setFullUrl("/about_us");
    Page p2 = new PageImpl();
    p2.setFullUrl("faq");
    Page p3 = new PageImpl();
    p3.setFullUrl("/new-to-hot-sauce");

    List<Page> pages = new ArrayList<Page>();
    pages.add(p1);
    pages.add(p2);
    pages.add(p3);

    PageDao pageDao = EasyMock.createMock(PageDao.class);
    EasyMock.expect(pageDao.readOnlineAndIncludedPages(5, 0, "fullUrl")).andReturn(pages);
    EasyMock.replay(pageDao);

    PageSiteMapGenerator psmg = new PageSiteMapGenerator();
    psmg.setPageDao(pageDao);
    psmg.setRowLimit(5);

    SiteMapGeneratorConfiguration smgc = new SiteMapGeneratorConfigurationImpl();
    smgc.setDisabled(false);
    smgc.setSiteMapGeneratorType(SiteMapGeneratorType.PAGE);
    smgc.setSiteMapChangeFreq(SiteMapChangeFreqType.HOURLY);
    smgc.setSiteMapPriority(SiteMapPriorityType.POINT5);

    testGenerator(smgc, psmg);

    File file1 = fileService.getResource("/sitemap_index.xml");
    File file2 = fileService.getResource("/sitemap1.xml");
    File file3 = fileService.getResource("/sitemap2.xml");

    compareFiles(file1, "src/test/resources/org/broadleafcommerce/sitemap/page/sitemap_index.xml");
    compareFiles(file2, "src/test/resources/org/broadleafcommerce/sitemap/page/sitemap1.xml");
    compareFiles(file3, "src/test/resources/org/broadleafcommerce/sitemap/page/sitemap2.xml");

}
 
開發者ID:passion1014,項目名稱:metaworks_framework,代碼行數:41,代碼來源:PageSiteMapGeneratorTest.java

示例2: testProductSiteMapGenerator

import org.broadleafcommerce.common.sitemap.domain.SiteMapGeneratorConfigurationImpl; //導入依賴的package包/類
@Test
public void testProductSiteMapGenerator() throws SiteMapException, IOException {

    Product p1 = new ProductImpl();
    p1.setUrl("/hot-sauces/sudden_death_sauce");
    Product p2 = new ProductImpl();
    p2.setUrl("hot-sauces/sweet_death_sauce");
    Product p3 = new ProductImpl();
    p3.setUrl("/hot-sauces/hoppin_hot_sauce");
    Product p4 = new ProductImpl();
    p4.setUrl("/hot-sauces/day_of_the_dead_chipotle_hot_sauce");

    List<Product> products = new ArrayList<Product>();
    products.add(p1);
    products.add(p2);
    products.add(p3);
    products.add(p4);
    
    ProductDao productDao = EasyMock.createMock(ProductDao.class);
    EasyMock.expect(productDao.readAllActiveProducts(EasyMock.eq(0), EasyMock.eq(5))).andReturn(products);
    EasyMock.replay(productDao);

    ProductSiteMapGenerator psmg = new ProductSiteMapGenerator();
    psmg.setProductDao(productDao);
    psmg.setPageSize(5);

    SiteMapGeneratorConfiguration smgc = new SiteMapGeneratorConfigurationImpl();
    smgc.setDisabled(false);
    smgc.setSiteMapGeneratorType(SiteMapGeneratorType.PRODUCT);
    smgc.setSiteMapChangeFreq(SiteMapChangeFreqType.HOURLY);
    smgc.setSiteMapPriority(SiteMapPriorityType.POINT5);

    testGenerator(smgc, psmg);

    File file1 = fileService.getResource("/sitemap_index.xml");
    File file2 = fileService.getResource("/sitemap1.xml");
    File file3 = fileService.getResource("/sitemap2.xml");

    compareFiles(file1, "src/test/resources/org/broadleafcommerce/sitemap/product/sitemap_index.xml");
    compareFiles(file2, "src/test/resources/org/broadleafcommerce/sitemap/product/sitemap1.xml");
    compareFiles(file3, "src/test/resources/org/broadleafcommerce/sitemap/product/sitemap2.xml");

}
 
開發者ID:passion1014,項目名稱:metaworks_framework,代碼行數:44,代碼來源:ProductSiteMapGeneratorTest.java

示例3: testSkuSiteMapGenerator

import org.broadleafcommerce.common.sitemap.domain.SiteMapGeneratorConfigurationImpl; //導入依賴的package包/類
@Test
public void testSkuSiteMapGenerator() throws SiteMapException, IOException {

    Product p1 = new ProductImpl();
    p1.setUrl("/hot-sauces/sudden_death_sauce");
    Sku s1 = new SkuImpl();
    p1.setDefaultSku(s1);
    
    Product p2 = new ProductImpl();
    p2.setUrl("/merchandise/hawt_like_a_habanero_mens");
    Sku s2 = new SkuImpl();
    s2.setUrlKey("/black_s");
    s2.setProduct(p2);
    Sku s3 = new SkuImpl();
    s3.setUrlKey("/black_m");
    s3.setProduct(p2);
    Sku s4 = new SkuImpl();
    s4.setUrlKey("/black_l");
    s4.setProduct(p2);
    
    List<Sku> skus = new ArrayList<Sku>();
    skus.add(s1);
    skus.add(s2);
    skus.add(s3);
    skus.add(s4);
    
    SkuDao skuDao = EasyMock.createMock(SkuDao.class);
    EasyMock.expect(skuDao.readAllActiveSkus(EasyMock.eq(0), EasyMock.eq(5))).andReturn(skus);
    EasyMock.replay(skuDao);

    SkuSiteMapGenerator ssmg = new SkuSiteMapGenerator();
    ssmg.setSkuDao(skuDao);
    ssmg.setPageSize(5);

    SiteMapGeneratorConfiguration smgc = new SiteMapGeneratorConfigurationImpl();
    smgc.setDisabled(false);
    smgc.setSiteMapGeneratorType(SiteMapGeneratorType.SKU);
    smgc.setSiteMapChangeFreq(SiteMapChangeFreqType.HOURLY);
    smgc.setSiteMapPriority(SiteMapPriorityType.POINT5);

    testGenerator(smgc, ssmg);

    File file1 = fileService.getResource("/sitemap_index.xml");
    File file2 = fileService.getResource("/sitemap1.xml");
    File file3 = fileService.getResource("/sitemap2.xml");

    compareFiles(file1, "src/test/resources/org/broadleafcommerce/sitemap/sku/sitemap_index.xml");
    compareFiles(file2, "src/test/resources/org/broadleafcommerce/sitemap/sku/sitemap1.xml");
    compareFiles(file3, "src/test/resources/org/broadleafcommerce/sitemap/sku/sitemap2.xml");

}
 
開發者ID:takbani,項目名稱:blcdemo,代碼行數:52,代碼來源:SkuSiteMapGeneratorTest.java


注:本文中的org.broadleafcommerce.common.sitemap.domain.SiteMapGeneratorConfigurationImpl類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。