mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-21 21:25:38 +00:00
removed further deprecations by switching imports from junit.* to org.junit
This commit is contained in:
+2
-2
@@ -15,7 +15,7 @@ public class MongoObjectFactoryImpl implements MongoObjectFactory {
|
||||
@Override
|
||||
public void storeAccessToken(String accessToken) {
|
||||
final BasicDBObject basicDBObject = getAccessTokenDBQuery(accessToken);
|
||||
db.getCollection(CollectionNames.IGTIMI_ACCESS_TOKENS.name()).update(basicDBObject, basicDBObject, /* upsert */ true, /* multi */ false, WriteConcern.SAFE);
|
||||
db.getCollection(CollectionNames.IGTIMI_ACCESS_TOKENS.name()).update(basicDBObject, basicDBObject, /* upsert */ true, /* multi */ false, WriteConcern.ACKNOWLEDGED);
|
||||
}
|
||||
|
||||
private BasicDBObject getAccessTokenDBQuery(String accessToken) {
|
||||
@@ -26,6 +26,6 @@ public class MongoObjectFactoryImpl implements MongoObjectFactory {
|
||||
@Override
|
||||
public void removeAccessToken(String accessToken) {
|
||||
final BasicDBObject basicDBObject = getAccessTokenDBQuery(accessToken);
|
||||
db.getCollection(CollectionNames.IGTIMI_ACCESS_TOKENS.name()).remove(basicDBObject, WriteConcern.SAFE);
|
||||
db.getCollection(CollectionNames.IGTIMI_ACCESS_TOKENS.name()).remove(basicDBObject, WriteConcern.ACKNOWLEDGED);
|
||||
}
|
||||
}
|
||||
|
||||
+20
-20
@@ -356,7 +356,7 @@ public class MongoObjectFactoryImpl implements MongoObjectFactory {
|
||||
storeColumnFactors(leaderboard, dbLeaderboard);
|
||||
storeLeaderboardCorrectionsAndDiscards(leaderboard, dbLeaderboard);
|
||||
}
|
||||
leaderboardCollection.update(query, dbLeaderboard, /* upsrt */ true, /* multi */ false, WriteConcern.SAFE);
|
||||
leaderboardCollection.update(query, dbLeaderboard, /* upsrt */ true, /* multi */ false, WriteConcern.ACKNOWLEDGED);
|
||||
}
|
||||
|
||||
private void storeColumnFactors(Leaderboard leaderboard, BasicDBObject dbLeaderboard) {
|
||||
@@ -491,7 +491,7 @@ public class MongoObjectFactoryImpl implements MongoObjectFactory {
|
||||
DBCollection leaderboardCollection = database.getCollection(CollectionNames.LEADERBOARDS.name());
|
||||
BasicDBObject query = new BasicDBObject(FieldNames.LEADERBOARD_NAME.name(), oldName);
|
||||
BasicDBObject renameUpdate = new BasicDBObject("$set", new BasicDBObject(FieldNames.LEADERBOARD_NAME.name(), newName));
|
||||
leaderboardCollection.update(query, renameUpdate, /* upsert */ true, /* multi */ false, WriteConcern.SAFE);
|
||||
leaderboardCollection.update(query, renameUpdate, /* upsert */ true, /* multi */ false, WriteConcern.ACKNOWLEDGED);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -535,7 +535,7 @@ public class MongoObjectFactoryImpl implements MongoObjectFactory {
|
||||
dbLeaderboardIds.add(dbLeaderboardId);
|
||||
}
|
||||
dbLeaderboardGroup.put(FieldNames.LEADERBOARD_GROUP_LEADERBOARDS.name(), dbLeaderboardIds);
|
||||
leaderboardGroupCollection.update(query, dbLeaderboardGroup, true, false, WriteConcern.SAFE);
|
||||
leaderboardGroupCollection.update(query, dbLeaderboardGroup, true, false, WriteConcern.ACKNOWLEDGED);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -550,7 +550,7 @@ public class MongoObjectFactoryImpl implements MongoObjectFactory {
|
||||
DBCollection leaderboardGroupCollection = database.getCollection(CollectionNames.LEADERBOARD_GROUPS.name());
|
||||
BasicDBObject query = new BasicDBObject(FieldNames.LEADERBOARD_GROUP_NAME.name(), oldName);
|
||||
BasicDBObject update = new BasicDBObject("$set", new BasicDBObject(FieldNames.LEADERBOARD_GROUP_NAME.name(), newName));
|
||||
leaderboardGroupCollection.update(query, update, /* upsert */ true, /* multi */ false, WriteConcern.SAFE);
|
||||
leaderboardGroupCollection.update(query, update, /* upsert */ true, /* multi */ false, WriteConcern.ACKNOWLEDGED);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -560,7 +560,7 @@ public class MongoObjectFactoryImpl implements MongoObjectFactory {
|
||||
newServerConfig.put(FieldNames.SERVER_IS_STANDALONE.name(), serverConfiguration.isStandaloneServer());
|
||||
DBObject currentServerConfig = serverCollection.findOne();
|
||||
if(currentServerConfig != null) {
|
||||
serverCollection.update(currentServerConfig, newServerConfig, /* upsrt */ true, /* multi */ false, WriteConcern.SAFE);
|
||||
serverCollection.update(currentServerConfig, newServerConfig, /* upsrt */ true, /* multi */ false, WriteConcern.ACKNOWLEDGED);
|
||||
} else {
|
||||
serverCollection.save(newServerConfig);
|
||||
}
|
||||
@@ -575,7 +575,7 @@ public class MongoObjectFactoryImpl implements MongoObjectFactory {
|
||||
DBObject serverDBObject = new BasicDBObject();
|
||||
serverDBObject.put(FieldNames.SERVER_NAME.name(), server.getName());
|
||||
serverDBObject.put(FieldNames.SERVER_URL.name(), server.getURL().toExternalForm());
|
||||
serverCollection.update(query, serverDBObject, /* upsrt */ true, /* multi */ false, WriteConcern.SAFE);
|
||||
serverCollection.update(query, serverDBObject, /* upsrt */ true, /* multi */ false, WriteConcern.ACKNOWLEDGED);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -628,7 +628,7 @@ public class MongoObjectFactoryImpl implements MongoObjectFactory {
|
||||
sailorsInfoWebsiteURLs.add(sailorsInfoWebsiteObject);
|
||||
}
|
||||
eventDBObject.put(FieldNames.EVENT_SAILORS_INFO_WEBSITES.name(), sailorsInfoWebsiteURLs);
|
||||
eventCollection.update(query, eventDBObject, /* upsrt */ true, /* multi */ false, WriteConcern.SAFE);
|
||||
eventCollection.update(query, eventDBObject, /* upsrt */ true, /* multi */ false, WriteConcern.ACKNOWLEDGED);
|
||||
// now store the links to the leaderboard groups
|
||||
DBCollection linksCollection = database.getCollection(CollectionNames.LEADERBOARD_GROUP_LINKS_FOR_EVENTS.name());
|
||||
linksCollection.createIndex(new BasicDBObject(FieldNames.EVENT_ID.name(), 1));
|
||||
@@ -639,7 +639,7 @@ public class MongoObjectFactoryImpl implements MongoObjectFactory {
|
||||
DBObject dbLinks = new BasicDBObject();
|
||||
dbLinks.put(FieldNames.EVENT_ID.name(), event.getId());
|
||||
dbLinks.put(FieldNames.LEADERBOARD_GROUP_UUID.name(), lgUUIDs);
|
||||
linksCollection.update(query, dbLinks, /* upsrt */ true, /* multi */ false, WriteConcern.SAFE);
|
||||
linksCollection.update(query, dbLinks, /* upsrt */ true, /* multi */ false, WriteConcern.ACKNOWLEDGED);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -647,7 +647,7 @@ public class MongoObjectFactoryImpl implements MongoObjectFactory {
|
||||
DBCollection eventCollection = database.getCollection(CollectionNames.EVENTS.name());
|
||||
BasicDBObject query = new BasicDBObject(FieldNames.EVENT_ID.name(), id);
|
||||
BasicDBObject renameUpdate = new BasicDBObject("$set", new BasicDBObject(FieldNames.EVENT_NAME.name(), newName));
|
||||
eventCollection.update(query, renameUpdate, /* upsert */ true, /* multi */ false, WriteConcern.SAFE);
|
||||
eventCollection.update(query, renameUpdate, /* upsert */ true, /* multi */ false, WriteConcern.ACKNOWLEDGED);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -722,7 +722,7 @@ public class MongoObjectFactoryImpl implements MongoObjectFactory {
|
||||
final int MAX_TRIES = 3;
|
||||
for (int i=0; i<MAX_TRIES && !success; i++) {
|
||||
try {
|
||||
regattasCollection.update(query, dbRegatta, /* upsrt */ true, /* multi */ false, WriteConcern.SAFE);
|
||||
regattasCollection.update(query, dbRegatta, /* upsrt */ true, /* multi */ false, WriteConcern.ACKNOWLEDGED);
|
||||
success = true;
|
||||
} catch (DuplicateKeyException e) {
|
||||
if (i+1==MAX_TRIES) {
|
||||
@@ -801,7 +801,7 @@ public class MongoObjectFactoryImpl implements MongoObjectFactory {
|
||||
DBObject query = new BasicDBObject(FieldNames.RACE_ID_AS_STRING.name(), raceIDAsString);
|
||||
DBObject entry = new BasicDBObject(FieldNames.RACE_ID_AS_STRING.name(), raceIDAsString);
|
||||
entry.put(FieldNames.REGATTA_NAME.name(), regatta.getName());
|
||||
regattaForRaceIDCollection.update(query, entry, /* upsrt */ true, /* multi */ false, WriteConcern.SAFE);
|
||||
regattaForRaceIDCollection.update(query, entry, /* upsrt */ true, /* multi */ false, WriteConcern.ACKNOWLEDGED);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1336,7 +1336,7 @@ public class MongoObjectFactoryImpl implements MongoObjectFactory {
|
||||
JSONObject json = competitorSerializer.serialize(competitor);
|
||||
DBObject query = (DBObject) JSON.parse(CompetitorJsonSerializer.getCompetitorIdQuery(competitor).toString());
|
||||
DBObject entry = (DBObject) JSON.parse(json.toString());
|
||||
collection.update(query, entry, /* upsrt */true, /* multi */false, WriteConcern.SAFE);
|
||||
collection.update(query, entry, /* upsrt */true, /* multi */false, WriteConcern.ACKNOWLEDGED);
|
||||
}
|
||||
|
||||
private void storeCompetitorWithBoat(CompetitorWithBoat competitor) {
|
||||
@@ -1344,7 +1344,7 @@ public class MongoObjectFactoryImpl implements MongoObjectFactory {
|
||||
JSONObject json = competitorWithBoatRefSerializer.serialize(competitor);
|
||||
DBObject query = (DBObject) JSON.parse(CompetitorJsonSerializer.getCompetitorIdQuery(competitor).toString());
|
||||
DBObject entry = (DBObject) JSON.parse(json.toString());
|
||||
collection.update(query, entry, /* upsrt */true, /* multi */false, WriteConcern.SAFE);
|
||||
collection.update(query, entry, /* upsrt */true, /* multi */false, WriteConcern.ACKNOWLEDGED);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1402,7 +1402,7 @@ public class MongoObjectFactoryImpl implements MongoObjectFactory {
|
||||
logger.info("Removing persistent competitor info for competitor "+competitor.getName()+" with ID "+competitor.getId());
|
||||
DBCollection collection = database.getCollection(CollectionNames.COMPETITORS.name());
|
||||
DBObject query = (DBObject) JSON.parse(CompetitorJsonSerializer.getCompetitorIdQuery(competitor).toString());
|
||||
collection.remove(query, WriteConcern.SAFE);
|
||||
collection.remove(query, WriteConcern.ACKNOWLEDGED);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1411,7 +1411,7 @@ public class MongoObjectFactoryImpl implements MongoObjectFactory {
|
||||
JSONObject json = boatSerializer.serialize(boat);
|
||||
DBObject query = (DBObject) JSON.parse(BoatJsonSerializer.getBoatIdQuery(boat).toString());
|
||||
DBObject entry = (DBObject) JSON.parse(json.toString());
|
||||
collection.update(query, entry, /* upsrt */true, /* multi */false, WriteConcern.SAFE);
|
||||
collection.update(query, entry, /* upsrt */true, /* multi */false, WriteConcern.ACKNOWLEDGED);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1440,7 +1440,7 @@ public class MongoObjectFactoryImpl implements MongoObjectFactory {
|
||||
logger.info("Removing persistent boat "+boat.getName()+" with ID "+boat.getId());
|
||||
DBCollection collection = database.getCollection(CollectionNames.BOATS.name());
|
||||
DBObject query = (DBObject) JSON.parse(BoatJsonSerializer.getBoatIdQuery(boat).toString());
|
||||
collection.remove(query, WriteConcern.SAFE);
|
||||
collection.remove(query, WriteConcern.ACKNOWLEDGED);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1455,7 +1455,7 @@ public class MongoObjectFactoryImpl implements MongoObjectFactory {
|
||||
entryObject.put(FieldNames.CONFIGURATION_MATCHER.name(), createDeviceConfigurationMatcherObject(matcher));
|
||||
entryObject.put(FieldNames.CONFIGURATION_CONFIG.name(), createDeviceConfigurationObject(configuration));
|
||||
|
||||
configurationsCollections.update(query, entryObject, /* upsrt */ true, /* multi */ false, WriteConcern.SAFE);
|
||||
configurationsCollections.update(query, entryObject, /* upsrt */ true, /* multi */ false, WriteConcern.ACKNOWLEDGED);
|
||||
}
|
||||
|
||||
private DBObject createDeviceConfigurationMatcherObject(DeviceConfigurationMatcher matcher) {
|
||||
@@ -1531,7 +1531,7 @@ public class MongoObjectFactoryImpl implements MongoObjectFactory {
|
||||
DBObject query = new BasicDBObject(FieldNames.RESULT_PROVIDERNAME.name(), resultProviderName);
|
||||
DBObject entry = new BasicDBObject(FieldNames.RESULT_PROVIDERNAME.name(), resultProviderName);
|
||||
entry.put(FieldNames.RESULT_URL.name(), url.toString());
|
||||
resultUrlsCollection.update(query, entry, /* upsrt */true, /* multi */false, WriteConcern.SAFE);
|
||||
resultUrlsCollection.update(query, entry, /* upsrt */true, /* multi */false, WriteConcern.ACKNOWLEDGED);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1727,7 +1727,7 @@ public class MongoObjectFactoryImpl implements MongoObjectFactory {
|
||||
final DBCollection collection = database.getCollection(CollectionNames.CONNECTIVITY_PARAMS_FOR_RACES_TO_BE_RESTORED.name());
|
||||
DBObject key = new BasicDBObject();
|
||||
key.putAll(paramsPersistenceService.getKey(params));
|
||||
collection.remove(key, WriteConcern.SAFE);
|
||||
collection.remove(key, WriteConcern.ACKNOWLEDGED);
|
||||
} else {
|
||||
logger.warning("Couldn't find a persistence service for connectivity parameters of type "+typeIdentifier);
|
||||
}
|
||||
@@ -1750,7 +1750,7 @@ public class MongoObjectFactoryImpl implements MongoObjectFactory {
|
||||
key.putAll(paramsPersistenceService.getKey(params));
|
||||
DBObject dbObject = new BasicDBObject();
|
||||
dbObject.putAll(paramsPersistenceService.mapFrom(params));
|
||||
collection.update(key, dbObject, /* upsert */ true, /* multi */ false, WriteConcern.SAFE);
|
||||
collection.update(key, dbObject, /* upsert */ true, /* multi */ false, WriteConcern.ACKNOWLEDGED);
|
||||
} catch (NoCorrespondingServiceRegisteredException e) {
|
||||
logger.log(Level.WARNING, "Couldn't find a persistence service for connectivity parameters of type "+typeIdentifier+
|
||||
". Couldn't store race "+params.getTrackerID()+" for restoring.", e);
|
||||
|
||||
+1
-1
@@ -104,7 +104,7 @@ public class MediaDBImpl implements MediaDB {
|
||||
private DBCollection getVideoCollection() {
|
||||
try {
|
||||
DBCollection dbVideos = database.getCollection(DbNames.Collections.VIDEOS.name());
|
||||
dbVideos.setWriteConcern(WriteConcern.FSYNC_SAFE);
|
||||
dbVideos.setWriteConcern(WriteConcern.JOURNALED);
|
||||
dbVideos.createIndex(new BasicDBObject(DbNames.Collections.VIDEOS.name(), 1));
|
||||
return dbVideos;
|
||||
} catch (NullPointerException e) {
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
package com.sap.sailing.domain.racelogtracking.test;
|
||||
|
||||
import static com.sap.sse.common.Util.size;
|
||||
import static junit.framework.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.mockito.Mockito.mock;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ import com.sap.sailing.domain.base.impl.MarkImpl;
|
||||
import com.sap.sailing.domain.racelogtracking.PingDeviceIdentifierImpl;
|
||||
import com.sap.sse.common.impl.MillisecondsTimePoint;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
public class RevokeDeviceMappingsWithMarkDefinitionTest {
|
||||
private RegattaLog regattaLog;
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
package com.sap.sailing.domain.racelogtracking.test.impl;
|
||||
|
||||
import static com.sap.sse.common.Util.size;
|
||||
import static junit.framework.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
+5
-5
@@ -1,10 +1,10 @@
|
||||
package com.sap.sailing.domain.racelogtracking.test.impl;
|
||||
|
||||
import static com.sap.sse.common.Util.size;
|
||||
import static junit.framework.Assert.assertEquals;
|
||||
import static junit.framework.Assert.assertNotNull;
|
||||
import static junit.framework.Assert.assertNull;
|
||||
import static junit.framework.Assert.assertTrue;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.mockito.Mockito.mock;
|
||||
|
||||
import java.io.Serializable;
|
||||
@@ -411,7 +411,7 @@ public class SensorFixStoreAndLoadTest {
|
||||
bravoFixTrack.getFirstFixAtOrAfter(new MillisecondsTimePoint(FIX_TIMESTAMP3)).getRideHeight());
|
||||
TestFixTrackImpl<Competitor> testFixTrack = trackedRace.getSensorTrack(comp, TestFixTrackImpl.TRACK_NAME);
|
||||
assertEquals(FIX_TEST_VALUE,
|
||||
testFixTrack.getFirstFixAtOrAfter(new MillisecondsTimePoint(FIX_TIMESTAMP)).getTestValue());
|
||||
testFixTrack.getFirstFixAtOrAfter(new MillisecondsTimePoint(FIX_TIMESTAMP)).getTestValue(), 0.0000001);
|
||||
fixLoaderAndTracker.stop(true, /* willBeRemoved */ false);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ import com.sap.sse.common.impl.DegreeBearingImpl;
|
||||
import com.sap.sse.common.impl.MillisecondsTimePoint;
|
||||
import com.sap.sse.common.impl.TimeRangeImpl;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
public class SensorFixStoreTest {
|
||||
private static final long FIX_TIMESTAMP = 110;
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
package com.sap.sailing.domain.racelogtracking.test.impl;
|
||||
|
||||
import static junit.framework.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import java.net.UnknownHostException;
|
||||
import java.util.Arrays;
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
package com.sap.sailing.domain.racelog.test;
|
||||
|
||||
import static junit.framework.Assert.assertSame;
|
||||
import static org.junit.Assert.assertSame;
|
||||
import static org.mockito.Mockito.mock;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ import com.sap.sailing.domain.racelogtracking.DeviceMappingWithRegattaLogEvent;
|
||||
import com.sap.sse.common.TimePoint;
|
||||
import com.sap.sse.common.impl.MillisecondsTimePoint;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
public class DeviceMappingFinderTest extends AbstractRegattaLogTrackingTest {
|
||||
private final Competitor competitor = new CompetitorImpl("comp", "Comp", "KYC", null, null, null, null, /* timeOnTimeFactor */ null, /* timeOnDistanceAllowancePerNauticalMile */ null, null);
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ package com.sap.sailing.domain.regattalog.tracking.analyzing.test;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
|
||||
+3
-3
@@ -1,8 +1,8 @@
|
||||
package com.sap.sailing.domain.common.test;
|
||||
|
||||
import static com.sap.sailing.domain.common.test.TimeTestHelpers.create;
|
||||
import static junit.framework.Assert.assertEquals;
|
||||
import static junit.framework.Assert.assertNull;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
@@ -15,7 +15,7 @@ import com.sap.sse.common.Util;
|
||||
import com.sap.sse.common.impl.MillisecondsTimePoint;
|
||||
import com.sap.sse.common.impl.TimeRangeImpl;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
public class TimeRangeTest {
|
||||
private void liesWithin(long fromOuter, long toOuter, long fromInner, long toInner) {
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ import com.sap.sse.common.TimePoint;
|
||||
import com.sap.sse.common.Util.Pair;
|
||||
import com.sap.sse.common.impl.MillisecondsTimePoint;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
/**
|
||||
* This class contains several tests for the {@link LowPointFirstToWinTwoRaces} scoring rule defined by
|
||||
|
||||
+2
-2
@@ -32,8 +32,8 @@ public class WindSteppingTest {
|
||||
Assert.assertEquals(-1, stepping.getLevelIndexForValue(8));
|
||||
Assert.assertEquals(2.0, stepping.getSteppedValueForValue(1.064), 0.005);
|
||||
Assert.assertEquals(-1.0, stepping.getSteppedValueForValue(7.8365), 0.005);
|
||||
Assert.assertEquals(1.55, stepping.getHistogramXValue(20, 1.5));
|
||||
Assert.assertEquals(2.55, stepping.getHistogramXValue(20, 2.5));
|
||||
Assert.assertEquals(1.55, stepping.getHistogramXValue(20, 1.5), 0.0000001);
|
||||
Assert.assertEquals(2.55, stepping.getHistogramXValue(20, 2.5), 0.0000001);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ import com.sap.sse.common.Util;
|
||||
import com.sap.sse.common.impl.DegreeBearingImpl;
|
||||
import com.sap.sse.common.impl.MillisecondsTimePoint;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
public class MarkPassingCalculatorPerformanceTest extends AbstractMockedRaceMarkPassingTest {
|
||||
|
||||
|
||||
+2
-2
@@ -39,7 +39,7 @@ public class MongoObjectFactoryImpl implements MongoObjectFactory {
|
||||
Exception lastException = null;
|
||||
while (attempt < 5 && !success) {
|
||||
try {
|
||||
expeditionDeviceConfigurationsCollection.update(key, expeditionDeviceConfigurationDBObject, /* upsert */ true, /* multi */ false, WriteConcern.SAFE);
|
||||
expeditionDeviceConfigurationsCollection.update(key, expeditionDeviceConfigurationDBObject, /* upsert */ true, /* multi */ false, WriteConcern.ACKNOWLEDGED);
|
||||
success = true;
|
||||
attempt++;
|
||||
} catch (Exception e) {
|
||||
@@ -54,6 +54,6 @@ public class MongoObjectFactoryImpl implements MongoObjectFactory {
|
||||
|
||||
@Override
|
||||
public void removeExpeditionDeviceConfiguration(ExpeditionDeviceConfiguration expeditionDeviceConfiguration) {
|
||||
expeditionDeviceConfigurationsCollection.remove(getExpeditionDeviceConfigurationDBKey(expeditionDeviceConfiguration), WriteConcern.SAFE);
|
||||
expeditionDeviceConfigurationsCollection.remove(getExpeditionDeviceConfigurationDBKey(expeditionDeviceConfiguration), WriteConcern.ACKNOWLEDGED);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@ import com.sap.sailing.domain.common.impl.PlacemarkImpl;
|
||||
import com.sap.sailing.geocoding.ReverseGeocoder;
|
||||
import com.sap.sailing.geocoding.impl.ReverseGeocoderImpl;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
public class ReverseGeocoderTest {
|
||||
private ReverseGeocoder geocoder;
|
||||
|
||||
@@ -42,7 +42,7 @@ import com.sap.sse.common.impl.CountryCodeFactoryImpl;
|
||||
import com.sap.sse.common.impl.MillisecondsTimePoint;
|
||||
import com.sap.sse.util.ClearStateTestSupport;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
public class SlicingTest {
|
||||
private final String regattaName = "test";
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ import java.net.URL;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@ import com.sap.sse.common.Util;
|
||||
import com.sap.sse.common.impl.AbstractColor;
|
||||
import com.sap.sse.common.impl.DegreeBearingImpl;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
public abstract class RaceLogMongoDBTest extends AbstractMongoDBTest {
|
||||
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ import com.sap.sailing.selenium.core.FindBy;
|
||||
import com.sap.sailing.selenium.pages.HostPage;
|
||||
import com.sap.sailing.selenium.pages.gwt.CheckBoxPO;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
/**
|
||||
* <p>The page object representing the leaderboard.</p>
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ import static com.sap.sailing.selenium.pages.common.DateHelper.getPastTime;
|
||||
import java.util.Date;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ import com.sap.sailing.selenium.pages.leaderboard.PairinfListCreationDialogPO;
|
||||
import com.sap.sailing.selenium.pages.leaderboard.PairingListCreationSetupDialogPO;
|
||||
import com.sap.sailing.selenium.test.AbstractSeleniumTest;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
public class PairinglistTest extends AbstractSeleniumTest {
|
||||
private static final String EVENT = "TestEvent";
|
||||
|
||||
+2
-2
@@ -2,7 +2,6 @@ package com.sap.sailing.server.gateway.serialization.test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertThat;
|
||||
import static org.junit.matchers.JUnitMatchers.hasItem;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
@@ -10,6 +9,7 @@ import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.hamcrest.CoreMatchers;
|
||||
import org.json.simple.JSONArray;
|
||||
import org.json.simple.JSONObject;
|
||||
import org.junit.Before;
|
||||
@@ -66,7 +66,7 @@ public class VenueJsonSerializerTest {
|
||||
JSONArray actualCourseAreas = (JSONArray) result.get(VenueJsonSerializer.FIELD_COURSE_AREAS);
|
||||
assertEquals(expectedCourseAreas.size(), actualCourseAreas.size());
|
||||
for (JSONObject courseArea : expectedCourseAreas.values()) {
|
||||
assertThat(actualCourseAreas, hasItem((Object)courseArea));
|
||||
assertThat(actualCourseAreas, CoreMatchers.hasItem((Object)courseArea));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ import com.sap.sse.common.Util;
|
||||
import com.sap.sse.common.impl.AbstractColor;
|
||||
import com.sap.sse.common.impl.MillisecondsTimePoint;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
public class RaceLogCourseDesignChangedEventSerializerTest {
|
||||
|
||||
|
||||
+2
-2
@@ -48,7 +48,7 @@ import com.sap.sse.common.media.MimeType;
|
||||
import com.sap.sse.mongodb.MongoDBConfiguration;
|
||||
import com.sap.sse.mongodb.MongoDBService;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
public class MediaReplicationTest extends AbstractServerReplicationTest {
|
||||
|
||||
@@ -283,7 +283,7 @@ public class MediaReplicationTest extends AbstractServerReplicationTest {
|
||||
|
||||
private void deleteAllDataFromDatabase() {
|
||||
MongoDBService service = MongoDBConfiguration.getDefaultTestConfiguration().getService();
|
||||
service.getDB().getWriteConcern().fsync();
|
||||
service.getDB().getWriteConcern().getJournal();
|
||||
service.getDB().dropDatabase();
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ import static org.junit.Assert.assertNotNull;
|
||||
import java.io.IOException;
|
||||
import java.util.UUID;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ import com.sap.sailing.domain.common.dto.AnniversaryType;
|
||||
import com.sap.sailing.server.anniversary.AnniversaryRaceDeterminator.AnniversaryChecker;
|
||||
import com.sap.sailing.server.anniversary.checker.QuarterChecker;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
public class AnniversaryQuarterCheckerTest {
|
||||
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ import com.sap.sailing.domain.common.dto.AnniversaryType;
|
||||
import com.sap.sailing.server.anniversary.AnniversaryRaceDeterminator.AnniversaryChecker;
|
||||
import com.sap.sailing.server.anniversary.checker.SameDigitChecker;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
public class AnniversarySameDigitCheckerTest {
|
||||
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
package com.sap.sailing.server.statistics;
|
||||
|
||||
import static junit.framework.Assert.assertEquals;
|
||||
import static junit.framework.Assert.assertTrue;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.mockito.Mockito.mock;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ import java.io.ObjectOutputStream;
|
||||
import java.io.PipedInputStream;
|
||||
import java.io.PipedOutputStream;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
|
||||
+12
-12
@@ -146,7 +146,7 @@ import com.sap.sse.mongodb.MongoDBService;
|
||||
import com.sap.sse.shared.media.ImageDescriptor;
|
||||
import com.sap.sse.shared.media.VideoDescriptor;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
public class MasterDataImportTest {
|
||||
|
||||
@@ -189,7 +189,7 @@ public class MasterDataImportTest {
|
||||
|
||||
private void deleteAllDataFromDatabase() {
|
||||
MongoDBService service = MongoDBConfiguration.getDefaultTestConfiguration().getService();
|
||||
service.getDB().getWriteConcern().fsync();
|
||||
service.getDB().getWriteConcern().getJournal();
|
||||
service.getDB().dropDatabase();
|
||||
}
|
||||
|
||||
@@ -366,7 +366,7 @@ public class MasterDataImportTest {
|
||||
destService = new RacingEventServiceImplMock(new DataImportProgressImpl(randomUUID), serviceFinderFactory){};
|
||||
domainFactory = destService.getBaseDomainFactory();
|
||||
DB db = destService.getMongoObjectFactory().getDatabase();
|
||||
db.setWriteConcern(WriteConcern.SAFE);
|
||||
db.setWriteConcern(WriteConcern.ACKNOWLEDGED);
|
||||
inputStream = new ByteArrayInputStream(os.toByteArray());
|
||||
MasterDataImporter importer = new MasterDataImporter(domainFactory, destService);
|
||||
importer.importFromStream(inputStream, randomUUID, false);
|
||||
@@ -411,7 +411,7 @@ public class MasterDataImportTest {
|
||||
|
||||
raceColumnOnTarget.setTrackedRace(fleet1OnTarget, trackedRaceForTarget);
|
||||
|
||||
Assert.assertEquals(factor, leaderboard.getScoringScheme().getScoreFactor(raceColumnOnTarget));
|
||||
Assert.assertEquals(factor, leaderboard.getScoringScheme().getScoreFactor(raceColumnOnTarget), 0.000001);
|
||||
|
||||
Iterable<Competitor> competitorsOnTarget = leaderboardOnTarget.getAllCompetitors();
|
||||
Iterator<Competitor> competitorIterator = competitorsOnTarget.iterator();
|
||||
@@ -422,12 +422,12 @@ public class MasterDataImportTest {
|
||||
Assert.assertEquals(
|
||||
scoreCorrection,
|
||||
leaderboardOnTarget.getScoreCorrection().getExplicitScoreCorrection(competitorOnTarget,
|
||||
raceColumnOnTarget));
|
||||
raceColumnOnTarget), 0.0000001);
|
||||
Assert.assertEquals(maxPointsReason, leaderboardOnTarget.getScoreCorrection()
|
||||
.getMaxPointsReason(competitorOnTarget, raceColumnOnTarget, MillisecondsTimePoint.now()));
|
||||
|
||||
// Check for carried points
|
||||
Assert.assertEquals(carriedPoints, leaderboardOnTarget.getCarriedPoints(competitorOnTarget));
|
||||
Assert.assertEquals(carriedPoints, leaderboardOnTarget.getCarriedPoints(competitorOnTarget), 0.0000001);
|
||||
|
||||
// Check for suppressed competitor
|
||||
Assert.assertTrue(leaderboardOnTarget.getSuppressedCompetitors().iterator().hasNext());
|
||||
@@ -676,7 +676,7 @@ public class MasterDataImportTest {
|
||||
Assert.assertEquals(
|
||||
scoreCorrection,
|
||||
leaderboardOnTarget.getScoreCorrection().getExplicitScoreCorrection(competitorOnTarget,
|
||||
raceColumnOnTarget));
|
||||
raceColumnOnTarget), 0.0000001);
|
||||
Assert.assertEquals(
|
||||
maxPointsReason,
|
||||
leaderboardOnTarget.getScoreCorrection().getMaxPointsReason(competitorOnTarget, raceColumnOnTarget,
|
||||
@@ -2091,7 +2091,7 @@ public class MasterDataImportTest {
|
||||
|
||||
RaceColumn metaColumn = metaColumns.iterator().next();
|
||||
Assert.assertNotNull(metaColumn);
|
||||
Assert.assertEquals(factor, overallLeaderboard.getScoringScheme().getScoreFactor(metaColumn));
|
||||
Assert.assertEquals(factor, overallLeaderboard.getScoringScheme().getScoreFactor(metaColumn), 0.0000001);
|
||||
|
||||
// Verify that overall leaderboard data has been persisted
|
||||
RacingEventService persistenceVerifier = new RacingEventServiceImplMock(){};
|
||||
@@ -2113,7 +2113,7 @@ public class MasterDataImportTest {
|
||||
|
||||
metaColumn = metaColumns.iterator().next();
|
||||
Assert.assertNotNull(metaColumn);
|
||||
Assert.assertEquals(factor, overallLeaderboard.getScoringScheme().getScoreFactor(metaColumn));
|
||||
Assert.assertEquals(factor, overallLeaderboard.getScoringScheme().getScoreFactor(metaColumn), 0.0000001);
|
||||
|
||||
}
|
||||
|
||||
@@ -2287,18 +2287,18 @@ public class MasterDataImportTest {
|
||||
|
||||
raceColumnOnTarget.setTrackedRace(defaultFleetOnTarget, trackedRaceForTarget);
|
||||
|
||||
Assert.assertEquals(factor, leaderboardOnTarget.getScoringScheme().getScoreFactor(raceColumnOnTarget));
|
||||
Assert.assertEquals(factor, leaderboardOnTarget.getScoringScheme().getScoreFactor(raceColumnOnTarget), 0.0000001);
|
||||
|
||||
// Check for score corrections
|
||||
Assert.assertEquals(
|
||||
scoreCorrection,
|
||||
leaderboardOnTarget.getScoreCorrection().getExplicitScoreCorrection(competitorOnTarget,
|
||||
raceColumnOnTarget));
|
||||
raceColumnOnTarget), 0.0000001);
|
||||
Assert.assertEquals(maxPointsReason, leaderboardOnTarget.getScoreCorrection()
|
||||
.getMaxPointsReason(competitorOnTarget, raceColumnOnTarget, MillisecondsTimePoint.now()));
|
||||
|
||||
// Check for carried points
|
||||
Assert.assertEquals(carriedPoints, leaderboardOnTarget.getCarriedPoints(competitorOnTarget));
|
||||
Assert.assertEquals(carriedPoints, leaderboardOnTarget.getCarriedPoints(competitorOnTarget), 0.0000001);
|
||||
|
||||
// Check for suppressed competitor
|
||||
Assert.assertTrue(leaderboardOnTarget.getSuppressedCompetitors().iterator().hasNext());
|
||||
|
||||
+1
-1
@@ -67,7 +67,7 @@ import com.sap.sse.common.impl.DegreeBearingImpl;
|
||||
import com.sap.sse.common.impl.MillisecondsTimePoint;
|
||||
import com.sap.sse.mongodb.MongoDBService;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
public class RaceColumnReloadTest {
|
||||
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ import org.junit.Test;
|
||||
|
||||
import com.sap.sailing.domain.common.sharding.ShardingType;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
public class ShardingLeaderBoardEncodingTest {
|
||||
@Test
|
||||
|
||||
+7
-5
@@ -6,7 +6,9 @@ import com.sap.sailing.server.trackfiles.impl.doublefix.DoubleFixProcessor;
|
||||
import com.sap.sailing.server.trackfiles.impl.doublefix.DoubleVectorFixData;
|
||||
import com.sap.sailing.server.trackfiles.impl.doublefix.DownsamplerTo1HzProcessor;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import org.junit.Assert;
|
||||
|
||||
public class DownsamplerTo1HzProcessorTest {
|
||||
|
||||
@@ -67,10 +69,10 @@ public class DownsamplerTo1HzProcessorTest {
|
||||
Assert.assertEquals("Count consolidated fixes", 1, delegate.countAccepted);
|
||||
DoubleVectorFixData lastFix = delegate.lastFix;
|
||||
Assert.assertNotNull("Lastfix", lastFix);
|
||||
Assert.assertEquals("Avg col 1", (12.4d + 0.01d - 10d + 1d + 0d) / 5d, lastFix.getFix()[0]);
|
||||
Assert.assertEquals("Avg col 2", 9d / 5d, lastFix.getFix()[1]);
|
||||
Assert.assertEquals("Avg col 3", 1d, lastFix.getFix()[2]);
|
||||
Assert.assertEquals("Avg col 4", 0d, lastFix.getFix()[3]);
|
||||
assertEquals("Avg col 1", (12.4d + 0.01d - 10d + 1d + 0d) / 5d, (double) lastFix.getFix()[0], 0.000001);
|
||||
assertEquals("Avg col 2", 9d / 5d, (double) lastFix.getFix()[1], 0.000001);
|
||||
assertEquals("Avg col 3", 1d, (double) lastFix.getFix()[2], 0.000001);
|
||||
assertEquals("Avg col 4", 0d, (double) lastFix.getFix()[3], 0.000001);
|
||||
}
|
||||
|
||||
private final class MyProcessor implements DoubleFixProcessor {
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ import com.sap.sse.common.TimePoint;
|
||||
import com.sap.sse.common.Util;
|
||||
import com.sap.sse.common.impl.MillisecondsTimePoint;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
public class LearningBatchProcessorTest {
|
||||
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ import com.sap.sailing.simulator.impl.BoatClassPropertiesImpl;
|
||||
import com.sap.sailing.simulator.impl.ConfigurationManager;
|
||||
import com.sap.sailing.simulator.impl.RacePropertiesImpl;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
public class ConfigurationManagerTest {
|
||||
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ import java.util.Map.Entry;
|
||||
import java.util.NavigableMap;
|
||||
import java.util.Set;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
package com.sap.sailing.simulator.test;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ import java.sql.Date;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ import java.io.InputStream;
|
||||
import java.io.ObjectInput;
|
||||
import java.io.ObjectInputStream;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
import com.sap.sailing.domain.common.Position;
|
||||
import com.sap.sailing.domain.common.impl.DegreePosition;
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ package com.sap.sailing.simulator.test.util;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
import com.sap.sailing.domain.common.impl.MeterDistance;
|
||||
import com.sap.sailing.simulator.Path;
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ import java.net.URL;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ import com.sap.sse.common.impl.RGBColor;
|
||||
import com.sap.sse.common.Color;
|
||||
import com.sap.sse.common.Util.Triple;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
public class AbstractColorTest {
|
||||
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ import java.util.UUID;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@ import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.mongodb.DB;
|
||||
import com.mongodb.Mongo;
|
||||
import com.mongodb.MongoClient;
|
||||
import com.mongodb.MongoClientURI;
|
||||
import com.sap.sse.mongodb.AlreadyRegisteredException;
|
||||
@@ -20,7 +19,7 @@ public class MongoDBServiceImpl implements MongoDBService {
|
||||
|
||||
private MongoDBConfiguration configuration;
|
||||
|
||||
private final Map<MongoClientURI, Mongo> mongos;
|
||||
private final Map<MongoClientURI, MongoClient> mongos;
|
||||
|
||||
private final Map<MongoClientURI, DB> dbs;
|
||||
|
||||
@@ -65,7 +64,7 @@ public class MongoDBServiceImpl implements MongoDBService {
|
||||
final MongoClientURI key = mongoDBConfiguration.getMongoClientURI();
|
||||
DB db = dbs.get(key);
|
||||
if (db == null) {
|
||||
Mongo mongo = mongos.get(key);
|
||||
MongoClient mongo = mongos.get(key);
|
||||
if (mongo == null) {
|
||||
mongo = new MongoClient(mongoDBConfiguration.getMongoClientURI());
|
||||
mongos.put(key, mongo);
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ import com.sap.sse.security.shared.UserManagementException;
|
||||
import com.sap.sse.security.userstore.mongodb.UserStoreImpl;
|
||||
import com.sap.sse.security.userstore.mongodb.impl.CollectionNames;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
public class PreferenceObjectBasedNotificationSetTest {
|
||||
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ import com.sap.sse.security.shared.UserManagementException;
|
||||
import com.sap.sse.security.userstore.mongodb.UserStoreImpl;
|
||||
import com.sap.sse.security.userstore.mongodb.impl.CollectionNames;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
public class UserPreferenceObjectAndConverterTest {
|
||||
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ import org.junit.Test;
|
||||
import com.sap.sse.pairinglist.PairingListTemplate;
|
||||
import com.sap.sse.pairinglist.impl.PairingListTemplateFactoryImpl;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
public class PairingListTemplateFactoryTest {
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import org.junit.Test;
|
||||
|
||||
import com.sap.sse.pairinglist.impl.PairingListTemplateImpl;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
|
||||
public class PairingListTemplateTest extends PairingListTemplateImpl {
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ import net.sf.marineapi.nmea.sentence.TalkerId;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import static junit.framework.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
/**
|
||||
* MHU parser tests.
|
||||
|
||||
Reference in New Issue
Block a user