Examples of Team


Examples of org.objectweb.speedo.pobjects.detach.Team

   *   tx.rollback
   *    attach => OK
   */
  public void testVersion6() {
    logger.log(BasicLevel.DEBUG, "***************testVersion6*****************");
    Team t = new Team("T6",null,null);
    Collection players = new ArrayList();
    Player p1 = new Player("p11", t, 20);
    players.add(p1);
    Player p2 = new Player("p12", t, 30);
    players.add(p2);
    t.setPlayers(players);
    Coach c = new Coach("c6", 10, t);
    t.setCoach(c);
    PersistenceManager pm = pmf.getPersistenceManager();
    pm.currentTransaction().begin();
    pm.makePersistent(t);
    pm.currentTransaction().commit();
    //begin
    pm.currentTransaction().begin();
    //detach the team t
    Team copyOfT = (Team) pm.detachCopy(t);
    //modify the coach
    t.getCoach().setExperience(99);
    Iterator it  = t.getPlayers().iterator();
    //modify the players
    while(it.hasNext()){
      Player p = (Player) it.next();
      p.setAge(99);
    }
    //rollback
    pm.currentTransaction().rollback();
    pm.currentTransaction().begin();
    try
      //attach the team
      Team attachedTeam = (Team) pm.makePersistent(copyOfT);
        pm.currentTransaction().commit();
    }catch(Exception e){
      fail("The attached is supposed to be ok.");
    } finally {
      if (pm.currentTransaction().isActive()) {
View Full Code Here

Examples of org.objectweb.speedo.pobjects.detach.Team

   *      attach(d2) => FAIL
   *   tx.commit  
   */
  public void testVersion7() {
    logger.log(BasicLevel.DEBUG, "***************testVersion7*****************");
    Team t = new Team("T7",null,null);
    Collection players = new ArrayList();
    Player p1 = new Player("p13", t, 20);
    players.add(p1);
    Player p2 = new Player("p14", t, 30);
    players.add(p2);
    t.setPlayers(players);
    Coach c = new Coach("c7", 10, t);
    t.setCoach(c);
    PersistenceManager pm = pmf.getPersistenceManager();
    pm.currentTransaction().begin();
    pm.makePersistent(t);
    pm.currentTransaction().commit();
    //begin
    pm.currentTransaction().begin();
    //detach the team t
    Team copyOfT1 = (Team) pm.detachCopy(t);
    //detach the team t
    Team copyOfT2 = (Team) pm.detachCopy(t);
    //commit
    pm.currentTransaction().commit();
   
    //modify the copy1
    copyOfT1.getCoach().setExperience(99);
    Iterator it  = copyOfT1.getPlayers().iterator();
    //modify the players
    while(it.hasNext()){
      Player p = (Player) it.next();
      p.setAge(99);
    }
    //modify the copy2
    copyOfT2.getCoach().setExperience(99);
    it  = copyOfT2.getPlayers().iterator();
    //modify the players
    while(it.hasNext()){
      Player p = (Player) it.next();
      p.setAge(99);
    }
   
    boolean attach1OK = false;
    try{
      pm.currentTransaction().begin();
      //attach the copy1
      Team attachedTeam1 = (Team) pm.makePersistent(copyOfT1);
        pm.currentTransaction().commit();
        attach1OK = true;
        pm.currentTransaction().begin();
      //attach the copy2
      Team attachedTeam2 = (Team) pm.makePersistent(copyOfT2);
        pm.currentTransaction().commit();
        fail("The second attach is supposed to fail");
    }catch(Exception e){
      assertTrue("The first attach is supposed to be ok.", attach1OK);
      assertEquals("Wrong exception thrown: " + e.getClass(), JDOException.class, e.getClass());
View Full Code Here

Examples of org.optaplanner.examples.tennis.domain.Team

        Map<Team, Integer> teamToDayCountMap = new HashMap<Team, Integer>(tennisSolution.getTeamList().size());
        for (Team team : tennisSolution.getTeamList()) {
            teamToDayCountMap.put(team, 0);
        }
        for (TeamAssignment teamAssignment : tennisSolution.getTeamAssignmentList()) {
            Team team = teamAssignment.getTeam();
            if (team != null) {
                int count = teamToDayCountMap.get(team);
                count++;
                teamToDayCountMap.put(team, count);
            }
View Full Code Here

Examples of org.optaplanner.examples.travelingtournament.domain.Team

                    while (!clonedFirstDayMatchList.isEmpty()) {
                        List<Match> rotateList = new ArrayList<Match>(4);
                        Match startMatch = clonedFirstDayMatchList.remove(0);
                        boolean otherInFirst = false;
                        rotateList.add(startMatch);
                        Team startHomeTeam = startMatch.getHomeTeam();
                        Team nextTeamToFind = startMatch.getAwayTeam();
                        while (!startHomeTeam.equals(nextTeamToFind)) {
                            Map<Team, Match> subTeamMap = dayTeamMap.get(otherInFirst ? firstDay : secondDay);
                            Match repairMatch = subTeamMap.get(nextTeamToFind);
                            if (otherInFirst) {
                                clonedFirstDayMatchList.remove(repairMatch);
View Full Code Here

Examples of org.spout.vanilla.scoreboard.Team

      // check if the team is correct if specified
      Scoreboard board = p.get(Scoreboard.class);
      boolean correctTeam = teamName == null; // default to whether the team name is set
      if (teamName != null && board != null) {
        Team team = board.getTeam(teamName);
        if (team != null) {
          if (teamNameInverted) {
            // make sure the player is not on the specified team
            correctTeam = !team.getPlayerNames().contains(p.getName());
          } else {
            // make sure the player is on the specified team
            correctTeam = team.getPlayerNames().contains(p.getName());
          }
        }
      }

      // make sure the player has the right amount of points for the specified objectives
View Full Code Here

Examples of org.springside.examples.showcase.entity.Team

    GetTeamDetailResult result = new GetTeamDetailResult();
    try {

      Validate.notNull(id, "id参数为空");

      Team team = accountService.getTeamWithDetail(id);

      Validate.notNull(team, "项目不存在(id:" + id + ")");

      TeamDTO dto = BeanMapper.map(team, TeamDTO.class);
      result.setTeam(dto);
View Full Code Here

Examples of org.vaadin.addon.customfield.demo.data.Team

                    }
                    return field;
                }
            });

            teamForm.setItemDataSource(new BeanItem<Team>(new Team()));
        }
        return teamForm;
    }
View Full Code Here

Examples of team.team

  {

  }
  public void run()
  {
    this.TeamA = new team();
    this.TeamB = new team();
   
    this.myServer=new server();
  }
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.