mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-25 06:58:39 +00:00
work commit in the middle of refactoring competitor.getBoat()
This commit is contained in:
+1
-1
@@ -75,7 +75,7 @@ public class StoreAndLoadDeviceIdentifierTest extends AbstractMongoDBTest {
|
||||
|
||||
private DeviceIdentifier storeAndLoad(DeviceIdentifier device, TypeBasedServiceFinderFactory forStoring, TypeBasedServiceFinderFactory forLoading) {
|
||||
createFactories(forStoring);
|
||||
Competitor c = DomainFactory.INSTANCE.getOrCreateCompetitor("a", "a", "a", null, null, null, null, null, /* timeOnTimeFactor */ null, /* timeOnDistanceAllowancePerNauticalMile */ null, null);
|
||||
Competitor c = DomainFactory.INSTANCE.getOrCreateCompetitor("a", "a", "a", null, null, null, null, /* timeOnTimeFactor */ null, /* timeOnDistanceAllowancePerNauticalMile */ null, null);
|
||||
regattaLog.add(new RegattaLogDeviceCompetitorMappingEventImpl(now(), now(), author, 0,
|
||||
c, device, now(), now()));
|
||||
createFactories(forLoading);
|
||||
|
||||
+1
-1
@@ -212,7 +212,7 @@ public class StoreAndLoadRaceLogEventsTest extends AbstractMongoDBTest {
|
||||
public void testStoreAndLoadRegisterCompetitorEvent() {
|
||||
RaceLogRegisterCompetitorEvent expectedEvent = new RaceLogRegisterCompetitorEventImpl(expectedEventTime,
|
||||
expectedEventTime, author, expectedId, expectedPassId, DomainFactory.INSTANCE.getOrCreateCompetitor(
|
||||
"comp", "comp", "c", null, null, null, null, null,
|
||||
"comp", "comp", "c", null, null, null, null,
|
||||
/* timeOnTimeFactor */null, /* timeOnDistanceAllowancePerNauticalMile */null, null));
|
||||
|
||||
DBObject dbObject = mongoFactory.storeRaceLogEntry(logIdentifier, expectedEvent);
|
||||
|
||||
+1
-1
@@ -60,7 +60,7 @@ public class StoreGPSFixTrackTest extends AbstractMongoDBTest {
|
||||
public void testStoreAndLoadFixes() throws TransformationException, NoCorrespondingServiceRegisteredException {
|
||||
TypeBasedServiceFinderFactory factory = new MockSmartphoneImeiServiceFinderFactory();
|
||||
AbstractLogEventAuthor author = new LogEventAuthorImpl("author", 0);
|
||||
Competitor comp = DomainFactory.INSTANCE.getOrCreateCompetitor("comp", "comp", "c", null, null, null, null, null,
|
||||
Competitor comp = DomainFactory.INSTANCE.getOrCreateCompetitor("comp", "comp", "c", null, null, null, null,
|
||||
/* timeOnTimeFactor */ null, /* timeOnDistanceAllowancePerNauticalMile */ null, null);
|
||||
Mark mark = DomainFactory.INSTANCE.getOrCreateMark("mark");
|
||||
MongoObjectFactory mongoObjectFactory = PersistenceFactory.INSTANCE.getMongoObjectFactory(getMongoService(), factory);
|
||||
|
||||
+3
-3
@@ -30,7 +30,7 @@ import com.mongodb.MongoException;
|
||||
import com.sap.sailing.domain.base.Boat;
|
||||
import com.sap.sailing.domain.base.BoatClass;
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sailing.domain.base.CompetitorWithBoat;
|
||||
import com.sap.sailing.domain.base.CompetitorAndBoat;
|
||||
import com.sap.sailing.domain.base.Course;
|
||||
import com.sap.sailing.domain.base.CourseArea;
|
||||
import com.sap.sailing.domain.base.DomainFactory;
|
||||
@@ -432,7 +432,7 @@ public class TestStoringAndLoadingEventsAndRegattas extends AbstractMongoDBTest
|
||||
// for some reason the dropping of collections doesn't work reliably on Linux... explicitly drop those collections that we depend on
|
||||
getMongoService().getDB().getCollection(CollectionNames.LEADERBOARDS.name()).drop();
|
||||
getMongoService().getDB().getCollection(CollectionNames.REGATTAS.name()).drop();
|
||||
CompetitorWithBoat hasso = AbstractLeaderboardTest.createCompetitorAndBoat("Dr. Hasso Plattner");
|
||||
CompetitorAndBoat hasso = AbstractLeaderboardTest.createCompetitorAndBoat("Dr. Hasso Plattner");
|
||||
BoatClass boatClass = DomainFactory.INSTANCE.getOrCreateBoatClass("29erXX", /* typicallyStartsUpwind */ true);
|
||||
final DynamicTrackedRegatta[] trackedRegatta = new DynamicTrackedRegatta[1];
|
||||
final DynamicTrackedRace q2YellowTrackedRace = new MockedTrackedRaceWithFixedRank(hasso, /* rank */ 1, /* started */ false, boatClass) {
|
||||
@@ -892,7 +892,7 @@ public class TestStoringAndLoadingEventsAndRegattas extends AbstractMongoDBTest
|
||||
DomainFactory.INSTANCE.createScoringScheme(ScoringSchemeType.LOW_POINT), null, OneDesignRankingMetric::new);
|
||||
|
||||
Map<Competitor, Boat> competitorsAndBoats = new LinkedHashMap<>();
|
||||
Competitor c = new CompetitorImpl("Axel", "Axel Uhl", "KYC", Color.RED, null, null, null, null, /* timeOnTimeFactor */ null, /* timeOnDistanceAllowancePerNauticalMile */ null, null);
|
||||
Competitor c = new CompetitorImpl("Axel", "Axel Uhl", "KYC", Color.RED, null, null, null, /* timeOnTimeFactor */ null, /* timeOnDistanceAllowancePerNauticalMile */ null, null);
|
||||
Boat b = new BoatImpl("123", "boat", boatClass, "GER 124");
|
||||
competitorsAndBoats.put(c, b);
|
||||
Iterable<Waypoint> waypoints = Collections.emptyList();
|
||||
|
||||
+13
-13
@@ -26,7 +26,7 @@ import com.sap.sailing.domain.base.RaceColumn;
|
||||
import com.sap.sailing.domain.base.impl.BoatClassImpl;
|
||||
import com.sap.sailing.domain.base.impl.BoatImpl;
|
||||
import com.sap.sailing.domain.base.impl.CompetitorImpl;
|
||||
import com.sap.sailing.domain.base.impl.CompetitorWithBoatImpl;
|
||||
import com.sap.sailing.domain.base.impl.CompetitorAndBoatImpl;
|
||||
import com.sap.sailing.domain.base.impl.NationalityImpl;
|
||||
import com.sap.sailing.domain.base.impl.PersonImpl;
|
||||
import com.sap.sailing.domain.base.impl.TeamImpl;
|
||||
@@ -118,18 +118,18 @@ public class TestStoringAndRetrievingLeaderboardGroups extends AbstractMongoDBTe
|
||||
Competitor wolfgang = new CompetitorImpl(123, "$$$Dr. Wolfgang+Hunger$$$", "KYC", Color.RED, null, null, new TeamImpl("STG", Collections.singleton(
|
||||
new PersonImpl("$$$Dr. Wolfgang+Hunger$$$", new NationalityImpl("GER"),
|
||||
/* dateOfBirth */ null, "This is famous Dr. Wolfgang Hunger")), new PersonImpl("Rigo van Maas", new NationalityImpl("NED"),
|
||||
/* dateOfBirth */ null, "This is Rigo, the coach")), new BoatImpl("123", "Dr. Wolfgang Hunger's boat", new BoatClassImpl("505", /* typicallyStartsUpwind */ true), null), /* timeOnTimeFactor */ null, /* timeOnDistanceAllowancePerNauticalMile */ null, null);
|
||||
/* dateOfBirth */ null, "This is Rigo, the coach")), /* timeOnTimeFactor */ null, /* timeOnDistanceAllowancePerNauticalMile */ null, null);
|
||||
Boat wolfgangsBoat = new BoatImpl("123", "Dr. Wolfgang Hunger's boat", new BoatClassImpl("505", /* typicallyStartsUpwind */ true), null);
|
||||
Competitor hasso = new CompetitorImpl(234, "Hasso Plattner", "KYC", Color.RED, null, null,
|
||||
new TeamImpl("STG", Collections.singleton(
|
||||
new PersonImpl("Hasso Plattner", new NationalityImpl("GER"),
|
||||
/* dateOfBirth */ null, "This is famous Dr. Hasso Plattner")), new PersonImpl("Lutz Patrunky", new NationalityImpl("GER"),
|
||||
/* dateOfBirth */ null, "This is Patty, the coach")), new BoatImpl("456", "Dr. Hasso Plattner's boat", new BoatClassImpl("505", /* typicallyStartsUpwind */ true), null), /* timeOnTimeFactor */ null, /* timeOnDistanceAllowancePerNauticalMile */ null, null);
|
||||
/* dateOfBirth */ null, "This is Patty, the coach")), /* timeOnTimeFactor */ null, /* timeOnDistanceAllowancePerNauticalMile */ null, null);
|
||||
Boat hassosBoat = new BoatImpl("456", "Dr. Hasso Plattner's boat", new BoatClassImpl("505", /* typicallyStartsUpwind */ true), null);
|
||||
final String raceColumnName1 = "My First Race 1";
|
||||
MockedTrackedRaceWithFixedRankAndManyCompetitors raceWithTwoCompetitors = new MockedTrackedRaceWithFixedRankAndManyCompetitors(
|
||||
new CompetitorWithBoatImpl(wolfgang,wolfgangsBoat), /* rank */ 1, /* started */ true);
|
||||
raceWithTwoCompetitors.addCompetitorAndBoat(new CompetitorWithBoatImpl(hasso,hassosBoat));
|
||||
new CompetitorAndBoatImpl(wolfgang,wolfgangsBoat), /* rank */ 1, /* started */ true);
|
||||
raceWithTwoCompetitors.addCompetitorAndBoat(new CompetitorAndBoatImpl(hasso,hassosBoat));
|
||||
|
||||
final String[] leaderboardNames = {"Leaderboard 0", "Leaderboard 1", "Leaderboard 2", "Leaderboard 3"};
|
||||
final int[] discardIndexResultsStartingWithHowManyRaces = new int[] { 5, 8 };
|
||||
@@ -177,18 +177,18 @@ public class TestStoringAndRetrievingLeaderboardGroups extends AbstractMongoDBTe
|
||||
Competitor wolfgang = new CompetitorImpl(123, "$$$Dr. Wolfgang+Hunger$$$", "KYC", Color.RED, null, null, new TeamImpl("STG", Collections.singleton(
|
||||
new PersonImpl("$$$Dr. Wolfgang+Hunger$$$", new NationalityImpl("GER"),
|
||||
/* dateOfBirth */ null, "This is famous Dr. Wolfgang Hunger")), new PersonImpl("Rigo van Maas", new NationalityImpl("NED"),
|
||||
/* dateOfBirth */ null, "This is Rigo, the coach")), new BoatImpl("123", "Dr. Wolfgang Hunger's boat", new BoatClassImpl("505", /* typicallyStartsUpwind */ true), null), /* timeOnTimeFactor */ null, /* timeOnDistanceAllowancePerNauticalMile */ null, null);
|
||||
/* dateOfBirth */ null, "This is Rigo, the coach")), /* timeOnTimeFactor */ null, /* timeOnDistanceAllowancePerNauticalMile */ null, null);
|
||||
Boat wolfgangsBoat = new BoatImpl("123", "Dr. Wolfgang Hunger's boat", new BoatClassImpl("505", /* typicallyStartsUpwind */ true), null);
|
||||
Competitor hasso = new CompetitorImpl(234, "Hasso Plattner", "KYC", Color.RED, null, null,
|
||||
new TeamImpl("STG", Collections.singleton(
|
||||
new PersonImpl("Hasso Plattner", new NationalityImpl("GER"),
|
||||
/* dateOfBirth */ null, "This is famous Dr. Hasso Plattner")), new PersonImpl("Lutz Patrunky", new NationalityImpl("GER"),
|
||||
/* dateOfBirth */ null, "This is Patty, the coach")), new BoatImpl("456", "Dr. Hasso Plattner's boat", new BoatClassImpl("505", /* typicallyStartsUpwind */ true), null), /* timeOnTimeFactor */ null, /* timeOnDistanceAllowancePerNauticalMile */ null, null);
|
||||
/* dateOfBirth */ null, "This is Patty, the coach")), /* timeOnTimeFactor */ null, /* timeOnDistanceAllowancePerNauticalMile */ null, null);
|
||||
Boat hassosBoat = new BoatImpl("456", "Dr. Hasso Plattner's boat", new BoatClassImpl("505", /* typicallyStartsUpwind */ true), null);
|
||||
final String raceColumnName1 = "My First Race 1";
|
||||
MockedTrackedRaceWithFixedRankAndManyCompetitors raceWithTwoCompetitors = new MockedTrackedRaceWithFixedRankAndManyCompetitors(
|
||||
new CompetitorWithBoatImpl(wolfgang,wolfgangsBoat), /* rank */ 1, /* started */ true);
|
||||
raceWithTwoCompetitors.addCompetitorAndBoat(new CompetitorWithBoatImpl(hasso,hassosBoat));
|
||||
new CompetitorAndBoatImpl(wolfgang,wolfgangsBoat), /* rank */ 1, /* started */ true);
|
||||
raceWithTwoCompetitors.addCompetitorAndBoat(new CompetitorAndBoatImpl(hasso,hassosBoat));
|
||||
|
||||
final String[] leaderboardNames = {"Leaderboard 0", "Leaderboard 1", "Leaderboard 2", "Leaderboard 3"};
|
||||
final int[] discardIndexResultsStartingWithHowManyRaces = new int[] { 5, 8 };
|
||||
@@ -236,18 +236,18 @@ public class TestStoringAndRetrievingLeaderboardGroups extends AbstractMongoDBTe
|
||||
Competitor wolfgang = new CompetitorImpl(123, "$$$Dr. Wolfgang+Hunger$$$", "KYC", Color.RED, null, null, new TeamImpl("STG", Collections.singleton(
|
||||
new PersonImpl("$$$Dr. Wolfgang+Hunger$$$", new NationalityImpl("GER"),
|
||||
/* dateOfBirth */ null, "This is famous Dr. Wolfgang Hunger")), new PersonImpl("Rigo van Maas", new NationalityImpl("NED"),
|
||||
/* dateOfBirth */ null, "This is Rigo, the coach")), new BoatImpl("123", "Dr. Wolfgang Hunger's boat", new BoatClassImpl("505", /* typicallyStartsUpwind */ true), null), /* timeOnTimeFactor */ null, /* timeOnDistanceAllowancePerNauticalMile */ null, null);
|
||||
/* dateOfBirth */ null, "This is Rigo, the coach")), /* timeOnTimeFactor */ null, /* timeOnDistanceAllowancePerNauticalMile */ null, null);
|
||||
Boat wolfgangsBoat = new BoatImpl("123", "Dr. Wolfgang Hunger's boat", new BoatClassImpl("505", /* typicallyStartsUpwind */ true), null);
|
||||
Competitor hasso = new CompetitorImpl(234, "Hasso Plattner", "KYC", Color.RED, null,null,
|
||||
new TeamImpl("STG", Collections.singleton(
|
||||
new PersonImpl("Hasso Plattner", new NationalityImpl("GER"),
|
||||
/* dateOfBirth */ null, "This is famous Dr. Hasso Plattner")), new PersonImpl("Lutz Patrunky", new NationalityImpl("GER"),
|
||||
/* dateOfBirth */ null, "This is Patty, the coach")), new BoatImpl("456", "Dr. Hasso Plattner's boat", new BoatClassImpl("505", /* typicallyStartsUpwind */ true), null), /* timeOnTimeFactor */ null, /* timeOnDistanceAllowancePerNauticalMile */ null, null);
|
||||
/* dateOfBirth */ null, "This is Patty, the coach")), /* timeOnTimeFactor */ null, /* timeOnDistanceAllowancePerNauticalMile */ null, null);
|
||||
Boat hassosBoat = new BoatImpl("456", "Dr. Hasso Plattner's boat", new BoatClassImpl("505", /* typicallyStartsUpwind */ true), null);
|
||||
final String raceColumnName1 = "My First Race 1";
|
||||
MockedTrackedRaceWithFixedRankAndManyCompetitors raceWithTwoCompetitors = new MockedTrackedRaceWithFixedRankAndManyCompetitors(
|
||||
new CompetitorWithBoatImpl(wolfgang,wolfgangsBoat), /* rank */ 1, /* started */ true);
|
||||
raceWithTwoCompetitors.addCompetitorAndBoat(new CompetitorWithBoatImpl(hasso,hassosBoat));
|
||||
new CompetitorAndBoatImpl(wolfgang,wolfgangsBoat), /* rank */ 1, /* started */ true);
|
||||
raceWithTwoCompetitors.addCompetitorAndBoat(new CompetitorAndBoatImpl(hasso,hassosBoat));
|
||||
|
||||
final String[] leaderboardNames = {"Leaderboard 0", "Leaderboard 1", "Leaderboard 2", "Leaderboard 3"};
|
||||
final int[] discardIndexResultsStartingWithHowManyRaces = new int[] { 5, 8 };
|
||||
|
||||
+17
-17
@@ -15,13 +15,13 @@ import org.junit.Test;
|
||||
import com.mongodb.MongoException;
|
||||
import com.sap.sailing.domain.base.Boat;
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sailing.domain.base.CompetitorWithBoat;
|
||||
import com.sap.sailing.domain.base.CompetitorAndBoat;
|
||||
import com.sap.sailing.domain.base.DomainFactory;
|
||||
import com.sap.sailing.domain.base.RaceColumn;
|
||||
import com.sap.sailing.domain.base.impl.BoatClassImpl;
|
||||
import com.sap.sailing.domain.base.impl.BoatImpl;
|
||||
import com.sap.sailing.domain.base.impl.CompetitorImpl;
|
||||
import com.sap.sailing.domain.base.impl.CompetitorWithBoatImpl;
|
||||
import com.sap.sailing.domain.base.impl.CompetitorAndBoatImpl;
|
||||
import com.sap.sailing.domain.base.impl.DomainFactoryImpl;
|
||||
import com.sap.sailing.domain.base.impl.NationalityImpl;
|
||||
import com.sap.sailing.domain.base.impl.PersonImpl;
|
||||
@@ -79,14 +79,14 @@ public class TestStoringAndRetrievingLeaderboards extends AbstractMongoDBTest {
|
||||
final int[] discardIndexResultsStartingWithHowManyRaces = new int[] { 5, 8 };
|
||||
FlexibleLeaderboardImpl leaderboard = new FlexibleLeaderboardImpl(leaderboardName, new ThresholdBasedResultDiscardingRuleImpl(discardIndexResultsStartingWithHowManyRaces),
|
||||
new LowPoint(), null);
|
||||
CompetitorWithBoat wolfgangWithBoat = createCompetitorAndBoat();
|
||||
CompetitorAndBoat wolfgangWithBoat = createCompetitorAndBoat();
|
||||
Competitor hasso = new CompetitorImpl(234, "Hasso Plattner", "KYC", Color.RED, null, null,
|
||||
new TeamImpl("STG", Collections.singleton(
|
||||
new PersonImpl("Hasso Plattner", new NationalityImpl("GER"),
|
||||
/* dateOfBirth */ null, "This is famous Dr. Hasso Plattner")), new PersonImpl("Lutz Patrunky", new NationalityImpl("GER"),
|
||||
/* dateOfBirth */ null, "This is Patty, the coach")), new BoatImpl("123", "Dr. Hasso Plattner's boat", new BoatClassImpl("505", /* typicallyStartsUpwind */ true), null), /* timeOnTimeFactor */ null, /* timeOnDistanceAllowancePerNauticalMile */ null, null);
|
||||
/* dateOfBirth */ null, "This is Patty, the coach")), /* timeOnTimeFactor */ null, /* timeOnDistanceAllowancePerNauticalMile */ null, null);
|
||||
Boat hassosBoat = new BoatImpl("123", "Dr. Hasso Plattner's boat", new BoatClassImpl("505", /* typicallyStartsUpwind */ true), null);
|
||||
CompetitorWithBoat hassoWithBoat = new CompetitorWithBoatImpl(hasso, hassosBoat);
|
||||
CompetitorAndBoat hassoWithBoat = new CompetitorAndBoatImpl(hasso, hassosBoat);
|
||||
final String raceColumnName1 = "My First Race 1";
|
||||
MockedTrackedRaceWithFixedRankAndManyCompetitors raceWithTwoCompetitors = new MockedTrackedRaceWithFixedRankAndManyCompetitors(wolfgangWithBoat, /* rank */ 1, /* started */ true);
|
||||
raceWithTwoCompetitors.addCompetitorAndBoat(hassoWithBoat);
|
||||
@@ -124,7 +124,7 @@ public class TestStoringAndRetrievingLeaderboards extends AbstractMongoDBTest {
|
||||
final int[] discardIndexResultsStartingWithHowManyRaces = new int[] { 5, 8 };
|
||||
FlexibleLeaderboardImpl leaderboard = new FlexibleLeaderboardImpl(leaderboardName, new ThresholdBasedResultDiscardingRuleImpl(discardIndexResultsStartingWithHowManyRaces),
|
||||
new LowPoint(), null);
|
||||
CompetitorWithBoat competitorWithBoat = createCompetitorAndBoat();
|
||||
CompetitorAndBoat competitorWithBoat = createCompetitorAndBoat();
|
||||
TrackedRace raceWithOneCompetitor1 = new MockedTrackedRaceWithFixedRank(competitorWithBoat, /* rank */ 1, /* started */ true);
|
||||
final String raceColumnName1 = "My First Race 1";
|
||||
leaderboard.addRace(raceWithOneCompetitor1, raceColumnName1, /* medalRace */ false);
|
||||
@@ -172,7 +172,7 @@ public class TestStoringAndRetrievingLeaderboards extends AbstractMongoDBTest {
|
||||
final int[] discardIndexResultsStartingWithHowManyRaces = new int[] { 5, 8 };
|
||||
FlexibleLeaderboardImpl leaderboard = new FlexibleLeaderboardImpl(leaderboardName, new ThresholdBasedResultDiscardingRuleImpl(discardIndexResultsStartingWithHowManyRaces),
|
||||
new LowPoint(), null);
|
||||
CompetitorWithBoat competitorWithBoat = createCompetitorAndBoat();
|
||||
CompetitorAndBoat competitorWithBoat = createCompetitorAndBoat();
|
||||
TrackedRace raceWithOneCompetitor = new MockedTrackedRaceWithFixedRank(competitorWithBoat, /* rank */ 1, /* started */ true);
|
||||
leaderboard.addRace(raceWithOneCompetitor, raceColumnName, /* medalRace */ false);
|
||||
leaderboard.setCarriedPoints(competitorWithBoat.getCompetitor(), carriedPointsForWolfgangHunger);
|
||||
@@ -197,7 +197,7 @@ public class TestStoringAndRetrievingLeaderboards extends AbstractMongoDBTest {
|
||||
final int[] discardIndexResultsStartingWithHowManyRaces = new int[] { 5, 8 };
|
||||
FlexibleLeaderboardImpl leaderboard = new FlexibleLeaderboardImpl(leaderboardName, new ThresholdBasedResultDiscardingRuleImpl(discardIndexResultsStartingWithHowManyRaces),
|
||||
new LowPoint(), null);
|
||||
CompetitorWithBoat competitorWithBoat = createCompetitorAndBoat();
|
||||
CompetitorAndBoat competitorWithBoat = createCompetitorAndBoat();
|
||||
TrackedRace raceWithOneCompetitor1 = new MockedTrackedRaceWithFixedRank(competitorWithBoat, /* rank */ 1, /* started */ true);
|
||||
TrackedRace raceWithOneCompetitor2 = new MockedTrackedRaceWithFixedRank(competitorWithBoat, /* rank */ 2, /* started */ true);
|
||||
leaderboard.addRace(raceWithOneCompetitor1, raceColumnName1, /* medalRace */ false);
|
||||
@@ -223,7 +223,7 @@ public class TestStoringAndRetrievingLeaderboards extends AbstractMongoDBTest {
|
||||
final int[] discardIndexResultsStartingWithHowManyRaces = new int[] { 5, 8 };
|
||||
FlexibleLeaderboardImpl leaderboard = new FlexibleLeaderboardImpl(leaderboardName, new ThresholdBasedResultDiscardingRuleImpl(discardIndexResultsStartingWithHowManyRaces),
|
||||
new LowPoint(), null);
|
||||
CompetitorWithBoat competitor = createCompetitorAndBoat();
|
||||
CompetitorAndBoat competitor = createCompetitorAndBoat();
|
||||
TrackedRace raceWithOneCompetitor1 = new MockedTrackedRaceWithFixedRank(competitor, /* rank */ 1, /* started */ true);
|
||||
TrackedRace raceWithOneCompetitor2 = new MockedTrackedRaceWithFixedRank(competitor, /* rank */ 2, /* started */ true);
|
||||
leaderboard.addRace(raceWithOneCompetitor1, raceColumnName1, /* medalRace */ false);
|
||||
@@ -249,7 +249,7 @@ public class TestStoringAndRetrievingLeaderboards extends AbstractMongoDBTest {
|
||||
final int[] discardIndexResultsStartingWithHowManyRaces = new int[] { 5, 8 };
|
||||
FlexibleLeaderboardImpl leaderboard = new FlexibleLeaderboardImpl(leaderboardName, new ThresholdBasedResultDiscardingRuleImpl(discardIndexResultsStartingWithHowManyRaces),
|
||||
new LowPoint(), null);
|
||||
CompetitorWithBoat competitorWithBoat = createCompetitorAndBoat();
|
||||
CompetitorAndBoat competitorWithBoat = createCompetitorAndBoat();
|
||||
TrackedRace raceWithOneCompetitor1 = new MockedTrackedRaceWithFixedRank(competitorWithBoat, /* rank */ 1, /* started */ true);
|
||||
TrackedRace raceWithOneCompetitor2 = new MockedTrackedRaceWithFixedRank(competitorWithBoat, /* rank */ 2, /* started */ true);
|
||||
leaderboard.addRace(raceWithOneCompetitor1, raceColumnName1, /* medalRace */ false);
|
||||
@@ -276,7 +276,7 @@ public class TestStoringAndRetrievingLeaderboards extends AbstractMongoDBTest {
|
||||
final int[] discardIndexResultsStartingWithHowManyRaces = new int[] { 5, 8 };
|
||||
FlexibleLeaderboardImpl leaderboard = new FlexibleLeaderboardImpl(leaderboardName, new ThresholdBasedResultDiscardingRuleImpl(discardIndexResultsStartingWithHowManyRaces),
|
||||
new LowPoint(), null);
|
||||
CompetitorWithBoat competitorWithBoat = createCompetitorAndBoat();
|
||||
CompetitorAndBoat competitorWithBoat = createCompetitorAndBoat();
|
||||
TrackedRace raceWithOneCompetitor1 = new MockedTrackedRaceWithFixedRank(competitorWithBoat, /* rank */ 1, /* started */ true);
|
||||
TrackedRace raceWithOneCompetitor2 = new MockedTrackedRaceWithFixedRank(competitorWithBoat, /* rank */ 2, /* started */ true);
|
||||
leaderboard.addRace(raceWithOneCompetitor1, raceColumnName1, /* medalRace */ false);
|
||||
@@ -314,7 +314,7 @@ public class TestStoringAndRetrievingLeaderboards extends AbstractMongoDBTest {
|
||||
final int[] discardIndexResultsStartingWithHowManyRaces = new int[] { 5, 8 };
|
||||
FlexibleLeaderboardImpl leaderboard = new FlexibleLeaderboardImpl(leaderboardName, new ThresholdBasedResultDiscardingRuleImpl(discardIndexResultsStartingWithHowManyRaces),
|
||||
new LowPoint(), null);
|
||||
CompetitorWithBoat competitorWithBoat = createCompetitorAndBoat();
|
||||
CompetitorAndBoat competitorWithBoat = createCompetitorAndBoat();
|
||||
TrackedRace raceWithOneCompetitor1 = new MockedTrackedRaceWithFixedRank(competitorWithBoat, /* rank */ 1, /* started */ true);
|
||||
TrackedRace raceWithOneCompetitor2 = new MockedTrackedRaceWithFixedRank(competitorWithBoat, /* rank */ 2, /* started */ true);
|
||||
RaceColumn r1 = leaderboard.addRace(raceWithOneCompetitor1, raceColumnName1, /* medalRace */ false);
|
||||
@@ -359,10 +359,10 @@ public class TestStoringAndRetrievingLeaderboards extends AbstractMongoDBTest {
|
||||
Competitor competitor = domainFactory.getOrCreateCompetitor(123, "$$$Dr. Wolfgang+Hunger$$$", "WH", Color.RED, "someone@nowhere.de", null, new TeamImpl("STG", Collections.singleton(
|
||||
new PersonImpl("$$$Dr. Wolfgang+Hunger$$$", new NationalityImpl("GER"),
|
||||
/* dateOfBirth */ null, "This is famous Dr. Wolfgang Hunger")), new PersonImpl("Rigo van Maas", new NationalityImpl("NED"),
|
||||
/* dateOfBirth */ null, "This is Rigo, the coach")), new BoatImpl("123", "Dr. Wolfgang Hunger's boat", new BoatClassImpl("505", /* typicallyStartsUpwind */ true), null),
|
||||
/* dateOfBirth */ null, "This is Rigo, the coach")),
|
||||
/* timeOnTimeFactor */ null, /* timeOnDistanceAllowancePerNauticalMile */ null, null);
|
||||
Boat boat = domainFactory.getOrCreateBoat(competitor, "Dr. Wolfgang Hunger's boat", new BoatClassImpl("505", /* typicallyStartsUpwind */ true), null, null);
|
||||
CompetitorWithBoat competitorWithBoat = new CompetitorWithBoatImpl(competitor, boat);
|
||||
CompetitorAndBoat competitorWithBoat = new CompetitorAndBoatImpl(competitor, boat);
|
||||
TrackedRace raceWithOneCompetitor1 = new MockedTrackedRaceWithFixedRank(competitorWithBoat, /* rank */ 1, /* started */ true);
|
||||
TrackedRace raceWithOneCompetitor2 = new MockedTrackedRaceWithFixedRank(competitorWithBoat, /* rank */ 2, /* started */ true);
|
||||
leaderboard.addRace(raceWithOneCompetitor1, raceColumnName1, /* medalRace */ false);
|
||||
@@ -385,12 +385,12 @@ public class TestStoringAndRetrievingLeaderboards extends AbstractMongoDBTest {
|
||||
assertEquals(maxPointsReason, loadedLeaderboard2.getScoreCorrection().getMaxPointsReason(competitor, loadedColumn2, MillisecondsTimePoint.now()));
|
||||
}
|
||||
|
||||
private CompetitorWithBoat createCompetitorAndBoat() {
|
||||
private CompetitorAndBoat createCompetitorAndBoat() {
|
||||
Competitor competitor = new CompetitorImpl(123, "$$$Dr. Wolfgang+Hunger$$$", "KYC", Color.RED, null, null, new TeamImpl("STG", Collections.singleton(
|
||||
new PersonImpl("$$$Dr. Wolfgang+Hunger$$$", new NationalityImpl("GER"),
|
||||
/* dateOfBirth */ null, "This is famous Dr. Wolfgang Hunger")), new PersonImpl("Rigo van Maas", new NationalityImpl("NED"),
|
||||
/* dateOfBirth */ null, "This is Rigo, the coach")), new BoatImpl("123", "Dr. Wolfgang Hunger's boat", new BoatClassImpl("505", /* typicallyStartsUpwind */ true), null), /* timeOnTimeFactor */ null, /* timeOnDistanceAllowancePerNauticalMile */ null, null);
|
||||
/* dateOfBirth */ null, "This is Rigo, the coach")), /* timeOnTimeFactor */ null, /* timeOnDistanceAllowancePerNauticalMile */ null, null);
|
||||
Boat boat = new BoatImpl(competitor.getId(), "Dr. Wolfgang Hunger's boat", new BoatClassImpl("505", /* typicallyStartsUpwind */ true), null);
|
||||
return new CompetitorWithBoatImpl(competitor, boat);
|
||||
return new CompetitorAndBoatImpl(competitor, boat);
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -307,7 +307,7 @@ public class TestStoringAndRetrievingRaceLogInLeaderboards extends RaceLogMongoD
|
||||
@Test
|
||||
public void testStoreAndRetrieveSimpleLeaderboardWithRaceLogFinishPositioningConfirmedEvent() {
|
||||
Competitor storedCompetitor = DomainFactory.INSTANCE.getOrCreateCompetitor(UUID.randomUUID(), "SAP Extreme Sailing Team", "SAP",
|
||||
Color.RED, "someone@nowhere.de", null, null, null,
|
||||
Color.RED, "someone@nowhere.de", null, null,
|
||||
/* timeOnTimeFactor */ null, /* timeOnDistanceAllowancePerNauticalMile */ null, null);
|
||||
CompetitorResults storedPositioningList = new CompetitorResultsImpl();
|
||||
storedPositioningList.add(new CompetitorResultImpl(storedCompetitor.getId(), storedCompetitor.getName(), /* rank */
|
||||
@@ -331,7 +331,7 @@ public class TestStoringAndRetrievingRaceLogInLeaderboards extends RaceLogMongoD
|
||||
@Test
|
||||
public void testStoreAndRetrieveSimpleLeaderboardWithRaceLogFinishPositioningConfirmedEventWithContents() {
|
||||
Competitor storedCompetitor = DomainFactory.INSTANCE.getOrCreateCompetitor(UUID.randomUUID(), "SAP Extreme Sailing Team", "SAP",
|
||||
Color.RED, "someone@nowhere.de", null, null, null,
|
||||
Color.RED, "someone@nowhere.de", null, null,
|
||||
/* timeOnTimeFactor */ null, /* timeOnDistanceAllowancePerNauticalMile */ null, null);
|
||||
CompetitorResults storedPositioningList = new CompetitorResultsImpl();
|
||||
final TimePoint finishingTimePoint = MillisecondsTimePoint.now();
|
||||
@@ -402,7 +402,7 @@ public class TestStoringAndRetrievingRaceLogInLeaderboards extends RaceLogMongoD
|
||||
@Test
|
||||
public void testStoreAndRetrieveSimpleLeaderboardWithRaceLogFinishPositioningListChangeEvent() {
|
||||
Competitor storedCompetitor = DomainFactory.INSTANCE.getOrCreateCompetitor(UUID.randomUUID(), "SAP Extreme Sailing Team", "SAP", Color.RED,
|
||||
"someone@nowhere.de", null, null, null, /* timeOnTimeFactor */ null, /* timeOnDistanceAllowancePerNauticalMile */ null, null);
|
||||
"someone@nowhere.de", null, null, /* timeOnTimeFactor */ null, /* timeOnDistanceAllowancePerNauticalMile */ null, null);
|
||||
CompetitorResults storedPositioningList = new CompetitorResultsImpl();
|
||||
storedPositioningList.add(new CompetitorResultImpl(storedCompetitor.getId(), storedCompetitor.getName(), /* rank */
|
||||
1, MaxPointsReason.NONE, /* score */ null, /* finishingTimePoint */null, /* comment */null));
|
||||
|
||||
+2
-2
@@ -208,7 +208,7 @@ public class TestStoringAndRetrievingRaceLogInRegatta extends AbstractTestStorin
|
||||
@Test
|
||||
public void testStoreAndRetrieveRegattaWithRaceLogFinishPositioningListChangeEvent() {
|
||||
Competitor storedCompetitor = DomainFactory.INSTANCE.getOrCreateCompetitor(UUID.randomUUID(), "SAP Extreme Sailing Team", "SAP", Color.RED,
|
||||
"someone@nowhere.de", null, null, null, /* timeOnTimeFactor */ null, /* timeOnDistanceAllowancePerNauticalMile */ null, null);
|
||||
"someone@nowhere.de", null, null, /* timeOnTimeFactor */ null, /* timeOnDistanceAllowancePerNauticalMile */ null, null);
|
||||
CompetitorResults storedPositioningList = new CompetitorResultsImpl();
|
||||
storedPositioningList.add(new CompetitorResultImpl(storedCompetitor.getId(), storedCompetitor.getName(), /* rank */ 1, MaxPointsReason.NONE, /* score */ null, /* finishingTime */ null, /* comment */ null));
|
||||
RaceLogFinishPositioningListChangedEvent event = new RaceLogFinishPositioningListChangedEventImpl(now, author, 0, storedPositioningList);
|
||||
@@ -232,7 +232,7 @@ public class TestStoringAndRetrievingRaceLogInRegatta extends AbstractTestStorin
|
||||
@Test
|
||||
public void testStoreAndRetrieveRegattaWithRaceLogFinishPositioningConfirmedEvent() {
|
||||
Competitor storedCompetitor = DomainFactory.INSTANCE.getOrCreateCompetitor(UUID.randomUUID(), "SAP Extreme Sailing Team", "SAP", Color.RED,
|
||||
"someone@nowhere.de", null, null, null, /* timeOnTimeFactor */ null, /* timeOnDistanceAllowancePerNauticalMile */ null, null);
|
||||
"someone@nowhere.de", null, null, /* timeOnTimeFactor */ null, /* timeOnDistanceAllowancePerNauticalMile */ null, null);
|
||||
CompetitorResults storedPositioningList = new CompetitorResultsImpl();
|
||||
storedPositioningList.add(new CompetitorResultImpl(storedCompetitor.getId(), storedCompetitor.getName(), /* rank */ 1, MaxPointsReason.NONE, /* score */ null, /* finishingTime */ null, /* comment */ null));
|
||||
RaceLogFinishPositioningConfirmedEvent event = new RaceLogFinishPositioningConfirmedEventImpl(now, author, 0, storedPositioningList);
|
||||
|
||||
Reference in New Issue
Block a user