Package org.broadleafcommerce.core.catalog.domain

Examples of org.broadleafcommerce.core.catalog.domain.CategoryImpl


        activeStartCal.add(Calendar.DAY_OF_YEAR, -2);
       
        Calendar activeEndCal = Calendar.getInstance();
        activeEndCal.add(Calendar.DAY_OF_YEAR, -1);
       
        Category category = new CategoryImpl();
        category.setName(categoryName);
        category.setActiveStartDate(activeStartCal.getTime());
        category = catalogService.saveCategory(category);
       
        Sku newSku = new SkuImpl();
        newSku.setName(productName);
        newSku.setRetailPrice(new Money(44.99));
View Full Code Here


public class CategoryDaoDataProvider {

    @DataProvider(name = "basicCategory")
    public static Object[][] provideBasicCategory() {
        Category category = new CategoryImpl();
        category.setName("Yuban");
        category.setDescription("Yuban");
        category.setId(1001L);
        return new Object[][] { { category } };
    }
View Full Code Here

        activeStartCal.add(Calendar.DAY_OF_YEAR, -2);
       
        Calendar activeEndCal = Calendar.getInstance();
        activeEndCal.add(Calendar.DAY_OF_YEAR, -1);
       
        Category category = new CategoryImpl();
        category.setName(categoryName);
        category.setActiveStartDate(activeStartCal.getTime());
        category = catalogService.saveCategory(category);
       
        Sku newSku = new SkuImpl();
        newSku.setName(productName);
        newSku.setRetailPrice(new Money(44.99));
View Full Code Here

    public Order createBasicOrder() {
        Order order = new OrderImpl();
        order.setId(getOrderId());
       
        Category category1 = new CategoryImpl();
        category1.setName("test1");
        category1.setId(1L);
       
        Product product1 = new ProductImpl();
       
        Sku sku1 = new SkuImpl();
        sku1.setName("test1");
        sku1.setId(1L);
        sku1.setDiscountable(true);
        sku1.setRetailPrice(new Money(19.99D));
        product1.setDefaultSku(sku1);

        CategoryProductXref xref1 = new CategoryProductXrefImpl();
        xref1.setProduct(product1);
        xref1.setCategory(category1);

        category1.getAllProductXrefs().add(xref1);
       
        Category category2 = new CategoryImpl();
        category2.setName("test2");
        category2.setId(2L);
       
        Product product2 = new ProductImpl();
       
        Sku sku2 = new SkuImpl();
        sku2.setName("test2");
        sku2.setId(2L);
        sku2.setDiscountable(true);
        sku2.setRetailPrice(new Money(29.99D));
        product2.setDefaultSku(sku2);

        CategoryProductXref xref2 = new CategoryProductXrefImpl();
        xref2.setProduct(product2);
        xref2.setCategory(category2);
       
        category2.getAllProductXrefs().add(xref2);
       
        DiscreteOrderItem orderItem1 = new DiscreteOrderItemImpl();
        orderItem1.setCategory(category1);
        orderItem1.setName("test1");
        orderItem1.setOrder(order);
View Full Code Here

     */
    public Order createOrderWithBundle() {
        Order order = new OrderImpl();
        order.setId(getOrderId());

        Category category1 = new CategoryImpl();
        category1.setName("test1");
        category1.setId(1L);

        Product product1 = new ProductImpl();

        Sku sku1 = new SkuImpl();
        sku1.setName("test1");
        sku1.setId(1L);
        sku1.setDiscountable(true);
        sku1.setRetailPrice(new Money(10D));
        product1.setDefaultSku(sku1);

        CategoryProductXref xref1 = new CategoryProductXrefImpl();
        xref1.setProduct(product1);
        xref1.setCategory(category1);
        category1.getAllProductXrefs().add(xref1);

        Category category2 = new CategoryImpl();
        category2.setName("test2");
        category2.setId(2L);

        Product product2 = new ProductImpl();

        Sku sku2 = new SkuImpl();
        sku2.setName("test2");
        sku2.setId(2L);
        sku2.setDiscountable(true);
        sku2.setRetailPrice(new Money(10D));
        product2.setDefaultSku(sku2);

        CategoryProductXref xref2 = new CategoryProductXrefImpl();
        xref2.setProduct(product2);
        xref2.setCategory(category2);
        category2.getAllProductXrefs().add(xref2);

        ProductBundle pb = new ProductBundleImpl();
        pb.setPricingModel(ProductBundlePricingModelType.ITEM_SUM);

        BundleOrderItem bundleOrderItem = new BundleOrderItemImpl();
View Full Code Here

public class CategorySiteMapGeneratorTest extends SiteMapGeneratorTest {

    @Test
    public void testCategorySiteMapGenerator() throws SiteMapException, IOException {

        Category rootCategory = new CategoryImpl();
        Category c1 = new CategoryImpl();
        c1.setUrl("/");
        c1.setDefaultParentCategory(rootCategory);
        Category c2 = new CategoryImpl();
        c2.setUrl("/hot-sauces");
        c2.setDefaultParentCategory(rootCategory);
        Category c3 = new CategoryImpl();
        c3.setUrl("merchandise");
        c3.setDefaultParentCategory(rootCategory);
        Category c4 = new CategoryImpl();
        c4.setUrl("/clearance");
        c4.setDefaultParentCategory(rootCategory);

        List<Category> categories = new ArrayList<Category>();
        categories.add(c1);
        categories.add(c2);
        categories.add(c3);
View Full Code Here

    protected void setUp() throws Exception {
        OfferDataItemProvider dataProvider = new OfferDataItemProvider();
       
        CandidateItemOfferImpl candidate = new CandidateItemOfferImpl();
       
        Category category1 = new CategoryImpl();
        category1.setName("test1");
        category1.setId(1L);
       
        Product product1 = new ProductImpl();
       
        Sku sku1 = new SkuImpl();
        sku1.setName("test1");
        sku1.setDiscountable(true);
        sku1.setRetailPrice(new Money(19.99D));
        product1.setDefaultSku(sku1);

        CategoryProductXref xref1 = new CategoryProductXrefImpl();
        xref1.setProduct(product1);
        xref1.setCategory(category1);
       
        category1.getAllProductXrefs().add(xref1);

        Category category2 = new CategoryImpl();
        category2.setName("test2");
        category2.setId(2L);
       
        Product product2 = new ProductImpl();
       
        Sku sku2 = new SkuImpl();
        sku2.setName("test2");
        sku2.setDiscountable(true);
        sku2.setRetailPrice(new Money(29.99D));
        product2.setDefaultSku(sku2);

        CategoryProductXref xref2 = new CategoryProductXrefImpl();
        xref2.setProduct(product2);
        xref2.setCategory(category2);

        category2.getAllProductXrefs().add(xref2);
       
        DiscreteOrderItemImpl orderItem1 = new DiscreteOrderItemImpl();
        orderItem1.setCategory(category1);
        orderItem1.setName("test1");
        orderItem1.setOrderItemType(OrderItemType.DISCRETE);
View Full Code Here

    @Test
    public void testOfferAppliesToItemsInCategoryAndOrderValueGreaterThanFifty() {
        //----------------------------------------------------------------------------------------------------
        // Mock up some order data
        OrderImpl order = new OrderImpl();
        CategoryImpl category = new CategoryImpl();
        category.setName("t-shirt");
        DiscreteOrderItemImpl orderItem = new DiscreteOrderItemImpl();
        ProductImpl product = new ProductImpl();
        ArrayList<CategoryProductXref> categories = new ArrayList<CategoryProductXref>();
        CategoryProductXref categoryXref = new CategoryProductXrefImpl();
        categoryXref.setProduct(product);
View Full Code Here

        DiscreteOrderItemImpl item = new DiscreteOrderItemImpl();
        Money amount = new Money(10D);
        items.add(item);
        item.setSalePrice(amount);
        ProductImpl product = new ProductImpl();
        CategoryImpl category = new CategoryImpl();
        category.setName("hat");
        product.setDefaultCategory(category);
        item.setProduct(product);
        item.setQuantity(3);

        DiscreteOrderItemImpl item2 = new DiscreteOrderItemImpl();
        Money amount2 = new Money(250D);
        items.add(item2);
        item2.setSalePrice(amount2);
        ProductImpl product2 = new ProductImpl();
        CategoryImpl category2 = new CategoryImpl();
        category2.setName("lawnmower");
        product2.setDefaultCategory(category2);
        item2.setProduct(product2);
        item2.setQuantity(1);

        HashMap<String, Object> vars = new HashMap<String, Object>();
View Full Code Here

    private CatalogService catalogService;

    @Test(groups = {"testCatalog"})
    @Transactional
    public void testCatalog() throws Exception {
        Category category = new CategoryImpl();
        category.setName("Soaps");
        category = catalogService.saveCategory(category);
        Category category2 = new CategoryImpl();
        category2.setName("Towels");
        category2 = catalogService.saveCategory(category2);
        Category category3 = new CategoryImpl();
        category3.setName("SuperCategory");
        category3 = catalogService.saveCategory(category3);

        CategoryXref temp = new CategoryXrefImpl();
        temp.setCategory(category);
        temp.setSubCategory(category3);
        category3.getAllParentCategoryXrefs().add(temp);
        category3 = catalogService.saveCategory(category3);
       
        // Test category hierarchy
        Long cat3Id = category3.getId();
        category3 = null;
        category3 = catalogService.findCategoryById(cat3Id);
        category3.getAllParentCategoryXrefs().clear();
        CategoryXref temp2 = new CategoryXrefImpl();
        temp2.setCategory(category);
        temp2.setSubCategory(category3);
        category3.getAllParentCategoryXrefs().add(temp2);
        CategoryXref temp3 = new CategoryXrefImpl();
        temp3.setCategory(category2);
        temp3.setSubCategory(category3);
        category3.getAllParentCategoryXrefs().add(temp3);
        category3 = catalogService.saveCategory(category3);
        assert category3.getAllParentCategoryXrefs().size() == 2;
       
        Product newProduct = new ProductImpl();
        Sku newDefaultSku = new SkuImpl();
        newDefaultSku = catalogService.saveSku(newDefaultSku);
        newProduct.setDefaultSku(newDefaultSku);
View Full Code Here

TOP

Related Classes of org.broadleafcommerce.core.catalog.domain.CategoryImpl

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.