1 4 package com.openedit.store.orders; 5 6 import com.openedit.WebPageRequest; 7 import com.openedit.modules.cart.CartModule; 8 import com.openedit.store.Cart; 9 import com.openedit.store.CartItem; 10 import com.openedit.store.Order; 11 import com.openedit.store.Store; 12 import com.openedit.store.StoreTestCase; 13 14 18 public class OrderExportTest extends StoreTestCase 19 { 20 21 24 public OrderExportTest(String inArg0) 25 { 26 super(inArg0); 27 } 28 public void testConvertion() throws Exception 29 { 30 35 } 36 public void testElectronicOrder() throws Exception 37 { 38 CartModule cartModule = (CartModule)getFixture().getModuleManager().getModule("CartModule"); 39 40 WebPageRequest context = getFixture().createPageRequest(); Store store = cartModule.getStore(context); 42 43 context.setRequestParameter( "productid", "1" ); 44 cartModule.updateCart( context ); 45 46 Cart cart = (Cart) context.getSessionValue( "cart" ); 47 cart.setCustomer(createCustomer()); 48 49 cartModule.processOrder(context); 50 51 Order order = (Order)context.getPageValue("order"); 53 assertNotNull(order); 54 55 CartItem item = (CartItem)order.getItems().get(0); 56 assertEquals( "electronic-delivery", item.getProduct().getShippingMethodId() ); 57 58 } 60 } 61 | Popular Tags |