Examples of Race


Examples of cz.muni.fi.pa165.ddtroops.entities.Race

        assertTrue(squadS.getMembers().contains(leader));
    }

    @Test
    public void testRemoveMember(){
        Race race = getRace();
        Skill skill = getSkill();
        Hero leader = getHero(race, skill);

        squad = new Squad();
        squad.getMembers().add(leader);
View Full Code Here

Examples of cz.muni.fi.pa165.ddtroops.entities.Race

    private RaceDAO raceDAO;

    @Test
    public void testCreateValid(){

        Race race = new Race();
        race.setName("Ogloj Chorchoj");
        race.setDescription("Velky cerv");
        race.setCharisma(Byte.MIN_VALUE);
        race.setConstitution(Byte.MIN_VALUE);
        race.setDexterity(Byte.MIN_VALUE);
        race.setIntelligence(Byte.MIN_VALUE);
        race.setStrength(Byte.MIN_VALUE);
        race.setWisdom(Byte.MIN_VALUE);

        raceDAO.create(race);
        assertNotNull(race.getId());
    }
View Full Code Here

Examples of cz.muni.fi.pa165.ddtroops.entities.Race

    }

    @Test
    public void testCreateInvalid(){

        Race race = new Race();
        race.setName("Ogloj Chorchoj");
        race.setDescription("Velky cerv");

        try{
            raceDAO.create(race);
        }
        catch(Exception ex)
View Full Code Here

Examples of cz.muni.fi.pa165.ddtroops.entities.Race

    @Test
    public void testGetById()
    {

        Race race = new Race();
        race.setName("Ogloj Chorchoj");
        race.setDescription("Velky cerv");
        race.setCharisma(Byte.MIN_VALUE);
        race.setConstitution(Byte.MIN_VALUE);
        race.setDexterity(Byte.MIN_VALUE);
        race.setIntelligence(Byte.MIN_VALUE);
        race.setStrength(Byte.MIN_VALUE);
        race.setWisdom(Byte.MIN_VALUE);

        raceDAO.create(race);
        assertEquals(race, raceDAO.getById(race.getId()));
    }
View Full Code Here

Examples of cz.muni.fi.pa165.ddtroops.entities.Race

    @Test
    public void testUpdate()
    {

        Race race = new Race();
        race.setName("Ogloj");
        race.setDescription("Velky cerv");
        race.setCharisma(Byte.MIN_VALUE);
        race.setConstitution(Byte.MIN_VALUE);
        race.setDexterity(Byte.MIN_VALUE);
        race.setIntelligence(Byte.MIN_VALUE);
        race.setStrength(Byte.MIN_VALUE);
        race.setWisdom(Byte.MIN_VALUE);

        raceDAO.create(race);
        assertEquals("Ogloj", raceDAO.getById(race.getId()).getName());

        race.setName("Stupid Ogloj");
        raceDAO.update(race);
        assertEquals("Stupid Ogloj", raceDAO.getById(race.getId()).getName());
    }
View Full Code Here

Examples of cz.muni.fi.pa165.ddtroops.entities.Race

    }

    @Test
    public void testGetAll()
    {
        Race race = new Race();
        race.setName("Ogloj");
        race.setDescription("Velky cerv");
        race.setCharisma(Byte.MIN_VALUE);
        race.setConstitution(Byte.MIN_VALUE);
        race.setDexterity(Byte.MIN_VALUE);
        race.setIntelligence(Byte.MIN_VALUE);
        race.setStrength(Byte.MIN_VALUE);
        race.setWisdom(Byte.MIN_VALUE);

        raceDAO.create(race);

        Race race2 = new Race();
        race2.setName("Ogloj");
        race2.setDescription("Velky cerv");
        race2.setCharisma(Byte.MIN_VALUE);
        race2.setConstitution(Byte.MIN_VALUE);
        race2.setDexterity(Byte.MIN_VALUE);
        race2.setIntelligence(Byte.MIN_VALUE);
        race2.setStrength(Byte.MIN_VALUE);
        race2.setWisdom(Byte.MIN_VALUE);

        raceDAO.create(race2);
        List<Race> races = raceDAO.getAll();
        assertTrue(races.contains(race)&&races.contains(race2));
    }
View Full Code Here

Examples of cz.muni.fi.pa165.ddtroops.entities.Race

    private Hero createHero(){
        hero = new Hero();
        hero.setGender(Gender.MALE);
        hero.setBelief("atheist");
        hero.setProfession("miner");
        Race race = mock(Race.class);
        hero.setRace(race);
        User user = mock(User.class);
        hero.setUser(user);
        hero.setStrength(Byte.MIN_VALUE);
        hero.setDexterity(Byte.MIN_VALUE);
View Full Code Here

Examples of cz.muni.fi.pa165.ddtroops.entities.Race

        verify(dao).getAll();
        verifyNoMoreInteractions(dao);
    }

    public Race getRace(){
        Race race = new Race();
        race.setName("SimpleRace");
        race.setDescription("Descript");
        race.setStrength(new Byte("61"));
        race.setDexterity(new Byte("61"));
        race.setConstitution(new Byte("15"));
        race.setIntelligence(new Byte("51"));
        race.setWisdom(new Byte("41"));
        race.setCharisma(new Byte("14"));
        return race;
    }
View Full Code Here

Examples of de.ailis.xadrian.data.Race

                final Element element = (Element) item;
                final String id = element.attributeValue("id");
                final String colorStr = element.attributeValue("color");
                final Color color = new Color(Integer.parseInt(colorStr
                    .substring(1), 16));
                final Race race = new Race(this.game, id, color);
                this.races.add(race);
                this.raceMap.put(id, race);
            }
        }
        catch (final DocumentException e)
View Full Code Here

Examples of de.ailis.xadrian.data.Race

        // Load preference values
        for (final Map.Entry<Race, JCheckBox> entry : this.racesCheckBoxes
            .entrySet())
        {
            final Race race = entry.getKey();
            final JCheckBox checkBox = entry.getValue();
            checkBox.setSelected(!config.isRaceIgnored(race));
        }
        this.showFactoryResourcesCheckBox.setSelected(config
            .isShowFactoryResources());
        this.nightModeCheckBox.setSelected(config
            .isNightMode());
        this.themeComboBox.setSelectedItem(ThemeFactory.getInstance().getTheme(
            UIManager.getLookAndFeel().getClass().getName()));
        this.localeComboBox.setSelectedItem(new ComboBoxEntry(null,
            config.getLocale()));
        this.prodStatsComboBox.setSelectedItem(new ComboBoxEntry(null,
            config.isProdStatsPerMinute()));
        this.x3tcPlayerSectorComboBox.setSelectedIndex(config.getX3TCPlayerSector());
        this.x3apPlayerSectorComboBox.setSelectedIndex(config.getX3APPlayerSector());

        final String defaultGameId = config.getDefaultGame();
        final GameFactory gameFactory = GameFactory.getInstance();
        if (defaultGameId == null || !gameFactory.hasGame(defaultGameId))
            this.gamesComboBox.setSelectedIndex(0);
        else
            this.gamesComboBox.setSelectedItem(GameFactory.getInstance()
                .getGame(defaultGameId));

        final Result result = super.open();
        if (result == Result.OK)
        {
            // Save preference values
            for (final Map.Entry<Race, JCheckBox> entry : this.racesCheckBoxes
                .entrySet())
            {
                final Race race = entry.getKey();
                final JCheckBox checkBox = entry.getValue();
                config.setRaceIgnored(race, !checkBox.isSelected());
            }
            for (final Game game : GameFactory.getInstance().getGames())
            {
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.