Examples of Food


Examples of org.jpacman.framework.model.Food

   * @throws FactoryException Never.
   */
  @Test
  public void testC5_PlayerMovesToFood() throws FactoryException {   
    Game game = makePlay("P.#");
    Food food = (Food) game.getBoard().spriteAt(1, 0);
    Player player = game.getPlayer();

    game.movePlayer(Direction.RIGHT);
   
    Tile newTile = tileAt(game, 1, 0);
    assertEquals("Food added", food.getPoints(), player.getPoints());
    assertEquals("Player moved", newTile.topSprite(), player);
    assertFalse("Food gone", newTile.containsSprite(food));
  }
View Full Code Here

Examples of personal.mhc.pardus.model.commodities.Food

        // Generic CommodityImpl object.
        CommodityImpl comm;
        // Loop through each commodity ...
        for(int i =1; i<=44; i++) {
            switch (i) {
                case  1: comm = new Food();break;
                case  2: comm = new Energy();break;
                case  3: comm = new Water();break;
                case  4: comm = new AnimalEmbryos();break;
                case  5: comm = new Ore();break;
                case  6: comm = new Metal();break;
                case  7: comm = new Electronics();break;
                case  8: comm = new Robots();break;
                case  9: comm = new HeavyPlastics();break;
                case 10: comm = new HandWeapons();break;
                case 11: comm = new BattleweaponsParts();break;
                case 12: comm = new DroidModules();break;
                case 13: comm = new RadioactiveCells();break;
                case 14: comm = new Medicines();break;
                case 15: comm = new NebulaGas();break;
                case 16: comm = new ChemicalSupplies();break;
                case 17: comm = new GemStones();break;
                case 18: comm = new OpticalComponents();break;
                case 19: comm = new Liquor();break;
                case 20: comm = new HydrogenFuel();break;
                case 21: comm = new ExoticMatter();break;
                case 22: comm = new BioWaste();break;
                case 23: comm = new Slaves();break;
                case 24: comm = new Drugs();break;
                case 25: comm = new NutrientClods();break;
                case 26: comm = new CyberneticX993Parts();break;
                case 27: comm = new ExoticCrystal();break;
                case 28: comm = new BlueSapphireJewels();break;
                case 29: comm = new RubyJewels();break;
                case 30: comm = new GoldenBerylJewels();break;
                case 31: comm = new NeuralTissue();break;
                case 32: comm = new StimChip();break;
                case 33: comm = new LeechBaby();break;
                case 34: comm = new MilitaryExplosives();break;
                case 35: comm = new HumanIntestines();break;
                case 36: comm = new SkaariLimbs(); break;
                case 37: comm = new KeldonBrains();break;
                case 38: comm = new RashkirBones(); break;
                case 39: comm = new Packages(); break;
                case 40: comm = new FactionPackage(); break;
                case 41: comm = new Explosives();break;
                case 42: comm = new VIP(); break;
                case 43: comm = new NeuralStimulator();break;
                case 44: comm = new X993RepairDrone();break;
                default: comm = new Food();break;
            }
            // And get the amount and max.
            // Set these values for the commodity.
            comm.setAmount(new Integer(request.getParameter(comm.getName()+"Amount")));
            comm.setMax(new Integer(request.getParameter(comm.getName()+"Max")));
View Full Code Here

Examples of test.mixed.Food

@Controller
public class FoodController {

  @RequestMapping(value = "/food")
  public String getFood(HttpServletRequest request) {
    Food food = new Food();
    food.setName("orange");
    food.setPrice(3.5);
    request.setAttribute("fruit", food);
    return "/food.jsp";
  }
View Full Code Here

Examples of test.mixed.Food

  public String after(HttpServletRequest request, HttpServletResponse response) {
    log.info("after 1 [{}]", request.getRequestURI());
    String fruit = request.getParameter("strawberry");
    if ("strawberry".equals(fruit)) {
      Food food = foodService.getFood("strawberry");
      request.setAttribute("fruit", food);
      return "/foodView.jsp";
    } else
      return null;
  }
View Full Code Here

Examples of test.mixed.Food

      "mixed-config.xml");

  @Test
  public void testInject() {
    FoodService2 foodService2 = applicationContext.getBean("foodService2");
    Food food = foodService2.getFood("apple");
    log.debug(food.getName());
    Assert.assertThat(food.getPrice(), is(5.3));
   
    FoodService foodService = applicationContext.getBean(FoodService.class);
    food = foodService.getFood("strawberry");
    log.debug(food.getName());
    Assert.assertThat(food.getPrice(), is(10.00));
  }
View Full Code Here

Examples of test.mixed.Food

  private FoodService foodService;

  public String before(HttpServletRequest request, HttpServletResponse response) {
    log.info("before 0 [{}]", request.getRequestURI());
    String fruit = request.getParameter("fruit");
    Food food = foodService.getFood(fruit);
    if(food != null) {
      request.setAttribute("fruit", food);
      return "/food.jsp";
    } else
      return null;
View Full Code Here

Examples of test.mixed.Food

    request.setContextPath("/firefly");
    request.setMethod("GET");
    MockHttpServletResponse response = new MockHttpServletResponse();
    dispatcherController.dispatcher(request, response);
    log.info(request.getDispatcherTarget());
    Food food = (Food) request.getAttribute("fruit");
    Assert.assertThat(food.getName(), is("orange"));

  }
View Full Code Here

Examples of test.mixed.Food

    request.setMethod("GET");
    request.setParameter("fruit", "apple");
    MockHttpServletResponse response = new MockHttpServletResponse();
    dispatcherController.dispatcher(request, response);
    log.info(request.getDispatcherTarget());
    Food food = (Food) request.getAttribute("fruit");
    Assert.assertThat(food.getName(), is("apple"));
    Assert.assertThat(food.getPrice(), is(5.3));
  }
View Full Code Here

Examples of test.mixed.Food

    request.setMethod("GET");
    request.setParameter("strawberry", "strawberry");
    MockHttpServletResponse response = new MockHttpServletResponse();
    dispatcherController.dispatcher(request, response);
    log.info(request.getDispatcherTarget());
    Food food = (Food) request.getAttribute("fruit");
    Assert.assertThat(food.getName(), is("strawberry"));
    Assert.assertThat(food.getPrice(), is(10.00));
    Assert.assertThat(request.getDispatcherTarget(),
        is("/WEB-INF/page/foodView.jsp"));

  }
View Full Code Here

Examples of test.mixed.Food

    request.setContextPath("/firefly");
    request.setMethod("GET");
    request.setParameter("fruit", "apple");
    MockHttpServletResponse response = new MockHttpServletResponse();
    dispatcherController.dispatcher(request, response);
    Food food = (Food) request.getAttribute("fruit");
    Assert.assertThat(food.getName(), is("apple"));
    Assert.assertThat(food.getPrice(), is(5.3));
    Assert.assertThat(request.getDispatcherTarget(),
        is("/WEB-INF/page/food.jsp"));
  }
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.