mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-17 11:19:15 +00:00
bug5867/bug5866: made center/radius final fields in CourseArea
This commit is contained in:
+21
-2
@@ -2,6 +2,8 @@ package com.sap.sailing.domain.common.dto;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import com.sap.sailing.domain.common.Position;
|
||||
import com.sap.sse.common.Distance;
|
||||
import com.sap.sse.security.shared.dto.NamedDTO;
|
||||
|
||||
/**
|
||||
@@ -9,19 +11,36 @@ import com.sap.sse.security.shared.dto.NamedDTO;
|
||||
*/
|
||||
public class CourseAreaDTO extends NamedDTO {
|
||||
private static final long serialVersionUID = -5279690838452265454L;
|
||||
public UUID id;
|
||||
private UUID id;
|
||||
private Position centerPosition;
|
||||
private Distance radius;
|
||||
|
||||
@Deprecated
|
||||
CourseAreaDTO() {} // for GWT RPC serialization only
|
||||
|
||||
public CourseAreaDTO(String name) {
|
||||
public CourseAreaDTO(UUID id, String name) {
|
||||
this(id, name, /* centerPosition */ null, /* radius */ null);
|
||||
}
|
||||
|
||||
public CourseAreaDTO(UUID id, String name, Position centerPosition, Distance radius) {
|
||||
super(name);
|
||||
this.id = id;
|
||||
this.centerPosition = centerPosition;
|
||||
this.radius = radius;
|
||||
}
|
||||
|
||||
public UUID getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public Position getCenterPosition() {
|
||||
return centerPosition;
|
||||
}
|
||||
|
||||
public Distance getRadius() {
|
||||
return radius;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
|
||||
+14
-7
@@ -194,6 +194,7 @@ import com.sap.sailing.domain.common.DeviceIdentifier;
|
||||
import com.sap.sailing.domain.common.MarkType;
|
||||
import com.sap.sailing.domain.common.MaxPointsReason;
|
||||
import com.sap.sailing.domain.common.PassingInstruction;
|
||||
import com.sap.sailing.domain.common.Position;
|
||||
import com.sap.sailing.domain.common.RaceIdentifier;
|
||||
import com.sap.sailing.domain.common.RankingMetrics;
|
||||
import com.sap.sailing.domain.common.RegattaName;
|
||||
@@ -1295,15 +1296,21 @@ public class DomainObjectFactoryImpl implements DomainObjectFactory {
|
||||
private CourseArea loadCourseArea(Document courseAreaDBObject) {
|
||||
final String name = (String) courseAreaDBObject.get(FieldNames.COURSE_AREA_NAME.name());
|
||||
final UUID id = (UUID) courseAreaDBObject.get(FieldNames.COURSE_AREA_ID.name());
|
||||
final CourseArea result = baseDomainFactory.getOrCreateCourseArea(id, name);
|
||||
final Document centerPosition = (Document) courseAreaDBObject.get(FieldNames.COURSE_AREA_CENTER_POSITION.name());
|
||||
if (centerPosition != null) {
|
||||
result.setCenterPosition(loadPosition(centerPosition));
|
||||
final Document centerPositionDoc = (Document) courseAreaDBObject.get(FieldNames.COURSE_AREA_CENTER_POSITION.name());
|
||||
final Position centerPosition;
|
||||
final Distance radius;
|
||||
if (centerPositionDoc != null) {
|
||||
centerPosition = loadPosition(centerPositionDoc);
|
||||
} else {
|
||||
centerPosition = null;
|
||||
}
|
||||
final Number radius = (Number) courseAreaDBObject.get(FieldNames.COURSE_AREA_RADIUS_IN_METERS.name());
|
||||
if (radius != null) {
|
||||
result.setRadius(new MeterDistance(radius.doubleValue()));
|
||||
final Number radiusNumber = (Number) courseAreaDBObject.get(FieldNames.COURSE_AREA_RADIUS_IN_METERS.name());
|
||||
if (radiusNumber != null) {
|
||||
radius = new MeterDistance(radiusNumber.doubleValue());
|
||||
} else {
|
||||
radius = null;
|
||||
}
|
||||
final CourseArea result = baseDomainFactory.getOrCreateCourseArea(id, name, centerPosition, radius);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -123,7 +123,7 @@ public class CreateAndTrackWithRaceLogTest extends RaceLogTrackingTestHelper {
|
||||
/* canBoatsOfCompetitorsChangePerRace */ true, CompetitorRegistrationType.CLOSED,
|
||||
/* registrationLinkSecret */ null, /* startDate */null, /* endDate */null, UUID.randomUUID(),
|
||||
Collections.<Series> singletonList(series), /* persistent */ true, new HighPoint(),
|
||||
service.getBaseDomainFactory().getOrCreateCourseArea(UUID.randomUUID(), "Default").getId(),
|
||||
service.getBaseDomainFactory().getOrCreateCourseArea(UUID.randomUUID(), "Default", /* centerPosition */ null, /* radius */ null).getId(),
|
||||
/* buoyZoneRadiusInHullLengths */2.0, /* useStartTimeInference */true,
|
||||
/* controlTrackingFromStartAndFinishTimes */ false, /* autoRestartTrackingUponCompetitorSetChange */ false, OneDesignRankingMetric::new);
|
||||
series.addRaceColumn(columnName, /* trackedRegattaRegistry */null);
|
||||
|
||||
-4
@@ -29,14 +29,10 @@ public interface CourseArea extends Positioned, NamedWithID, IsManagedByCache<Sh
|
||||
*/
|
||||
Position getCenterPosition();
|
||||
|
||||
void setCenterPosition(Position centerPosition);
|
||||
|
||||
/**
|
||||
* If {@link #getCenterPosition()} delivers a non-{@code null} result, asking the radius of this course area, which
|
||||
* is assumed to be of circulare shape, can make sense. If may, however, not be defined in which case {@code null}
|
||||
* is returned.
|
||||
*/
|
||||
Distance getRadius();
|
||||
|
||||
void setRadius(Distance radius);
|
||||
}
|
||||
|
||||
+3
-1
@@ -7,7 +7,9 @@ import java.util.UUID;
|
||||
import com.sap.sailing.domain.abstractlog.race.analyzing.impl.RaceLogResolver;
|
||||
import com.sap.sailing.domain.common.MarkType;
|
||||
import com.sap.sailing.domain.common.PassingInstruction;
|
||||
import com.sap.sailing.domain.common.Position;
|
||||
import com.sap.sse.common.Color;
|
||||
import com.sap.sse.common.Distance;
|
||||
|
||||
public interface SharedDomainFactory<RLR extends RaceLogResolver> extends CompetitorFactory, BoatFactory {
|
||||
|
||||
@@ -98,7 +100,7 @@ public interface SharedDomainFactory<RLR extends RaceLogResolver> extends Compet
|
||||
* If a {@link CourseArea} with the given id already exists, it is returned. Otherwise a new {@link CourseArea}
|
||||
* is created.
|
||||
*/
|
||||
CourseArea getOrCreateCourseArea(UUID id, String name);
|
||||
CourseArea getOrCreateCourseArea(UUID id, String name, Position centerPosition, Distance radius);
|
||||
|
||||
/**
|
||||
* Gets the {@link CourseArea} with passed id; if there is no such {@link CourseArea} <code>null</code> will be returned.
|
||||
|
||||
+6
-14
@@ -12,12 +12,14 @@ public class CourseAreaImpl extends NamedImpl implements CourseArea {
|
||||
private static final long serialVersionUID = 5912385360170509150L;
|
||||
|
||||
private final UUID id;
|
||||
private Position centerPosition; // no setter yet; TODO bug5867; clarify replication etc.
|
||||
private Distance radius; // no setter yet; TODO bug5867; clarify replication etc.
|
||||
private final Position centerPosition;
|
||||
private final Distance radius;
|
||||
|
||||
public CourseAreaImpl(String name, UUID id) {
|
||||
public CourseAreaImpl(String name, UUID id, Position centerPosition, Distance radius) {
|
||||
super(name);
|
||||
this.id = id;
|
||||
this.centerPosition = centerPosition;
|
||||
this.radius = radius;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -30,23 +32,13 @@ public class CourseAreaImpl extends NamedImpl implements CourseArea {
|
||||
return centerPosition;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCenterPosition(Position centerPosition) {
|
||||
this.centerPosition = centerPosition;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Distance getRadius() {
|
||||
return radius;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRadius(Distance radius) {
|
||||
this.radius = radius;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CourseArea resolve(SharedDomainFactory<?> domainFactory) {
|
||||
return domainFactory.getOrCreateCourseArea(id, getName());
|
||||
return domainFactory.getOrCreateCourseArea(id, getName(), /* centerPosition */ null, /* radius */ null);
|
||||
}
|
||||
}
|
||||
|
||||
+4
-2
@@ -31,7 +31,9 @@ import com.sap.sailing.domain.base.Waypoint;
|
||||
import com.sap.sailing.domain.common.BoatClassMasterdata;
|
||||
import com.sap.sailing.domain.common.MarkType;
|
||||
import com.sap.sailing.domain.common.PassingInstruction;
|
||||
import com.sap.sailing.domain.common.Position;
|
||||
import com.sap.sse.common.Color;
|
||||
import com.sap.sse.common.Distance;
|
||||
import com.sap.sse.common.Duration;
|
||||
import com.sap.sse.common.WithID;
|
||||
|
||||
@@ -369,10 +371,10 @@ public class SharedDomainFactoryImpl<RLR extends RaceLogResolver> implements Sha
|
||||
}
|
||||
|
||||
@Override
|
||||
public CourseArea getOrCreateCourseArea(UUID courseAreaId, String name) {
|
||||
public CourseArea getOrCreateCourseArea(UUID courseAreaId, String name, Position centerPosition, Distance radius) {
|
||||
CourseArea result = getExistingCourseAreaById(courseAreaId);
|
||||
if (result == null) {
|
||||
result = new CourseAreaImpl(name, courseAreaId);
|
||||
result = new CourseAreaImpl(name, courseAreaId, centerPosition, radius);
|
||||
courseAreaCache.put(courseAreaId, result);
|
||||
}
|
||||
return result;
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ public class BravoFixTrackAverageRideHeightTest {
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
track = new BravoFixTrackImpl<>(new CourseAreaImpl("Test", UUID.randomUUID()),
|
||||
track = new BravoFixTrackImpl<>(new CourseAreaImpl("Test", UUID.randomUUID(), /* centerPosition */ null, /* radius */ null),
|
||||
"test", /* hasExtendedFixes */ true);
|
||||
track.add(createFix(10l, /* rideHeightPort */ 0.6, /* rideHeightStarboard */ 0.6, /* heel */ 10., /* pitch */ 5.));
|
||||
track.add(createFix(20l, /* rideHeightPort */ 0.6, /* rideHeightStarboard */ 0.6, /* heel */ 10., /* pitch */ 5.));
|
||||
|
||||
+1
-1
@@ -143,7 +143,7 @@ public class BravoFixTrackFoiledDistanceCacheTest {
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
final CourseAreaImpl courseArea = new CourseAreaImpl("Test", UUID.randomUUID());
|
||||
final CourseAreaImpl courseArea = new CourseAreaImpl("Test", UUID.randomUUID(), /* centerPosition */ null, /* radius */ null);
|
||||
gpsTrack = new DynamicGPSFixMovingTrackImpl<>(courseArea, /* millisecondsOverWhichToAverage */ 15000);
|
||||
track = new BravoFixTrackImpl<CourseArea>(courseArea, "test", /* hasExtendedFixes */ true, gpsTrack) {
|
||||
private static final long serialVersionUID = 1473560197177750211L;
|
||||
|
||||
+2
-2
@@ -18,7 +18,7 @@ import com.sap.sse.common.impl.MillisecondsTimePoint;
|
||||
public class BravoFixTrackInterpolationWithNullTest {
|
||||
@Test
|
||||
public void testFixesWithNonNullFieldsAreSelected() {
|
||||
DynamicBravoFixTrack<CourseArea> track = new BravoFixTrackImpl<>(new CourseAreaImpl("Test", UUID.randomUUID()),
|
||||
DynamicBravoFixTrack<CourseArea> track = new BravoFixTrackImpl<>(new CourseAreaImpl("Test", UUID.randomUUID(), /* centerPosition */ null, /* radius */ null),
|
||||
"test", /* hasExtendedFixes */ true);
|
||||
track.add(createFix(10l, 5., null));
|
||||
track.add(createFix(20l, null, 7.));
|
||||
@@ -28,7 +28,7 @@ public class BravoFixTrackInterpolationWithNullTest {
|
||||
|
||||
@Test
|
||||
public void testFixesWithNonNullFieldsAreSelectedForMultipleNullsInARow() {
|
||||
DynamicBravoFixTrack<CourseArea> track = new BravoFixTrackImpl<>(new CourseAreaImpl("Test", UUID.randomUUID()),
|
||||
DynamicBravoFixTrack<CourseArea> track = new BravoFixTrackImpl<>(new CourseAreaImpl("Test", UUID.randomUUID(), /* centerPosition */ null, /* radius */ null),
|
||||
"test", /* hasExtendedFixes */ true);
|
||||
track.add(createFix(10l, 5., null));
|
||||
track.add(createFix(20l, null, 7.));
|
||||
|
||||
+1
-1
@@ -73,7 +73,7 @@ public class CompetitorProviderCacheInvalidationTest extends AbstractLeaderboard
|
||||
@Before
|
||||
public void setUp() {
|
||||
final CourseAreaImpl courseArea = new CourseAreaImpl(
|
||||
"Test Course Area", UUID.randomUUID());
|
||||
"Test Course Area", UUID.randomUUID(), /* centerPosition */ null, /* radius */ null);
|
||||
flexibleLeaderboard = new FlexibleLeaderboardImpl("Test Flexible Leaderboard",
|
||||
new ThresholdBasedResultDiscardingRuleImpl(new int[0]), new LowPoint(), courseArea);
|
||||
competitorProviderFlexibleLeaderboard = new CompetitorProviderFromRaceColumnsAndRegattaLike(flexibleLeaderboard);
|
||||
|
||||
+1
-1
@@ -80,7 +80,7 @@ public class CourseUpdateDuringNonAtomicSerializationTest implements Serializabl
|
||||
new BoatClassImpl(BoatClassMasterdata._5O5),
|
||||
/* canBoatsOfCompetitorsChangePerRace */ true, CompetitorRegistrationType.CLOSED,
|
||||
/*startDate*/ null, /*endDate*/ null, /* trackedRegattaRegistry */ null,
|
||||
new LowPoint(), UUID.randomUUID(), new CourseAreaImpl("Alpha", UUID.randomUUID()),
|
||||
new LowPoint(), UUID.randomUUID(), new CourseAreaImpl("Alpha", UUID.randomUUID(), /* centerPosition */ null, /* radius */ null),
|
||||
/* registrationLinkSecret */ UUID.randomUUID().toString());
|
||||
TrackedRegatta trackedRegatta = new TrackedRegattaImpl(regatta);
|
||||
RaceDefinition race = new RaceDefinitionImpl("Test Race", course, regatta.getBoatClass(), Collections.<Competitor,Boat>emptyMap());
|
||||
|
||||
+3
-3
@@ -32,7 +32,7 @@ public class LeaderboardDTOCacheInvalidationTest {
|
||||
final String newName = "My New Leaderboard";
|
||||
FlexibleLeaderboard l = new FlexibleLeaderboardImpl(oldName,
|
||||
new ThresholdBasedResultDiscardingRuleImpl(new int[0]), new LowPoint(),
|
||||
new CourseAreaImpl("My Course Area", UUID.randomUUID()));
|
||||
new CourseAreaImpl("My Course Area", UUID.randomUUID(), /* centerPosition */ null, /* radius */ null));
|
||||
final TimePoint now = MillisecondsTimePoint.now();
|
||||
LeaderboardDTO dto = l.getLeaderboardDTO(now, Collections.<String> emptySet(),
|
||||
/* addOverallDetails */ false, /* trackedRegattaRegistry */ null, DomainFactory.INSTANCE,
|
||||
@@ -54,7 +54,7 @@ public class LeaderboardDTOCacheInvalidationTest {
|
||||
final TimePoint now = MillisecondsTimePoint.now();
|
||||
FlexibleLeaderboard l = new FlexibleLeaderboardImpl(name,
|
||||
new ThresholdBasedResultDiscardingRuleImpl(new int[0]), new LowPoint(),
|
||||
new CourseAreaImpl("My Course Area", UUID.randomUUID()));
|
||||
new CourseAreaImpl("My Course Area", UUID.randomUUID(), /* centerPosition */ null, /* radius */ null));
|
||||
final LeaderboardGroup lg = new LeaderboardGroupImpl("LG", "LG", /* displayName */ null, /* displayGroupsInReverseOrder */ false, Arrays.asList(l));
|
||||
final LeaderboardGroupMetaLeaderboard seriesLb = new LeaderboardGroupMetaLeaderboard(lg, new LowPoint(), new ThresholdBasedResultDiscardingRuleImpl(new int[0]));
|
||||
LeaderboardDTO seriesLbDtoBeforeDisplayNameIsSet = seriesLb.getLeaderboardDTO(now, Collections.<String> emptySet(),
|
||||
@@ -87,7 +87,7 @@ public class LeaderboardDTOCacheInvalidationTest {
|
||||
final String name = "My Flexible Leaderboard";
|
||||
FlexibleLeaderboard l = new FlexibleLeaderboardImpl(name,
|
||||
new ThresholdBasedResultDiscardingRuleImpl(new int[0]), new LowPoint(),
|
||||
new CourseAreaImpl("My Course Area", UUID.randomUUID()));
|
||||
new CourseAreaImpl("My Course Area", UUID.randomUUID(), /* centerPosition */ null, /* radius */ null));
|
||||
final String oldRaceColumnName = "Old";
|
||||
FlexibleRaceColumn rc = l.addRaceColumn(oldRaceColumnName, /* medalRace */ false);
|
||||
final TimePoint now = MillisecondsTimePoint.now();
|
||||
|
||||
+1
-1
@@ -2110,7 +2110,7 @@ public class LeaderboardScoringAndRankingTest extends LeaderboardScoringAndRanki
|
||||
/* canBoatsOfCompetitorsChangePerRace */ true, CompetitorRegistrationType.CLOSED,
|
||||
/*startDate*/ null, /*endDate*/ null, trackedRegattaRegistry,
|
||||
new HighPointFirstGets10Or8AndLastBreaksTie(), "578876345345",
|
||||
new CourseAreaImpl("Humba", UUID.randomUUID()),
|
||||
new CourseAreaImpl("Humba", UUID.randomUUID(), /* centerPosition */ null, /* radius */ null),
|
||||
/* registrationLinkSecret */ UUID.randomUUID().toString());
|
||||
trackedRegattaRegistry.getOrCreateTrackedRegatta(dummyRegatta);
|
||||
Competitor[] competitors = createCompetitors(10).toArray(new Competitor[0]);
|
||||
|
||||
+1
-1
@@ -92,7 +92,7 @@ public class MarkPassingUpdateFromRaceLogFinishPositioingListTest extends Abstra
|
||||
new WindImpl(/* position */null, new MillisecondsTimePoint(dateFormat.parse("05/01/2014-09:02:00")),
|
||||
new KnotSpeedWithBearingImpl(10, new DegreeBearingImpl(269))),
|
||||
new WindSourceImpl(WindSourceType.WEB));
|
||||
leaderboard = new FlexibleLeaderboardImpl("Test", new ThresholdBasedResultDiscardingRuleImpl(new int[0]), new LowPoint(), new CourseAreaImpl("Here", UUID.randomUUID()));
|
||||
leaderboard = new FlexibleLeaderboardImpl("Test", new ThresholdBasedResultDiscardingRuleImpl(new int[0]), new LowPoint(), new CourseAreaImpl("Here", UUID.randomUUID(), /* centerPosition */ null, /* radius */ null));
|
||||
final RaceColumn raceColumn = leaderboard.addRace(getTrackedRace(), "R", /* medalRace */ false);
|
||||
raceLog = raceColumn.getRaceLog(raceColumn.getFleets().iterator().next());
|
||||
}
|
||||
|
||||
+1
-1
@@ -162,7 +162,7 @@ public class OfflineSerializationTest extends AbstractSerializationTest {
|
||||
// see bug 1605
|
||||
@Test
|
||||
public void testSerializingOverallLeaderboardWithFactorOnColumn() throws ClassNotFoundException, IOException {
|
||||
Leaderboard leaderboard = new FlexibleLeaderboardImpl("Test Leaderboard", new ThresholdBasedResultDiscardingRuleImpl(new int[] { 3, 5 }), new HighPoint(), new CourseAreaImpl("Alpha", UUID.randomUUID()));
|
||||
Leaderboard leaderboard = new FlexibleLeaderboardImpl("Test Leaderboard", new ThresholdBasedResultDiscardingRuleImpl(new int[] { 3, 5 }), new HighPoint(), new CourseAreaImpl("Alpha", UUID.randomUUID(), /* centerPosition */ null, /* radius */ null));
|
||||
LeaderboardGroup leaderboardGroup = new LeaderboardGroupImpl("LeaderboardGroup", "Test Leaderboard Group", /* displayName */ null, /* displayGroupsInReverseOrder */ false, Arrays.asList(new Leaderboard[] { leaderboard }));
|
||||
final LeaderboardGroupMetaLeaderboard overallLeaderboard =
|
||||
new LeaderboardGroupMetaLeaderboard(leaderboardGroup, new HighPoint(),
|
||||
|
||||
+1
-1
@@ -110,7 +110,7 @@ public class RegattaLogEventNotificationForwardingTest extends AbstractSerializa
|
||||
|
||||
private FlexibleLeaderboard createTestLeaderboard() {
|
||||
FlexibleLeaderboard leaderboard = new FlexibleLeaderboardImpl("Flexible Leaderboard", new ThresholdBasedResultDiscardingRuleImpl(new int[0]),
|
||||
new LowPoint(), new CourseAreaImpl("Test Course Area", UUID.randomUUID()));
|
||||
new LowPoint(), new CourseAreaImpl("Test Course Area", UUID.randomUUID(), /* centerPosition */ null, /* radius */ null));
|
||||
return leaderboard;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -224,7 +224,7 @@ public abstract class TrackBasedTest {
|
||||
final boolean isMedal = false;
|
||||
final boolean persistent = false;
|
||||
final ScoringScheme scoringScheme = new LowPoint();
|
||||
final CourseArea courseArea = new CourseAreaImpl("Course Area", UUID.randomUUID());
|
||||
final CourseArea courseArea = new CourseAreaImpl("Course Area", UUID.randomUUID(), /* centerPosition */ null, /* radius */ null);
|
||||
final Serializable regatteId = "regatta id";
|
||||
Iterable<? extends Fleet> regattaFleets = Collections.singleton(regattaFleet);
|
||||
TrackedRegattaRegistry trackedRegattaRegistry = mock(TrackedRegattaRegistry.class);
|
||||
|
||||
+1
-1
@@ -92,7 +92,7 @@ public abstract class AbstractExportedPositionsBasedTest {
|
||||
/* isFleetsCanRunInParallel */ true, Collections.singleton(new FleetImpl("Default")),
|
||||
/* raceColumnNames */ Collections.singleton("R1"), /* trackedRegattaRegistry */ null)),
|
||||
/* persistent */ false, new LowPoint(), UUID.randomUUID(),
|
||||
new CourseAreaImpl("CourseArea", UUID.randomUUID()), OneDesignRankingMetric::new,
|
||||
new CourseAreaImpl("CourseArea", UUID.randomUUID(), /* centerPosition */ null, /* radius */ null), OneDesignRankingMetric::new,
|
||||
/* registrationLinkSecret */ UUID.randomUUID().toString());
|
||||
final DynamicTrackedRegatta trackedRegatta = new DynamicTrackedRegattaImpl(regatta);
|
||||
final Map<CompetitorWithBoat, Iterable<GPSFixMoving>> competitorsAndTheirTracks = createCompetitorsAndTheirTracks(competitorPositionsJson, boatClass);
|
||||
|
||||
+1
-1
@@ -77,7 +77,7 @@ public class AbstractMockedRaceMarkPassingTest {
|
||||
/* canBoatsOfCompetitorsChangePerRace */ true, CompetitorRegistrationType.CLOSED,
|
||||
/*startDate*/ null, /*endDate*/ null, Arrays.asList(new SeriesImpl("Series", true, /* isFleetsCanRunInParallel */ true, Arrays.asList(new FleetImpl("fleet")),
|
||||
new ArrayList<String>(), null)),
|
||||
true, new HighPoint(), "ID", new CourseAreaImpl("area", new UUID(5, 5)), OneDesignRankingMetric::new,
|
||||
true, new HighPoint(), "ID", new CourseAreaImpl("area", new UUID(5, 5), /* centerPosition */ null, /* radius */ null), OneDesignRankingMetric::new,
|
||||
/* registrationLinkSecret */ UUID.randomUUID().toString());
|
||||
Course course = new CourseImpl("course", waypoints);
|
||||
Map<Competitor, Boat> competitorsAndBoats = new HashMap<>();
|
||||
|
||||
+2
-2
@@ -74,10 +74,10 @@ public class RegattaRaceStatesSettingsDialogComponent implements SettingsDialogC
|
||||
boolean allCheckboxesSelected = true;
|
||||
for (CourseAreaDTO courseAreaDTO : courseAreas) {
|
||||
CheckBox checkBox = dialog.createCheckbox(courseAreaDTO.getName());
|
||||
boolean isCourseAreaVisible = Util.contains(initialSettings.getVisibleCourseAreas(), courseAreaDTO.id);
|
||||
boolean isCourseAreaVisible = Util.contains(initialSettings.getVisibleCourseAreas(), courseAreaDTO.getId());
|
||||
allCheckboxesSelected &= isCourseAreaVisible;
|
||||
checkBox.setValue(isCourseAreaVisible);
|
||||
courseAreaCheckBoxMap.put(courseAreaDTO.id, checkBox);
|
||||
courseAreaCheckBoxMap.put(courseAreaDTO.getId(), checkBox);
|
||||
|
||||
courseAreaGrid.setWidget(rowIndex, columnIndex++, checkBox);
|
||||
if(columnIndex == maxCourseAreasPerRow) {
|
||||
|
||||
+1
-1
@@ -91,7 +91,7 @@ public final class RegattaRaceStatesSettings extends AbstractGenericSerializable
|
||||
}
|
||||
Set<UUID> courseAreaIds = new HashSet<>();
|
||||
for (CourseAreaDTO courseArea : defaultCourseAreas) {
|
||||
courseAreaIds.add(courseArea.id);
|
||||
courseAreaIds.add(courseArea.getId());
|
||||
}
|
||||
visibleCourseAreas.setDefaultValues(courseAreaIds);
|
||||
}
|
||||
|
||||
+3
-1
@@ -1,5 +1,7 @@
|
||||
package com.sap.sailing.gwt.ui.adminconsole;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import com.google.gwt.resources.client.ImageResource;
|
||||
import com.sap.sailing.domain.common.dto.CourseAreaDTO;
|
||||
import com.sap.sse.common.Util;
|
||||
@@ -35,7 +37,7 @@ public class CourseAreaListInlineEditorComposite extends GenericStringListInline
|
||||
|
||||
@Override
|
||||
protected CourseAreaDTO parse(String s) {
|
||||
return new CourseAreaDTO(s);
|
||||
return new CourseAreaDTO(UUID.randomUUID(), s);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+2
-1
@@ -4,6 +4,7 @@ import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import com.sap.sailing.domain.common.dto.CourseAreaDTO;
|
||||
import com.sap.sailing.gwt.ui.client.SailingServiceWriteAsync;
|
||||
@@ -44,6 +45,6 @@ public class EventCreateDialog extends EventDialog {
|
||||
imagesListComposite.fillImages(Collections.<ImageDTO>emptyList());
|
||||
videosListComposite.fillVideos(Collections.<VideoDTO>emptyList());
|
||||
// add default course area
|
||||
courseAreaNameList.setValue(Collections.singletonList(new CourseAreaDTO("Default")));
|
||||
courseAreaNameList.setValue(Collections.singletonList(new CourseAreaDTO(UUID.randomUUID(), "Default")));
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -175,14 +175,14 @@ public abstract class EventDialog extends DataEntryDialogWithDateTimeBox<EventDT
|
||||
@Override
|
||||
protected EventDTO getResult() {
|
||||
final List<LeaderboardGroupDTO> leaderboardGroups = new ArrayList<>();
|
||||
List<String> leaderboardGroupNames = leaderboardGroupList.getValue();
|
||||
final List<String> leaderboardGroupNames = leaderboardGroupList.getValue();
|
||||
for (final String lgName : leaderboardGroupNames) {
|
||||
final LeaderboardGroupDTO lgDTO = availableLeaderboardGroupsByName.get(lgName);
|
||||
if (lgDTO != null) {
|
||||
leaderboardGroups.add(lgDTO);
|
||||
}
|
||||
}
|
||||
EventDTO result = new EventDTO(nameEntryField.getText(), leaderboardGroups);
|
||||
final EventDTO result = new EventDTO(nameEntryField.getText(), leaderboardGroups);
|
||||
result.setDescription(descriptionEntryField.getText());
|
||||
result.setOfficialWebsiteURL(externalLinksComposite.getOfficialWebsiteURLValue());
|
||||
result.setBaseURL(baseURLEntryField.getText().trim().isEmpty() ? null : baseURLEntryField.getText().trim());
|
||||
@@ -191,7 +191,7 @@ public abstract class EventDialog extends DataEntryDialogWithDateTimeBox<EventDT
|
||||
result.endDate = endDateBox.getValue();
|
||||
result.isPublic = isPublicCheckBox.getValue();
|
||||
result.id = id;
|
||||
List<CourseAreaDTO> courseAreas = courseAreaNameList.getValue();
|
||||
final List<CourseAreaDTO> courseAreas = courseAreaNameList.getValue();
|
||||
for (ImageDTO image : imagesListComposite.getAllImages()) {
|
||||
result.addImage(image);
|
||||
}
|
||||
|
||||
+3
-12
@@ -647,12 +647,7 @@ public class EventListComposite extends Composite {
|
||||
|
||||
@Override
|
||||
public void onSuccess(EventDTO result) {
|
||||
final String[] namesOfCourseAreasToAdd = new String[courseAreasToAdd.size()];
|
||||
int i = 0;
|
||||
for (CourseAreaDTO courseAreaToAdd : courseAreasToAdd) {
|
||||
namesOfCourseAreasToAdd[i++] = courseAreaToAdd.getName();
|
||||
}
|
||||
sailingServiceWrite.createCourseAreas(oldEvent.id, namesOfCourseAreasToAdd,
|
||||
sailingServiceWrite.createCourseAreas(oldEvent.id, courseAreasToAdd,
|
||||
new AsyncCallback<Void>() {
|
||||
@Override
|
||||
public void onFailure(Throwable t) {
|
||||
@@ -665,7 +660,7 @@ public class EventListComposite extends Composite {
|
||||
final UUID[] idsOfCourseAreasToRemove = new UUID[courseAreasToRemove.size()];
|
||||
int j = 0;
|
||||
for (CourseAreaDTO courseAreaToRemove : courseAreasToRemove) {
|
||||
idsOfCourseAreasToRemove[j++] = courseAreaToRemove.id;
|
||||
idsOfCourseAreasToRemove[j++] = courseAreaToRemove.getId();
|
||||
}
|
||||
sailingServiceWrite.removeCourseAreas(oldEvent.id, idsOfCourseAreasToRemove,
|
||||
new AsyncCallback<Void>() {
|
||||
@@ -712,12 +707,8 @@ public class EventListComposite extends Composite {
|
||||
}
|
||||
|
||||
private void createNewEvent(final EventDTO newEvent, final List<LeaderboardGroupDTO> existingLeaderboardGroups) {
|
||||
List<String> courseAreaNames = new ArrayList<String>();
|
||||
for (CourseAreaDTO courseAreaDTO : newEvent.venue.getCourseAreas()) {
|
||||
courseAreaNames.add(courseAreaDTO.getName());
|
||||
}
|
||||
sailingServiceWrite.createEvent(newEvent.getName(), newEvent.getDescription(), newEvent.startDate, newEvent.endDate,
|
||||
newEvent.venue.getName(), newEvent.isPublic, courseAreaNames, newEvent.getOfficialWebsiteURL(), newEvent.getBaseURL(),
|
||||
newEvent.venue.getName(), newEvent.isPublic, newEvent.venue.getCourseAreas(), newEvent.getOfficialWebsiteURL(), newEvent.getBaseURL(),
|
||||
newEvent.getSailorsInfoWebsiteURLs(), newEvent.getImages(), newEvent.getVideos(), newEvent.getLeaderboardGroupIds(),
|
||||
new AsyncCallback<EventDTO>() {
|
||||
@Override
|
||||
|
||||
+2
-2
@@ -35,12 +35,12 @@ public class FlexibleLeaderboardEditDialog extends FlexibleLeaderboardDialog {
|
||||
sailingEventsListBox = createSailingEventListBox();
|
||||
for (EventDTO event : existingEvents) {
|
||||
for (CourseAreaDTO courseArea : event.venue.getCourseAreas()) {
|
||||
if (Util.contains(leaderboard.getCourseAreaIds(), courseArea.id)) {
|
||||
if (Util.contains(leaderboard.getCourseAreaIds(), courseArea.getId())) {
|
||||
int index = existingEvents.indexOf(event) + 1; // + 1 because of the "Please select... item"
|
||||
sailingEventsListBox.setSelectedIndex(index);
|
||||
onEventSelectionChanged();
|
||||
courseAreaSelection.setSelectedSet(Util.map(leaderboard.getCourseAreaIds(),
|
||||
id->Util.first(Util.filter(event.venue.getCourseAreas(), ca->ca.id.equals(id)))));
|
||||
id->Util.first(Util.filter(event.venue.getCourseAreas(), ca->ca.getId().equals(id)))));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-6
@@ -34,7 +34,6 @@ import com.google.gwt.view.client.SelectionChangeEvent.Handler;
|
||||
import com.sap.sailing.domain.common.RankingMetrics;
|
||||
import com.sap.sailing.domain.common.ScoringSchemeType;
|
||||
import com.sap.sailing.domain.common.dto.BoatClassDTO;
|
||||
import com.sap.sailing.domain.common.dto.CourseAreaDTO;
|
||||
import com.sap.sailing.domain.common.impl.MeterDistance;
|
||||
import com.sap.sailing.gwt.ui.adminconsole.StructureImportListComposite.RegattaStructureProvider;
|
||||
import com.sap.sailing.gwt.ui.adminconsole.places.AdminConsoleView.Presenter;
|
||||
@@ -234,12 +233,8 @@ public class StructureImportManagementPanel extends SimplePanel implements Regat
|
||||
}
|
||||
|
||||
private void createEvent(final EventDTO newEvent) {
|
||||
List<String> courseAreaNames = new ArrayList<String>();
|
||||
for (CourseAreaDTO courseAreaDTO : newEvent.venue.getCourseAreas()) {
|
||||
courseAreaNames.add(courseAreaDTO.getName());
|
||||
}
|
||||
sailingServiceWrite.createEvent(newEvent.getName(), newEvent.getDescription(), newEvent.startDate, newEvent.endDate,
|
||||
newEvent.venue.getName(), newEvent.isPublic, courseAreaNames, newEvent.getOfficialWebsiteURL(), newEvent.getBaseURL(),
|
||||
newEvent.venue.getName(), newEvent.isPublic, newEvent.venue.getCourseAreas(), newEvent.getOfficialWebsiteURL(), newEvent.getBaseURL(),
|
||||
newEvent.getSailorsInfoWebsiteURLs(), newEvent.getImages(),
|
||||
newEvent.getVideos(), newEvent.getLeaderboardGroupIds(), new AsyncCallback<EventDTO>() {
|
||||
@Override
|
||||
|
||||
+2
-1
@@ -36,6 +36,7 @@ import com.sap.sailing.domain.common.abstractlog.NotRevokableException;
|
||||
import com.sap.sailing.domain.common.dto.BoatDTO;
|
||||
import com.sap.sailing.domain.common.dto.CompetitorDTO;
|
||||
import com.sap.sailing.domain.common.dto.CompetitorWithBoatDTO;
|
||||
import com.sap.sailing.domain.common.dto.CourseAreaDTO;
|
||||
import com.sap.sailing.domain.common.dto.FleetDTO;
|
||||
import com.sap.sailing.domain.common.dto.PairingListDTO;
|
||||
import com.sap.sailing.domain.common.dto.RaceColumnInSeriesDTO;
|
||||
@@ -292,7 +293,7 @@ public interface SailingServiceWrite extends FileStorageManagementGwtService, Sa
|
||||
|
||||
void removeCourseAreas(UUID eventId, UUID[] courseAreaIds) throws UnauthorizedException;
|
||||
|
||||
void createCourseAreas(UUID eventId, String[] courseAreaNames) throws UnauthorizedException;
|
||||
void createCourseAreas(UUID eventId, List<CourseAreaDTO> courseAreas);
|
||||
|
||||
EventDTO createEvent(String eventName, String eventDescription, Date startDate, Date endDate, String venue,
|
||||
boolean isPublic, List<String> courseAreaNames, String officialWebsiteURLAsString, String baseURLAsString,
|
||||
|
||||
+3
-2
@@ -29,6 +29,7 @@ import com.sap.sailing.domain.common.WindSource;
|
||||
import com.sap.sailing.domain.common.dto.BoatDTO;
|
||||
import com.sap.sailing.domain.common.dto.CompetitorDTO;
|
||||
import com.sap.sailing.domain.common.dto.CompetitorWithBoatDTO;
|
||||
import com.sap.sailing.domain.common.dto.CourseAreaDTO;
|
||||
import com.sap.sailing.domain.common.dto.FleetDTO;
|
||||
import com.sap.sailing.domain.common.dto.PairingListDTO;
|
||||
import com.sap.sailing.domain.common.dto.RaceColumnInSeriesDTO;
|
||||
@@ -478,7 +479,7 @@ public interface SailingServiceWriteAsync extends FileStorageManagementGwtServic
|
||||
void removeEvents(Collection<UUID> eventIds, AsyncCallback<Void> asyncCallback);
|
||||
|
||||
void createEvent(String eventName, String eventDescription, Date startDate, Date endDate, String venue,
|
||||
boolean isPublic, List<String> courseAreaNames, String officialWebsiteURL, String baseURL,
|
||||
boolean isPublic, List<CourseAreaDTO> courseAreas, String officialWebsiteURL, String baseURL,
|
||||
Map<String, String> sailorsInfoWebsiteURLsByLocaleName, List<ImageDTO> images,
|
||||
List<VideoDTO> videos, List<UUID> leaderboardGroupIDs,
|
||||
AsyncCallback<EventDTO> callback);
|
||||
@@ -503,7 +504,7 @@ public interface SailingServiceWriteAsync extends FileStorageManagementGwtServic
|
||||
String baseURL, Map<String, String> sailorsInfoWebsiteURLsByLocaleName, List<ImageDTO> images,
|
||||
List<VideoDTO> videos, List<String> windFinderReviewedSpotCollectionIds, AsyncCallback<EventDTO> callback);
|
||||
|
||||
void createCourseAreas(UUID eventId, String[] courseAreaNames, AsyncCallback<Void> callback);
|
||||
void createCourseAreas(UUID eventId, List<CourseAreaDTO> courseAreas, AsyncCallback<Void> callback);
|
||||
|
||||
void removeCourseAreas(UUID eventId, UUID[] idsOfCourseAreasToRemove, AsyncCallback<Void> callback);
|
||||
|
||||
|
||||
+1
-2
@@ -3721,8 +3721,7 @@ public class SailingServiceImpl extends ResultCachingProxiedRemoteServiceServlet
|
||||
}
|
||||
|
||||
private CourseAreaDTO convertToCourseAreaDTO(CourseArea courseArea) {
|
||||
CourseAreaDTO courseAreaDTO = new CourseAreaDTO(courseArea.getName());
|
||||
courseAreaDTO.id = courseArea.getId();
|
||||
CourseAreaDTO courseAreaDTO = new CourseAreaDTO(courseArea.getId(), courseArea.getName(), courseArea.getCenterPosition(), courseArea.getRadius());
|
||||
return courseAreaDTO;
|
||||
}
|
||||
|
||||
|
||||
+5
-8
@@ -1517,7 +1517,6 @@ public class SailingServiceWriteImpl extends SailingServiceImpl implements Saili
|
||||
List<VideoDTO> videos, List<UUID> leaderboardGroupIds)
|
||||
throws UnauthorizedException {
|
||||
final UUID eventUuid = UUID.randomUUID();
|
||||
|
||||
return getSecurityService().setOwnershipCheckPermissionForObjectCreationAndRevertOnError(
|
||||
SecuredDomainType.EVENT, EventBaseImpl.getTypeRelativeObjectIdentifier(eventUuid), eventName,
|
||||
new Callable<EventDTO>() {
|
||||
@@ -1536,20 +1535,18 @@ public class SailingServiceWriteImpl extends SailingServiceImpl implements Saili
|
||||
getService().apply(new CreateEvent(eventName, eventDescription, startTimePoint, endTimePoint,
|
||||
venue, isPublic, eventUuid, officialWebsiteURL, baseURL, sailorsInfoWebsiteURLs,
|
||||
eventImages, eventVideos, leaderboardGroupIds));
|
||||
createCourseAreas(eventUuid, courseAreaNames.toArray(new String[courseAreaNames.size()]));
|
||||
createCourseAreas(eventUuid, Util.asList(Util.map(courseAreaNames, courseAreaName->new CourseAreaDTO(UUID.randomUUID(), courseAreaName))));
|
||||
return getEventById(eventUuid, false);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createCourseAreas(UUID eventId, String[] courseAreaNames) {
|
||||
public void createCourseAreas(UUID eventId, List<CourseAreaDTO> courseAreas) {
|
||||
getSecurityService().checkCurrentUserUpdatePermission(getService().getEvent(eventId));
|
||||
final UUID[] courseAreaIDs = new UUID[courseAreaNames.length];
|
||||
for (int i = 0; i < courseAreaNames.length; i++) {
|
||||
courseAreaIDs[i] = UUID.randomUUID();
|
||||
}
|
||||
getService().apply(new AddCourseAreas(eventId, courseAreaNames, courseAreaIDs));
|
||||
getService().apply(new AddCourseAreas(eventId,
|
||||
Util.toArray(Util.map(courseAreas, CourseAreaDTO::getName), new String[courseAreas.size()]),
|
||||
Util.toArray(Util.map(courseAreas, CourseAreaDTO::getId), new UUID[courseAreas.size()])));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@ public class RaceLogConnectivityParamsLoadAndStoreTest extends AbstractConnectiv
|
||||
final Regatta regatta = racingEventService.createRegatta("My Regatta", "12mR", true,
|
||||
CompetitorRegistrationType.CLOSED, /* registrationLinkSecret */ null, MillisecondsTimePoint.now(),
|
||||
MillisecondsTimePoint.now().plus(Duration.ONE_DAY), UUID.randomUUID(), series, /* persistent */ true,
|
||||
new LowPoint(), racingEventService.getBaseDomainFactory().getOrCreateCourseArea(UUID.randomUUID(), "Default").getId(),
|
||||
new LowPoint(), racingEventService.getBaseDomainFactory().getOrCreateCourseArea(UUID.randomUUID(), "Default", /* centerPosition */ null, /* radius */ null).getId(),
|
||||
/* buoyZoneRadiusInHullLengths */ 2.0,
|
||||
/* useStartTimeInference */ true, /* controlTrackingFromStartAndFinishTimes */ false,
|
||||
/* autoRestartTrackingUponCompetitorSetChange */ false, OneDesignRankingMetric::new);
|
||||
|
||||
+6
-8
@@ -155,7 +155,7 @@ public class TestStoringAndLoadingEventsAndRegattas extends AbstractMongoDBTest
|
||||
final Venue venue = new VenueImpl(venueName);
|
||||
|
||||
for (String courseAreaName : courseAreaNames) {
|
||||
CourseArea courseArea = DomainFactory.INSTANCE.getOrCreateCourseArea(UUID.randomUUID(), courseAreaName);
|
||||
CourseArea courseArea = DomainFactory.INSTANCE.getOrCreateCourseArea(UUID.randomUUID(), courseAreaName, /* centerPosition */ null, /* radius */ null);
|
||||
venue.addCourseArea(courseArea);
|
||||
}
|
||||
MongoObjectFactory mof = PersistenceFactory.INSTANCE.getMongoObjectFactory(getMongoService());
|
||||
@@ -222,14 +222,12 @@ public class TestStoringAndLoadingEventsAndRegattas extends AbstractMongoDBTest
|
||||
final String venueName = "Venue Name";
|
||||
final Venue venue = new VenueImpl(venueName);
|
||||
final String courseAreaAlphaName = "Alpha";
|
||||
final CourseArea courseAreaAlpha = DomainFactory.INSTANCE.getOrCreateCourseArea(UUID.randomUUID(), courseAreaAlphaName);
|
||||
final DegreePosition alphaCenter = new DegreePosition(49, 8);
|
||||
courseAreaAlpha.setCenterPosition(alphaCenter);
|
||||
final NauticalMileDistance alphaRadius = new NauticalMileDistance(2.5);
|
||||
courseAreaAlpha.setRadius(alphaRadius);
|
||||
final CourseArea courseAreaAlpha = DomainFactory.INSTANCE.getOrCreateCourseArea(UUID.randomUUID(), courseAreaAlphaName, alphaCenter, alphaRadius);
|
||||
venue.addCourseArea(courseAreaAlpha);
|
||||
final String courseAreaBravoName = "Bravo";
|
||||
final CourseArea courseAreaBravo = DomainFactory.INSTANCE.getOrCreateCourseArea(UUID.randomUUID(), courseAreaBravoName);
|
||||
final CourseArea courseAreaBravo = DomainFactory.INSTANCE.getOrCreateCourseArea(UUID.randomUUID(), courseAreaBravoName, /* centerPosition */ null, /* radius */ null);
|
||||
venue.addCourseArea(courseAreaBravo);
|
||||
MongoObjectFactory mof = PersistenceFactory.INSTANCE.getMongoObjectFactory(getMongoService());
|
||||
Event event = new EventImpl(eventName, eventStartDate, eventEndDate, venue, /*isPublic*/ true, UUID.randomUUID());
|
||||
@@ -271,7 +269,7 @@ public class TestStoringAndLoadingEventsAndRegattas extends AbstractMongoDBTest
|
||||
final String venueName = "Venue Name";
|
||||
final String courseAreaName = "Alpha";
|
||||
final Venue venue = new VenueImpl(venueName);
|
||||
CourseArea courseArea = DomainFactory.INSTANCE.getOrCreateCourseArea(UUID.randomUUID(), courseAreaName);
|
||||
CourseArea courseArea = DomainFactory.INSTANCE.getOrCreateCourseArea(UUID.randomUUID(), courseAreaName, /* centerPosition */ null, /* radius */ null);
|
||||
venue.addCourseArea(courseArea);
|
||||
|
||||
MongoObjectFactory mof = PersistenceFactory.INSTANCE.getMongoObjectFactory(getMongoService());
|
||||
@@ -324,7 +322,7 @@ public class TestStoringAndLoadingEventsAndRegattas extends AbstractMongoDBTest
|
||||
final String venueName = "Venue Name";
|
||||
final String courseAreaName = "Alpha";
|
||||
final Venue venue = new VenueImpl(venueName);
|
||||
CourseArea courseArea = DomainFactory.INSTANCE.getOrCreateCourseArea(UUID.randomUUID(), courseAreaName);
|
||||
CourseArea courseArea = DomainFactory.INSTANCE.getOrCreateCourseArea(UUID.randomUUID(), courseAreaName, /* centerPosition */ null, /* radius */ null);
|
||||
venue.addCourseArea(courseArea);
|
||||
|
||||
MongoObjectFactory mof = PersistenceFactory.INSTANCE.getMongoObjectFactory(getMongoService());
|
||||
@@ -377,7 +375,7 @@ public class TestStoringAndLoadingEventsAndRegattas extends AbstractMongoDBTest
|
||||
final TimePoint createdAt = MillisecondsTimePoint.now();
|
||||
final String eventName = "Event Name";
|
||||
final Venue venue = new VenueImpl("My Venue");
|
||||
CourseArea courseArea = DomainFactory.INSTANCE.getOrCreateCourseArea(UUID.randomUUID(), "Alfa");
|
||||
CourseArea courseArea = DomainFactory.INSTANCE.getOrCreateCourseArea(UUID.randomUUID(), "Alfa", /* centerPosition */ null, /* radius */ null);
|
||||
venue.addCourseArea(courseArea);
|
||||
|
||||
MongoObjectFactory mof = PersistenceFactory.INSTANCE.getMongoObjectFactory(getMongoService());
|
||||
|
||||
+1
-1
@@ -145,7 +145,7 @@ public class TestStoringAndRetrievingLeaderboards extends AbstractMongoDBTest {
|
||||
public void testStoreAndRetrieveSimpleLeaderboard() {
|
||||
final String leaderboardName = "TestLeaderboard";
|
||||
final int[] discardIndexResultsStartingWithHowManyRaces = new int[] { 5, 8 };
|
||||
final CourseArea courseArea = DomainFactory.INSTANCE.getOrCreateCourseArea(UUID.randomUUID(), "My Course Area");
|
||||
final CourseArea courseArea = DomainFactory.INSTANCE.getOrCreateCourseArea(UUID.randomUUID(), "My Course Area", /* centerPosition */ null, /* radius */ null);
|
||||
FlexibleLeaderboardImpl leaderboard = new FlexibleLeaderboardImpl(leaderboardName, new ThresholdBasedResultDiscardingRuleImpl(discardIndexResultsStartingWithHowManyRaces),
|
||||
new LowPoint(), courseArea);
|
||||
new MongoObjectFactoryImpl(db).storeLeaderboard(leaderboard);
|
||||
|
||||
+12
-6
@@ -10,6 +10,7 @@ import com.sap.sailing.domain.base.SharedDomainFactory;
|
||||
import com.sap.sailing.domain.common.Position;
|
||||
import com.sap.sailing.domain.common.impl.MeterDistance;
|
||||
import com.sap.sailing.server.gateway.serialization.impl.CourseAreaJsonSerializer;
|
||||
import com.sap.sse.common.Distance;
|
||||
import com.sap.sse.shared.json.JsonDeserializationException;
|
||||
import com.sap.sse.shared.json.JsonDeserializer;
|
||||
import com.sap.sse.shared.util.impl.UUIDHelper;
|
||||
@@ -25,16 +26,21 @@ public class CourseAreaJsonDeserializer implements JsonDeserializer<CourseArea>
|
||||
throws JsonDeserializationException {
|
||||
String name = (String) object.get(CourseAreaJsonSerializer.FIELD_NAME);
|
||||
Serializable id = (Serializable) object.get(CourseAreaJsonSerializer.FIELD_ID);
|
||||
final CourseArea result = factory.getOrCreateCourseArea((UUID) UUIDHelper.tryUuidConversion(id), name);
|
||||
final Position centerPosition;
|
||||
final Distance radius;
|
||||
final JSONObject centerPositionJson = (JSONObject) object.get(CourseAreaJsonSerializer.FIELD_CENTER_POSITION);
|
||||
if (centerPositionJson != null) {
|
||||
final Position centerPosition = new PositionJsonDeserializer().deserialize(centerPositionJson);
|
||||
result.setCenterPosition(centerPosition);
|
||||
centerPosition = new PositionJsonDeserializer().deserialize(centerPositionJson);
|
||||
} else {
|
||||
centerPosition = null;
|
||||
}
|
||||
final Number radius = (Number) object.get(CourseAreaJsonSerializer.FIELD_RADIUS_IN_METERS);
|
||||
if (radius != null) {
|
||||
result.setRadius(new MeterDistance(radius.doubleValue()));
|
||||
final Number radiusNumber = (Number) object.get(CourseAreaJsonSerializer.FIELD_RADIUS_IN_METERS);
|
||||
if (radiusNumber != null) {
|
||||
radius = new MeterDistance(radiusNumber.doubleValue());
|
||||
} else {
|
||||
radius = null;
|
||||
}
|
||||
final CourseArea result = factory.getOrCreateCourseArea((UUID) UUIDHelper.tryUuidConversion(id), name, centerPosition, radius);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
+2
-4
@@ -89,11 +89,9 @@ public class EventDataJsonSerializerTest {
|
||||
when(event.getStartDate()).thenReturn(expectedStartDate);
|
||||
when(event.getEndDate()).thenReturn(expectedEndDate);
|
||||
when(event.getVenue()).thenReturn(expectedVenue);
|
||||
final CourseArea alpha = DomainFactory.INSTANCE.getOrCreateCourseArea(UUID.randomUUID(), "Alpha");
|
||||
alpha.setCenterPosition(new DegreePosition(49, 8));
|
||||
alpha.setRadius(new NauticalMileDistance(2));
|
||||
final CourseArea alpha = DomainFactory.INSTANCE.getOrCreateCourseArea(UUID.randomUUID(), "Alpha", new DegreePosition(49, 8), new NauticalMileDistance(2));
|
||||
expectedVenue.addCourseArea(alpha);
|
||||
final CourseArea bravo= DomainFactory.INSTANCE.getOrCreateCourseArea(UUID.randomUUID(), "Bravo");
|
||||
final CourseArea bravo= DomainFactory.INSTANCE.getOrCreateCourseArea(UUID.randomUUID(), "Bravo", /* centerPosition */ null, /* radius */ null);
|
||||
expectedVenue.addCourseArea(bravo);
|
||||
when(event.getVideos()).thenReturn(Collections.<VideoDescriptor>emptySet());
|
||||
when(event.getImages()).thenReturn(Collections.<ImageDescriptor>singleton(expectedLogoImageDescriptor));
|
||||
|
||||
+1
-1
@@ -109,7 +109,7 @@ public abstract class AbstractLogReplicationTest<LogT extends AbstractLog<EventT
|
||||
/* registrationLinkSecret */ UUID.randomUUID().toString(), /* startDate */ null, /* endDate */ null,
|
||||
/* regatta ID */ UUID.randomUUID(), regattaCreationParams, /* persistent */ true, new LowPoint(),
|
||||
/* a single default course area ID */ Collections.singleton(master.getBaseDomainFactory()
|
||||
.getOrCreateCourseArea(UUID.randomUUID(), "Course Area").getId()),
|
||||
.getOrCreateCourseArea(UUID.randomUUID(), "Course Area", /* centerPosition */ null, /* radius */ null).getId()),
|
||||
/* buoyZoneRadiusInHullLengths */2.0, /* useStartTimeInference */ true,
|
||||
/* controlTrackingFromStartAndFinishTimes */ false,
|
||||
/* autoRestartTrackingUponCompetitorSetChange */ false, RankingMetrics.ONE_DESIGN);
|
||||
|
||||
+2
-2
@@ -41,10 +41,10 @@ public class PostingOperationFromReplicaToMasterTest extends AbstractServerRepli
|
||||
@Test
|
||||
public void testPostOperationToMaster() throws InterruptedException, URISyntaxException {
|
||||
final String leaderboardName = "My Leaderboard";
|
||||
final CourseArea courseArea = replica.getBaseDomainFactory().getOrCreateCourseArea(UUID.randomUUID(), "Course Area");
|
||||
final CourseArea courseArea = replica.getBaseDomainFactory().getOrCreateCourseArea(UUID.randomUUID(), "Course Area", /* centerPosition */ null, /* radius */ null);
|
||||
// in production, backward replication of a course area would happen by a backward
|
||||
// replication of an event with that course area; here, we have to "emulate" this explicitly
|
||||
master.getBaseDomainFactory().getOrCreateCourseArea(courseArea.getId(), courseArea.getName());
|
||||
master.getBaseDomainFactory().getOrCreateCourseArea(courseArea.getId(), courseArea.getName(), /* centerPosition */ null, /* radius */ null);
|
||||
final CreateFlexibleLeaderboard operation = new CreateFlexibleLeaderboard(/* leaderboardName */ leaderboardName,
|
||||
/* leaderboardDisplayName */ null, /* discardThresholds */ new int[0], /* scoringScheme */ new LowPoint(),
|
||||
/* courseAreaId */ Collections.singleton(courseArea.getId()));
|
||||
|
||||
+2
-2
@@ -99,10 +99,10 @@ public class TrackRaceBoatCompetitorMetadataReplicationTest extends AbstractServ
|
||||
}
|
||||
|
||||
private void startTrackingOnMaster() throws Exception {
|
||||
final CourseArea courseArea = master.getBaseDomainFactory().getOrCreateCourseArea(UUID.randomUUID(), "Course Area");
|
||||
final CourseArea courseArea = master.getBaseDomainFactory().getOrCreateCourseArea(UUID.randomUUID(), "Course Area", /* centerPosition */ null, /* radius */ null);
|
||||
// in production, a course area creation based on an event's venue creation would be
|
||||
// replicated; in test set-ups, the course area needs to be "replicated" manually:
|
||||
replica.getBaseDomainFactory().getOrCreateCourseArea(courseArea.getId(), courseArea.getName());
|
||||
replica.getBaseDomainFactory().getOrCreateCourseArea(courseArea.getId(), courseArea.getName(), /* centerPosition */ null, /* radius */ null);
|
||||
final Regatta regatta = master.createRegatta("Test regatta", "J/70",
|
||||
/* canBoatsOfCompetitorsChangePerRace==true because it's a league race we're using for this test */ true,
|
||||
CompetitorRegistrationType.CLOSED, /* registrationLinkSecret */ null,
|
||||
|
||||
+1
-1
@@ -57,7 +57,7 @@ public class MediaMasterDataExportTest {
|
||||
private static final ThresholdBasedResultDiscardingRule resultDiscardingRule = new ThresholdBasedResultDiscardingRuleImpl(new int[0]);
|
||||
private static final boolean isMedal = false;
|
||||
private static final ScoringScheme scoringScheme = new LowPoint();
|
||||
private static final CourseArea courseArea = new CourseAreaImpl("Course Area", UUID.randomUUID());
|
||||
private static final CourseArea courseArea = new CourseAreaImpl("Course Area", UUID.randomUUID(), /* centerPosition */ null, /* radius */ null);
|
||||
|
||||
@Test
|
||||
public void testTrackWithAssignedRaceButEmptyLeaderboardGroup() {
|
||||
|
||||
+1
-1
@@ -132,7 +132,7 @@ public class AutomaticRetrackUponCompetitorSetChangeTest {
|
||||
/* start with no series */ Collections.emptySet(),
|
||||
/* persistent */ true, new LowPoint(),
|
||||
/* defaultCourseAreaId */ service.getBaseDomainFactory()
|
||||
.getOrCreateCourseArea(UUID.randomUUID(), "Course Area").getId(),
|
||||
.getOrCreateCourseArea(UUID.randomUUID(), "Course Area", /* centerPosition */ null, /* radius */ null).getId(),
|
||||
/* buoyZoneRadiusInHullLengths */ 2., /* useStartTimeInference */ false, /* controlTrackingFromStartAndFinishTimes */ false,
|
||||
/* autoRestartTrackingUponCompetitorSetChange */ true, /* rankingMetricConstructor */ OneDesignRankingMetric::new);
|
||||
regattaIdentifier = new RegattaName(regatta.getName());
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@ public class LeaderboardStorageTest extends TestCase {
|
||||
RacingEventService service = new RacingEventServiceImpl();
|
||||
int[] dicardingThresholds = {};
|
||||
Leaderboard leaderboard = service.addFlexibleLeaderboard(LEADERBOARD_NAME, "testIt", dicardingThresholds,
|
||||
new LowPoint(), Collections.singleton(service.getBaseDomainFactory().getOrCreateCourseArea(UUID.randomUUID(), "maaap").getId()));
|
||||
new LowPoint(), Collections.singleton(service.getBaseDomainFactory().getOrCreateCourseArea(UUID.randomUUID(), "maaap", /* centerPosition */ null, /* radius */ null).getId()));
|
||||
List<DynamicPerson> sailorList = new ArrayList<DynamicPerson>();
|
||||
sailorList.add(new PersonImpl("sailor", new NationalityImpl("GER"), null, ""));
|
||||
DynamicTeam team = new TeamImpl("team", sailorList, null);
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@ public class LeaderboardWithEliminationTransitiveRemovalTest {
|
||||
/* competitorRegistrationType */ CompetitorRegistrationType.CLOSED, /* registrationLinkSecret */ null,
|
||||
/* startDate */ null, /* endDate */ null, /* id */ UUID.randomUUID(),
|
||||
regattaStructure, /* persistent */ true, new LowPoint(),
|
||||
/* courseAreaIds */ Collections.singleton(server.getBaseDomainFactory().getOrCreateCourseArea(UUID.randomUUID(), "Default").getId()),
|
||||
/* courseAreaIds */ Collections.singleton(server.getBaseDomainFactory().getOrCreateCourseArea(UUID.randomUUID(), "Default", /* centerPosition */ null, /* radius */ null).getId()),
|
||||
/* buoyZoneRadiusInHullLengths */ null, /* useStartTimeInference */ false,
|
||||
/* controlTrackingFromStartAndFinishTimes */ true, /* autoRestartTrackingUponCompetitorSetChange */ false,
|
||||
RankingMetrics.ONE_DESIGN));
|
||||
|
||||
+2
-2
@@ -70,7 +70,7 @@ public class LeagueEventHierarchyOwnershipChangeTest {
|
||||
public void setUp() throws Exception {
|
||||
event = service.addEvent("Test", "Test Event", TimePoint.now(), TimePoint.now().plus(Duration.ONE_WEEK), "Here",
|
||||
/* isPublic */ true, UUID.randomUUID());
|
||||
defaultCourseArea = new CourseAreaImpl("Default", UUID.randomUUID());
|
||||
defaultCourseArea = new CourseAreaImpl("Default", UUID.randomUUID(), /* centerPosition */ null, /* radius */ null);
|
||||
event.getVenue().addCourseArea(defaultCourseArea);
|
||||
leaderboardGroup = new LeaderboardGroupImpl("LG", "LGDesc", "The LG", /* displayGroupsInReverseOrder */ false,
|
||||
Collections.emptyList());
|
||||
@@ -112,7 +112,7 @@ public class LeagueEventHierarchyOwnershipChangeTest {
|
||||
new ThresholdBasedResultDiscardingRuleImpl(new int[0]));
|
||||
leaderboardGroup2.setOverallLeaderboard(overallLeaderboard2);
|
||||
leaderboardGroup2.addLeaderboard(new FlexibleLeaderboardImpl("FlexibleLeaderboard",
|
||||
new ThresholdBasedResultDiscardingRuleImpl(new int[0]), new LowPoint(), new CourseAreaImpl("CA", UUID.randomUUID())));
|
||||
new ThresholdBasedResultDiscardingRuleImpl(new int[0]), new LowPoint(), new CourseAreaImpl("CA", UUID.randomUUID(), /* centerPosition */ null, /* radius */ null)));
|
||||
event.addLeaderboardGroup(leaderboardGroup2);
|
||||
SailingHierarchyOwnershipUpdater.createOwnershipUpdater(/* createNewGroup */ true , /* existingGroupIdOrNull */ null,
|
||||
THE_NEW_OWNING_GROUP_NAME,
|
||||
|
||||
+11
-11
@@ -270,7 +270,7 @@ public class MasterDataImportTest {
|
||||
Event event = sourceService.addEvent(TEST_EVENT_NAME, /* eventDescription */null, eventStartDate, eventEndDate,
|
||||
"testVenue", false, eventUUID);
|
||||
UUID courseAreaUUID = UUID.randomUUID();
|
||||
CourseArea courseArea = sourceService.getBaseDomainFactory().getOrCreateCourseArea(courseAreaUUID, "testArea");
|
||||
CourseArea courseArea = sourceService.getBaseDomainFactory().getOrCreateCourseArea(courseAreaUUID, "testArea", /* centerPosition */ null, /* radius */ null);
|
||||
event.getVenue().addCourseArea(courseArea);
|
||||
List<String> raceColumnNames = new ArrayList<>();
|
||||
String raceColumnName = "T1";
|
||||
@@ -555,7 +555,7 @@ public class MasterDataImportTest {
|
||||
Event event = sourceService.addEvent(TEST_EVENT_NAME, /* eventDescription */null, eventStartDate, eventEndDate,
|
||||
"testVenue", false, eventUUID);
|
||||
final UUID courseAreaUUID = UUID.randomUUID();
|
||||
final CourseArea courseArea = sourceService.getBaseDomainFactory().getOrCreateCourseArea(courseAreaUUID, "testArea");
|
||||
final CourseArea courseArea = sourceService.getBaseDomainFactory().getOrCreateCourseArea(courseAreaUUID, "testArea", /* centerPosition */ null, /* radius */ null);
|
||||
event.getVenue().addCourseArea(courseArea);
|
||||
List<String> raceColumnNames = new ArrayList<>();
|
||||
String raceColumnName = "T1";
|
||||
@@ -735,7 +735,7 @@ public class MasterDataImportTest {
|
||||
Event event = sourceService.addEvent(TEST_EVENT_NAME, /* eventDescription */null, eventStartDate, eventEndDate,
|
||||
"testVenue", false, eventUUID);
|
||||
UUID courseAreaUUID = UUID.randomUUID();
|
||||
CourseArea courseArea = sourceService.getBaseDomainFactory().getOrCreateCourseArea(courseAreaUUID, "testArea");
|
||||
CourseArea courseArea = sourceService.getBaseDomainFactory().getOrCreateCourseArea(courseAreaUUID, "testArea", /* centerPosition */ null, /* radius */ null);
|
||||
event.getVenue().addCourseArea(courseArea);
|
||||
List<String> raceColumnNames = new ArrayList<>();
|
||||
String raceColumnName = "T1";
|
||||
@@ -882,7 +882,7 @@ public class MasterDataImportTest {
|
||||
InterruptedException, ClassNotFoundException {
|
||||
Event event = sourceService.addEvent(TEST_EVENT_NAME, /* eventDescription */null, eventStartDate, eventEndDate,
|
||||
"testVenue", false, eventUUID);
|
||||
final CourseArea courseArea = sourceService.getBaseDomainFactory().getOrCreateCourseArea(UUID.randomUUID(), "testArea");
|
||||
final CourseArea courseArea = sourceService.getBaseDomainFactory().getOrCreateCourseArea(UUID.randomUUID(), "testArea", /* centerPosition */ null, /* radius */ null);
|
||||
event.getVenue().addCourseArea(courseArea);
|
||||
List<String> raceColumnNames = new ArrayList<>();
|
||||
String raceColumnName = "T1";
|
||||
@@ -1027,7 +1027,7 @@ public class MasterDataImportTest {
|
||||
Event event = sourceService.addEvent(TEST_EVENT_NAME, /* eventDescription */null, eventStartDate, eventEndDate,
|
||||
"testVenue", false, eventUUID);
|
||||
final UUID courseAreaUUID = UUID.randomUUID();
|
||||
final CourseArea courseArea = sourceService.getBaseDomainFactory().getOrCreateCourseArea(courseAreaUUID, "testArea");
|
||||
final CourseArea courseArea = sourceService.getBaseDomainFactory().getOrCreateCourseArea(courseAreaUUID, "testArea", /* centerPosition */ null, /* radius */ null);
|
||||
event.getVenue().addCourseArea(courseArea);
|
||||
List<String> raceColumnNames = new ArrayList<>();
|
||||
String raceColumnName = "T1";
|
||||
@@ -1128,7 +1128,7 @@ public class MasterDataImportTest {
|
||||
venueNameNotToOverride = "doNotOverride";
|
||||
Event eventNotToOverride = destService.addEvent(TEST_EVENT_NAME, /* eventDescription */null,
|
||||
eventStartDate, eventEndDate, venueNameNotToOverride, false, eventUUID);
|
||||
courseAreaNotToOverride = destService.getBaseDomainFactory().getOrCreateCourseArea(courseAreaUUID, "testAreaNotToOverride");
|
||||
courseAreaNotToOverride = destService.getBaseDomainFactory().getOrCreateCourseArea(courseAreaUUID, "testAreaNotToOverride", /* centerPosition */ null, /* radius */ null);
|
||||
eventNotToOverride.getVenue().addCourseArea(courseAreaNotToOverride);
|
||||
List<String> raceColumnNamesNotToOverride = new ArrayList<>();
|
||||
raceColumnNameNotToOveride = "T1nottooverride";
|
||||
@@ -1209,7 +1209,7 @@ public class MasterDataImportTest {
|
||||
InterruptedException, ClassNotFoundException {
|
||||
Event event = sourceService.addEvent(TEST_EVENT_NAME, /* eventDescription */null, eventStartDate, eventEndDate, "testVenue", false, eventUUID);
|
||||
final UUID courseAreaUUID = UUID.randomUUID();
|
||||
final CourseArea courseArea = sourceService.getBaseDomainFactory().getOrCreateCourseArea(courseAreaUUID, "testArea");
|
||||
final CourseArea courseArea = sourceService.getBaseDomainFactory().getOrCreateCourseArea(courseAreaUUID, "testArea", /* centerPosition */ null, /* radius */ null);
|
||||
event.getVenue().addCourseArea(courseArea);
|
||||
List<String> raceColumnNames = new ArrayList<>();
|
||||
String raceColumnName = "T1";
|
||||
@@ -1306,7 +1306,7 @@ public class MasterDataImportTest {
|
||||
String venueNameToOverride = "Override";
|
||||
Event eventToOverride = destService.addEvent(TEST_EVENT_NAME, /* eventDescription */null, eventStartDate,
|
||||
eventEndDate, venueNameToOverride, false, eventUUID);
|
||||
courseAreaNotToOverride = destService.getBaseDomainFactory().getOrCreateCourseArea(courseAreaUUID, "testAreaNotToOverride");
|
||||
courseAreaNotToOverride = destService.getBaseDomainFactory().getOrCreateCourseArea(courseAreaUUID, "testAreaNotToOverride", /* centerPosition */ null, /* radius */ null);
|
||||
eventToOverride.getVenue().addCourseArea(courseAreaNotToOverride);
|
||||
List<String> raceColumnNamesToOverride = new ArrayList<>();
|
||||
String raceColumnNameToOveride = raceColumnName;
|
||||
@@ -1605,7 +1605,7 @@ public class MasterDataImportTest {
|
||||
Event event = sourceService.addEvent(TEST_EVENT_NAME, /* eventDescription */null, eventStartDate, eventEndDate,
|
||||
"testVenue", false, eventUUID);
|
||||
final UUID courseAreaUUID = UUID.randomUUID();
|
||||
final CourseArea courseArea = sourceService.getBaseDomainFactory().getOrCreateCourseArea(courseAreaUUID, "testArea");
|
||||
final CourseArea courseArea = sourceService.getBaseDomainFactory().getOrCreateCourseArea(courseAreaUUID, "testArea", /* centerPosition */ null, /* radius */ null);
|
||||
event.getVenue().addCourseArea(courseArea);
|
||||
List<String> raceColumnNames = new ArrayList<>();
|
||||
String raceColumnName = "T1";
|
||||
@@ -1850,7 +1850,7 @@ public class MasterDataImportTest {
|
||||
Event event = sourceService.addEvent(TEST_EVENT_NAME, /* eventDescription */null, eventStartDate, eventEndDate,
|
||||
"testVenue", false, eventUUID);
|
||||
final UUID courseAreaUUID = UUID.randomUUID();
|
||||
final CourseArea courseArea = sourceService.getBaseDomainFactory().getOrCreateCourseArea(courseAreaUUID, "testArea");
|
||||
final CourseArea courseArea = sourceService.getBaseDomainFactory().getOrCreateCourseArea(courseAreaUUID, "testArea", /* centerPosition */ null, /* radius */ null);
|
||||
event.getVenue().addCourseArea(courseArea);
|
||||
List<String> raceColumnNames = new ArrayList<>();
|
||||
String raceColumnName = "T1";
|
||||
@@ -2067,7 +2067,7 @@ public class MasterDataImportTest {
|
||||
public void testMasterDataImportWithFlexibleLeaderboard() throws MalformedURLException, IOException,
|
||||
InterruptedException, ClassNotFoundException {
|
||||
final UUID courseAreaUUID = UUID.randomUUID();
|
||||
sourceService.getBaseDomainFactory().getOrCreateCourseArea(courseAreaUUID, "testArea");
|
||||
sourceService.getBaseDomainFactory().getOrCreateCourseArea(courseAreaUUID, "testArea", /* centerPosition */ null, /* radius */ null);
|
||||
List<String> raceColumnNames = new ArrayList<>();
|
||||
String raceColumnName = "T1";
|
||||
raceColumnNames.add(raceColumnName);
|
||||
|
||||
+3
-3
@@ -159,9 +159,9 @@ public class SearchServiceTest {
|
||||
"Kiel", /* isPublic */ true, UUID.randomUUID(), /* officialWebsiteURLAsString */ null, /*baseURL*/null,
|
||||
/* sailorsInfoWebsiteURLAsString */ null, /* images */Collections.<ImageDescriptor> emptyList(), /* videos */Collections.<VideoDescriptor> emptyList(), /* leaderboardGroupIds */ Collections.<UUID> emptyList()));
|
||||
kiel = pfingstbusch.getVenue();
|
||||
final CourseArea kielAlpha = server.getBaseDomainFactory().getOrCreateCourseArea(UUID.randomUUID(), "Alpha");
|
||||
final CourseArea kielAlpha = server.getBaseDomainFactory().getOrCreateCourseArea(UUID.randomUUID(), "Alpha", /* centerPosition */ null, /* radius */ null);
|
||||
kiel.addCourseArea(kielAlpha);
|
||||
final CourseArea kielBravo = server.getBaseDomainFactory().getOrCreateCourseArea(UUID.randomUUID(), "Bravo");
|
||||
final CourseArea kielBravo = server.getBaseDomainFactory().getOrCreateCourseArea(UUID.randomUUID(), "Bravo", /* centerPosition */ null, /* radius */ null);
|
||||
kiel.addCourseArea(kielBravo);
|
||||
final LinkedHashMap<String, SeriesCreationParametersDTO> seriesCreationParams = new LinkedHashMap<String, SeriesCreationParametersDTO>();
|
||||
seriesCreationParams.put("Default",
|
||||
@@ -208,7 +208,7 @@ public class SearchServiceTest {
|
||||
"Flensburg", /* isPublic */ true, UUID.randomUUID(), /* officialWebsiteURLAsString */ null, /*baseURL*/null,
|
||||
/*sailorsInfoWebsiteURLAsString */ null, /* images */Collections.<ImageDescriptor> emptyList(), /* videos */Collections.<VideoDescriptor> emptyList(), /* leaderboardGroupIds */ Collections.<UUID> emptyList()));
|
||||
flensburg = aalEvent.getVenue();
|
||||
final CourseArea flensburgStandard = server.getBaseDomainFactory().getOrCreateCourseArea(UUID.randomUUID(), "Standard");
|
||||
final CourseArea flensburgStandard = server.getBaseDomainFactory().getOrCreateCourseArea(UUID.randomUUID(), "Standard", /* centerPosition */ null, /* radius */ null);
|
||||
flensburg.addCourseArea(flensburgStandard);
|
||||
aalRegatta = server.apply(new AddSpecificRegatta(RegattaImpl.getDefaultName("Aalregatta", "ORC"), "ORC",
|
||||
/* canBoatsOfCompetitorsChangePerRace */ true, CompetitorRegistrationType.CLOSED,
|
||||
|
||||
+1
-1
@@ -309,7 +309,7 @@ public class JumpyTrackSmootheningTest {
|
||||
/* canBoatsOfCompetitorsChangePerRace */ false, /* competitorRegistrationType */ CompetitorRegistrationType.CLOSED,
|
||||
/* startDate */ null, /* endDate */ null, Collections.singleton(new SeriesImpl("Default", /* isMedal */ false, /* isFleetsCanRunInParallel */ false,
|
||||
Collections.singleton(new FleetImpl("Default", 0)), Collections.singleton("R1"), new DummyTrackedRegattaRegistry())), /* persistent */ false,
|
||||
new LowPoint(), UUID.randomUUID(), new CourseAreaImpl("Default", UUID.randomUUID()), OneDesignRankingMetric::new,
|
||||
new LowPoint(), UUID.randomUUID(), new CourseAreaImpl("Default", UUID.randomUUID(), /* centerPosition */ null, /* radius */ null), OneDesignRankingMetric::new,
|
||||
/* registrationLinkSecret */ null));
|
||||
final Boat boat = ((CompetitorWithBoat) gallagherZelenka).getBoat();
|
||||
final Map<Competitor, Boat> competitorsAndTheirBoats = Util.<Competitor, Boat>mapBuilder().put(gallagherZelenka, boat).build();
|
||||
|
||||
+1
-1
@@ -3898,7 +3898,7 @@ Replicator {
|
||||
public CourseArea[] addCourseAreasWithoutReplication(UUID eventId, UUID[] courseAreaIds, String[] courseAreaNames) {
|
||||
final CourseArea[] result = new CourseArea[courseAreaNames.length];
|
||||
for (int i=0; i<courseAreaIds.length; i++) {
|
||||
final CourseArea courseArea = getBaseDomainFactory().getOrCreateCourseArea(courseAreaIds[i], courseAreaNames[i]);
|
||||
final CourseArea courseArea = getBaseDomainFactory().getOrCreateCourseArea(courseAreaIds[i], courseAreaNames[i], /* centerPosition */ null, /* radius */ null);
|
||||
final Event event = eventsById.get(eventId);
|
||||
if (event == null) {
|
||||
throw new IllegalArgumentException("No sailing event with ID " + eventId + " found.");
|
||||
|
||||
Reference in New Issue
Block a user