Examples of buy()


Examples of org.jboss.as.quickstarts.sfsb.ShoppingCart.buy()

        cart.buy(EAP, 1);
        System.out.println("Buying another \"" + EAP + "\"");
        cart.buy(EAP, 1);

        System.out.println("Buying a \"" + SOAP + "\"");
        cart.buy(SOAP, 1);

        System.out.println("\nPrint cart:");
        HashMap<String, Integer> cartContents = cart.getCartContents();
        for (String product : cartContents.keySet()) {
            System.out.println(cartContents.get(product) + "     " + product);
View Full Code Here

Examples of org.jboss.tutorial.entity.bean.ShoppingCart.buy()

   {
      InitialContext ctx = new InitialContext();
      ShoppingCart cart = (ShoppingCart) ctx.lookup("ShoppingCartBean/remote");

      System.out.println("Buying 2 memory sticks");
      cart.buy("Memory stick", 2, 500.00);
      System.out.println("Buying a laptop");
      cart.buy("Laptop", 1, 2000.00);

      System.out.println("Print cart:");
      Order order = cart.getOrder();
View Full Code Here

Examples of org.jboss.tutorial.entity.bean.ShoppingCart.buy()

      ShoppingCart cart = (ShoppingCart) ctx.lookup("ShoppingCartBean/remote");

      System.out.println("Buying 2 memory sticks");
      cart.buy("Memory stick", 2, 500.00);
      System.out.println("Buying a laptop");
      cart.buy("Laptop", 1, 2000.00);

      System.out.println("Print cart:");
      Order order = cart.getOrder();
      System.out.println("Total: $" + order.getTotal());
      for (LineItem item : order.getLineItems())
View Full Code Here

Examples of org.jboss.tutorial.injection.bean.ShoppingCart.buy()

   {
      InitialContext ctx = new InitialContext();
      ShoppingCart cart = (ShoppingCart) ctx.lookup("ShoppingCartBean/remote");

      System.out.println("Buying 1 memory stick");
      cart.buy("Memory stick", 1);
      System.out.println("Buying another memory stick");
      cart.buy("Memory stick", 1);

      System.out.println("Buying a laptop");
      cart.buy("Laptop", 1);
View Full Code Here

Examples of org.jboss.tutorial.injection.bean.ShoppingCart.buy()

      ShoppingCart cart = (ShoppingCart) ctx.lookup("ShoppingCartBean/remote");

      System.out.println("Buying 1 memory stick");
      cart.buy("Memory stick", 1);
      System.out.println("Buying another memory stick");
      cart.buy("Memory stick", 1);

      System.out.println("Buying a laptop");
      cart.buy("Laptop", 1);

      System.out.println("Print cart:");
View Full Code Here

Examples of org.jboss.tutorial.injection.bean.ShoppingCart.buy()

      cart.buy("Memory stick", 1);
      System.out.println("Buying another memory stick");
      cart.buy("Memory stick", 1);

      System.out.println("Buying a laptop");
      cart.buy("Laptop", 1);

      System.out.println("Print cart:");
      HashMap<String, Integer> fullCart = cart.getCartContents();
      for (String product : fullCart.keySet())
      {
View Full Code Here

Examples of org.jboss.tutorial.jboss_deployment_descriptor.bean.ShoppingCart.buy()

      ShoppingCart cart = (ShoppingCart) ctx.lookup("ShoppingCart");

      System.out.println("Attempting to buy 1 memory stick with incorrect password");
      try
      {
         cart.buy("Memory stick", 1);
         throw new RuntimeException("ERROR - User with incorrect password was able to access the bean");
      }
      catch (javax.ejb.EJBAccessException e)
      {
         System.out.println("Caught javax.ejb.EJBAccessException as expected");
View Full Code Here

Examples of org.jboss.tutorial.jboss_deployment_descriptor.bean.ShoppingCart.buy()

      securityClient.setSimple("bill", "password-test");
      securityClient.login();

      System.out.println("bill is a shopper, so is allowed to buy");
      System.out.println("Buying 1 memory stick");
      cart.buy("Memory stick", 1);
      System.out.println("Buying another memory stick");
      cart.buy("Memory stick", 1);

      System.out.println("Buying a laptop");
      cart.buy("Laptop", 1);
View Full Code Here

Examples of org.jboss.tutorial.jboss_deployment_descriptor.bean.ShoppingCart.buy()

      System.out.println("bill is a shopper, so is allowed to buy");
      System.out.println("Buying 1 memory stick");
      cart.buy("Memory stick", 1);
      System.out.println("Buying another memory stick");
      cart.buy("Memory stick", 1);

      System.out.println("Buying a laptop");
      cart.buy("Laptop", 1);

      System.out.println("Print cart:");
View Full Code Here

Examples of org.jboss.tutorial.jboss_deployment_descriptor.bean.ShoppingCart.buy()

      cart.buy("Memory stick", 1);
      System.out.println("Buying another memory stick");
      cart.buy("Memory stick", 1);

      System.out.println("Buying a laptop");
      cart.buy("Laptop", 1);

      System.out.println("Print cart:");
      HashMap<String, Integer> fullCart = cart.getCartContents();
      for (String product : fullCart.keySet())
      {
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.