Renamed RaceCommittee to RaceLog

This commit is contained in:
Armin Zamani committed 2013-02-02 16:34:53 +01:00
1 parent 12bf61007a
commit 02b225f307
116 files changed
+1544 -1546

No files matched your search

@@ -17,14 +17,14 @@ import com.sap.sailing.domain.common.TimePoint;
import com.sap.sailing.domain.persistence.MongoFactory;
import com.sap.sailing.domain.persistence.impl.DomainObjectFactoryImpl;
import com.sap.sailing.domain.persistence.impl.MongoObjectFactoryImpl;
import com.sap.sailing.domain.racecommittee.Flags;
import com.sap.sailing.domain.racecommittee.RaceCommitteeEventFactory;
import com.sap.sailing.domain.racecommittee.RaceCommitteeFlagEvent;
import com.sap.sailing.domain.racelog.Flags;
import com.sap.sailing.domain.racelog.RaceLogEventFactory;
import com.sap.sailing.domain.racelog.RaceLogFlagEvent;
public class TestStoringAndRetrievingRaceCommitteeEventData extends AbstractMongoDBTest {
private static final String RACECOMMITTEE_TEST_COLLECTION = "racecommittee_test_collection";
public class TestStoringAndRetrievingRaceLogEventData extends AbstractMongoDBTest {
private static final String RACELOG_TEST_COLLECTION = "racelog_test_collection";
public TestStoringAndRetrievingRaceCommitteeEventData() throws UnknownHostException, MongoException {
public TestStoringAndRetrievingRaceLogEventData() throws UnknownHostException, MongoException {
super();
}
@@ -32,12 +32,12 @@ public class TestStoringAndRetrievingRaceCommitteeEventData extends AbstractMong
@Override
public void dropTestDB() throws UnknownHostException, MongoException, InterruptedException {
super.dropTestDB();
db.getCollection(RACECOMMITTEE_TEST_COLLECTION).drop();
db.getCollection(RACELOG_TEST_COLLECTION).drop();
}
@Test
public void testDBConnection() throws UnknownHostException, MongoException {
DBCollection coll = db.getCollection(RACECOMMITTEE_TEST_COLLECTION);
DBCollection coll = db.getCollection(RACELOG_TEST_COLLECTION);
assertNotNull(coll);
BasicDBObject doc = new BasicDBObject();
doc.put("upperflag", "AP");
@@ -48,7 +48,7 @@ public class TestStoringAndRetrievingRaceCommitteeEventData extends AbstractMong
@Test
public void testDBRead() throws UnknownHostException, MongoException, InterruptedException {
{
DBCollection coll = db.getCollection(RACECOMMITTEE_TEST_COLLECTION);
DBCollection coll = db.getCollection(RACELOG_TEST_COLLECTION);
assertNotNull(coll);
BasicDBObject doc = new BasicDBObject();
doc.put("upperflag", "AP");
@@ -57,7 +57,7 @@ public class TestStoringAndRetrievingRaceCommitteeEventData extends AbstractMong
}
{
DBCollection coll = db.getCollection(RACECOMMITTEE_TEST_COLLECTION);
DBCollection coll = db.getCollection(RACELOG_TEST_COLLECTION);
assertNotNull(coll);
DBObject object = coll.findOne();
assertEquals("AP", object.get("upperflag"));
@@ -66,21 +66,21 @@ public class TestStoringAndRetrievingRaceCommitteeEventData extends AbstractMong
}
@Test
public void storeWindObject() throws UnknownHostException, MongoException, InterruptedException {
public void storeRaceLogObject() throws UnknownHostException, MongoException, InterruptedException {
TimePoint now = MillisecondsTimePoint.now();
RaceCommitteeFlagEvent rcEvent = RaceCommitteeEventFactory.INSTANCE.createFlagEvent(now, 0, Flags.AP, Flags.ALPHA, true);
RaceLogFlagEvent rcEvent = RaceLogEventFactory.INSTANCE.createFlagEvent(now, 0, Flags.AP, Flags.ALPHA, true);
{
DBObject rcEventForMongo = ((MongoObjectFactoryImpl) MongoFactory.INSTANCE.getDefaultMongoObjectFactory())
.storeRaceCommitteeFlagEvent(rcEvent);
DBCollection coll = db.getCollection(RACECOMMITTEE_TEST_COLLECTION);
.storeRaceLogFlagEvent(rcEvent);
DBCollection coll = db.getCollection(RACELOG_TEST_COLLECTION);
coll.insert(rcEventForMongo);
}
{
DBCollection coll = db.getCollection(RACECOMMITTEE_TEST_COLLECTION);
DBCollection coll = db.getCollection(RACELOG_TEST_COLLECTION);
assertNotNull(coll);
DBObject object = coll.findOne();
RaceCommitteeFlagEvent readRcEvent = (RaceCommitteeFlagEvent) ((DomainObjectFactoryImpl) MongoFactory.INSTANCE.getDefaultDomainObjectFactory()).loadRaceCommitteeEvent(object);
RaceLogFlagEvent readRcEvent = (RaceLogFlagEvent) ((DomainObjectFactoryImpl) MongoFactory.INSTANCE.getDefaultDomainObjectFactory()).loadRaceLogEvent(object);
assertEquals(rcEvent.getTimePoint(), readRcEvent.getTimePoint());
assertEquals(rcEvent.getId(), readRcEvent.getId());
assertEquals(rcEvent.getPassId(), readRcEvent.getPassId());
@@ -19,11 +19,11 @@ import com.sap.sailing.domain.base.impl.MillisecondsTimePoint;
import com.sap.sailing.domain.common.TimePoint;
import com.sap.sailing.domain.persistence.impl.DomainObjectFactoryImpl;
import com.sap.sailing.domain.persistence.impl.MongoObjectFactoryImpl;
import com.sap.sailing.domain.racecommittee.RaceCommitteeEvent;
import com.sap.sailing.domain.racecommittee.RaceCommitteeEventFactory;
import com.sap.sailing.domain.racecommittee.RaceCommitteeEventTrack;
import com.sap.sailing.domain.racecommittee.RaceCommitteeStartTimeEvent;
import com.sap.sailing.domain.racecommittee.impl.EmptyRaceCommitteeStore;
import com.sap.sailing.domain.racelog.RaceLog;
import com.sap.sailing.domain.racelog.RaceLogEvent;
import com.sap.sailing.domain.racelog.RaceLogEventFactory;
import com.sap.sailing.domain.racelog.RaceLogStartTimeEvent;
import com.sap.sailing.domain.racelog.impl.EmptyRaceLogStore;
import com.sap.sailing.domain.test.AbstractTracTracLiveTest;
import com.sap.sailing.domain.tracking.DynamicRaceDefinitionSet;
import com.sap.sailing.domain.tracking.DynamicTrackedRace;
@@ -35,14 +35,14 @@ import com.sap.sailing.domain.tractracadapter.ReceiverType;
import com.sap.sailing.mongodb.MongoDBConfiguration;
import com.sap.sailing.server.impl.RacingEventServiceImpl;
public class TestStoringAndRetrievingRaceCommitteeEventTracksTest extends AbstractTracTracLiveTest {
public class TestStoringAndRetrievingRaceLogsTest extends AbstractTracTracLiveTest {
private Mongo mongo;
private DB db;
private final MongoDBConfiguration dbConfiguration;
public TestStoringAndRetrievingRaceCommitteeEventTracksTest() throws URISyntaxException, MalformedURLException {
public TestStoringAndRetrievingRaceLogsTest() throws URISyntaxException, MalformedURLException {
super();
dbConfiguration = MongoDBConfiguration.getDefaultTestConfiguration();
}
@@ -62,12 +62,12 @@ public class TestStoringAndRetrievingRaceCommitteeEventTracksTest extends Abstra
}
@Test
public void testStoreAFewRCEventEntries() throws UnknownHostException, MongoException, InterruptedException {
public void testStoreAFewRaceLogEntries() throws UnknownHostException, MongoException, InterruptedException {
DomainFactory domainFactory = DomainFactory.INSTANCE;
Regatta domainEvent = domainFactory.getOrCreateDefaultRegatta(getTracTracEvent(), /* trackedRegattaRegistry */ null);
DynamicTrackedRegatta trackedRegatta = new RacingEventServiceImpl().getOrCreateTrackedRegatta(domainEvent);
Iterable<Receiver> typeControllers = domainFactory.getUpdateReceivers(trackedRegatta, getTracTracEvent(),
EmptyWindStore.INSTANCE, EmptyRaceCommitteeStore.INSTANCE,
EmptyWindStore.INSTANCE, EmptyRaceLogStore.INSTANCE,
/* startOfTracking */null, /* endOfTracking */null, /* delayToLiveInMillis */
0l, /* simulator */ null, new DynamicRaceDefinitionSet() {
@Override
@@ -81,18 +81,18 @@ public class TestStoringAndRetrievingRaceCommitteeEventTracksTest extends Abstra
@Override
public void addRaceDefinition(RaceDefinition race) {
}
}, EmptyRaceCommitteeStore.INSTANCE);
}, EmptyRaceLogStore.INSTANCE);
Mongo myFirstMongo = newMongo();
DB firstDatabase = myFirstMongo.getDB(dbConfiguration.getDatabaseName());
new MongoObjectFactoryImpl(firstDatabase).addRaceCommitteeEventTrackDumper(trackedRegatta, trackedRace);
RaceCommitteeEventTrack raceCommitteeEventTrack = trackedRace.getRaceCommitteeEventTrack();
new MongoObjectFactoryImpl(firstDatabase).addRaceLogDumper(trackedRegatta, trackedRace);
RaceLog raceLog = trackedRace.getRaceLog();
TimePoint timePoint = MillisecondsTimePoint.now();
TimePoint timePointStartTime = new MillisecondsTimePoint(timePoint.asMillis() + 60000);
TimePoint initialTimePointStartTime = timePointStartTime;
for (int passId = 0; passId < 100; passId++) {
raceCommitteeEventTrack.add(RaceCommitteeEventFactory.INSTANCE.createStartTimeEvent(timePoint, passId, timePointStartTime));
raceLog.add(RaceLogEventFactory.INSTANCE.createStartTimeEvent(timePoint, passId, timePointStartTime));
timePoint = new MillisecondsTimePoint(timePoint.asMillis() + 100);
timePointStartTime = new MillisecondsTimePoint(timePointStartTime.asMillis() + 100);
}
@@ -101,14 +101,14 @@ public class TestStoringAndRetrievingRaceCommitteeEventTracksTest extends Abstra
Mongo mySecondMongo = newMongo();
DB secondDatabase = mySecondMongo.getDB(dbConfiguration.getDatabaseName());
RaceCommitteeEventTrack result = new DomainObjectFactoryImpl(secondDatabase).loadRaceCommitteeEventTrack(domainEvent, race);
RaceLog result = new DomainObjectFactoryImpl(secondDatabase).loadRaceLog(domainEvent, race);
int resultingPassId = 0;
timePointStartTime = initialTimePointStartTime;
result.lockForRead();
try {
for (RaceCommitteeEvent event : result.getRawFixes()) {
RaceCommitteeStartTimeEvent startTimeEvent = (RaceCommitteeStartTimeEvent) event;
for (RaceLogEvent event : result.getRawFixes()) {
RaceLogStartTimeEvent startTimeEvent = (RaceLogStartTimeEvent) event;
assertEquals(resultingPassId, startTimeEvent.getPassId());
assertEquals(timePointStartTime, startTimeEvent.getStartTime());
@@ -27,7 +27,7 @@ import com.sap.sailing.domain.common.impl.DegreePosition;
import com.sap.sailing.domain.common.impl.WindSourceImpl;
import com.sap.sailing.domain.persistence.impl.DomainObjectFactoryImpl;
import com.sap.sailing.domain.persistence.impl.MongoObjectFactoryImpl;
import com.sap.sailing.domain.racecommittee.impl.EmptyRaceCommitteeStore;
import com.sap.sailing.domain.racelog.impl.EmptyRaceLogStore;
import com.sap.sailing.domain.test.AbstractTracTracLiveTest;
import com.sap.sailing.domain.tracking.DynamicRaceDefinitionSet;
import com.sap.sailing.domain.tracking.DynamicTrackedRegatta;
@@ -74,7 +74,7 @@ public class TestStoringAndRetrievingWindTracksTest extends AbstractTracTracLive
Regatta domainEvent = domainFactory.getOrCreateDefaultRegatta(getTracTracEvent(), /* trackedRegattaRegistry */ null);
DynamicTrackedRegatta trackedRegatta = new RacingEventServiceImpl().getOrCreateTrackedRegatta(domainEvent);
Iterable<Receiver> typeControllers = domainFactory.getUpdateReceivers(trackedRegatta, getTracTracEvent(),
EmptyWindStore.INSTANCE, EmptyRaceCommitteeStore.INSTANCE,
EmptyWindStore.INSTANCE, EmptyRaceLogStore.INSTANCE,
/* startOfTracking */null, /* endOfTracking */null, /* delayToLiveInMillis */
0l, /* simulator */ null, new DynamicRaceDefinitionSet() {
@Override
@@ -88,7 +88,7 @@ public class TestStoringAndRetrievingWindTracksTest extends AbstractTracTracLive
@Override
public void addRaceDefinition(RaceDefinition race) {
}
}, EmptyRaceCommitteeStore.INSTANCE);
}, EmptyRaceLogStore.INSTANCE);
WindSource windSource = new WindSourceImpl(WindSourceType.WEB);
Mongo myFirstMongo = newMongo();
DB firstDatabase = myFirstMongo.getDB(dbConfiguration.getDatabaseName());