Package net.geco.model

Examples of net.geco.model.Result


 
  public List<Result> buildResultForCategoryByCourses(Category cat) {
    Map<Course, List<Runner>> runnersMap = registry().getRunnersByCourseFromCategory(cat.getName());
    List<Result> results = new Vector<Result>();
    for (Entry<Course, List<Runner>> entry : runnersMap.entrySet()) {
      Result result = factory().createResult();
      result.setIdentifier(cat.getShortname() + " - " + entry.getKey().getName()); //$NON-NLS-1$
      results.add(sortResult(result, entry.getValue()));
    }
    return results;
  }
View Full Code Here


    }
    return results;
  }
 
  public Result buildResultForCategory(Category cat) {
    Result result = factory().createResult();
    result.setIdentifier(cat.getShortname());
    List<Runner> runners = registry().getRunnersFromCategory(cat);
    if( runners!=null ){
      sortResult(result, runners);
    }
    return result;
View Full Code Here

    }
    return result;
  }
 
  public Result buildResultForCourse(Course course) {
    Result result = factory().createResult();
    result.setIdentifier(course.getName());
    List<Runner> runners = registry().getRunnersFromCourse(course);
    if( runners!=null ) {
      sortResult(result, runners);
    }
    return result;
View Full Code Here

  }
 
  @Test
  public void testBlueCourseBasics() {
    Result blueResults = mullaghmeenResultBuilder.buildResultForCourse(mullaghmeenStage.registry().findCourse("Blue"));
    assertEquals("Blue", blueResults.getIdentifier());
    assertFalse(blueResults.isEmpty());
   
    assertFalse(blueResults.getRankedRunners().isEmpty());
    blueResults.clearRankedRunners();
    assertTrue(blueResults.getRankedRunners().isEmpty());

    assertFalse(blueResults.getNRRunners().isEmpty());
    blueResults.clearNrRunners();
    assertTrue(blueResults.getNRRunners().isEmpty());

//    assertFalse(blueResults.getOtherRunners().isEmpty());
//    blueResults.clearOtherRunners();
    assertTrue(blueResults.getOtherRunners().isEmpty());
   
    assertTrue(blueResults.isEmpty());   
  }
View Full Code Here

    assertTrue(blueResults.isEmpty());   
  }
 
  @Test
  public void testBlueCourseRanking() {
    Result blueResults = mullaghmeenResultBuilder.buildResultForCourse(mullaghmeenStage.registry().findCourse("Blue"));
   
    List<RankedRunner> ranking = blueResults.getRanking();
    assertEquals(32, ranking.size());
    assertEquals(1, ranking.get(0).getRank());
    assertEquals("Jack Millar", ranking.get(0).getRunnerData().getRunner().getName());
   
    // runner with same rank
View Full Code Here

    }
  }

  @Test
  public void testBlueCourseLists() {
    Result blueResults = mullaghmeenResultBuilder.buildResultForCourse(mullaghmeenStage.registry().findCourse("Blue"));

    assertEquals(0, blueResults.getOtherRunners().size());
   
    List<RunnerRaceData> nrRunners = blueResults.getNRRunners();
    assertEquals(3, nrRunners.size());
    for (RunnerRaceData runnerRaceData : nrRunners) {
      Assert.assertNotSame(Status.OK, runnerRaceData.getResult().getStatus());
    }
View Full Code Here

   
  }
 
  @Test
  public void testOrangeCourse() {
    Result orangeResults = mullaghmeenResultBuilder.buildResultForCourse(mullaghmeenStage.registry().findCourse("Orange"));
    assertEquals("Orange", orangeResults.getIdentifier());
    assertFalse(orangeResults.isEmpty());
   
    assertEquals(23, orangeResults.getRanking().size());
    assertEquals(1, orangeResults.getNRRunners().size());
    assertEquals(1, orangeResults.getOtherRunners().size());
    RunnerRaceData runnerRaceData = orangeResults.getOtherRunners().get(0);
    assertEquals("Jackie McCavana", runnerRaceData.getRunner().getName());
   
  }
View Full Code Here

  }

 
  @Test
  public void testLongCourse() {
    Result lcResults = belfieldResultBuilder.buildResultForCourse(belfieldStage.registry().findCourse("Long Course"));
    assertEquals("Long Course", lcResults.getIdentifier());
    assertFalse(lcResults.isEmpty());
   
    assertEquals(38, lcResults.getRanking().size());
    assertEquals("Gerard Butler", lcResults.getRanking().get(0).getRunnerData().getRunner().getName());
    assertEquals(13, lcResults.getNRRunners().size());
    RunnerRaceData ncRunner = belfieldStage.registry().findRunnerData("10886"); // "Ruth Lynam, N/C"
    assertTrue(ncRunner.getRunner().isNC());
    assertTrue(lcResults.getNRRunners().contains(ncRunner));
  }
View Full Code Here

TOP

Related Classes of net.geco.model.Result

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.