mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-17 01:31:01 +00:00
remove quadruple from simulator code;
This commit is contained in:
1 parent
fa357054f8
commit
0f49df97b5
9 files changed
+135
-116
No files matched your search
+23
-21
@@ -8,43 +8,45 @@ import junit.framework.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.sap.sailing.domain.common.impl.Util.Quadruple;
|
||||
import com.sap.sailing.simulator.BoatClassProperties;
|
||||
import com.sap.sailing.simulator.RaceProperties;
|
||||
import com.sap.sailing.simulator.impl.BoatClassPropertiesImpl;
|
||||
import com.sap.sailing.simulator.impl.ConfigurationManager;
|
||||
import com.sap.sailing.simulator.impl.RacePropertiesImpl;
|
||||
|
||||
public class ConfigurationManagerTest {
|
||||
|
||||
private final List<Quadruple<String, Double, String, Integer>> _boatClassesInfo = new ArrayList<Quadruple<String, Double, String, Integer>>();
|
||||
|
||||
private final List<Quadruple<String, String, String, Integer>> _racesInfo = new ArrayList<Quadruple<String, String, String, Integer>>();
|
||||
private final List<BoatClassProperties> _boatClassesInfo = new ArrayList<BoatClassProperties>();
|
||||
private final List<RaceProperties> _racesInfo = new ArrayList<RaceProperties>();
|
||||
|
||||
@Before
|
||||
public void initialize() {
|
||||
this._boatClassesInfo.add(new Quadruple<String, Double, String, Integer>("49er", 4.995, "resources/PolarDiagram49.csv", 0));
|
||||
this._boatClassesInfo.add(new Quadruple<String, Double, String, Integer>("49er Bethwaite", 4.876, "resources/PolarDiagram49Bethwaite.csv", 1));
|
||||
this._boatClassesInfo.add(new Quadruple<String, Double, String, Integer>("49er ORC", 4.995, "resources/PolarDiagram49ORC.csv", 2));
|
||||
this._boatClassesInfo.add(new Quadruple<String, Double, String, Integer>("49er STG", 4.876, "resources/PolarDiagram49STG.csv", 3));
|
||||
this._boatClassesInfo.add(new Quadruple<String, Double, String, Integer>("505 STG", 5.05, "resources/PolarDiagram505STG.csv", 4));
|
||||
this._boatClassesInfo.add(new BoatClassPropertiesImpl("49er", 4.995, "resources/PolarDiagram49.csv", 0));
|
||||
this._boatClassesInfo.add(new BoatClassPropertiesImpl("49er Bethwaite", 4.876, "resources/PolarDiagram49Bethwaite.csv", 1));
|
||||
this._boatClassesInfo.add(new BoatClassPropertiesImpl("49er ORC", 4.995, "resources/PolarDiagram49ORC.csv", 2));
|
||||
this._boatClassesInfo.add(new BoatClassPropertiesImpl("49er STG", 4.876, "resources/PolarDiagram49STG.csv", 3));
|
||||
this._boatClassesInfo.add(new BoatClassPropertiesImpl("505 STG", 5.05, "resources/PolarDiagram505STG.csv", 4));
|
||||
|
||||
this._racesInfo
|
||||
.add(new Quadruple<String, String, String, Integer>(
|
||||
.add(new RacePropertiesImpl(
|
||||
"Internationale Deutche Meisterschaft - 49er Race4",
|
||||
"49er STG",
|
||||
"http://germanmaster.traclive.dk/events/event_20110929_Internatio/clientparams.php?event=event_20110929_Internatio&race=d1f521fa-ec52-11e0-a523-406186cbf87c",
|
||||
0));
|
||||
this._racesInfo
|
||||
.add(new Quadruple<String, String, String, Integer>(
|
||||
.add(new RacePropertiesImpl (
|
||||
"Internationale Deutche Meisterschaft - 49er Race5",
|
||||
"49er STG",
|
||||
"http://germanmaster.traclive.dk/events/event_20110929_Internatio/clientparams.php?event=event_20110929_Internatio&race=eb06795a-ec52-11e0-a523-406186cbf87c",
|
||||
1));
|
||||
this._racesInfo
|
||||
.add(new Quadruple<String, String, String, Integer>(
|
||||
.add(new RacePropertiesImpl (
|
||||
"Internationale Deutche Meisterschaft - Star Race4",
|
||||
"49er STG",
|
||||
"http://germanmaster.traclive.dk/events/event_20110929_Internatio/clientparams.php?event=event_20110929_Internatio&race=6bb0829e-ec44-11e0-a523-406186cbf87c",
|
||||
2));
|
||||
this._racesInfo
|
||||
.add(new Quadruple<String, String, String, Integer>(
|
||||
.add(new RacePropertiesImpl (
|
||||
"Kieler Woche 2012 - 49er Yellow - Race 1",
|
||||
"49er STG",
|
||||
"http://germanmaster.traclive.dk/events/event_20120615_KielerWoch/clientparams.php?event=event_20120615_KielerWoch&race=0b5969cc-b789-11e1-a845-406186cbf87c",
|
||||
@@ -73,10 +75,10 @@ public class ConfigurationManagerTest {
|
||||
@Test
|
||||
public void test_getBoatClassesInfo() {
|
||||
int index = 0;
|
||||
for (final Quadruple<String, Double, String, Integer> tuple : ConfigurationManager.INSTANCE.getBoatClassesInfo()) {
|
||||
Assert.assertEquals(this._boatClassesInfo.get(index).getA(), tuple.getA());
|
||||
Assert.assertEquals(this._boatClassesInfo.get(index).getB(), tuple.getB());
|
||||
Assert.assertEquals(this._boatClassesInfo.get(index).getC(), tuple.getC());
|
||||
for (final BoatClassProperties tuple : ConfigurationManager.INSTANCE.getBoatClassesInfo()) {
|
||||
Assert.assertEquals(this._boatClassesInfo.get(index).getName(), tuple.getName());
|
||||
Assert.assertEquals(this._boatClassesInfo.get(index).getLength(), tuple.getLength());
|
||||
Assert.assertEquals(this._boatClassesInfo.get(index).getPolar(), tuple.getPolar());
|
||||
index++;
|
||||
}
|
||||
}
|
||||
@@ -84,10 +86,10 @@ public class ConfigurationManagerTest {
|
||||
@Test
|
||||
public void test_getRacesInfo() {
|
||||
int index = 0;
|
||||
for (final Quadruple<String, String, String, Integer> tuple : ConfigurationManager.INSTANCE.getRacesInfo()) {
|
||||
Assert.assertEquals(this._racesInfo.get(index).getA(), tuple.getA());
|
||||
Assert.assertEquals(this._racesInfo.get(index).getB(), tuple.getB());
|
||||
Assert.assertEquals(this._racesInfo.get(index).getC(), tuple.getC());
|
||||
for (final RaceProperties tuple : ConfigurationManager.INSTANCE.getRacesInfo()) {
|
||||
Assert.assertEquals(this._racesInfo.get(index).getName(), tuple.getName());
|
||||
Assert.assertEquals(this._racesInfo.get(index).getBoatClass(), tuple.getBoatClass());
|
||||
Assert.assertEquals(this._racesInfo.get(index).getURL(), tuple.getURL());
|
||||
index++;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user