Examples of CART


Examples of org.springframework.samples.jpetstore.domain.Cart

public class AddItemToCartAction extends BaseAction {

  public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
    CartActionForm cartForm = (CartActionForm) form;
    Cart cart = cartForm.getCart();
    String workingItemId = cartForm.getWorkingItemId();
    if (cart.containsItemId(workingItemId)) {
      cart.incrementQuantityByItemId(workingItemId);
    }
    else {
      // isInStock is a "real-time" property that must be updated
      // every time an item is added to the cart, even if other
      // item details are cached.
View Full Code Here

Examples of org.xrace.view.session.Cart

        courseDH9B, categorieDss);
  }

  public void testEmptyCart() throws Exception
  {
    Cart cart = new Cart();

    Assert.assertEquals(0.0, cart.getSousTotal().doubleValue(), 0.0);
    Assert.assertEquals(0.0, cart.getEscompte().doubleValue(), 0.0);
    Assert.assertEquals(0.0, cart.getTotal().doubleValue(), 0.0);
    Assert.assertEquals(0, cart.getItems().size());
  }
View Full Code Here

Examples of test.complex.model.Cart

        pf.setEndpoint(orderEndpoint.getEndpoint());
        pf.setType(OrderService.class);
        OrderService orderService = (OrderService) pf.getObject();

        // Prepare cart for order request
        Cart cart = new Cart();
        OrderItem orderItem = new OrderItem();
        orderItem.setCount(2);
        orderItem.setItem("Book");
        cart.getItems().add(orderItem);

        // Call the service
        OrderConfirmation orderConfirmation = orderService.order(cart);
        orderConfirmation = orderService.order(cart);
        orderConfirmation = orderService.order(cart);

        // Check that we get the expected order confirmation
        assertNotNull(orderConfirmation);
        cart = orderConfirmation.getCart();
        assertNotNull(cart);
        assertEquals(1, cart.getItems().size());
        orderItem = cart.getItems().get(0);
        assertEquals(2, orderItem.getCount());
        assertEquals("Book", orderItem.getItem());

        // Analyse the WSDL that is generated from the pojo service
        Document description = orderEndpoint.getDescription();
View Full Code Here

Examples of y1.pos.Cart

       
    int q2 = s.getAvailable( new Item("Piim", 0.55) );    // tagastab samuti 3
   
    System.out.println("Piima laoseis kasutades new item: " + q2)
   
    Cart c = new Cart();
   
    c.add(i1);     // võtame siit ühe leiva...
    c.add(i2, 2);     // ja kaks piima
    c.change(i1, 3);     // tahan ikka 3 leiba
    c.remove(i2);     // ei, piima ma vist ei taha
    c.add(i2, 1);     // siiski, võtaks ühe piima
    c.add(i2, 1);     // võtame ühe piima veel
   
    System.out.println("\nOstukorvi sisu: " + c.toString());
   
    Order outgoingOrder2 = c.checkOut();
    System.out.println("Kokku maksta: " + c.getTotal() + "€");
   
    s.dispatch(outgoingOrder2); // Soovin eemaldada laost — ei eemalda, kuna leiba pole laos piisavalt

    System.out.println("\nLaos on hetkel: " + s.toString());

   
    Cart c2 = new Cart();
    c2.add(i1, 1); // võtan 1 leiva
    c2.add(i2, 1); // 1 piima
    c2.add(i3, 1); // 1 saia
       
    System.out.println("\nOstukorvi sisu: " + c2.toString());

    Order outgoingOrder3 = c2.checkOut();

    s.dispatch(outgoingOrder3); // Eemaldab laost kogu leiva, 1 saia ja 1 piima.
    System.out.println("\nLaos on hetkel: " + s.toString()); // 2 saia, 2 piima.

View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.