Examples of PriceGuide


Examples of personal.mhc.pardus.model.PriceGuide

     * Test newPriceGuide() creates a new PriceGuide.
     */
    @Test
    public void testNewPriceGuide(){
        // Call newPriceGuide() to create new PriceGuide.
        PriceGuide pg = pgs.newPriceGuide();
        // Create generic CommodityImpl.
        CommodityImpl comm;
        // Loop through all of the commodities.
        for(int i =1; i<=44; i++) {
            switch (i) {
                case  1: comm = pg.getFood();break;
                case  2: comm = pg.getEnergy();break;
                case  3: comm = pg.getWater();break;
                case  4: comm = pg.getAnimalEmbryos();break;
                case  5: comm = pg.getOre();break;
                case  6: comm = pg.getMetal();break;
                case  7: comm = pg.getElectronics();break;
                case  8: comm = pg.getRobots();break;
                case  9: comm = pg.getHeavyPlastics();break;
                case 10: comm = pg.getHandWeapons();break;
                case 11: comm = pg.getBattleweaponsParts();break;
                case 12: comm = pg.getDroidModules();break;
                case 13: comm = pg.getRadioactiveCells();break;
                case 14: comm = pg.getMedicines();break;
                case 15: comm = pg.getNebulaGas();break;
                case 16: comm = pg.getChemicalSupplies();break;
                case 17: comm = pg.getGemStones();break;
                case 18: comm = pg.getOpticalComponents();break;
                case 19: comm = pg.getLiquor();break;
                case 20: comm = pg.getHydrogenFuel();break;
                case 21: comm = pg.getExoticMatter();break;
                case 22: comm = pg.getBioWaste();break;
                case 23: comm = pg.getSlaves();break;
                case 24: comm = pg.getDrugs();break;
                case 25: comm = pg.getNutrientClods();break;
                case 26: comm = pg.getCyberneticX993Parts();break;
                case 27: comm = pg.getExoticCrystal();break;
                case 28: comm = pg.getBlueSapphireJewels();break;
                case 29: comm = pg.getRubyJewels();break;
                case 30: comm = pg.getGoldenBerylJewels();break;
                case 31: comm = pg.getNeuralTissue();break;
                case 32: comm = pg.getStimChip();break;
                case 33: comm = pg.getLeechBaby();break;
                case 34: comm = pg.getMilitaryExplosives();break;
                case 35: comm = pg.getHumanIntestines();break;
                case 36: comm = pg.getSkaariLimbs(); break;
                case 37: comm = pg.getKeldonBrains();break;
                case 38: comm = pg.getRashkirBones(); break;
                case 39: comm = pg.getPackages(); break;
                case 40: comm = pg.getFactionPackage(); break;
                case 41: comm = pg.getExplosives();break;
                case 42: comm = pg.getVIP(); break;
                case 43: comm = pg.getNeuralStimulator();break;
                case 44: comm = pg.getX993RepairDrone();break;
                default: comm = pg.getFood();break;
            }
            // Check that the commodity is established.
            assertTrue(comm.getAmount() == 0);
            assertTrue(comm.getMax() == 0);
            assertTrue(comm.getDesiredBuy() == 0);
View Full Code Here

Examples of personal.mhc.pardus.model.PriceGuide

        // Create CommodityImpl to update.
        CommodityImpl commodity = new VIP();
        // Set commodity's amount.
        commodity.setAmount(10);
        // Create a priceGuide.
        PriceGuide priceGuide = pgs.newPriceGuide();
        // Call updatePriceGuide with a PriceGuide.
        PriceGuide pg = null;
        try {
            pg = pgs.updatePriceGuide(priceGuide, commodity);
        } catch (CommodityException ex) {
            fail();
        }
        // Did it update the commodity?
        assertTrue(pg.getVIP().getAmount() == commodity.getAmount());
        // Did it leave other commodities alone?
        assertTrue(pg.getFood().getAmount() == 0);
    }
View Full Code Here

Examples of personal.mhc.pardus.model.PriceGuide

        // Create CommodityImpl to update.
        CommodityImpl commodity = new VIP();
        // Set commodity's amount.
        commodity.setAmount(10);
        // Call updatePriceGuide without having a PriceGuide.
        PriceGuide pg = null;
        try {
            pg = pgs.updatePriceGuide(null, commodity);
        } catch (CommodityException ex) {
            fail();
        }
        // Did it update the commodity?
        assertTrue(pg.getVIP().getAmount() == commodity.getAmount());
        // Did it leave other commodities alone?
        assertTrue(pg.getFood().getAmount() == 0);
    }
View Full Code Here

Examples of personal.mhc.pardus.model.PriceGuide

     *
     * @return PriceGuide Default PriceGuide.
     */
    public PriceGuide newPriceGuide() {
        // Return newly created price guide.
        return new PriceGuide();
    }
View Full Code Here

Examples of personal.mhc.pardus.model.PriceGuide

     * @return commodityPrices View to be displayed.
     */
    @RequestMapping("updateCommodityPrices")
    public String updateCommPrices(HttpServletRequest request, HttpServletResponse response){
        // Get new priceGuide to be updated.
        PriceGuide priceGuide = pgs.newPriceGuide();
        // Generic CommodityImpl object.
        CommodityImpl comm;
        // Loop through each commodity ...
        for(int i =1; i<=44; i++) {
            switch (i) {
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.