Esempio n. 1
0
  /**
   * Test method for {@link
   * com.google.code.magja.service.order.OrderRemoteServiceImpl#addComment(com.google.code.magja.model.order.Order,
   * java.lang.String, java.lang.String, java.lang.Boolean)}.
   */
  @Test
  public void testAddComment() {

    Order order = new Order();
    order.setId(100000001);

    try {
      service.addComment(order, "pending", "Hello World", false);
    } catch (ServiceException e) {
      fail(e.getMessage());
    }
  }
Esempio n. 2
0
  /**
   * Test method for {@link
   * com.google.code.magja.service.order.OrderRemoteServiceImpl#cancel(com.google.code.magja.model.order.Order)}.
   */
  @Test
  public void testCancel() {

    Order order = new Order();
    order.setId(100000001);

    try {
      service.cancel(order);
    } catch (ServiceException e) {
      fail(e.getMessage());
    }
  }
Esempio n. 3
0
  /**
   * Test method for {@link
   * com.google.code.magja.service.order.OrderRemoteServiceImpl#list(com.google.code.magja.model.order.OrderFilter)}.
   */
  @Test
  public void testList() {
    try {

      List<Order> list = service.list(null);
      for (Order order : list) System.out.println(order.toString());

      // TODO: is not working tha find with filter
      // make sure to have a order with billing_name = Joao da Silva
      OrderFilter filter = new OrderFilter();
      filter.getItems().add(new OrderFilterItem("billing_name", "like", "%Silva%"));
      // filter.getItems().add(new OrderFilterItem("billing_lastname", "=", "Martins"));

      List<Order> filtered = service.list(filter);
      for (Order order : filtered) System.out.println(order.toString());

    } catch (ServiceException e) {
      fail(e.getMessage());
    }
  }