Examples of Ingredient


Examples of adios.model.Ingredient

  @Autowired
  private TableRecipeIngredientDao tableRecipeIngredientDao;
 
 
  public boolean addIngredient (Ingredient4Recipe i4r){
    Ingredient i = new Ingredient();
    i.setName(i4r.getName());
    try{
      i = ingredientDao.getIngredientForName(i);     
    }catch (Exception e){
      ingredientDao.persist(i);
      i=ingredientDao.getIngredientForName(i);
    }finally{
      i4r.setIngrdientId(i.getIngredientId());
    }
   
    TableRecipeIngredient tab= new TableRecipeIngredient();
    tab.setRecipeId(i4r.getRecipeId());
    tab.setIngredientId(i4r.getIngrdientId());
View Full Code Here

Examples of adios.model.Ingredient

   
    ArrayList<Ingredient4Recipe> i4rList = new ArrayList<Ingredient4Recipe>();
    if(ingredientTableList != null){
      Iterator<TableRecipeIngredient> it = ingredientTableList.iterator();
      TableRecipeIngredient tab=null;
      Ingredient i =null;
      while(it.hasNext()){
        Ingredient4Recipe i4rResult = new Ingredient4Recipe();
        tab = it.next();
        i = ingredientDao.getIngredientForId(tab.getIngredientId());
        i4rResult.setName(i.getName());
        i4rResult.setQuantity(tab.getIngQuantity());
        i4rResult.setUnit(tab.getIngUnit());
       
        i4rList.add(i4rResult);
      }
View Full Code Here

Examples of adios.model.Ingredient

   
    ArrayList<Ingredient4Recipe> i4rList = new ArrayList<Ingredient4Recipe>();

    ArrayList<Ingredient> ingList = ingredientDao.getMostUsedIng();
    Iterator<Ingredient> it =  ingList.iterator();
    Ingredient i =null;
   
    while(it.hasNext()){
      Ingredient4Recipe i4rResult = new Ingredient4Recipe();
      i = it.next();     
      i4rResult.setName(i.getName());
      i4rResult.setIngrdientId(i.getIngredientId());
      i4rList.add(i4rResult);
    }
   
    return i4rList; 
  }
View Full Code Here

Examples of com.manning.siia.kitchen.domain.Ingredient

  private final Recipe recipe = new Recipe("grub");

  @Test
  public void shouldNotBeSatisfiedByEmptyList() throws Exception {
    Ingredient ingredient = mock(Ingredient.class);
    recipe.addIngredient(ingredient);
    assertThat(recipe.isSatisfiedBy(Collections.<Product>emptyList()), is(false));
  }
View Full Code Here

Examples of com.manning.siia.kitchen.domain.Ingredient

    assertThat(recipe.isSatisfiedBy(Collections.<Product>emptyList()), is(false));
  }
 
  @Test
  public void shouldBeSatisfiedByCorrectIngredients() throws Exception {
    Ingredient ingredient = mock(Ingredient.class);
    Product product = mock(Product.class);
    given(ingredient.isSatisfiedBy(product)).willReturn(true);

    recipe.addIngredient(ingredient);
    assertThat(recipe.isSatisfiedBy(Arrays.asList(product)), is(true));
  }
View Full Code Here

Examples of com.manning.siia.kitchen.domain.Ingredient

  }

  @Test
  public void shouldMarshallDomain() {
    Recipe r = new Recipe("Nasi");
    Ingredient i = new Ingredient("Beef", new Amount(500, Unit.GRAMS), Type.Meat);
    r.addIngredient(i);
    r.addIngredient(new Ingredient("Red Sweet Pepper", new Amount(1, Unit.PIECES), Type.Vegetable));

    System.out.println(xstream.toXML(r));
  }
View Full Code Here

Examples of com.manning.siia.kitchen.domain.Ingredient

*/
public class RecipeObjectMother {

  public static Recipe friedEggRecipe() {
    Recipe recipe = new Recipe("fried egg");
    recipe.addIngredient(new Ingredient("egg", new Amount(1, Amount.Unit.PIECES), Ingredient.Type.Grocery));
    recipe.addIngredient(new Ingredient("butter", new Amount(20, Amount.Unit.GRAMS), Ingredient.Type.Grocery));
    return recipe;
  }
View Full Code Here

Examples of com.manning.siia.kitchen.domain.Ingredient

    return recipe;
  }

  public static Recipe steak() {
    Recipe recipe = new Recipe("steak");
    recipe.addIngredient(new Ingredient("steak", new Amount(1, Amount.Unit.PIECES), Ingredient.Type.Meat));
    recipe.addIngredient(new Ingredient("pepper", new Amount(2, Amount.Unit.GRAMS), Ingredient.Type.Grocery));
    recipe.addIngredient(new Ingredient("salt", new Amount(2, Amount.Unit.GRAMS), Ingredient.Type.Grocery));
    return recipe;
  }
View Full Code Here

Examples of com.yummynoodlebar.core.domain.Ingredient

    item.setCost(new BigDecimal("12.99"));
    item.setDescription("Crispy Noodles with Sauce - Our signature dish");
    item.setId(YUMMY_ITEM);
    item.setMinutesToPrepare(10);
    item.setName("Yummy Noodles");
    item.setIngredients(Collections.singleton(new Ingredient("Noodles", "Egg Fried Noodles.")));

    return item;
  }
View Full Code Here

Examples of demo.hw.server.data.Ingredient

   
    private List<Beverage> beverages;
   
    public JavascriptExampleImpl() {
        beverages = new ArrayList<Beverage>();
        Ingredient chalk = new Ingredient();
        chalk.setName("chalk");
        chalk.setCategory(Category.Mineral);
        Ingredient broccoli = new Ingredient();
        broccoli.setName("broccoli");
        broccoli.setCategory(Category.Vegetable);
        Ingredient locust = new Ingredient();
        locust.setName("locust");
        locust.setCategory(Category.Animal);
       
        Beverage b = new Beverage();
        b.setName("broccoli shake");
        b.setProof(20);
        Ingredient[] ingredients;
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.