Package org.newinstance.gucoach.model

Examples of org.newinstance.gucoach.model.Team


        Assert.assertEquals(2, result.size());
    }

    @Test
    public void updateFixtureTest() {
        final Team team1 = createTeam("Young Boys", 1);
        final Team team2 = createTeam("Old Girls", 2);

        final List<Team> teams = new ArrayList<Team>();
        teams.add(team1);
        teams.add(team2);
View Full Code Here


        Assert.assertEquals("2:0", result.get(0).getMatchResult());
    }

    @Test
    public void removeFixtureTest() {
        final Team team1 = createTeam("FC Barcelona", 1);
        final Team team2 = createTeam("Manchester United", 2);

        final List<Team> teams = new ArrayList<Team>();
        teams.add(team1);
        teams.add(team2);
View Full Code Here

    }

    @Test(expected = PersistenceException.class)
    // TODO test only works if executed last
    public void insertFixtureTwiceTest() {
        final Team team1 = createTeam("FC Barcelona", 1);
        final Team team2 = createTeam("Manchester United", 2);

        final List<Team> teams = new ArrayList<Team>();
        teams.add(team1);
        teams.add(team2);
View Full Code Here

        teamService = new TeamService(em);
    }

    @Test
    public void insertTeamsTest() {
        final Team team1 = createTeam("FC Barcelona", 1);
        final Team team2 = createTeam("Manchester United", 2);
        final Team team3 = createTeam("Real Madrid", 3);

        final List<Team> teams = new ArrayList<Team>();
        teams.add(team1);
        teams.add(team2);
        teams.add(team3);
View Full Code Here

        Assert.assertEquals(3, result.size());
    }

    @Test
    public void updateTeamTest() {
        final Team team1 = createTeam("FC Sion", 1);

        final List<Team> teams = new ArrayList<Team>();
        teams.add(team1);

        em.getTransaction().begin();
        teamService.insertTeams(teams);
        em.getTransaction().commit();

        // update team name
        team1.setName("Manchester United");
        em.getTransaction().begin();
        teamService.updateTeam(team1);
        em.getTransaction().commit();

        final List<Team> result = teamService.findAllTeams();
View Full Code Here

        Assert.assertEquals("Manchester United", result.get(0).getName());
    }

    @Test
    public void removeTeamTest() {
        final Team team1 = createTeam("FC Barcelona", 1);
        final List<Team> teams = new ArrayList<Team>();
        teams.add(team1);

        em.getTransaction().begin();
        teamService.insertTeams(teams);
View Full Code Here

    }

    @Test(expected = PersistenceException.class)
    // TODO test only works if executed last
    public void insertTeamsWithSameNameTest() throws Exception {
        final Team team1 = createTeam("FC Liverpool", 1);
        final Team team2 = createTeam("FC Liverpool", 2);

        final List<Team> teams = new ArrayList<Team>();
        teams.add(team1);
        teams.add(team2);
View Full Code Here

TOP

Related Classes of org.newinstance.gucoach.model.Team

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.