added test for PolarDiagramImpl49

This commit is contained in:
Alexandru Dimofte committed 2012-05-29 11:51:02 +03:00
1 parent 8db21ee761
commit 8a2efddc89
1 file changed
+44
@@ -5,12 +5,19 @@ import static org.junit.Assert.*;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.NavigableMap;
import java.util.SortedSet;
import java.util.TreeMap;
import java.util.TreeSet;
import java.util.logging.Logger;
import org.junit.Test;
import com.sap.sailing.domain.common.Bearing;
import com.sap.sailing.domain.common.Distance;
import com.sap.sailing.domain.common.Position;
import com.sap.sailing.domain.common.Speed;
import com.sap.sailing.domain.common.impl.DegreeBearingImpl;
import com.sap.sailing.domain.common.impl.DegreePosition;
import com.sap.sailing.simulator.Boundary;
import com.sap.sailing.simulator.Path;
@@ -26,6 +33,8 @@ import com.sap.sailing.simulator.impl.SimulationParametersImpl;
import com.sap.sailing.simulator.impl.TimedPositionWithSpeedSimple;
import com.sap.sailing.simulator.impl.WindFieldImpl;
import com.sap.sailing.domain.base.impl.KnotSpeedImpl;
public class SimulatorTest {
private static Logger logger = Logger.getLogger("com.sap.sailing");
@@ -89,4 +98,39 @@ public class SimulatorTest {
assertEquals("Number of path points", 30, pth.getPathPoints().size());
}
@Test
public void testPolarDiagram49_1() {
SortedSet<Speed> speeds = new TreeSet<Speed>();
NavigableMap<Speed, NavigableMap<Bearing, Speed>> table = new TreeMap<Speed, NavigableMap<Bearing, Speed>>();
NavigableMap<Bearing, Speed> tableRow;
tableRow = new TreeMap<Bearing,Speed>();
tableRow.put(new DegreeBearingImpl(0), Speed.NULL);
tableRow.put(new DegreeBearingImpl(52), Speed.NULL);
tableRow.put(new DegreeBearingImpl(60), Speed.NULL);
tableRow.put(new DegreeBearingImpl(75), Speed.NULL);
tableRow.put(new DegreeBearingImpl(90), Speed.NULL);
tableRow.put(new DegreeBearingImpl(110), Speed.NULL);
tableRow.put(new DegreeBearingImpl(120), Speed.NULL);
tableRow.put(new DegreeBearingImpl(135), Speed.NULL);
tableRow.put(new DegreeBearingImpl(150), Speed.NULL);
tableRow.put(new DegreeBearingImpl(180), Speed.NULL);
table.put(Speed.NULL, tableRow);
tableRow = new TreeMap<Bearing,Speed>();
tableRow.put(new DegreeBearingImpl(0), Speed.NULL);
tableRow.put(new DegreeBearingImpl(52), new KnotSpeedImpl(6.57));
tableRow.put(new DegreeBearingImpl(60), new KnotSpeedImpl(7.01));
tableRow.put(new DegreeBearingImpl(75), new KnotSpeedImpl(7.36));
tableRow.put(new DegreeBearingImpl(90), new KnotSpeedImpl(7.31));
tableRow.put(new DegreeBearingImpl(110), new KnotSpeedImpl(0));
tableRow.put(new DegreeBearingImpl(120), new KnotSpeedImpl(0));
tableRow.put(new DegreeBearingImpl(135), new KnotSpeedImpl(0));
tableRow.put(new DegreeBearingImpl(150), new KnotSpeedImpl(0));
tableRow.put(new DegreeBearingImpl(180), new KnotSpeedImpl(0));
table.put(new KnotSpeedImpl(6), tableRow);
}
}