Package springapp.repository

Examples of springapp.repository.InMemoryProductDao


  }

  public void testIncreasePriceWithNullListOfProducts() {
    try {
      productManager = new SimpleProductManager();
      productManager.setProductDao(new InMemoryProductDao(null));
      productManager.increasePrice(POSITIVE_PRICE_INCREASE);
    } catch (NullPointerException ex) {
      fail("Products list is null.");
    }
  }
View Full Code Here


  }

  public void testIncreasePriceWithEmptyListOfProducts() {
    try {
      productManager = new SimpleProductManager();
      productManager.setProductDao(new InMemoryProductDao(
          new ArrayList<Product>()));
      productManager.increasePrice(POSITIVE_PRICE_INCREASE);
    } catch (Exception ex) {
      fail("Products list is empty.");
    }
View Full Code Here

public class InventoryControllerTests extends TestCase {
  public void testHandleRequestView() throws Exception {
    InventoryController controller = new InventoryController();
    SimpleProductManager spm = new SimpleProductManager();
    spm.setProductDao(new InMemoryProductDao(new ArrayList<Product>()));
    controller.setProductManager(spm);
    ModelAndView modelAndView = controller.handleRequest(null, null);
    assertEquals("hello", modelAndView.getViewName());
    assertNotNull(modelAndView.getModel());
    Map modelMap = (Map) modelAndView.getModel().get("model");
View Full Code Here

    product = new Product();
    product.setDescription("Table");
    product.setPrice(TABLE_PRICE);
    products.add(product);

    ProductDao productDao = new InMemoryProductDao(products);
    productManager.setProductDao(productDao);
    // productManager.setProducts(products);
  }
View Full Code Here

    // productManager.setProducts(products);
  }

  public void testGetProductsWithNoProducts() {
    productManager = new SimpleProductManager();
    productManager.setProductDao(new InMemoryProductDao(null));
    assertNull(productManager.getProducts());
  }
View Full Code Here

TOP

Related Classes of springapp.repository.InMemoryProductDao

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.