Merge branch 'master' into polar-api

Conflicts:
	java/com.sap.sailing.domain/META-INF/MANIFEST.MF
	java/com.sap.sailing.gwt.ui/META-INF/MANIFEST.MF
	java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/SailingService.java
	java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/SailingServiceAsync.java
	java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/server/SailingServiceImpl.java
	java/com.sap.sailing.mongodb.test/META-INF/MANIFEST.MF
	java/com.sap.sailing.server.gateway/META-INF/MANIFEST.MF
	java/com.sap.sailing.server.replication.test/META-INF/MANIFEST.MF
	java/com.sap.sailing.server/META-INF/MANIFEST.MF
	java/com.sap.sailing.server/SailingServer (No Proxy).launch
	java/com.sap.sailing.server/SailingServer (No Proxy, Jetty on 8889, Cached MTB).launch
	java/com.sap.sailing.server/SailingServer (No Proxy, winddbTest).launch
	java/com.sap.sailing.server/SailingServer (Proxy, Jetty on 8889).launch
	java/com.sap.sailing.server/SailingServer (Proxy, Remote Debug SAP VM).launch
	java/com.sap.sailing.server/SailingServer (Proxy, SwissTiming Live Simulation).launch
	java/com.sap.sailing.server/SailingServer (Proxy, winddbTest).launch
	java/com.sap.sailing.server/src/com/sap/sailing/server/impl/RacingEventServiceImpl.java
	java/com.sap.sailing.targetplatform/definitions/race-analysis-p2-ide-local.target
	java/com.sap.sse.datamining/src/com/sap/sse/datamining/impl/components/AbstractParallelMultiDimensionalGroupingProcessor.java
This commit is contained in:
Frederik Petersen committed 2014-10-16 09:33:58 +02:00
commit 4cad148934
2533 files changed
+118571 -57002

No files matched your search

+8 -8
View File
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="output" path="bin"/>
</classpath>
+12 -8
View File
@@ -1,8 +1,12 @@
#Thu Jan 19 09:52:44 CET 2012
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.7
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8
+13 -13
View File
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/com.sap.sailing.domain.test/src/com/sap/sailing/domain/test/FetchTracksAndStoreLocallyTest.java"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="1"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.sap.sailing.domain.test.FetchTracksAndStoreLocallyTest"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="event_20110505_SailingTea abf0d9f4-016f-11e1-9787-406186cbf87c 3b964570-0171-11e1-9787-406186cbf87c 0c4d0baa-0171-11e1-9787-406186cbf87c e9bd4f18-0171-11e1-9787-406186cbf87c 634d0f80-019f-11e1-9efc-406186cbf87c 94f4ad68-019f-11e1-9efc-406186cbf87c dd8f6f40-019f-11e1-9efc-406186cbf87c fe88769c-019f-11e1-9efc-406186cbf87c 18f75c6e-01a0-11e1-9efc-406186cbf87c 4eabdd1c-01a0-11e1-9efc-406186cbf87c b48bbca6-01a0-11e1-9efc-406186cbf87c d23a2f6c-01a0-11e1-9efc-406186cbf87c 711c50fa-01a2-11e1-9efc-406186cbf87c 94ad14d2-01a2-11e1-9efc-406186cbf87c 9c1698c4-0247-11e1-9efc-406186cbf87c 47ea61ac-01a4-11e1-9efc-406186cbf87c a9fff154-02cb-11e1-9efc-406186cbf87c 87a80e52-02cb-11e1-9efc-406186cbf87c baa795a2-02cb-11e1-9efc-406186cbf87c cb39980c-02cb-11e1-9efc-406186cbf87c f3c76a6a-02cb-11e1-9efc-406186cbf87c e015db32-02cb-11e1-9efc-406186cbf87c 06fcf3d4-02cc-11e1-9efc-406186cbf87c 237c267e-02cc-11e1-9efc-406186cbf87c 9244339e-02d1-11e1-9efc-406186cbf87c d793e304-02d1-11e1-9efc-406186cbf87c 0348a674-02d2-11e1-9efc-406186cbf87c 01ea3604-02ef-11e1-9efc-406186cbf87c 83165008-02d3-11e1-9efc-406186cbf87c ba0c75f6-02d3-11e1-9efc-406186cbf87c d122fa12-02d3-11e1-9efc-406186cbf87c e40ec25a-02d3-11e1-9efc-406186cbf87c"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.sap.sailing.domain.test"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dhttp.proxyHost=proxy.wdf.sap.corp -Dhttp.proxyPort=8080 -Dtractrac.tunnel=true"/>
</launchConfiguration>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/com.sap.sailing.domain.test/src/com/sap/sailing/domain/test/FetchTracksAndStoreLocallyTest.java"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="1"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.sap.sailing.domain.test.FetchTracksAndStoreLocallyTest"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="event_20110505_SailingTea abf0d9f4-016f-11e1-9787-406186cbf87c 3b964570-0171-11e1-9787-406186cbf87c 0c4d0baa-0171-11e1-9787-406186cbf87c e9bd4f18-0171-11e1-9787-406186cbf87c 634d0f80-019f-11e1-9efc-406186cbf87c 94f4ad68-019f-11e1-9efc-406186cbf87c dd8f6f40-019f-11e1-9efc-406186cbf87c fe88769c-019f-11e1-9efc-406186cbf87c 18f75c6e-01a0-11e1-9efc-406186cbf87c 4eabdd1c-01a0-11e1-9efc-406186cbf87c b48bbca6-01a0-11e1-9efc-406186cbf87c d23a2f6c-01a0-11e1-9efc-406186cbf87c 711c50fa-01a2-11e1-9efc-406186cbf87c 94ad14d2-01a2-11e1-9efc-406186cbf87c 9c1698c4-0247-11e1-9efc-406186cbf87c 47ea61ac-01a4-11e1-9efc-406186cbf87c a9fff154-02cb-11e1-9efc-406186cbf87c 87a80e52-02cb-11e1-9efc-406186cbf87c baa795a2-02cb-11e1-9efc-406186cbf87c cb39980c-02cb-11e1-9efc-406186cbf87c f3c76a6a-02cb-11e1-9efc-406186cbf87c e015db32-02cb-11e1-9efc-406186cbf87c 06fcf3d4-02cc-11e1-9efc-406186cbf87c 237c267e-02cc-11e1-9efc-406186cbf87c 9244339e-02d1-11e1-9efc-406186cbf87c d793e304-02d1-11e1-9efc-406186cbf87c 0348a674-02d2-11e1-9efc-406186cbf87c 01ea3604-02ef-11e1-9efc-406186cbf87c 83165008-02d3-11e1-9efc-406186cbf87c ba0c75f6-02d3-11e1-9efc-406186cbf87c d122fa12-02d3-11e1-9efc-406186cbf87c e40ec25a-02d3-11e1-9efc-406186cbf87c"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.sap.sailing.domain.test"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dhttp.proxyHost=proxy.wdf.sap.corp -Dhttp.proxyPort=8080 -Dtractrac.tunnel=true"/>
</launchConfiguration>
+22 -22
View File
@@ -1,22 +1,22 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Test
Bundle-SymbolicName: com.sap.sailing.domain.test
Bundle-Version: 1.0.0.qualifier
Bundle-Vendor: SAP
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Require-Bundle: com.sap.sailing.domain,
com.tractrac.clientmodule;bundle-version="2.0.0",
com.sap.sailing.domain.tractracadapter,
com.googlecode.java-diff-utils;bundle-version="1.3.0",
com.sap.sailing.domain.common,
com.sap.sailing.domain.shared.android,
org.mockito.mockito-core;bundle-version="1.9.5",
com.sap.sailing.domain.test,
org.hamcrest;bundle-version="1.1.0",
org.objenesis;bundle-version="1.3.0",
org.junit4;bundle-version="4.8.2",
org.json.simple;bundle-version="1.1.0",
com.sap.sse.common
Export-Package: com.sap.sailing.domain.test,
com.sap.sailing.domain.test.mock
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Test
Bundle-SymbolicName: com.sap.sailing.domain.test
Bundle-Version: 1.0.0.qualifier
Bundle-Vendor: SAP
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Require-Bundle: com.sap.sailing.domain,
com.tractrac.clientmodule;bundle-version="2.0.0",
com.sap.sailing.domain.tractracadapter,
com.googlecode.java-diff-utils;bundle-version="1.3.0",
com.sap.sailing.domain.common,
com.sap.sailing.domain.shared.android,
org.mockito.mockito-core;bundle-version="1.9.5",
com.sap.sailing.domain.test,
org.hamcrest;bundle-version="1.1.0",
org.objenesis;bundle-version="1.3.0",
org.junit4;bundle-version="4.8.2",
org.json.simple;bundle-version="1.1.0",
com.sap.sse.common
Export-Package: com.sap.sailing.domain.test,
com.sap.sailing.domain.test.mock
+31 -24
View File
@@ -1,24 +1,31 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.jdt.junit.launchconfig">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/com.sap.sailing.domain.test/src/com/sap/sailing/domain/test"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="2"/>
</listAttribute>
<mapAttribute key="org.eclipse.debug.core.preferred_launchers">
<mapEntry key="[debug]" value="org.eclipse.jdt.junit.launchconfig"/>
<mapEntry key="[run]" value="org.eclipse.jdt.junit.launchconfig"/>
</mapAttribute>
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value="=com.sap.sailing.domain.test/src&lt;com.sap.sailing.domain.test"/>
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value=""/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.sap.sailing.domain.test"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-ea"/>
</launchConfiguration>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.jdt.junit.launchconfig">
<booleanAttribute key="com.sap.jvm.profiling.ui.widgets.allowDebugging" value="false"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/com.sap.sailing.domain.test/src/com/sap/sailing/domain/test"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="2"/>
</listAttribute>
<mapAttribute key="org.eclipse.debug.core.preferred_launchers">
<mapEntry key="[debug]" value="org.eclipse.jdt.junit.launchconfig"/>
<mapEntry key="[run]" value="org.eclipse.jdt.junit.launchconfig"/>
</mapAttribute>
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value="=com.sap.sailing.domain.test/src&lt;com.sap.sailing.domain.test"/>
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value=""/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.sap.sailing.domain.test"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-ea -DspatialWind=true"/>
<stringAttribute key="profilingTraceType-ALLOCATION_TRACE" value="KEY_APPLICATION_FILTER%CTX_KEY%*%CTX_ENTRY%KEY_INC_LINE_NRS%CTX_KEY%true%CTX_ENTRY%KEY_MAX_SIZE%CTX_KEY%65536%CTX_ENTRY%INCREASE_COUNT%CTX_KEY%8192%CTX_ENTRY%KEY_USER_FILTER%CTX_KEY%*%CTX_ENTRY%KEY_ID%CTX_KEY%false%CTX_ENTRY%KEY_MIN_SIZE%CTX_KEY%32%CTX_ENTRY%KEY_SESSION_FILTER%CTX_KEY%*%CTX_ENTRY%KEY_ENABLEMENT%CTX_KEY%false%CTX_ENTRY%CLASS_FILTER%CTX_KEY%*%CTX_ENTRY%KEY_REQUEST_FILTER%CTX_KEY%*%CTX_ENTRY%KEY_ADAPTIVE%CTX_KEY%false%CTX_ENTRY%KEY_JRUBY_SUPPORT%CTX_KEY%false%CTX_ENTRY%"/>
<stringAttribute key="profilingTraceType-IO_TRACE" value="KEY_APPLICATION_FILTER%CTX_KEY%*%CTX_ENTRY%KEY_SESSION_FILTER%CTX_KEY%*%CTX_ENTRY%KEY_ENABLEMENT%CTX_KEY%false%CTX_ENTRY%KEY_USER_FILTER%CTX_KEY%*%CTX_ENTRY%KEY_REQUEST_FILTER%CTX_KEY%*%CTX_ENTRY%"/>
<stringAttribute key="profilingTraceType-METHOD_PARAMETER_TRACE" value="KEY_APPLICATION_FILTER%CTX_KEY%*%CTX_ENTRY%KEY_SESSION_FILTER%CTX_KEY%*%CTX_ENTRY%KEY_ENABLEMENT%CTX_KEY%false%CTX_ENTRY%KEY_USER_FILTER%CTX_KEY%*%CTX_ENTRY%KEY_REQUEST_FILTER%CTX_KEY%*%CTX_ENTRY%"/>
<stringAttribute key="profilingTraceType-NETWORK_TRACE" value="KEY_APPLICATION_FILTER%CTX_KEY%*%CTX_ENTRY%KEY_SESSION_FILTER%CTX_KEY%*%CTX_ENTRY%KEY_ENABLEMENT%CTX_KEY%false%CTX_ENTRY%KEY_USER_FILTER%CTX_KEY%*%CTX_ENTRY%KEY_REQUEST_FILTER%CTX_KEY%*%CTX_ENTRY%KEY_RESOLVE_ALL_HOSTS%CTX_KEY%true%CTX_ENTRY%"/>
<stringAttribute key="profilingTraceType-PERFORMANCE_HOTSPOT_TRACE" value="KEY_IGNORE_SLEEPING_THREADS%CTX_KEY%true%CTX_ENTRY%KEY_APPLICATION_FILTER%CTX_KEY%*%CTX_ENTRY%KEY_SESSION_FILTER%CTX_KEY%*%CTX_ENTRY%KEY_ENABLEMENT%CTX_KEY%false%CTX_ENTRY%KEY_USER_FILTER%CTX_KEY%*%CTX_ENTRY%KEY_REQUEST_FILTER%CTX_KEY%*%CTX_ENTRY%"/>
<stringAttribute key="profilingTraceType-SYNCHRONIZATION_TRACE" value="KEY_APPLICATION_FILTER%CTX_KEY%*%CTX_ENTRY%KEY_SESSION_FILTER%CTX_KEY%*%CTX_ENTRY%KEY_ENABLEMENT%CTX_KEY%false%CTX_ENTRY%KEY_USER_FILTER%CTX_KEY%*%CTX_ENTRY%KEY_REQUEST_FILTER%CTX_KEY%*%CTX_ENTRY%"/>
</launchConfiguration>
@@ -1,21 +1,21 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.jdt.junit.launchconfig">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/com.sap.sailing.domain.test/src/com/sap/sailing/domain/test"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="2"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value="=com.sap.sailing.domain.test/src&lt;com.sap.sailing.domain.test"/>
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/sapjvm_7"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value=""/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.sap.sailing.domain.test"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y -XX:+UseParallelGC -ea -Djava.util.logging.config.file=${project_loc:com.sap.sailing.server}/../target/configuration/logging_debug.properties"/>
</launchConfiguration>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.jdt.junit.launchconfig">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/com.sap.sailing.domain.test/src/com/sap/sailing/domain/test"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="2"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value="=com.sap.sailing.domain.test/src&lt;com.sap.sailing.domain.test"/>
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/sapjvm_7"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value=""/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.sap.sailing.domain.test"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y -XX:+UseParallelGC -ea -Djava.util.logging.config.file=${project_loc:com.sap.sailing.server}/../target/configuration/logging_debug.properties"/>
</launchConfiguration>
+20 -20
View File
@@ -1,20 +1,20 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.jdt.junit.launchconfig">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/com.sap.sailing.domain.test/src/com/sap/sailing/domain/test"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="2"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value="=com.sap.sailing.domain.test/src&lt;com.sap.sailing.domain.test"/>
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value=""/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.sap.sailing.domain.test"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dtractrac.tunnel=true"/>
</launchConfiguration>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.jdt.junit.launchconfig">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/com.sap.sailing.domain.test/src/com/sap/sailing/domain/test"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="2"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value="=com.sap.sailing.domain.test/src&lt;com.sap.sailing.domain.test"/>
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value=""/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.sap.sailing.domain.test"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dtractrac.tunnel=true"/>
</launchConfiguration>
+20 -20
View File
@@ -1,20 +1,20 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.jdt.junit.launchconfig">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/com.sap.sailing.domain.test/src/com/sap/sailing/domain/test"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="2"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value="=com.sap.sailing.domain.test/src&lt;com.sap.sailing.domain.test"/>
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value=""/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.sap.sailing.domain.test"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dhttp.proxyHost=proxy -Dhttp.proxyPort=8080 -XX:+UseParallelGC -Dtractrac.tunnel=true -Dtractrac.tunnel.host=localhost -ea -Djava.util.logging.config.file=${project_loc:com.sap.sailing.server}/../target/configuration/logging_debug.properties"/>
</launchConfiguration>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.jdt.junit.launchconfig">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/com.sap.sailing.domain.test/src/com/sap/sailing/domain/test"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="2"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value="=com.sap.sailing.domain.test/src&lt;com.sap.sailing.domain.test"/>
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value=""/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.sap.sailing.domain.test"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dhttp.proxyHost=proxy -Dhttp.proxyPort=8080 -XX:+UseParallelGC -Dtractrac.tunnel=true -Dtractrac.tunnel.host=localhost -ea -Djava.util.logging.config.file=${project_loc:com.sap.sailing.server}/../target/configuration/logging_debug.properties -DspatialWind=true"/>
</launchConfiguration>
+20 -20
View File
@@ -1,20 +1,20 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.jdt.junit.launchconfig">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/com.sap.sailing.domain.test/src/com/sap/sailing/domain/test"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="2"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value="=com.sap.sailing.domain.test/src&lt;com.sap.sailing.domain.test"/>
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value=""/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.sap.sailing.domain.test"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dhttp.proxyHost=proxy -Dhttp.proxyPort=8080 -XX:+UseParallelGC"/>
</launchConfiguration>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.jdt.junit.launchconfig">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/com.sap.sailing.domain.test/src/com/sap/sailing/domain/test"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="2"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value="=com.sap.sailing.domain.test/src&lt;com.sap.sailing.domain.test"/>
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value=""/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.sap.sailing.domain.test"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dhttp.proxyHost=proxy -Dhttp.proxyPort=8080 -XX:+UseParallelGC"/>
</launchConfiguration>
@@ -1,21 +1,21 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.jdt.junit.launchconfig">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/com.sap.sailing.domain.test/src/com/sap/sailing/domain/test"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="2"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value="=com.sap.sailing.domain.test/src&lt;com.sap.sailing.domain.test"/>
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/sapjvm_7"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value=""/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.sap.sailing.domain.test"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y -Dhttp.proxyHost=proxy -Dhttp.proxyPort=8080 -XX:+UseParallelGC -Dtractrac.tunnel=true -Dtractrac.tunnel.host=10.18.206.73 -ea -Djava.util.logging.config.file=${project_loc:com.sap.sailing.server}/../target/configuration/logging_debug.properties"/>
</launchConfiguration>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.jdt.junit.launchconfig">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/com.sap.sailing.domain.test/src/com/sap/sailing/domain/test"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="2"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value="=com.sap.sailing.domain.test/src&lt;com.sap.sailing.domain.test"/>
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/sapjvm_7"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value=""/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.sap.sailing.domain.test"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y -Dhttp.proxyHost=proxy -Dhttp.proxyPort=8080 -XX:+UseParallelGC -Dtractrac.tunnel=true -Dtractrac.tunnel.host=10.18.206.73 -ea -Djava.util.logging.config.file=${project_loc:com.sap.sailing.server}/../target/configuration/logging_debug.properties"/>
</launchConfiguration>
+17 -17
View File
@@ -1,17 +1,17 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/com.sap.sailing.domain.test"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="4"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="ttcmtester.TestTTCM"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="http://simulation.tracdev.dk/simulateconf/j80race12.txt&#13;&#10;tcp://localhost:4411&#13;&#10;tcp://localhost:4410"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.sap.sailing.domain.test"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dhttp.proxyHost=proxy -Dhttp.proxyPort=8080"/>
</launchConfiguration>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/com.sap.sailing.domain.test"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="4"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="ttcmtester.TestTTCM"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="http://simulation.tracdev.dk/simulateconf/j80race12.txt&#13;&#10;tcp://localhost:4411&#13;&#10;tcp://localhost:4410"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.sap.sailing.domain.test"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dhttp.proxyHost=proxy -Dhttp.proxyPort=8080"/>
</launchConfiguration>
@@ -1,16 +1,16 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/com.sap.sailing.domain.test/src/ttcmtester/TestTTCM.java"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="1"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="ttcmtester.TestTTCM"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="http://www.traclive.dk/simulateconf/j80race12.txt&#13;&#10;tcp://traclive.dk:1621&#13;&#10;tcp://traclive.dk:1620"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.sap.sailing.domain.test"/>
</launchConfiguration>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/com.sap.sailing.domain.test/src/ttcmtester/TestTTCM.java"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="1"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="ttcmtester.TestTTCM"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="http://www.traclive.dk/simulateconf/j80race12.txt&#13;&#10;tcp://traclive.dk:1621&#13;&#10;tcp://traclive.dk:1620"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.sap.sailing.domain.test"/>
</launchConfiguration>
@@ -53,7 +53,7 @@ PrecisionMeters:20
ShortAvgTime:180
LongAvgTime:900
TimeZone:
CompMarkerTimeout:4
CompMarkerTimeout:5
FramesPerSecond:8
replayspeedup:5
MatchRaceClock:0
@@ -82,8 +82,8 @@ DisableChangeRace:0
DisableLeaderboard:0
DisableAnalysis:0
TableFontSize:11
//live-uri:tcp://192.168.1.203:4400
//stored-uri:tcp://192.168.1.203:4401
//live-uri:tcp://traclive.dk:5500
//stored-uri:tcp://traclive.dk:5501
compInitialsFontSize:11
AutoRotate:1
MassStart:0
@@ -92,7 +92,7 @@ StartType:Mass
ReCalcDirAndSpeed:0
RaceHandicapSystem:NONE
TeamCompetitionType:NONE
LiveDelaySecs: 4
LiveDelaySecs: 10
//-------- AUTO GENERATED PARAMETERS START ----------------
@@ -101,6 +101,7 @@ EventName:ESS Florianopolis 2013
EventDB:event_20131112_ESSFlorian
EventStartTime:2013-11-12 00:00:00
EventEndTime:2013-11-18 00:00:00
EventType:a1b74ca0-fdd8-11dc-8811-005056c00008
RaceID:bca3b490-2dce-0131-27f0-60a44ce903c3
RaceName:Race 1
@@ -287,275 +288,299 @@ Comp8StartTime:2013-11-14 16:15:00
Comp8ClassUUID:648ee25a-83db-11e2-88c0-10bf48d758ce
Comp8RouteUUID:71e6cc30-2dce-0131-27ea-60a44ce903c3
ControlPoint1UUID:1286f15e-83be-11e2-88c0-10bf48d758ce
ControlPoint1Name:Orange
ControlPoint1HasTwoPoints:0
ControlPoint1ShortName:O
ControlPoint1DataSheet:Type=Buoy###BREAKLINE###Color=Orange###BREAKLINE###Shape=Conical###BREAKLINE###Name=Orange
ControlPoint1Mark1Lon:-48.561082
ControlPoint1Mark1Lat:-27.585780
ControlPoint1UUID:0f82e950-3046-0131-cf67-10b11c4ed8fd
ControlPoint1Name:RC-Green
ControlPoint1HasTwoPoints:1
ControlPoint1ShortName:S
ControlPoint1DataSheet:P1.Type=StartBoat###BREAKLINE###P1.Name=Race Committee###BREAKLINE###P1.UUID=3e6c1c94-83bf-11e2-88c0-10bf48d758ce###BREAKLINE###P2.Type=Buoy###BREAKLINE###P2.Color=Green###BREAKLINE###P2.Shape=Conical###BREAKLINE###P2.Name=Green###BREAKLINE###P2.UUID=785c3e44-83be-11e2-88c0-10bf48d758ce###BREAKLINE###
ControlPoint1Mark1Lon:-48.559788
ControlPoint1Mark1Lat:-27.584880
ControlPoint1Mark2Lon:-48.563377
ControlPoint1Mark2Lat:-27.584063
ControlPoint2UUID:133d41f0-2dca-0131-279a-60a44ce903c3
ControlPoint2Name:RC-Black Conical
ControlPoint2HasTwoPoints:1
ControlPoint2ShortName:S
ControlPoint2DataSheet:P1.Type=StartBoat###BREAKLINE###P1.Name=Race Committee###BREAKLINE###P1.UUID=3e6c1c94-83bf-11e2-88c0-10bf48d758ce###BREAKLINE###P2.Type=Buoy###BREAKLINE###P2.Color=Black###BREAKLINE###P2.Shape=Conical###BREAKLINE###P2.Pattern=Checkered###BREAKLINE###P2.Name=Black Conical###BREAKLINE###P2.UUID=d78695ea-83be-11e2-88c0-10bf48d758ce###BREAKLINE###
ControlPoint2Mark1Lon:-48.559360
ControlPoint2Mark1Lat:-27.584543
ControlPoint2Mark2Lon:-48.561523
ControlPoint2Mark2Lat:-27.584017
ControlPoint2UUID:1286f15e-83be-11e2-88c0-10bf48d758ce
ControlPoint2Name:Orange
ControlPoint2HasTwoPoints:0
ControlPoint2ShortName:O
ControlPoint2DataSheet:Type=Buoy###BREAKLINE###Color=Orange###BREAKLINE###Shape=Conical###BREAKLINE###Name=Orange
ControlPoint2Mark1Lon:-48.562633
ControlPoint2Mark1Lat:-27.586080
ControlPoint3UUID:1c17f4d0-2dc9-0131-274a-60a44ce903c3
ControlPoint3Name:Black Conical-WhiteP
ControlPoint3UUID:133d41f0-2dca-0131-279a-60a44ce903c3
ControlPoint3Name:RC-Black Conical
ControlPoint3HasTwoPoints:1
ControlPoint3ShortName:S
ControlPoint3DataSheet:P1.Type=Buoy###BREAKLINE###P1.Color=Black###BREAKLINE###P1.Shape=Conical###BREAKLINE###P1.Pattern=Checkered###BREAKLINE###P1.Name=Black Conical###BREAKLINE###P1.UUID=d78695ea-83be-11e2-88c0-10bf48d758ce###BREAKLINE###P2.Type=Buoy###BREAKLINE###P2.Color=White###BREAKLINE###P2.Shape=Conical###BREAKLINE###P2.Name=White P###BREAKLINE###P2.UUID=e9ec42f8-83bd-11e2-88c0-10bf48d758ce###BREAKLINE###
ControlPoint3Mark1Lon:-48.561523
ControlPoint3Mark1Lat:-27.584017
ControlPoint3Mark2Lon:-48.560910
ControlPoint3Mark2Lat:-27.585353
ControlPoint3DataSheet:P1.Type=StartBoat###BREAKLINE###P1.Name=Race Committee###BREAKLINE###P1.UUID=3e6c1c94-83bf-11e2-88c0-10bf48d758ce###BREAKLINE###P2.Type=Buoy###BREAKLINE###P2.Color=Black###BREAKLINE###P2.Shape=Conical###BREAKLINE###P2.Pattern=Checkered###BREAKLINE###P2.Name=Black Conical###BREAKLINE###P2.UUID=d78695ea-83be-11e2-88c0-10bf48d758ce###BREAKLINE###
ControlPoint3Mark1Lon:-48.559395
ControlPoint3Mark1Lat:-27.584552
ControlPoint3Mark2Lon:-48.561523
ControlPoint3Mark2Lat:-27.584002
ControlPoint4UUID:2b184930-2dca-0131-27a4-60a44ce903c3
ControlPoint4Name:RC-Black Cylinder
ControlPoint4UUID:1c17f4d0-2dc9-0131-274a-60a44ce903c3
ControlPoint4Name:Black Conical-WhiteP
ControlPoint4HasTwoPoints:1
ControlPoint4ShortName:F
ControlPoint4DataSheet:P1.Type=StartBoat###BREAKLINE###P1.Name=Race Committee###BREAKLINE###P1.UUID=3e6c1c94-83bf-11e2-88c0-10bf48d758ce###BREAKLINE###P2.Type=Buoy###BREAKLINE###P2.Color=Black###BREAKLINE###P2.Shape=Cylinder###BREAKLINE###P2.Pattern=Checkered###BREAKLINE###P2.Name=Black Cylinder###BREAKLINE###P2.UUID=b153dfd6-83be-11e2-88c0-10bf48d758ce###BREAKLINE###
ControlPoint4Mark1Lon:-48.559360
ControlPoint4Mark1Lat:-27.584543
ControlPoint4Mark2Lon:-48.561470
ControlPoint4Mark2Lat:-27.585952
ControlPoint4ShortName:S
ControlPoint4DataSheet:P1.Type=Buoy###BREAKLINE###P1.Color=Black###BREAKLINE###P1.Shape=Conical###BREAKLINE###P1.Pattern=Checkered###BREAKLINE###P1.Name=Black Conical###BREAKLINE###P1.UUID=d78695ea-83be-11e2-88c0-10bf48d758ce###BREAKLINE###P2.Type=Buoy###BREAKLINE###P2.Color=White###BREAKLINE###P2.Shape=Conical###BREAKLINE###P2.Name=White P###BREAKLINE###P2.UUID=e9ec42f8-83bd-11e2-88c0-10bf48d758ce###BREAKLINE###
ControlPoint4Mark1Lon:-48.561523
ControlPoint4Mark1Lat:-27.584002
ControlPoint4Mark2Lon:-48.562482
ControlPoint4Mark2Lat:-27.585808
ControlPoint5UUID:2c46b4a0-2dc9-0131-2754-60a44ce903c3
ControlPoint5Name:Black Conical-WhiteS
ControlPoint5UUID:2b184930-2dca-0131-27a4-60a44ce903c3
ControlPoint5Name:RC-Black Cylinder
ControlPoint5HasTwoPoints:1
ControlPoint5ShortName:S
ControlPoint5DataSheet:P1.Type=Buoy###BREAKLINE###P1.Color=Black###BREAKLINE###P1.Shape=Conical###BREAKLINE###P1.Pattern=Checkered###BREAKLINE###P1.Name=Black Conical###BREAKLINE###P1.UUID=d78695ea-83be-11e2-88c0-10bf48d758ce###BREAKLINE###P2.Type=Buoy###BREAKLINE###P2.Color=White###BREAKLINE###P2.Shape=Conical###BREAKLINE###P2.Name=White S###BREAKLINE###P2.UUID=bf6777e6-83bd-11e2-88c0-10bf48d758ce###BREAKLINE###
ControlPoint5Mark1Lon:-48.561523
ControlPoint5Mark1Lat:-27.584017
ControlPoint5Mark2Lon:-48.561337
ControlPoint5Mark2Lat:-27.585883
ControlPoint5ShortName:F
ControlPoint5DataSheet:P1.Type=StartBoat###BREAKLINE###P1.Name=Race Committee###BREAKLINE###P1.UUID=3e6c1c94-83bf-11e2-88c0-10bf48d758ce###BREAKLINE###P2.Type=Buoy###BREAKLINE###P2.Color=Black###BREAKLINE###P2.Shape=Cylinder###BREAKLINE###P2.Pattern=Checkered###BREAKLINE###P2.Name=Black Cylinder###BREAKLINE###P2.UUID=b153dfd6-83be-11e2-88c0-10bf48d758ce###BREAKLINE###
ControlPoint5Mark1Lon:-48.559395
ControlPoint5Mark1Lat:-27.584552
ControlPoint5Mark2Lon:-48.562600
ControlPoint5Mark2Lat:-27.585920
ControlPoint6UUID:3240586c-83c0-11e2-88c0-10bf48d758ce
ControlPoint6Name:Finish Pole
ControlPoint6HasTwoPoints:0
ControlPoint6ShortName:F
ControlPoint6DataSheet:Color=Black###BREAKLINE###Type=Landmark###BREAKLINE###Name=Finish Pole
ControlPoint6Mark1Lon:-48.557442
ControlPoint6Mark1Lat:-27.587342
ControlPoint6UUID:2c46b4a0-2dc9-0131-2754-60a44ce903c3
ControlPoint6Name:Black Conical-WhiteS
ControlPoint6HasTwoPoints:1
ControlPoint6ShortName:S
ControlPoint6DataSheet:P1.Type=Buoy###BREAKLINE###P1.Color=Black###BREAKLINE###P1.Shape=Conical###BREAKLINE###P1.Pattern=Checkered###BREAKLINE###P1.Name=Black Conical###BREAKLINE###P1.UUID=d78695ea-83be-11e2-88c0-10bf48d758ce###BREAKLINE###P2.Type=Buoy###BREAKLINE###P2.Color=White###BREAKLINE###P2.Shape=Conical###BREAKLINE###P2.Name=White S###BREAKLINE###P2.UUID=bf6777e6-83bd-11e2-88c0-10bf48d758ce###BREAKLINE###
ControlPoint6Mark1Lon:-48.561523
ControlPoint6Mark1Lat:-27.584002
ControlPoint6Mark2Lon:-48.562603
ControlPoint6Mark2Lat:-27.585983
ControlPoint7UUID:32e7cd80-2f60-0131-ce8e-10b11c4ed8fd
ControlPoint7Name:Black Conical - Orange
ControlPoint7HasTwoPoints:1
ControlPoint7ShortName:BO
ControlPoint7DataSheet:P1.Type=Buoy###BREAKLINE###P1.Color=Black###BREAKLINE###P1.Shape=Conical###BREAKLINE###P1.Pattern=Checkered###BREAKLINE###P1.Name=Black Conical###BREAKLINE###P1.UUID=d78695ea-83be-11e2-88c0-10bf48d758ce###BREAKLINE###P2.Type=Buoy###BREAKLINE###P2.Color=Orange###BREAKLINE###P2.Shape=Conical###BREAKLINE###P2.Name=Orange###BREAKLINE###P2.UUID=1286f15e-83be-11e2-88c0-10bf48d758ce###BREAKLINE###
ControlPoint7Mark1Lon:-48.557167
ControlPoint7Mark1Lat:-27.587635
ControlPoint7Mark2Lon:-48.557228
ControlPoint7Mark2Lat:-27.587597
ControlPoint7UUID:3240586c-83c0-11e2-88c0-10bf48d758ce
ControlPoint7Name:Finish Pole
ControlPoint7HasTwoPoints:0
ControlPoint7ShortName:F
ControlPoint7DataSheet:Color=Black###BREAKLINE###Type=Landmark###BREAKLINE###Name=Finish Pole
ControlPoint7Mark1Lon:-48.557442
ControlPoint7Mark1Lat:-27.587342
ControlPoint8UUID:3e6c1c94-83bf-11e2-88c0-10bf48d758ce
ControlPoint8Name:Race Committee
ControlPoint8HasTwoPoints:0
ControlPoint8ShortName:RC
ControlPoint8DataSheet:Type=StartBoat###BREAKLINE###Name=Race Committee
ControlPoint8Mark1Lon:-48.559360
ControlPoint8Mark1Lat:-27.584543
ControlPoint8UUID:32e7cd80-2f60-0131-ce8e-10b11c4ed8fd
ControlPoint8Name:Black Conical - Orange
ControlPoint8HasTwoPoints:1
ControlPoint8ShortName:BO
ControlPoint8DataSheet:P1.Type=Buoy###BREAKLINE###P1.Color=Black###BREAKLINE###P1.Shape=Conical###BREAKLINE###P1.Pattern=Checkered###BREAKLINE###P1.Name=Black Conical###BREAKLINE###P1.UUID=d78695ea-83be-11e2-88c0-10bf48d758ce###BREAKLINE###P2.Type=Buoy###BREAKLINE###P2.Color=Orange###BREAKLINE###P2.Shape=Conical###BREAKLINE###P2.Name=Orange###BREAKLINE###P2.UUID=1286f15e-83be-11e2-88c0-10bf48d758ce###BREAKLINE###
ControlPoint8Mark1Lon:-48.557167
ControlPoint8Mark1Lat:-27.587635
ControlPoint8Mark2Lon:-48.557228
ControlPoint8Mark2Lat:-27.587597
ControlPoint9UUID:3fdd2402-83be-11e2-88c0-10bf48d758ce
ControlPoint9Name:Yellow
ControlPoint9UUID:38e5ec90-30f1-0131-d0ad-10b11c4ed8fd
ControlPoint9Name:R9 Yellow
ControlPoint9HasTwoPoints:0
ControlPoint9ShortName:Y
ControlPoint9DataSheet:Type=Buoy###BREAKLINE###Color=Yellow###BREAKLINE###Shape=Conical###BREAKLINE###Name=Yellow
ControlPoint9Mark1Lon:-48.558780
ControlPoint9Mark1Lat:-27.575673
ControlPoint9Mark1Lon:-48.556918
ControlPoint9Mark1Lat:-27.574885
ControlPoint10UUID:4bea7160-2dc9-0131-275e-60a44ce903c3
ControlPoint10Name:Black Conical-Yellow
ControlPoint10HasTwoPoints:1
ControlPoint10ShortName:S
ControlPoint10DataSheet:P1.Type=Buoy###BREAKLINE###P1.Color=Black###BREAKLINE###P1.Shape=Conical###BREAKLINE###P1.Pattern=Checkered###BREAKLINE###P1.Name=Black Conical###BREAKLINE###P1.UUID=d78695ea-83be-11e2-88c0-10bf48d758ce###BREAKLINE###P2.Type=Buoy###BREAKLINE###P2.Color=Yellow###BREAKLINE###P2.Shape=Conical###BREAKLINE###P2.Name=Yellow###BREAKLINE###P2.UUID=3fdd2402-83be-11e2-88c0-10bf48d758ce###BREAKLINE###
ControlPoint10Mark1Lon:-48.561523
ControlPoint10Mark1Lat:-27.584017
ControlPoint10Mark2Lon:-48.558780
ControlPoint10Mark2Lat:-27.575673
ControlPoint10UUID:3e6c1c94-83bf-11e2-88c0-10bf48d758ce
ControlPoint10Name:Race Committee
ControlPoint10HasTwoPoints:0
ControlPoint10ShortName:RC
ControlPoint10DataSheet:Type=StartBoat###BREAKLINE###Name=Race Committee
ControlPoint10Mark1Lon:-48.559395
ControlPoint10Mark1Lat:-27.584552
ControlPoint11UUID:4f74d870-2dca-0131-27ae-60a44ce903c3
ControlPoint11Name:Red-Green
ControlPoint11HasTwoPoints:1
ControlPoint11ShortName:RG
ControlPoint11DataSheet:P1.Type=Buoy###BREAKLINE###P1.Color=Red###BREAKLINE###P1.Shape=Conical###BREAKLINE###P1.Name=Red###BREAKLINE###P1.UUID=5427c7d2-83be-11e2-88c0-10bf48d758ce###BREAKLINE###P2.Type=Buoy###BREAKLINE###P2.Color=Green###BREAKLINE###P2.Shape=Conical###BREAKLINE###P2.Name=Green###BREAKLINE###P2.UUID=785c3e44-83be-11e2-88c0-10bf48d758ce###BREAKLINE###
ControlPoint11Mark1Lon:-48.559185
ControlPoint11Mark1Lat:-27.583568
ControlPoint11Mark2Lon:-48.560898
ControlPoint11Mark2Lat:-27.585495
ControlPoint11UUID:3fdd2402-83be-11e2-88c0-10bf48d758ce
ControlPoint11Name:Yellow
ControlPoint11HasTwoPoints:0
ControlPoint11ShortName:Y
ControlPoint11DataSheet:Type=Buoy###BREAKLINE###Color=Yellow###BREAKLINE###Shape=Conical###BREAKLINE###Name=Yellow
ControlPoint11Mark1Lon:-48.558770
ControlPoint11Mark1Lat:-27.575680
ControlPoint12UUID:5427c7d2-83be-11e2-88c0-10bf48d758ce
ControlPoint12Name:Red
ControlPoint12HasTwoPoints:0
ControlPoint12ShortName:R
ControlPoint12DataSheet:Type=Buoy###BREAKLINE###Color=Red###BREAKLINE###Shape=Conical###BREAKLINE###Name=Red
ControlPoint12Mark1Lon:-48.559185
ControlPoint12Mark1Lat:-27.583568
ControlPoint12UUID:4bea7160-2dc9-0131-275e-60a44ce903c3
ControlPoint12Name:Black Conical-Yellow
ControlPoint12HasTwoPoints:1
ControlPoint12ShortName:S
ControlPoint12DataSheet:P1.Type=Buoy###BREAKLINE###P1.Color=Black###BREAKLINE###P1.Shape=Conical###BREAKLINE###P1.Pattern=Checkered###BREAKLINE###P1.Name=Black Conical###BREAKLINE###P1.UUID=d78695ea-83be-11e2-88c0-10bf48d758ce###BREAKLINE###P2.Type=Buoy###BREAKLINE###P2.Color=Yellow###BREAKLINE###P2.Shape=Conical###BREAKLINE###P2.Name=Yellow###BREAKLINE###P2.UUID=3fdd2402-83be-11e2-88c0-10bf48d758ce###BREAKLINE###
ControlPoint12Mark1Lon:-48.561523
ControlPoint12Mark1Lat:-27.584002
ControlPoint12Mark2Lon:-48.558770
ControlPoint12Mark2Lat:-27.575680
ControlPoint13UUID:60e54960-2dc8-0131-2722-60a44ce903c3
ControlPoint13Name:Black Gate
ControlPoint13UUID:4f74d870-2dca-0131-27ae-60a44ce903c3
ControlPoint13Name:Red-Green
ControlPoint13HasTwoPoints:1
ControlPoint13ShortName:B
ControlPoint13DataSheet:P1.Type=Buoy###BREAKLINE###P1.Color=Black###BREAKLINE###P1.Shape=Cylinder###BREAKLINE###P1.Pattern=Checkered###BREAKLINE###P1.Name=Black Cylinder###BREAKLINE###P1.UUID=b153dfd6-83be-11e2-88c0-10bf48d758ce###BREAKLINE###P2.Type=Buoy###BREAKLINE###P2.Color=Black###BREAKLINE###P2.Shape=Conical###BREAKLINE###P2.Pattern=Checkered###BREAKLINE###P2.Name=Black Conical###BREAKLINE###P2.UUID=d78695ea-83be-11e2-88c0-10bf48d758ce###BREAKLINE###
ControlPoint13Mark1Lon:-48.561470
ControlPoint13Mark1Lat:-27.585952
ControlPoint13Mark2Lon:-48.561523
ControlPoint13Mark2Lat:-27.584017
ControlPoint13ShortName:RG
ControlPoint13DataSheet:P1.Type=Buoy###BREAKLINE###P1.Color=Red###BREAKLINE###P1.Shape=Conical###BREAKLINE###P1.Name=Red###BREAKLINE###P1.UUID=5427c7d2-83be-11e2-88c0-10bf48d758ce###BREAKLINE###P2.Type=Buoy###BREAKLINE###P2.Color=Green###BREAKLINE###P2.Shape=Conical###BREAKLINE###P2.Name=Green###BREAKLINE###P2.UUID=785c3e44-83be-11e2-88c0-10bf48d758ce###BREAKLINE###
ControlPoint13Mark1Lon:-48.559833
ControlPoint13Mark1Lat:-27.575753
ControlPoint13Mark2Lon:-48.562470
ControlPoint13Mark2Lat:-27.585780
ControlPoint14UUID:648db960-2dca-0131-27b8-60a44ce903c3
ControlPoint14Name:Red-Orange
ControlPoint14HasTwoPoints:1
ControlPoint14ShortName:RO
ControlPoint14DataSheet:P1.Type=Buoy###BREAKLINE###P1.Color=Red###BREAKLINE###P1.Shape=Conical###BREAKLINE###P1.Name=Red###BREAKLINE###P1.UUID=5427c7d2-83be-11e2-88c0-10bf48d758ce###BREAKLINE###P2.Type=Buoy###BREAKLINE###P2.Color=Orange###BREAKLINE###P2.Shape=Conical###BREAKLINE###P2.Name=Orange###BREAKLINE###P2.UUID=1286f15e-83be-11e2-88c0-10bf48d758ce###BREAKLINE###
ControlPoint14Mark1Lon:-48.559185
ControlPoint14Mark1Lat:-27.583568
ControlPoint14Mark2Lon:-48.561082
ControlPoint14Mark2Lat:-27.585780
ControlPoint14UUID:538c48e0-31fd-0131-cc02-10bf48d758ce
ControlPoint14Name:R20-Green
ControlPoint14HasTwoPoints:0
ControlPoint14ShortName:G
ControlPoint14Mark1Lon:-48.560232
ControlPoint14Mark1Lat:-27.580741
ControlPoint15UUID:72216ea0-2dca-0131-27c2-60a44ce903c3
ControlPoint15Name:Red-Yellow
ControlPoint15HasTwoPoints:1
ControlPoint15ShortName:RY
ControlPoint15DataSheet:P1.Type=Buoy###BREAKLINE###P1.Color=Red###BREAKLINE###P1.Shape=Conical###BREAKLINE###P1.Name=Red###BREAKLINE###P1.UUID=5427c7d2-83be-11e2-88c0-10bf48d758ce###BREAKLINE###P2.Type=Buoy###BREAKLINE###P2.Color=Yellow###BREAKLINE###P2.Shape=Conical###BREAKLINE###P2.Name=Yellow###BREAKLINE###P2.UUID=3fdd2402-83be-11e2-88c0-10bf48d758ce###BREAKLINE###
ControlPoint15Mark1Lon:-48.559185
ControlPoint15Mark1Lat:-27.583568
ControlPoint15Mark2Lon:-48.558780
ControlPoint15Mark2Lat:-27.575673
ControlPoint15UUID:5427c7d2-83be-11e2-88c0-10bf48d758ce
ControlPoint15Name:Red
ControlPoint15HasTwoPoints:0
ControlPoint15ShortName:R
ControlPoint15DataSheet:Type=Buoy###BREAKLINE###Color=Red###BREAKLINE###Shape=Conical###BREAKLINE###Name=Red
ControlPoint15Mark1Lon:-48.559833
ControlPoint15Mark1Lat:-27.575753
ControlPoint16UUID:785c3e44-83be-11e2-88c0-10bf48d758ce
ControlPoint16Name:Green
ControlPoint16HasTwoPoints:0
ControlPoint16ShortName:G
ControlPoint16DataSheet:Type=Buoy###BREAKLINE###Color=Green###BREAKLINE###Shape=Conical###BREAKLINE###Name=Green
ControlPoint16Mark1Lon:-48.560898
ControlPoint16Mark1Lat:-27.585495
ControlPoint16UUID:60e54960-2dc8-0131-2722-60a44ce903c3
ControlPoint16Name:Black Gate
ControlPoint16HasTwoPoints:1
ControlPoint16ShortName:B
ControlPoint16DataSheet:P1.Type=Buoy###BREAKLINE###P1.Color=Black###BREAKLINE###P1.Shape=Cylinder###BREAKLINE###P1.Pattern=Checkered###BREAKLINE###P1.Name=Black Cylinder###BREAKLINE###P1.UUID=b153dfd6-83be-11e2-88c0-10bf48d758ce###BREAKLINE###P2.Type=Buoy###BREAKLINE###P2.Color=Black###BREAKLINE###P2.Shape=Conical###BREAKLINE###P2.Pattern=Checkered###BREAKLINE###P2.Name=Black Conical###BREAKLINE###P2.UUID=d78695ea-83be-11e2-88c0-10bf48d758ce###BREAKLINE###
ControlPoint16Mark1Lon:-48.562600
ControlPoint16Mark1Lat:-27.585920
ControlPoint16Mark2Lon:-48.561523
ControlPoint16Mark2Lat:-27.584002
ControlPoint17UUID:7c057f10-2dc9-0131-2768-60a44ce903c3
ControlPoint17Name:Green-Orange
ControlPoint17UUID:648db960-2dca-0131-27b8-60a44ce903c3
ControlPoint17Name:Red-Orange
ControlPoint17HasTwoPoints:1
ControlPoint17ShortName:GO
ControlPoint17DataSheet:P1.Type=Buoy###BREAKLINE###P1.Color=Green###BREAKLINE###P1.Shape=Conical###BREAKLINE###P1.Name=Green###BREAKLINE###P1.UUID=785c3e44-83be-11e2-88c0-10bf48d758ce###BREAKLINE###P2.Type=Buoy###BREAKLINE###P2.Color=Orange###BREAKLINE###P2.Shape=Conical###BREAKLINE###P2.Name=Orange###BREAKLINE###P2.UUID=1286f15e-83be-11e2-88c0-10bf48d758ce###BREAKLINE###
ControlPoint17Mark1Lon:-48.560898
ControlPoint17Mark1Lat:-27.585495
ControlPoint17Mark2Lon:-48.561082
ControlPoint17Mark2Lat:-27.585780
ControlPoint17ShortName:RO
ControlPoint17DataSheet:P1.Type=Buoy###BREAKLINE###P1.Color=Red###BREAKLINE###P1.Shape=Conical###BREAKLINE###P1.Name=Red###BREAKLINE###P1.UUID=5427c7d2-83be-11e2-88c0-10bf48d758ce###BREAKLINE###P2.Type=Buoy###BREAKLINE###P2.Color=Orange###BREAKLINE###P2.Shape=Conical###BREAKLINE###P2.Name=Orange###BREAKLINE###P2.UUID=1286f15e-83be-11e2-88c0-10bf48d758ce###BREAKLINE###
ControlPoint17Mark1Lon:-48.559833
ControlPoint17Mark1Lat:-27.575753
ControlPoint17Mark2Lon:-48.562633
ControlPoint17Mark2Lat:-27.586080
ControlPoint18UUID:914f22b0-2dca-0131-27cc-60a44ce903c3
ControlPoint18Name:White Gate
ControlPoint18UUID:72216ea0-2dca-0131-27c2-60a44ce903c3
ControlPoint18Name:Red-Yellow
ControlPoint18HasTwoPoints:1
ControlPoint18ShortName:W
ControlPoint18DataSheet:P1.Type=Buoy###BREAKLINE###P1.Color=White###BREAKLINE###P1.Shape=Conical###BREAKLINE###P1.Name=White S###BREAKLINE###P1.UUID=bf6777e6-83bd-11e2-88c0-10bf48d758ce###BREAKLINE###P2.Type=Buoy###BREAKLINE###P2.Color=White###BREAKLINE###P2.Shape=Conical###BREAKLINE###P2.Name=White P###BREAKLINE###P2.UUID=e9ec42f8-83bd-11e2-88c0-10bf48d758ce###BREAKLINE###
ControlPoint18Mark1Lon:-48.561337
ControlPoint18Mark1Lat:-27.585883
ControlPoint18Mark2Lon:-48.560910
ControlPoint18Mark2Lat:-27.585353
ControlPoint18ShortName:RY
ControlPoint18DataSheet:P1.Type=Buoy###BREAKLINE###P1.Color=Red###BREAKLINE###P1.Shape=Conical###BREAKLINE###P1.Name=Red###BREAKLINE###P1.UUID=5427c7d2-83be-11e2-88c0-10bf48d758ce###BREAKLINE###P2.Type=Buoy###BREAKLINE###P2.Color=Yellow###BREAKLINE###P2.Shape=Conical###BREAKLINE###P2.Name=Yellow###BREAKLINE###P2.UUID=3fdd2402-83be-11e2-88c0-10bf48d758ce###BREAKLINE###
ControlPoint18Mark1Lon:-48.559833
ControlPoint18Mark1Lat:-27.575753
ControlPoint18Mark2Lon:-48.558770
ControlPoint18Mark2Lat:-27.575680
ControlPoint19UUID:aa831320-2dc8-0131-272c-60a44ce903c3
ControlPoint19Name:Finish Pole-Cylinder
ControlPoint19HasTwoPoints:1
ControlPoint19ShortName:F
ControlPoint19DataSheet:P1.Color=Black###BREAKLINE###P1.Type=Landmark###BREAKLINE###P1.Name=Finish Pole###BREAKLINE###P1.UUID=3240586c-83c0-11e2-88c0-10bf48d758ce###BREAKLINE###P2.Type=Buoy###BREAKLINE###P2.Color=Black###BREAKLINE###P2.Shape=Cylinder###BREAKLINE###P2.Pattern=Checkered###BREAKLINE###P2.Name=Black Cylinder###BREAKLINE###P2.UUID=b153dfd6-83be-11e2-88c0-10bf48d758ce###BREAKLINE###
ControlPoint19Mark1Lon:-48.557442
ControlPoint19Mark1Lat:-27.587342
ControlPoint19Mark2Lon:-48.561470
ControlPoint19Mark2Lat:-27.585952
ControlPoint19UUID:785c3e44-83be-11e2-88c0-10bf48d758ce
ControlPoint19Name:Green
ControlPoint19HasTwoPoints:0
ControlPoint19ShortName:G
ControlPoint19DataSheet:Type=Buoy###BREAKLINE###Color=Green###BREAKLINE###Shape=Conical###BREAKLINE###Name=Green
ControlPoint19Mark1Lon:-48.562470
ControlPoint19Mark1Lat:-27.585780
ControlPoint20UUID:af4e4920-2dc9-0131-2772-60a44ce903c3
ControlPoint20Name:Green-WhiteP
ControlPoint20UUID:7c057f10-2dc9-0131-2768-60a44ce903c3
ControlPoint20Name:Green-Orange
ControlPoint20HasTwoPoints:1
ControlPoint20ShortName:GP
ControlPoint20DataSheet:P1.Type=Buoy###BREAKLINE###P1.Color=Green###BREAKLINE###P1.Shape=Conical###BREAKLINE###P1.Name=Green###BREAKLINE###P1.UUID=785c3e44-83be-11e2-88c0-10bf48d758ce###BREAKLINE###P2.Type=Buoy###BREAKLINE###P2.Color=White###BREAKLINE###P2.Shape=Conical###BREAKLINE###P2.Name=White P###BREAKLINE###P2.UUID=e9ec42f8-83bd-11e2-88c0-10bf48d758ce###BREAKLINE###
ControlPoint20Mark1Lon:-48.560898
ControlPoint20Mark1Lat:-27.585495
ControlPoint20Mark2Lon:-48.560910
ControlPoint20Mark2Lat:-27.585353
ControlPoint20ShortName:GO
ControlPoint20DataSheet:P1.Type=Buoy###BREAKLINE###P1.Color=Green###BREAKLINE###P1.Shape=Conical###BREAKLINE###P1.Name=Green###BREAKLINE###P1.UUID=785c3e44-83be-11e2-88c0-10bf48d758ce###BREAKLINE###P2.Type=Buoy###BREAKLINE###P2.Color=Orange###BREAKLINE###P2.Shape=Conical###BREAKLINE###P2.Name=Orange###BREAKLINE###P2.UUID=1286f15e-83be-11e2-88c0-10bf48d758ce###BREAKLINE###
ControlPoint20Mark1Lon:-48.562470
ControlPoint20Mark1Lat:-27.585780
ControlPoint20Mark2Lon:-48.562633
ControlPoint20Mark2Lat:-27.586080
ControlPoint21UUID:b153dfd6-83be-11e2-88c0-10bf48d758ce
ControlPoint21Name:Black Cylinder
ControlPoint21HasTwoPoints:0
ControlPoint21ShortName:B
ControlPoint21DataSheet:Type=Buoy###BREAKLINE###Color=Black###BREAKLINE###Shape=Cylinder###BREAKLINE###Pattern=Checkered###BREAKLINE###Name=Black Cylinder
ControlPoint21Mark1Lon:-48.561470
ControlPoint21Mark1Lat:-27.585952
ControlPoint21UUID:914f22b0-2dca-0131-27cc-60a44ce903c3
ControlPoint21Name:White Gate
ControlPoint21HasTwoPoints:1
ControlPoint21ShortName:W
ControlPoint21DataSheet:P1.Type=Buoy###BREAKLINE###P1.Color=White###BREAKLINE###P1.Shape=Conical###BREAKLINE###P1.Name=White S###BREAKLINE###P1.UUID=bf6777e6-83bd-11e2-88c0-10bf48d758ce###BREAKLINE###P2.Type=Buoy###BREAKLINE###P2.Color=White###BREAKLINE###P2.Shape=Conical###BREAKLINE###P2.Name=White P###BREAKLINE###P2.UUID=e9ec42f8-83bd-11e2-88c0-10bf48d758ce###BREAKLINE###
ControlPoint21Mark1Lon:-48.562603
ControlPoint21Mark1Lat:-27.585983
ControlPoint21Mark2Lon:-48.562482
ControlPoint21Mark2Lat:-27.585808
ControlPoint22UUID:bf6777e6-83bd-11e2-88c0-10bf48d758ce
ControlPoint22Name:White S
ControlPoint22HasTwoPoints:0
ControlPoint22ShortName:W
ControlPoint22DataSheet:Type=Buoy###BREAKLINE###Color=White###BREAKLINE###Shape=Conical###BREAKLINE###Name=White S
ControlPoint22Mark1Lon:-48.561337
ControlPoint22Mark1Lat:-27.585883
ControlPoint22UUID:aa831320-2dc8-0131-272c-60a44ce903c3
ControlPoint22Name:Finish Pole-Cylinder
ControlPoint22HasTwoPoints:1
ControlPoint22ShortName:F
ControlPoint22DataSheet:P1.Color=Black###BREAKLINE###P1.Type=Landmark###BREAKLINE###P1.Name=Finish Pole###BREAKLINE###P1.UUID=3240586c-83c0-11e2-88c0-10bf48d758ce###BREAKLINE###P2.Type=Buoy###BREAKLINE###P2.Color=Black###BREAKLINE###P2.Shape=Cylinder###BREAKLINE###P2.Pattern=Checkered###BREAKLINE###P2.Name=Black Cylinder###BREAKLINE###P2.UUID=b153dfd6-83be-11e2-88c0-10bf48d758ce###BREAKLINE###
ControlPoint22Mark1Lon:-48.557442
ControlPoint22Mark1Lat:-27.587342
ControlPoint22Mark2Lon:-48.562600
ControlPoint22Mark2Lat:-27.585920
ControlPoint23UUID:ca1aabf0-2dc9-0131-277c-60a44ce903c3
ControlPoint23Name:Green-WhiteS
ControlPoint23UUID:af4e4920-2dc9-0131-2772-60a44ce903c3
ControlPoint23Name:Green-WhiteP
ControlPoint23HasTwoPoints:1
ControlPoint23ShortName:GS
ControlPoint23DataSheet:P1.Type=Buoy###BREAKLINE###P1.Color=Green###BREAKLINE###P1.Shape=Conical###BREAKLINE###P1.Name=Green###BREAKLINE###P1.UUID=785c3e44-83be-11e2-88c0-10bf48d758ce###BREAKLINE###P2.Type=Buoy###BREAKLINE###P2.Color=White###BREAKLINE###P2.Shape=Conical###BREAKLINE###P2.Name=White S###BREAKLINE###P2.UUID=bf6777e6-83bd-11e2-88c0-10bf48d758ce###BREAKLINE###
ControlPoint23Mark1Lon:-48.560898
ControlPoint23Mark1Lat:-27.585495
ControlPoint23Mark2Lon:-48.561337
ControlPoint23Mark2Lat:-27.585883
ControlPoint23ShortName:GP
ControlPoint23DataSheet:P1.Type=Buoy###BREAKLINE###P1.Color=Green###BREAKLINE###P1.Shape=Conical###BREAKLINE###P1.Name=Green###BREAKLINE###P1.UUID=785c3e44-83be-11e2-88c0-10bf48d758ce###BREAKLINE###P2.Type=Buoy###BREAKLINE###P2.Color=White###BREAKLINE###P2.Shape=Conical###BREAKLINE###P2.Name=White P###BREAKLINE###P2.UUID=e9ec42f8-83bd-11e2-88c0-10bf48d758ce###BREAKLINE###
ControlPoint23Mark1Lon:-48.562470
ControlPoint23Mark1Lat:-27.585780
ControlPoint23Mark2Lon:-48.562482
ControlPoint23Mark2Lat:-27.585808
ControlPoint24UUID:d78695ea-83be-11e2-88c0-10bf48d758ce
ControlPoint24Name:Black Conical
ControlPoint24UUID:b153dfd6-83be-11e2-88c0-10bf48d758ce
ControlPoint24Name:Black Cylinder
ControlPoint24HasTwoPoints:0
ControlPoint24ShortName:B
ControlPoint24DataSheet:Type=Buoy###BREAKLINE###Color=Black###BREAKLINE###Shape=Conical###BREAKLINE###Pattern=Checkered###BREAKLINE###Name=Black Conical
ControlPoint24Mark1Lon:-48.561523
ControlPoint24Mark1Lat:-27.584017
ControlPoint24DataSheet:Type=Buoy###BREAKLINE###Color=Black###BREAKLINE###Shape=Cylinder###BREAKLINE###Pattern=Checkered###BREAKLINE###Name=Black Cylinder
ControlPoint24Mark1Lon:-48.562600
ControlPoint24Mark1Lat:-27.585920
ControlPoint25UUID:da6bf290-2dc8-0131-2736-60a44ce903c3
ControlPoint25Name:Black Conical-Green
ControlPoint25HasTwoPoints:1
ControlPoint25ShortName:S
ControlPoint25DataSheet:P1.Type=Buoy###BREAKLINE###P1.Color=Black###BREAKLINE###P1.Shape=Conical###BREAKLINE###P1.Pattern=Checkered###BREAKLINE###P1.Name=Black Conical###BREAKLINE###P1.UUID=d78695ea-83be-11e2-88c0-10bf48d758ce###BREAKLINE###P2.Type=Buoy###BREAKLINE###P2.Color=Green###BREAKLINE###P2.Shape=Conical###BREAKLINE###P2.Name=Green###BREAKLINE###P2.UUID=785c3e44-83be-11e2-88c0-10bf48d758ce###BREAKLINE###
ControlPoint25Mark1Lon:-48.561523
ControlPoint25Mark1Lat:-27.584017
ControlPoint25Mark2Lon:-48.560898
ControlPoint25Mark2Lat:-27.585495
ControlPoint25UUID:bf6777e6-83bd-11e2-88c0-10bf48d758ce
ControlPoint25Name:White S
ControlPoint25HasTwoPoints:0
ControlPoint25ShortName:W
ControlPoint25DataSheet:Type=Buoy###BREAKLINE###Color=White###BREAKLINE###Shape=Conical###BREAKLINE###Name=White S
ControlPoint25Mark1Lon:-48.562603
ControlPoint25Mark1Lat:-27.585983
ControlPoint26UUID:e00b6730-2dc9-0131-2786-60a44ce903c3
ControlPoint26Name:Green-Yellow
ControlPoint26UUID:ca1aabf0-2dc9-0131-277c-60a44ce903c3
ControlPoint26Name:Green-WhiteS
ControlPoint26HasTwoPoints:1
ControlPoint26ShortName:GY
ControlPoint26DataSheet:P1.Type=Buoy###BREAKLINE###P1.Color=Green###BREAKLINE###P1.Shape=Conical###BREAKLINE###P1.Name=Green###BREAKLINE###P1.UUID=785c3e44-83be-11e2-88c0-10bf48d758ce###BREAKLINE###P2.Type=Buoy###BREAKLINE###P2.Color=Yellow###BREAKLINE###P2.Shape=Conical###BREAKLINE###P2.Name=Yellow###BREAKLINE###P2.UUID=3fdd2402-83be-11e2-88c0-10bf48d758ce###BREAKLINE###
ControlPoint26Mark1Lon:-48.560898
ControlPoint26Mark1Lat:-27.585495
ControlPoint26Mark2Lon:-48.558780
ControlPoint26Mark2Lat:-27.575673
ControlPoint26ShortName:GS
ControlPoint26DataSheet:P1.Type=Buoy###BREAKLINE###P1.Color=Green###BREAKLINE###P1.Shape=Conical###BREAKLINE###P1.Name=Green###BREAKLINE###P1.UUID=785c3e44-83be-11e2-88c0-10bf48d758ce###BREAKLINE###P2.Type=Buoy###BREAKLINE###P2.Color=White###BREAKLINE###P2.Shape=Conical###BREAKLINE###P2.Name=White S###BREAKLINE###P2.UUID=bf6777e6-83bd-11e2-88c0-10bf48d758ce###BREAKLINE###
ControlPoint26Mark1Lon:-48.562470
ControlPoint26Mark1Lat:-27.585780
ControlPoint26Mark2Lon:-48.562603
ControlPoint26Mark2Lat:-27.585983
ControlPoint27UUID:e9ec42f8-83bd-11e2-88c0-10bf48d758ce
ControlPoint27Name:White P
ControlPoint27UUID:d78695ea-83be-11e2-88c0-10bf48d758ce
ControlPoint27Name:Black Conical
ControlPoint27HasTwoPoints:0
ControlPoint27ShortName:W
ControlPoint27DataSheet:Type=Buoy###BREAKLINE###Color=White###BREAKLINE###Shape=Conical###BREAKLINE###Name=White P
ControlPoint27Mark1Lon:-48.560910
ControlPoint27Mark1Lat:-27.585353
ControlPoint27ShortName:B
ControlPoint27DataSheet:Type=Buoy###BREAKLINE###Color=Black###BREAKLINE###Shape=Conical###BREAKLINE###Pattern=Checkered###BREAKLINE###Name=Black Conical
ControlPoint27Mark1Lon:-48.561523
ControlPoint27Mark1Lat:-27.584002
ControlPoint28UUID:fc08e310-2dc9-0131-2790-60a44ce903c3
ControlPoint28Name:Orange-Yellow
ControlPoint28UUID:da6bf290-2dc8-0131-2736-60a44ce903c3
ControlPoint28Name:Black Conical-Green
ControlPoint28HasTwoPoints:1
ControlPoint28ShortName:OY
ControlPoint28DataSheet:P1.Type=Buoy###BREAKLINE###P1.Color=Orange###BREAKLINE###P1.Shape=Conical###BREAKLINE###P1.Name=Orange###BREAKLINE###P1.UUID=1286f15e-83be-11e2-88c0-10bf48d758ce###BREAKLINE###P2.Type=Buoy###BREAKLINE###P2.Color=Yellow###BREAKLINE###P2.Shape=Conical###BREAKLINE###P2.Name=Yellow###BREAKLINE###P2.UUID=3fdd2402-83be-11e2-88c0-10bf48d758ce###BREAKLINE###
ControlPoint28Mark1Lon:-48.561082
ControlPoint28Mark1Lat:-27.585780
ControlPoint28Mark2Lon:-48.558780
ControlPoint28Mark2Lat:-27.575673
ControlPoint28ShortName:S
ControlPoint28DataSheet:P1.Type=Buoy###BREAKLINE###P1.Color=Black###BREAKLINE###P1.Shape=Conical###BREAKLINE###P1.Pattern=Checkered###BREAKLINE###P1.Name=Black Conical###BREAKLINE###P1.UUID=d78695ea-83be-11e2-88c0-10bf48d758ce###BREAKLINE###P2.Type=Buoy###BREAKLINE###P2.Color=Green###BREAKLINE###P2.Shape=Conical###BREAKLINE###P2.Name=Green###BREAKLINE###P2.UUID=785c3e44-83be-11e2-88c0-10bf48d758ce###BREAKLINE###
ControlPoint28Mark1Lon:-48.561523
ControlPoint28Mark1Lat:-27.584002
ControlPoint28Mark2Lon:-48.562470
ControlPoint28Mark2Lat:-27.585780
ControlPoint29UUID:fc09f220-2dc8-0131-2740-60a44ce903c3
ControlPoint29Name:Black Conical-Red
ControlPoint29UUID:e00b6730-2dc9-0131-2786-60a44ce903c3
ControlPoint29Name:Green-Yellow
ControlPoint29HasTwoPoints:1
ControlPoint29ShortName:S
ControlPoint29DataSheet:P1.Type=Buoy###BREAKLINE###P1.Color=Black###BREAKLINE###P1.Shape=Conical###BREAKLINE###P1.Pattern=Checkered###BREAKLINE###P1.Name=Black Conical###BREAKLINE###P1.UUID=d78695ea-83be-11e2-88c0-10bf48d758ce###BREAKLINE###P2.Type=Buoy###BREAKLINE###P2.Color=Red###BREAKLINE###P2.Shape=Conical###BREAKLINE###P2.Name=Red###BREAKLINE###P2.UUID=5427c7d2-83be-11e2-88c0-10bf48d758ce###BREAKLINE###
ControlPoint29Mark1Lon:-48.561523
ControlPoint29Mark1Lat:-27.584017
ControlPoint29Mark2Lon:-48.559185
ControlPoint29Mark2Lat:-27.583568
ControlPoint29ShortName:GY
ControlPoint29DataSheet:P1.Type=Buoy###BREAKLINE###P1.Color=Green###BREAKLINE###P1.Shape=Conical###BREAKLINE###P1.Name=Green###BREAKLINE###P1.UUID=785c3e44-83be-11e2-88c0-10bf48d758ce###BREAKLINE###P2.Type=Buoy###BREAKLINE###P2.Color=Yellow###BREAKLINE###P2.Shape=Conical###BREAKLINE###P2.Name=Yellow###BREAKLINE###P2.UUID=3fdd2402-83be-11e2-88c0-10bf48d758ce###BREAKLINE###
ControlPoint29Mark1Lon:-48.562470
ControlPoint29Mark1Lat:-27.585780
ControlPoint29Mark2Lon:-48.558770
ControlPoint29Mark2Lat:-27.575680
ControlPoint30UUID:e9ec42f8-83bd-11e2-88c0-10bf48d758ce
ControlPoint30Name:White P
ControlPoint30HasTwoPoints:0
ControlPoint30ShortName:W
ControlPoint30DataSheet:Type=Buoy###BREAKLINE###Color=White###BREAKLINE###Shape=Conical###BREAKLINE###Name=White P
ControlPoint30Mark1Lon:-48.562482
ControlPoint30Mark1Lat:-27.585808
ControlPoint31UUID:fc08e310-2dc9-0131-2790-60a44ce903c3
ControlPoint31Name:Orange-Yellow
ControlPoint31HasTwoPoints:1
ControlPoint31ShortName:OY
ControlPoint31DataSheet:P1.Type=Buoy###BREAKLINE###P1.Color=Orange###BREAKLINE###P1.Shape=Conical###BREAKLINE###P1.Name=Orange###BREAKLINE###P1.UUID=1286f15e-83be-11e2-88c0-10bf48d758ce###BREAKLINE###P2.Type=Buoy###BREAKLINE###P2.Color=Yellow###BREAKLINE###P2.Shape=Conical###BREAKLINE###P2.Name=Yellow###BREAKLINE###P2.UUID=3fdd2402-83be-11e2-88c0-10bf48d758ce###BREAKLINE###
ControlPoint31Mark1Lon:-48.562633
ControlPoint31Mark1Lat:-27.586080
ControlPoint31Mark2Lon:-48.558770
ControlPoint31Mark2Lat:-27.575680
ControlPoint32UUID:fc09f220-2dc8-0131-2740-60a44ce903c3
ControlPoint32Name:Black Conical-Red
ControlPoint32HasTwoPoints:1
ControlPoint32ShortName:S
ControlPoint32DataSheet:P1.Type=Buoy###BREAKLINE###P1.Color=Black###BREAKLINE###P1.Shape=Conical###BREAKLINE###P1.Pattern=Checkered###BREAKLINE###P1.Name=Black Conical###BREAKLINE###P1.UUID=d78695ea-83be-11e2-88c0-10bf48d758ce###BREAKLINE###P2.Type=Buoy###BREAKLINE###P2.Color=Red###BREAKLINE###P2.Shape=Conical###BREAKLINE###P2.Name=Red###BREAKLINE###P2.UUID=5427c7d2-83be-11e2-88c0-10bf48d758ce###BREAKLINE###
ControlPoint32Mark1Lon:-48.561523
ControlPoint32Mark1Lat:-27.584002
ControlPoint32Mark2Lon:-48.559833
ControlPoint32Mark2Lat:-27.575753
SegmentFile:segments.php
@@ -1,2 +1,2 @@
#!/bin/sh
#!/bin/bash
java -Dfile.encoding=en_US.UTF-8 -cp bin/com.sap.sailing.domain.test-1.0.0-SNAPSHOT.jar:../com.sap.sailing.domain.tractracadapter/bin/com.sap.sailing.domain.tractracadapter-1.0.0-SNAPSHOT.jar:../com.sap.sailing.domain/bin/com.sap.sailing.domain-1.0.0-SNAPSHOT.jar:../com.tractrac.clientmodule/bin/com.tractrac.clientmodule-1.0.0-SNAPSHOT.jar:../com.tractrac.clientmodule/lib/TracTracClientModule.jar:../com.googlecode.java-diff-utils/bin/com.googlecode.java-diff-utils-1.3.0-SNAPSHOT.jar com.sap.sailing.domain.test.UnicodeCharactersInCompetitorNamesTest
@@ -1,24 +1,25 @@
package com.sap.sailing.domain.common;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import java.util.Date;
import org.junit.Test;
import com.sap.sailing.domain.common.impl.MillisecondsDurationImpl;
import com.sap.sailing.domain.common.impl.MillisecondsTimePoint;
import com.sap.sailing.domain.common.media.MediaTrack;
import static org.junit.Assert.*;
public class MediaTrackTest {
private static final Duration ONE_MILLISECOND = new MillisecondsDurationImpl(1);
@Test
public void testExactOverlap() throws Exception {
MediaTrack mediaTrack = new MediaTrack();
mediaTrack.startTime = new Date();
mediaTrack.durationInMillis = 1;
mediaTrack.startTime = MillisecondsTimePoint.now();
mediaTrack.duration = ONE_MILLISECOND;
Date startTime = new Date(mediaTrack.startTime.getTime());
Date endTime = new Date(mediaTrack.deriveEndTime().getTime());
TimePoint startTime = mediaTrack.startTime;
TimePoint endTime = mediaTrack.deriveEndTime();
assertTrue(mediaTrack.overlapsWith(startTime, endTime));
}
@@ -26,11 +27,11 @@ public class MediaTrackTest {
@Test
public void testNoOverlapLeft() throws Exception {
MediaTrack mediaTrack = new MediaTrack();
mediaTrack.startTime = new Date();
mediaTrack.durationInMillis = 1;
mediaTrack.startTime = MillisecondsTimePoint.now();
mediaTrack.duration = ONE_MILLISECOND;
Date startTime = new Date(mediaTrack.startTime.getTime() + 2);
Date endTime = new Date(startTime.getTime() + 1);
TimePoint startTime = mediaTrack.startTime.plus(2);
TimePoint endTime = startTime.plus(1);
assertFalse(mediaTrack.overlapsWith(startTime, endTime));
}
@@ -38,11 +39,11 @@ public class MediaTrackTest {
@Test
public void testNoOverlapRight() throws Exception {
MediaTrack mediaTrack = new MediaTrack();
mediaTrack.startTime = new Date();
mediaTrack.durationInMillis = 1;
mediaTrack.startTime = MillisecondsTimePoint.now();
mediaTrack.duration = ONE_MILLISECOND;
Date startTime = new Date(mediaTrack.startTime.getTime() - 2);
Date endTime = new Date(startTime.getTime() + 1);
TimePoint startTime = mediaTrack.startTime.minus( 2);
TimePoint endTime = startTime.plus(1);
assertFalse(mediaTrack.overlapsWith(startTime, endTime));
}
@@ -50,11 +51,11 @@ public class MediaTrackTest {
@Test
public void testPartialOverlapLeft() throws Exception {
MediaTrack mediaTrack = new MediaTrack();
mediaTrack.startTime = new Date();
mediaTrack.durationInMillis = 2;
mediaTrack.startTime = MillisecondsTimePoint.now();
mediaTrack.duration = ONE_MILLISECOND.times(2);
Date startTime = new Date(mediaTrack.startTime.getTime() - 1);
Date endTime = new Date(startTime.getTime() + 2);
TimePoint startTime = mediaTrack.startTime.minus( 1);
TimePoint endTime = startTime.plus(2);
assertTrue(mediaTrack.overlapsWith(startTime, endTime));
}
@@ -62,11 +63,11 @@ public class MediaTrackTest {
@Test
public void testPartialOverlapRight() throws Exception {
MediaTrack mediaTrack = new MediaTrack();
mediaTrack.startTime = new Date();
mediaTrack.durationInMillis = 2;
mediaTrack.startTime = MillisecondsTimePoint.now();
mediaTrack.duration = ONE_MILLISECOND.times(2);
Date startTime = new Date(mediaTrack.startTime.getTime() + 1);
Date endTime = new Date(startTime.getTime() + 2);
TimePoint startTime = mediaTrack.startTime.plus(1);
TimePoint endTime = startTime.plus(2);
assertTrue(mediaTrack.overlapsWith(startTime, endTime));
}
@@ -74,11 +75,11 @@ public class MediaTrackTest {
@Test
public void testMediaFullyIncluded() throws Exception {
MediaTrack mediaTrack = new MediaTrack();
mediaTrack.startTime = new Date();
mediaTrack.durationInMillis = 1;
mediaTrack.startTime = MillisecondsTimePoint.now();
mediaTrack.duration = ONE_MILLISECOND;
Date startTime = new Date(mediaTrack.startTime.getTime() - 1);
Date endTime = new Date(startTime.getTime() + 3);
TimePoint startTime = mediaTrack.startTime.minus( 1);
TimePoint endTime = startTime.plus(3);
assertTrue(mediaTrack.overlapsWith(startTime, endTime));
}
@@ -86,11 +87,11 @@ public class MediaTrackTest {
@Test
public void testMediaFullyIncluding() throws Exception {
MediaTrack mediaTrack = new MediaTrack();
mediaTrack.startTime = new Date();
mediaTrack.durationInMillis = 3;
mediaTrack.startTime = MillisecondsTimePoint.now();
mediaTrack.duration = ONE_MILLISECOND.times(3);
Date startTime = new Date(mediaTrack.startTime.getTime() + 1);
Date endTime = new Date(startTime.getTime() + 1);
TimePoint startTime = mediaTrack.startTime.plus(1);
TimePoint endTime = startTime.plus(1);
assertTrue(mediaTrack.overlapsWith(startTime, endTime));
}
@@ -98,11 +99,11 @@ public class MediaTrackTest {
@Test
public void testOverlapOpenEndStartingEarlier() throws Exception {
MediaTrack mediaTrack = new MediaTrack();
mediaTrack.startTime = new Date();
mediaTrack.durationInMillis = 1;
mediaTrack.startTime = MillisecondsTimePoint.now();
mediaTrack.duration = ONE_MILLISECOND;
Date startTime = new Date(mediaTrack.startTime.getTime() - 1);
Date endTime = null; //--> open end
TimePoint startTime = mediaTrack.startTime.minus( 1);
TimePoint endTime = null; //--> open end
assertTrue(mediaTrack.overlapsWith(startTime, endTime));
}
@@ -110,11 +111,11 @@ public class MediaTrackTest {
@Test
public void testOverlapOpenEndStartingLater() throws Exception {
MediaTrack mediaTrack = new MediaTrack();
mediaTrack.startTime = new Date();
mediaTrack.durationInMillis = 2;
mediaTrack.startTime = MillisecondsTimePoint.now();
mediaTrack.duration = ONE_MILLISECOND.times(2);
Date startTime = new Date(mediaTrack.startTime.getTime() + 1);
Date endTime = null; //--> open end
TimePoint startTime = mediaTrack.startTime.plus(1);
TimePoint endTime = null; //--> open end
assertTrue(mediaTrack.overlapsWith(startTime, endTime));
}
@@ -122,13 +123,61 @@ public class MediaTrackTest {
@Test
public void testOpenEndNoOverlap() throws Exception {
MediaTrack mediaTrack = new MediaTrack();
mediaTrack.startTime = new Date();
mediaTrack.durationInMillis = 1;
mediaTrack.startTime = MillisecondsTimePoint.now();
mediaTrack.duration = ONE_MILLISECOND;
Date startTime = new Date(mediaTrack.startTime.getTime() + 2);
Date endTime = null; //--> open end
TimePoint startTime = mediaTrack.startTime.plus(2);
TimePoint endTime = null; //--> open end
assertFalse(mediaTrack.overlapsWith(startTime, endTime));
}
@Test
public void testNoDurationWithOverlap() throws Exception {
MediaTrack mediaTrack = new MediaTrack();
mediaTrack.startTime = MillisecondsTimePoint.now();
mediaTrack.duration = null; // --> open end
TimePoint startTime = mediaTrack.startTime.plus(2);
TimePoint endTime = startTime.plus(2);
assertTrue(mediaTrack.overlapsWith(startTime, endTime));
}
@Test
public void testNoDurationWithoutOverlap() throws Exception {
MediaTrack mediaTrack = new MediaTrack();
mediaTrack.startTime = MillisecondsTimePoint.now();
mediaTrack.duration = null; // --> open end
TimePoint startTime = mediaTrack.startTime.minus(10);
TimePoint endTime = startTime.plus(2);
assertFalse(mediaTrack.overlapsWith(startTime, endTime));
}
@Test
public void testNoDurationOpenEnd() throws Exception {
MediaTrack mediaTrack = new MediaTrack();
mediaTrack.startTime = MillisecondsTimePoint.now();
mediaTrack.duration = null; // --> open end
TimePoint startTime = mediaTrack.startTime.minus(10);
TimePoint endTime = null;
assertTrue(mediaTrack.overlapsWith(startTime, endTime));
}
@Test
public void testNoDurationOpenEnd2() throws Exception {
MediaTrack mediaTrack = new MediaTrack();
mediaTrack.startTime = MillisecondsTimePoint.now();
mediaTrack.duration = null; // --> open end
TimePoint startTime = mediaTrack.startTime.plus(10);
TimePoint endTime = null;
assertTrue(mediaTrack.overlapsWith(startTime, endTime));
}
}
@@ -1,83 +1,81 @@
package com.sap.sailing.domain.common;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import java.util.Date;
import org.junit.Test;
import com.sap.sailing.domain.common.impl.MillisecondsTimePoint;
import com.sap.sailing.domain.common.media.MediaUtil;
import static org.junit.Assert.*;
public class MediaUtilTest {
@Test
public void testCompareDatesAllNull() throws Exception {
Date date1 = null;
Date date2 = null;
TimePoint date1 = null;
TimePoint date2 = null;
assertTrue(MediaUtil.compareDatesAllowingNull(date1, date2) == 0);
}
@Test
public void testCompareDatesFirstNull() throws Exception {
Date date1 = null;
Date date2 = new Date();
TimePoint date1 = null;
TimePoint date2 = MillisecondsTimePoint.now();
assertTrue(MediaUtil.compareDatesAllowingNull(date1, date2) < 0);
}
@Test
public void testCompareDatesSecondNull() throws Exception {
Date date1 = new Date();
Date date2 = null;
TimePoint date1 = MillisecondsTimePoint.now();
TimePoint date2 = null;
assertTrue(MediaUtil.compareDatesAllowingNull(date1, date2) > 0);
}
@Test
public void testCompareDatesFirstGreaterSecond() throws Exception {
Date date1 = new Date();
Date date2 = new Date(date1.getTime() - 1);
TimePoint date1 = MillisecondsTimePoint.now();
TimePoint date2 = date1.minus(1);
assertTrue(MediaUtil.compareDatesAllowingNull(date1, date2) > 0);
}
@Test
public void testCompareDatesSecondGreaterFirst() throws Exception {
Date date1 = new Date();
Date date2 = new Date(date1.getTime() + 1);
TimePoint date1 = MillisecondsTimePoint.now();
TimePoint date2 = date1.plus(1);
assertTrue(MediaUtil.compareDatesAllowingNull(date1, date2) < 0);
}
@Test
public void testEqualsDatesAllNull() throws Exception {
Date date1 = null;
Date date2 = null;
TimePoint date1 = null;
TimePoint date2 = null;
assertTrue(MediaUtil.equalsDatesAllowingNull(date1, date2));
}
@Test
public void testEqualsDatesFirstNull() throws Exception {
Date date1 = null;
Date date2 = new Date();
TimePoint date1 = null;
TimePoint date2 = MillisecondsTimePoint.now();
assertFalse(MediaUtil.equalsDatesAllowingNull(date1, date2));
}
@Test
public void testEqualsDatesSecondNull() throws Exception {
Date date1 = new Date();
Date date2 = null;
TimePoint date1 = MillisecondsTimePoint.now();
TimePoint date2 = null;
assertFalse(MediaUtil.equalsDatesAllowingNull(date1, date2));
}
@Test
public void testEqualsDatesBothEqual() throws Exception {
Date date1 = new Date();
Date date2 = new Date(date1.getTime());
TimePoint date1 = MillisecondsTimePoint.now();
TimePoint date2 = date1.plus(0);
assertTrue(MediaUtil.equalsDatesAllowingNull(date1, date2));
}
@Test
public void testEqualsDatesNotEqual() throws Exception {
Date date1 = new Date();
Date date2 = new Date(date1.getTime() + 1);
TimePoint date1 = MillisecondsTimePoint.now();
TimePoint date2 = date1.plus(1);
assertFalse(MediaUtil.equalsDatesAllowingNull(date1, date2));
}
@@ -1,6 +1,8 @@
package com.sap.sailing.domain.common.test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.*;
import static org.hamcrest.Matchers.*;
import org.junit.Test;
@@ -98,4 +100,39 @@ public class DurationTest {
assertEquals(3600*25, oneDay.asSeconds(), 0.1);
assertEquals(3600*25*1000, oneDay.asMillis());
}
@Test
public void compare() {
assertTrue(MillisecondsDurationImpl.ONE_MINUTE.compareTo(MillisecondsDurationImpl.ONE_HOUR) < 0);
assertTrue(MillisecondsDurationImpl.ONE_HOUR.compareTo(MillisecondsDurationImpl.ONE_MINUTE) > 0);
}
@Test
public void compareEquals() {
assertThat(MillisecondsDurationImpl.ONE_HOUR.compareTo(MillisecondsDurationImpl.ONE_HOUR), is(0));
}
@Test
public void testEqualForSame() {
assertThat(MillisecondsDurationImpl.ONE_HOUR, is(MillisecondsDurationImpl.ONE_HOUR));
}
@Test
public void testEqualForEuqal() {
Duration t1 = MillisecondsDurationImpl.ONE_HOUR;
Duration t2 = new MillisecondsDurationImpl(t1.asMillis());
assertThat(t1, is(t2));
assertThat(t2, is(t1));
}
@Test
public void testEqualForNull() {
assertFalse(MillisecondsDurationImpl.ONE_HOUR.equals(null));
}
@Test
public void testEqualForString() {
assertFalse(MillisecondsDurationImpl.ONE_HOUR.equals("s"));
}
}
@@ -14,8 +14,11 @@ import java.io.ObjectInputStream;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import org.junit.Before;
import org.junit.Test;
@@ -72,6 +75,39 @@ public class LeaderboardDTODiffingTest {
}
return null;
}
@Test
public void testEmptyLegDetailsGetFilled() throws FileNotFoundException, IOException, ClassNotFoundException {
// remove legDetails for R9 for all competitors from previousVersion; remember which ones did contain data
Set<CompetitorDTO> hadLegDetailsInR9 = new HashSet<>();
Map<CompetitorDTO, LeaderboardRowDTO> newRows = new HashMap<>();
for (CompetitorDTO competitor : previousVersion.rows.keySet()) {
LeaderboardRowDTO competitorRow = new LeaderboardRowDTO();
cloner.clone(newVersion.rows.get(competitor), competitorRow);
Map<String, LeaderboardEntryDTO> newFieldsByRaceColumnName = new HashMap<>();
for (Entry<String, LeaderboardEntryDTO> e : competitorRow.fieldsByRaceColumnName.entrySet()) {
LeaderboardEntryDTO newEntry = new LeaderboardEntryDTO();
cloner.clone(e.getValue(), newEntry);
newFieldsByRaceColumnName.put(e.getKey(), newEntry);
}
competitorRow.fieldsByRaceColumnName = newFieldsByRaceColumnName;
newRows.put(competitor, competitorRow); // use a copy of the row so we can null out legDetails for R9 in previousVersion only
LeaderboardRowDTO previousRow = previousVersion.rows.get(competitor);
assertNotSame(previousRow, competitorRow);
if (previousRow.fieldsByRaceColumnName.get("R9").legDetails != null) {
hadLegDetailsInR9.add(competitor);
previousRow.fieldsByRaceColumnName.get("R9").legDetails = null;
assertNotNull(competitorRow.fieldsByRaceColumnName.get("R9").legDetails != null);
}
}
newVersion.rows = newRows;
newVersion.strip(previousVersion); // should contain the leg details now
LeaderboardDTO applied = newVersion.getLeaderboardDTO(previousVersion);
// now applied must contain the leg details
for (CompetitorDTO competitor : hadLegDetailsInR9) {
assertNotNull(applied.rows.get(competitor).fieldsByRaceColumnName.get("R9").legDetails);
}
}
@Test
public void testLeaderboardSuccessfullyRead() {
@@ -301,7 +337,7 @@ public class LeaderboardDTODiffingTest {
public void testPartialRaceColumnDTOCompaction() throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException, SecurityException {
// create a modified R9 RaceDTO clone in newVersion to make sure that even changing a property in the RaceDTO will keep the RaceColumnDTO from being omitted
RaceColumnDTO r9 = newVersion.getRaceColumnByName("R9");
RaceColumnDTO clonedR9 = new RaceColumnDTO(r9.isValidInTotalScore());
RaceColumnDTO clonedR9 = new RaceColumnDTO();
cloner.clone(r9, clonedR9);
// also clone the racesPerFleet map, or else we'd be modifying the previous version's one too
final Field racesPerFleetField = clonedR9.getClass().getDeclaredField("racesPerFleet");
@@ -1,17 +1,56 @@
package com.sap.sailing.domain.common.test;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
import com.sap.sailing.domain.common.TimePoint;
import com.sap.sailing.domain.common.impl.MillisecondsTimePoint;
import static org.junit.Assert.*;
import static org.hamcrest.Matchers.*;
public class TimePointTest {
@Test
public void compare() {
TimePoint one = new MillisecondsTimePoint(Long.MIN_VALUE);
TimePoint two = new MillisecondsTimePoint(Long.MAX_VALUE);
assertTrue(one.before(two));
assertTrue(two.after(one));
}
@Test
public void compareEquals() {
TimePoint one = new MillisecondsTimePoint(Long.MIN_VALUE);
TimePoint two = new MillisecondsTimePoint(Long.MIN_VALUE);
assertThat(one.compareTo(two), is(0));
assertFalse(one.before(two));
assertFalse(two.after(one));
}
@Test
public void testEqualForSame() {
TimePoint t = new MillisecondsTimePoint(Long.MIN_VALUE);
assertThat(t, is(t));
}
@Test
public void testEqualForEuqal() {
TimePoint t1 = new MillisecondsTimePoint(Long.MIN_VALUE);
TimePoint t2 = new MillisecondsTimePoint(Long.MIN_VALUE);
assertThat(t1, is(t2));
assertThat(t2, is(t1));
}
@Test
public void testEqualForNull() {
TimePoint t = new MillisecondsTimePoint(Long.MIN_VALUE);
assertFalse(t.equals(null));
}
@Test
public void testEqualForString() {
TimePoint t = new MillisecondsTimePoint(Long.MIN_VALUE);
assertFalse(t.equals("s"));
}
}
@@ -11,29 +11,31 @@ import java.net.URL;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.logging.Logger;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Rule;
import org.junit.rules.Timeout;
import com.maptrack.client.io.TypeController;
import com.sap.sailing.domain.common.PassingInstruction;
import com.sap.sailing.domain.tractracadapter.Receiver;
import com.sap.sailing.domain.tractracadapter.TracTracConnectionConstants;
import com.sap.sailing.domain.tractracadapter.TracTracControlPoint;
import com.sap.sailing.domain.tractracadapter.impl.ControlPointAdapter;
import com.sap.sse.common.Util;
import com.tractrac.clientmodule.ControlPoint;
import com.tractrac.clientmodule.Event;
import com.tractrac.clientmodule.data.DataController;
import com.tractrac.clientmodule.data.DataController.Listener;
import com.tractrac.clientmodule.setup.KeyValue;
import com.sap.sse.common.Util.Pair;
import com.tractrac.model.lib.api.ModelLocator;
import com.tractrac.model.lib.api.event.CreateModelException;
import com.tractrac.model.lib.api.event.IEvent;
import com.tractrac.model.lib.api.event.IRace;
import com.tractrac.model.lib.api.route.IControl;
import com.tractrac.subscription.lib.api.IEventSubscriber;
import com.tractrac.subscription.lib.api.IRaceSubscriber;
import com.tractrac.subscription.lib.api.ISubscriberFactory;
import com.tractrac.subscription.lib.api.SubscriberInitializationException;
import com.tractrac.subscription.lib.api.SubscriptionLocator;
/**
* Subclassing tests have to call {@link #addListenersForStoredDataAndStartController(Iterable)} to kick off
@@ -44,17 +46,16 @@ import com.tractrac.clientmodule.setup.KeyValue;
* @author Axel Uhl (D043530)
*
*/
public abstract class AbstractTracTracLiveTest extends StoredTrackBasedTest implements Listener {
public abstract class AbstractTracTracLiveTest extends StoredTrackBasedTest {
private static final Logger logger = Logger.getLogger(AbstractTracTracLiveTest.class.getName());
protected static final boolean tractracTunnel = Boolean.valueOf(System.getProperty("tractrac.tunnel", "false"));
protected static final String tractracTunnelHost = System.getProperty("tractrac.tunnel.host", "localhost");
private Event event;
private IRace race;
private IEventSubscriber eventSubscriber;
private IRaceSubscriber raceSubscriber;
private final Collection<Receiver> receivers;
private Thread ioThread;
private DataController controller;
@Rule public Timeout AbstractTracTracLiveTestTimeout = new Timeout(2 * 60 * 1000);
@Rule public Timeout AbstractTracTracLiveTestTimeout = new Timeout(3 * 60 * 1000);
protected AbstractTracTracLiveTest() throws URISyntaxException, MalformedURLException {
receivers = new HashSet<Receiver>();
@@ -62,9 +63,11 @@ public abstract class AbstractTracTracLiveTest extends StoredTrackBasedTest impl
/**
* Default set-up for an STG training session in Weymouth, 2011
* @throws SubscriberInitializationException
* @throws CreateModelException
*/
@Before
public void setUp() throws MalformedURLException, IOException, InterruptedException, URISyntaxException, ParseException {
public void setUp() throws MalformedURLException, IOException, InterruptedException, URISyntaxException, SubscriberInitializationException, ParseException, CreateModelException {
final String eventID = "event_20110505_SailingTea";
final String raceID = "bd8c778e-7c65-11e0-8236-406186cbf87c";
setUp(getParamURL(eventID, raceID), getLiveURI(), getStoredURI());
@@ -83,10 +86,22 @@ public abstract class AbstractTracTracLiveTest extends StoredTrackBasedTest impl
"&race="+raceID);
}
protected void setUp(URL paramUrl, URI liveUri, URI storedUri) throws FileNotFoundException, MalformedURLException {
protected IEventSubscriber getEventSubscriber() {
return eventSubscriber;
}
protected IRaceSubscriber getRaceSubscriber() {
return raceSubscriber;
}
protected void setUp(URL paramUrl, URI liveUri, URI storedUri) throws FileNotFoundException, MalformedURLException, URISyntaxException, SubscriberInitializationException, CreateModelException {
// Read event data from configuration file
event = KeyValue.setup(paramUrl);
assertNotNull(event);
final IRace race = ModelLocator.getEventFactory().createRace(new URI(paramUrl.toString()));
this.race = race;
ISubscriberFactory subscriberFactory = SubscriptionLocator.getSusbcriberFactory();
eventSubscriber = subscriberFactory.createEventSubscriber(race.getEvent(), liveUri, storedUri);
raceSubscriber = subscriberFactory.createRaceSubscriber(race, liveUri, storedUri);
assertNotNull(race);
// Initialize data controller using live and stored data sources
if (storedUri.toString().startsWith("file:")) {
try {
@@ -97,9 +112,7 @@ public abstract class AbstractTracTracLiveTest extends StoredTrackBasedTest impl
e.printStackTrace();
}
}
controller = new DataController(liveUri, storedUri, this);
// Start live and stored data streams
ioThread = new Thread(controller, "I/O for event "+event.getName()+", paramURL "+paramUrl);
// TODO Start live and stored data subscribers
// test cases need to start the thread calling startController
// after adding their listeners
}
@@ -110,112 +123,43 @@ public abstract class AbstractTracTracLiveTest extends StoredTrackBasedTest impl
protected void addListenersForStoredDataAndStartController(Iterable<Receiver> receivers) {
for (Receiver receiver : receivers) {
this.receivers.add(receiver);
for (TypeController typeController : receiver.getTypeControllersAndStart()) {
getController().add(typeController);
}
receiver.subscribe();
}
startController();
}
/**
* Called when the {@link #storedDataEnd()} event was received. Adds the listeners
* returned to the {@link #getController() controller}, presumably for live data.
* This default implementation returns an empty iterable. Subclasses may override
* to return more.
*/
protected Iterable<TypeController> getListenersForLiveData() {
return Collections.emptySet();
}
protected void startController() {
ioThread.start();
getEventSubscriber().start();
getRaceSubscriber().start();
}
@After
public void tearDown() throws MalformedURLException, IOException, InterruptedException {
logger.info("entering "+getClass().getName()+".tearDown()");
Thread.sleep(500); // wait a bit before stopping the controller; in earlier versions we did a web request to stop the
// simulator here; then, the ioThread joined flawlessly; aggressively stopping the controller doesn't let the ioThread join
if (getController() != null) // the controller (and the ioThread see below) are null if the data is being read from a local file.
controller.stop(/* abortStored */ true);
logger.info("successfully stopped controller");
try {
if (ioThread != null) {
ioThread.join(3000); // just wait a little bit, then give up
}
} catch (InterruptedException ex) {
Assert.fail(ex.getMessage());
}
logger.info("successfully joined ioThread");
for (Receiver receiver : receivers) {
receiver.stopPreemptively();
logger.info("successfully stopped receiver "+receiver);
}
getEventSubscriber().stop();
getRaceSubscriber().stop();
logger.info("leaving "+getClass().getName()+".tearDown()");
}
protected Event getTracTracEvent() {
return event;
protected IEvent getTracTracEvent() {
return race.getEvent();
}
protected IRace getTracTracRace() {
return race;
}
protected DataController getController() {
return controller;
}
@Override
public void liveDataConnected() {
System.out.println("Live data connected");
}
@Override
public void liveDataDisconnected() {
System.out.println("Live data disconnected");
}
@Override
public void stopped() {
System.out.println("stopped");
}
@Override
public void storedDataBegin() {
System.out.println("Stored data begin");
}
@Override
public void storedDataEnd() {
System.out.println("Stored data end");
}
@Override
public void storedDataProgress(float progress) {
System.out.println("Stored data progress: "+progress);
}
@Override
public void storedDataError(String arg0) {
System.err.println("Error with stored data "+arg0);
}
@Override
public void liveDataConnectError(String arg0) {
System.err.println("Error with live data "+arg0);
}
public static Iterable<Util.Pair<TracTracControlPoint, PassingInstruction>> getTracTracControlPointsWithPassingInstructions(Iterable<ControlPoint> controlPoints) {
List<Util.Pair<TracTracControlPoint, PassingInstruction>> ttControlPoints = new ArrayList<Util.Pair<TracTracControlPoint, PassingInstruction>>();
for (com.tractrac.clientmodule.ControlPoint cp : controlPoints) {
ttControlPoints.add(new Util.Pair<TracTracControlPoint, PassingInstruction>(new ControlPointAdapter(cp), null));
public static Iterable<Pair<TracTracControlPoint, PassingInstruction>> getTracTracControlPointsWithPassingInstructions(Iterable<IControl> controlPoints) {
List<Pair<TracTracControlPoint, PassingInstruction>> ttControlPoints = new ArrayList<Pair<TracTracControlPoint, PassingInstruction>>();
for (IControl cp : controlPoints) {
ttControlPoints.add(new Pair<TracTracControlPoint, PassingInstruction>(new ControlPointAdapter(cp), null));
}
return ttControlPoints;
}
public static Iterable<TracTracControlPoint> getTracTracControlPoints(Iterable<ControlPoint> controlPoints) {
public static Iterable<TracTracControlPoint> getTracTracControlPoints(Iterable<IControl> controlPoints) {
List<TracTracControlPoint> ttControlPoints = new ArrayList<>();
for (com.tractrac.clientmodule.ControlPoint cp : controlPoints) {
for (IControl cp : controlPoints) {
ttControlPoints.add(new ControlPointAdapter(cp));
}
return ttControlPoints;
@@ -9,20 +9,20 @@ import java.util.Collections;
import org.junit.Test;
import com.sap.sailing.domain.base.BearingWithConfidence;
import com.sap.sailing.domain.base.impl.BearingWithConfidenceImpl;
import com.sap.sailing.domain.base.impl.PositionWithConfidenceImpl;
import com.sap.sailing.domain.common.Bearing;
import com.sap.sailing.domain.common.BearingCluster;
import com.sap.sailing.domain.common.Position;
import com.sap.sailing.domain.common.confidence.BearingWithConfidence;
import com.sap.sailing.domain.common.confidence.BearingWithConfidenceCluster;
import com.sap.sailing.domain.common.confidence.ConfidenceBasedAverager;
import com.sap.sailing.domain.common.confidence.ConfidenceFactory;
import com.sap.sailing.domain.common.confidence.HasConfidence;
import com.sap.sailing.domain.common.confidence.impl.BearingWithConfidenceImpl;
import com.sap.sailing.domain.common.impl.DegreeBearingImpl;
import com.sap.sailing.domain.common.impl.DegreePosition;
import com.sap.sailing.domain.common.impl.RadianBearingImpl;
import com.sap.sailing.domain.common.scalablevalue.impl.ScalablePosition;
import com.sap.sailing.domain.confidence.ConfidenceBasedAverager;
import com.sap.sailing.domain.confidence.ConfidenceFactory;
import com.sap.sailing.domain.confidence.HasConfidence;
import com.sap.sailing.domain.tracking.impl.BearingCluster;
import com.sap.sailing.domain.tracking.impl.BearingWithConfidenceCluster;
public class BearingTest {
@Test
@@ -0,0 +1,122 @@
package com.sap.sailing.domain.test;
import static org.junit.Assert.assertEquals;
import static org.mockito.Matchers.anyBoolean;
import static org.mockito.Matchers.anyObject;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import org.junit.Before;
import org.junit.Test;
import com.sap.sailing.domain.base.Competitor;
import com.sap.sailing.domain.base.impl.CompetitorImpl;
import com.sap.sailing.domain.common.Bearing;
import com.sap.sailing.domain.common.LegType;
import com.sap.sailing.domain.common.NoWindException;
import com.sap.sailing.domain.common.Position;
import com.sap.sailing.domain.common.TimePoint;
import com.sap.sailing.domain.common.impl.DegreeBearingImpl;
import com.sap.sailing.domain.common.impl.DegreePosition;
import com.sap.sailing.domain.common.impl.KnotSpeedWithBearingImpl;
import com.sap.sailing.domain.common.impl.MillisecondsTimePoint;
import com.sap.sailing.domain.tracking.GPSFixMoving;
import com.sap.sailing.domain.tracking.GPSFixTrack;
import com.sap.sailing.domain.tracking.TrackedLeg;
import com.sap.sailing.domain.tracking.TrackedLegOfCompetitor;
import com.sap.sailing.domain.tracking.TrackedRace;
import com.sap.sailing.domain.tracking.WindLegTypeAndLegBearingCache;
import com.sap.sailing.domain.tracking.impl.DynamicGPSFixMovingTrackImpl;
import com.sap.sailing.domain.tracking.impl.DynamicTrackedRaceImpl;
import com.sap.sailing.domain.tracking.impl.TrackedLegImpl;
import com.sap.sailing.domain.tracking.impl.TrackedLegOfCompetitorImpl;
import com.sap.sailing.domain.tracking.impl.WindImpl;
public class BeatAngleTest {
private Competitor competitor;
private GPSFixTrack<Competitor, GPSFixMoving> competitorTrack;
private TrackedRace trackedRace;
private TrackedLeg trackedLeg;
private TrackedLegOfCompetitor trackedLegOfCompetitor;
@SuppressWarnings("unchecked")
@Before
public void setUp() {
competitor = mock(CompetitorImpl.class);
trackedRace = mock(DynamicTrackedRaceImpl.class);
trackedLeg = mock(TrackedLegImpl.class);
trackedLegOfCompetitor = mock(TrackedLegOfCompetitorImpl.class);
competitorTrack = mock(DynamicGPSFixMovingTrackImpl.class);
when(competitorTrack.getEstimatedPosition((TimePoint) anyObject(), /* extrapolate */ anyBoolean())).thenReturn(new DegreePosition(0, 0));
when(trackedLegOfCompetitor.getCompetitor()).thenReturn(competitor);
when(trackedLegOfCompetitor.getTrackedLeg()).thenReturn(trackedLeg);
when(trackedRace.getTrack(competitor)).thenReturn(competitorTrack);
when(trackedLeg.getTrackedRace()).thenReturn(trackedRace);
}
private void setUp(final Bearing windToBearing, final Bearing boatToBearing, final Bearing legBearing, LegType legType)
throws NoWindException {
when(trackedLeg.getLegBearing((TimePoint) anyObject())).thenReturn(legBearing);
when(trackedLeg.getLegType((TimePoint) anyObject())).thenReturn(legType);
when(trackedRace.getWind((Position) anyObject(), (TimePoint) anyObject())).thenReturn(
new WindImpl(new DegreePosition(0, 0), MillisecondsTimePoint.now(), new KnotSpeedWithBearingImpl(12,
windToBearing)));
when(trackedLegOfCompetitor.getSpeedOverGround((TimePoint) anyObject())).thenReturn(new KnotSpeedWithBearingImpl(10, boatToBearing));
when(trackedLegOfCompetitor.getBeatAngle((TimePoint) anyObject())).thenCallRealMethod();
when(trackedLegOfCompetitor.getBeatAngle((TimePoint) anyObject(), (WindLegTypeAndLegBearingCache) anyObject())).thenCallRealMethod();
}
@Test
public void testBeatAngleUpwindPort() throws NoWindException {
final Bearing windToBearing = new DegreeBearingImpl(123);
final Bearing boatToBearing = new DegreeBearingImpl(348);
final Bearing legBearing = new DegreeBearingImpl(303);
setUp(windToBearing, boatToBearing, legBearing, LegType.UPWIND);
assertEquals(-45., trackedLegOfCompetitor.getBeatAngle(MillisecondsTimePoint.now()).getDegrees(), 0.00001);
}
@Test
public void testBeatAngleUpwindStarboard() throws NoWindException {
final Bearing windToBearing = new DegreeBearingImpl(123);
final Bearing boatToBearing = new DegreeBearingImpl(258);
final Bearing legBearing = new DegreeBearingImpl(303);
setUp(windToBearing, boatToBearing, legBearing, LegType.UPWIND);
assertEquals(45., trackedLegOfCompetitor.getBeatAngle(MillisecondsTimePoint.now()).getDegrees(), 0.00001);
}
@Test
public void testBeatAngleDownwindPort() throws NoWindException {
final Bearing windToBearing = new DegreeBearingImpl(123);
final Bearing boatToBearing = new DegreeBearingImpl(120);
final Bearing legBearing = new DegreeBearingImpl(123);
setUp(windToBearing, boatToBearing, legBearing, LegType.DOWNWIND);
assertEquals(-177., trackedLegOfCompetitor.getBeatAngle(MillisecondsTimePoint.now()).getDegrees(), 0.00001);
}
@Test
public void testBeatAngleDownwindStarboard() throws NoWindException {
final Bearing windToBearing = new DegreeBearingImpl(123);
final Bearing boatToBearing = new DegreeBearingImpl(126);
final Bearing legBearing = new DegreeBearingImpl(123);
setUp(windToBearing, boatToBearing, legBearing, LegType.DOWNWIND);
assertEquals(177., trackedLegOfCompetitor.getBeatAngle(MillisecondsTimePoint.now()).getDegrees(), 0.00001);
}
@Test
public void testBeatAngleReachingPort() throws NoWindException {
final Bearing windToBearing = new DegreeBearingImpl(123);
final Bearing boatToBearing = new DegreeBearingImpl(33);
final Bearing legBearing = new DegreeBearingImpl(33);
setUp(windToBearing, boatToBearing, legBearing, LegType.REACHING);
assertEquals(-90., trackedLegOfCompetitor.getBeatAngle(MillisecondsTimePoint.now()).getDegrees(), 0.00001);
}
@Test
public void testBeatAngleReachingStarboard() throws NoWindException {
final Bearing windToBearing = new DegreeBearingImpl(303);
final Bearing boatToBearing = new DegreeBearingImpl(33);
final Bearing legBearing = new DegreeBearingImpl(33);
setUp(windToBearing, boatToBearing, legBearing, LegType.REACHING);
assertEquals(90., trackedLegOfCompetitor.getBeatAngle(MillisecondsTimePoint.now()).getDegrees(), 0.00001);
}
}
@@ -0,0 +1,271 @@
package com.sap.sailing.domain.test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
import com.sap.sailing.domain.common.Bounds;
import com.sap.sailing.domain.common.impl.BoundsImpl;
import com.sap.sailing.domain.common.impl.DegreePosition;
public class BoundsTest {
@Test
public void simpleContains() {
Bounds b = new BoundsImpl(new DegreePosition(1, 1), new DegreePosition(3, 3));
assertTrue(b.contains(new DegreePosition(2, 2)));
assertFalse(b.contains(new DegreePosition(4, 4)));
assertFalse(b.contains(new DegreePosition(0, 0)));
assertFalse(b.contains(new DegreePosition(0, 2)));
assertFalse(b.contains(new DegreePosition(2, 0)));
assertFalse(b.contains(new DegreePosition(2, 4)));
}
@Test
public void crossDateLineContains() {
Bounds b = new BoundsImpl(new DegreePosition(1, 179), new DegreePosition(3, -179));
assertTrue(b.contains(new DegreePosition(2, 180)));
assertFalse(b.contains(new DegreePosition(4, -178)));
assertFalse(b.contains(new DegreePosition(0, 178)));
assertFalse(b.contains(new DegreePosition(0, 180)));
assertFalse(b.contains(new DegreePosition(2, 178)));
assertFalse(b.contains(new DegreePosition(2, -178)));
}
@Test
public void simpleUnionTestOverlap() {
Bounds b1 = new BoundsImpl(new DegreePosition(1, 1), new DegreePosition(3, 3));
Bounds b2 = new BoundsImpl(new DegreePosition(2, 2), new DegreePosition(4, 4));
Bounds u = b1.union(b2);
assertEquals(1.0, u.getSouthWest().getLatDeg(), 0.00000001);
assertEquals(1.0, u.getSouthWest().getLngDeg(), 0.00000001);
assertEquals(4.0, u.getNorthEast().getLatDeg(), 0.00000001);
assertEquals(4.0, u.getNorthEast().getLngDeg(), 0.00000001);
}
@Test
public void testDatelineUnionOverlap() {
Bounds b1 = new BoundsImpl(new DegreePosition(1, 179), new DegreePosition(3, -179));
Bounds b2 = new BoundsImpl(new DegreePosition(2, 180), new DegreePosition(4, -178));
Bounds u = b1.union(b2);
assertEquals(1.0, u.getSouthWest().getLatDeg(), 0.00000001);
assertEquals(179, u.getSouthWest().getLngDeg(), 0.00000001);
assertEquals(4.0, u.getNorthEast().getLatDeg(), 0.00000001);
assertEquals(-178, u.getNorthEast().getLngDeg(), 0.00000001);
}
@Test
public void testDatelineUnionOutside() {
Bounds b1 = new BoundsImpl(new DegreePosition(1, 179), new DegreePosition(3, -179));
Bounds b2 = new BoundsImpl(new DegreePosition(4, -178), new DegreePosition(5, -177));
Bounds u = b1.union(b2);
assertEquals(1.0, u.getSouthWest().getLatDeg(), 0.00000001);
assertEquals(179, u.getSouthWest().getLngDeg(), 0.00000001);
assertEquals(5.0, u.getNorthEast().getLatDeg(), 0.00000001);
assertEquals(-177, u.getNorthEast().getLngDeg(), 0.00000001);
}
@Test
public void testDatelineUnionOneSideAndOtherSide() {
Bounds b1 = new BoundsImpl(new DegreePosition(1, 178), new DegreePosition(3, 179));
Bounds b2 = new BoundsImpl(new DegreePosition(4, -178), new DegreePosition(5, -177));
Bounds u = b1.union(b2);
assertEquals(1.0, u.getSouthWest().getLatDeg(), 0.00000001);
assertEquals(178, u.getSouthWest().getLngDeg(), 0.00000001);
assertEquals(5.0, u.getNorthEast().getLatDeg(), 0.00000001);
assertEquals(-177, u.getNorthEast().getLngDeg(), 0.00000001);
}
@Test
public void simpleUnionTestOutside() {
Bounds b1 = new BoundsImpl(new DegreePosition(1, 1), new DegreePosition(3, 3));
Bounds b2 = new BoundsImpl(new DegreePosition(4, 4), new DegreePosition(5, 5));
Bounds u = b1.union(b2);
assertEquals(1.0, u.getSouthWest().getLatDeg(), 0.00000001);
assertEquals(1.0, u.getSouthWest().getLngDeg(), 0.00000001);
assertEquals(5.0, u.getNorthEast().getLatDeg(), 0.00000001);
assertEquals(5.0, u.getNorthEast().getLngDeg(), 0.00000001);
}
@Test
public void unionTestWithEmptyBounds() {
Bounds b1 = new BoundsImpl(new DegreePosition(1, 1), new DegreePosition(3, 3));
Bounds b2 = new BoundsImpl(new DegreePosition(4, 4), new DegreePosition(4, 4));
Bounds u = b1.union(b2);
assertEquals(1.0, u.getSouthWest().getLatDeg(), 0.00000001);
assertEquals(1.0, u.getSouthWest().getLngDeg(), 0.00000001);
assertEquals(4.0, u.getNorthEast().getLatDeg(), 0.00000001);
assertEquals(4.0, u.getNorthEast().getLngDeg(), 0.00000001);
}
@Test
public void unionTestWithTwoEmptyBounds() {
Bounds b1 = new BoundsImpl(new DegreePosition(1, 1), new DegreePosition(1, 1));
Bounds b2 = new BoundsImpl(new DegreePosition(4, 4), new DegreePosition(4, 4));
Bounds u = b1.union(b2);
assertEquals(1.0, u.getSouthWest().getLatDeg(), 0.00000001);
assertEquals(1.0, u.getSouthWest().getLngDeg(), 0.00000001);
assertEquals(4.0, u.getNorthEast().getLatDeg(), 0.00000001);
assertEquals(4.0, u.getNorthEast().getLngDeg(), 0.00000001);
}
@Test
public void simpleIntersectsTest() {
Bounds b1 = new BoundsImpl(new DegreePosition(1, 1), new DegreePosition(3, 3));
Bounds b2 = new BoundsImpl(new DegreePosition(2, 2), new DegreePosition(5, 5));
assertTrue(b1.intersects(b2));
assertTrue(b2.intersects(b1));
}
@Test
public void simpleIntersectTest() {
Bounds b1 = new BoundsImpl(new DegreePosition(1, 1), new DegreePosition(3, 3));
Bounds b2 = new BoundsImpl(new DegreePosition(2, 2), new DegreePosition(5, 5));
Bounds i = b1.intersect(b2);
assertEquals(2, i.getSouthWest().getLatDeg(), 0.0000001);
assertEquals(3, i.getNorthEast().getLatDeg(), 0.0000001);
assertEquals(2, i.getSouthWest().getLngDeg(), 0.0000001);
assertEquals(3, i.getNorthEast().getLngDeg(), 0.0000001);
}
@Test
public void simpleNegativeIntersectsTest() {
Bounds b1 = new BoundsImpl(new DegreePosition(1, 1), new DegreePosition(3, 3));
Bounds b2 = new BoundsImpl(new DegreePosition(4, 4), new DegreePosition(5, 5));
assertFalse(b1.intersects(b2));
assertFalse(b2.intersects(b1));
}
@Test
public void simpleNegativeIntersectTest() {
Bounds b1 = new BoundsImpl(new DegreePosition(1, 1), new DegreePosition(3, 3));
Bounds b2 = new BoundsImpl(new DegreePosition(4, 4), new DegreePosition(5, 5));
Bounds i = b1.intersect(b2);
assertTrue(i.isEmpty());
}
@Test
public void simpleNegativeIntersectsTestNonIntersectingLat() {
Bounds b1 = new BoundsImpl(new DegreePosition(1, 1), new DegreePosition(3, 3));
Bounds b2 = new BoundsImpl(new DegreePosition(4, 2), new DegreePosition(5, 5));
assertFalse(b1.intersects(b2));
assertFalse(b2.intersects(b1));
}
@Test
public void simpleNegativeIntersectTestNonIntersectingLat() {
Bounds b1 = new BoundsImpl(new DegreePosition(1, 1), new DegreePosition(3, 3));
Bounds b2 = new BoundsImpl(new DegreePosition(4, 2), new DegreePosition(5, 5));
Bounds i = b1.intersect(b2);
assertTrue(i.isEmpty());
}
@Test
public void intersectsWithContainsTest() {
Bounds b1 = new BoundsImpl(new DegreePosition(1, 1), new DegreePosition(4, 4));
Bounds b2 = new BoundsImpl(new DegreePosition(2, 2), new DegreePosition(3, 3));
assertTrue(b1.intersects(b2));
assertTrue(b2.intersects(b1));
}
@Test
public void intersectWithContainsTest() {
Bounds b1 = new BoundsImpl(new DegreePosition(1, 1), new DegreePosition(4, 4));
Bounds b2 = new BoundsImpl(new DegreePosition(2, 2), new DegreePosition(3, 3));
Bounds i = b1.intersect(b2);
assertEquals(2, i.getSouthWest().getLatDeg(), 0.0000001);
assertEquals(3, i.getNorthEast().getLatDeg(), 0.0000001);
assertEquals(2, i.getSouthWest().getLngDeg(), 0.0000001);
assertEquals(3, i.getNorthEast().getLngDeg(), 0.0000001);
}
@Test
public void dateLineIntersectsTest() {
Bounds b1 = new BoundsImpl(new DegreePosition(1, 178), new DegreePosition(3, -177));
Bounds b2 = new BoundsImpl(new DegreePosition(2, -178), new DegreePosition(5, -176));
assertTrue(b1.intersects(b2));
assertTrue(b2.intersects(b1));
}
@Test
public void dateLineIntersectTest() {
Bounds b1 = new BoundsImpl(new DegreePosition(1, 178), new DegreePosition(3, -177));
Bounds b2 = new BoundsImpl(new DegreePosition(2, -178), new DegreePosition(5, -176));
Bounds i = b1.intersect(b2);
assertEquals(2, i.getSouthWest().getLatDeg(), 0.0000001);
assertEquals(3, i.getNorthEast().getLatDeg(), 0.0000001);
assertEquals(-178, i.getSouthWest().getLngDeg(), 0.0000001);
assertEquals(-177, i.getNorthEast().getLngDeg(), 0.0000001);
}
@Test
public void dateLineNegativeIntersectsTestNonMatchingLat() {
Bounds b1 = new BoundsImpl(new DegreePosition(1, 178), new DegreePosition(3, -177));
Bounds b2 = new BoundsImpl(new DegreePosition(4, -178), new DegreePosition(5, -176));
assertFalse(b1.intersects(b2));
assertFalse(b2.intersects(b1));
}
@Test
public void dateLineNegativeIntersectTestNonMatchingLat() {
Bounds b1 = new BoundsImpl(new DegreePosition(1, 178), new DegreePosition(3, -177));
Bounds b2 = new BoundsImpl(new DegreePosition(4, -178), new DegreePosition(5, -176));
Bounds i = b1.intersect(b2);
assertTrue(i.isEmpty());
}
@Test
public void dateLineNegativeIntersectsTest() {
Bounds b1 = new BoundsImpl(new DegreePosition(1, 178), new DegreePosition(3, 179));
Bounds b2 = new BoundsImpl(new DegreePosition(2, -178), new DegreePosition(5, -177));
assertFalse(b1.intersects(b2));
assertFalse(b2.intersects(b1));
}
@Test
public void dateLineNegativeIntersectTest() {
Bounds b1 = new BoundsImpl(new DegreePosition(1, 178), new DegreePosition(3, 179));
Bounds b2 = new BoundsImpl(new DegreePosition(2, -178), new DegreePosition(5, -177));
Bounds i = b1.intersect(b2);
assertTrue(i.isEmpty());
}
@Test
public void dateLineNegativeIntersectsTestBoundsCrossingDateLine() {
Bounds b1 = new BoundsImpl(new DegreePosition(1, 178), new DegreePosition(3, -179));
Bounds b2 = new BoundsImpl(new DegreePosition(2, -178), new DegreePosition(5, -177));
assertFalse(b1.intersects(b2));
assertFalse(b2.intersects(b1));
}
@Test
public void dateLineNegativeIntersectTestBoundsCrossingDateLine() {
Bounds b1 = new BoundsImpl(new DegreePosition(1, 178), new DegreePosition(3, -179));
Bounds b2 = new BoundsImpl(new DegreePosition(2, -178), new DegreePosition(5, -177));
Bounds i = b1.intersect(b2);
assertTrue(i.isEmpty());
}
@Test
public void infiniteIntersectNoDateLine() {
Bounds b1 = new BoundsImpl(new DegreePosition(-90, -180), new DegreePosition(90, 180));
Bounds b2 = new BoundsImpl(new DegreePosition(-10, -20), new DegreePosition(20, 20));
Bounds i = b1.intersect(b2);
assertEquals(-10, i.getSouthWest().getLatDeg(), 0.0000001);
assertEquals(20, i.getNorthEast().getLatDeg(), 0.0000001);
assertEquals(-20, i.getSouthWest().getLngDeg(), 0.0000001);
assertEquals(20, i.getNorthEast().getLngDeg(), 0.0000001);
}
@Test
public void infiniteIntersectDateLine() {
Bounds b1 = new BoundsImpl(new DegreePosition(-90, -180), new DegreePosition(90, 180));
Bounds b2 = new BoundsImpl(new DegreePosition(-10, 170), new DegreePosition(20, -170));
Bounds i = b1.intersect(b2);
assertEquals(-10, i.getSouthWest().getLatDeg(), 0.0000001);
assertEquals(20, i.getNorthEast().getLatDeg(), 0.0000001);
assertEquals(170, i.getSouthWest().getLngDeg(), 0.0000001);
assertEquals(-170, i.getNorthEast().getLngDeg(), 0.0000001);
}
}
@@ -0,0 +1,70 @@
package com.sap.sailing.domain.test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import java.util.Iterator;
import java.util.UUID;
import java.util.concurrent.ExecutionException;
import javax.imageio.ImageIO;
import javax.imageio.ImageReader;
import javax.imageio.stream.ImageInputStream;
import org.junit.Test;
import com.sap.sailing.domain.base.Event;
import com.sap.sailing.domain.base.impl.EventImpl;
import com.sap.sailing.domain.common.ImageSize;
import com.sap.sailing.domain.common.impl.ImageSizeImpl;
public class CalculateImageSizeFromUrlTest {
@Test
public void calculateImageSizeFromUrl() throws IOException {
int width = 350;
int height = 150;
ImageSize size = calculate("http://placehold.it/" + width + "x" + height);
assertTrue(size.getWidth() == width);
assertTrue(size.getHeight() == height);
}
public ImageSize calculate(String urlS) throws IOException {
ImageInputStream in = null;
try {
URL url = new URL(urlS);
URLConnection conn = url.openConnection();
in = ImageIO.createImageInputStream(conn.getInputStream());
final Iterator<ImageReader> readers = ImageIO.getImageReaders(in);
if (readers.hasNext()) {
ImageReader reader = readers.next();
try {
reader.setInput(in);
return new ImageSizeImpl(reader.getWidth(0), reader.getHeight(0));
} finally {
reader.dispose();
}
}
} finally {
if (in != null) {
in.close();
}
}
return null;
}
@Test
public void testEventImageSize() throws MalformedURLException, InterruptedException, ExecutionException {
Event e = new EventImpl("Event Name", /* startDate */ null, /* endDate */ null, "Kiel", /* isPublic */ true, UUID.randomUUID());
int width = Math.max(10, (int) (200. * Math.random()));
int height = Math.max(10, (int) (100. * Math.random()));
URL imageURL = new URL("http://placehold.it/" + width + "x" + height);
e.addImageURL(imageURL);
ImageSize expectedSize = new ImageSizeImpl(width, height);
assertEquals(expectedSize, e.getImageSize(imageURL));
}
}
@@ -28,6 +28,8 @@ import com.sap.sailing.domain.tracking.GPSFixMoving;
import com.sap.sailing.domain.tracking.MarkPassing;
import com.sap.sailing.domain.tracking.impl.WindImpl;
import com.sap.sailing.domain.tractracadapter.ReceiverType;
import com.tractrac.model.lib.api.event.CreateModelException;
import com.tractrac.subscription.lib.api.SubscriberInitializationException;
public class ConcurrencyTest extends OnlineTracTracBasedTest {
private static final Logger logger = Logger.getLogger(ConcurrencyTest.class.getName());
@@ -37,7 +39,7 @@ public class ConcurrencyTest extends OnlineTracTracBasedTest {
}
@Before
public void setUp() throws URISyntaxException, IOException, InterruptedException, ParseException {
public void setUp() throws URISyntaxException, IOException, InterruptedException, ParseException, SubscriberInitializationException, CreateModelException {
super.setUp();
// load Race8 of RC44 Cup in Sweden
super.setUp("event_20110815_RCSwedenCu",
@@ -54,7 +56,7 @@ public class ConcurrencyTest extends OnlineTracTracBasedTest {
}
@Test
public void comparSingleThreadedApproximationWithMultiThreaded() {
public void compareSingleThreadedApproximationWithMultiThreaded() {
int numberOfCPUs = Runtime.getRuntime().availableProcessors();
logger.info("Number of processors: "+numberOfCPUs);
assertTrue(numberOfCPUs >= 1);
@@ -0,0 +1,62 @@
package com.sap.sailing.domain.test;
import static org.junit.Assert.assertEquals;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.ConcurrentLinkedQueue;
import org.junit.Test;
import com.sap.sailing.util.impl.ConcurrentHashBag;
import com.sap.sse.common.Util;
/**
* Measures the performance of different concurrent collections types and shows their add and remove behavior for
* different collection sizes and different numbers of concurrently accessing threads. The collections used must be able
* to hold the same element multiple times, keeping count, not necessarily order.
*
* @author Axel Uhl (D043530)
*
*/
public class ConcurrentCollectionsPerformanceTest {
private static final int COUNT = 10000;
@Test
public void testConcurrentLinkedQueue() {
Collection<Object> c = new ConcurrentLinkedQueue<Object>();
System.out.println("ConcurrentLinkedQueue" + runWith(c));
}
@Test
public void testConcurrentHashMap() {
Collection<Object> c = new ConcurrentHashBag<Object>();
System.out.println("ConcurrentHashBag" + runWith(c));
}
private com.sap.sse.common.Util.Pair<Long, Long> runWith(Collection<Object> c) {
List<Object> l = new ArrayList<>(COUNT);
for (int i=0; i<COUNT; i++) {
l.add(new Object());
}
// add all objects a second time to ensure
for (Object o : new ArrayList<Object>(l)) {
l.add(o);
}
long startInsert = System.currentTimeMillis();
for (Object o : l) {
c.add(o);
}
long endInsert = System.currentTimeMillis();
assertEquals(l.size(), c.size());
Collections.shuffle(l);
long startRemove = System.currentTimeMillis();
for (Object o : l) {
c.remove(o);
}
long endRemove = System.currentTimeMillis();
return new Util.Pair<Long, Long>(endInsert-startInsert, endRemove-startRemove);
}
}
@@ -11,30 +11,32 @@ import java.util.Set;
import org.junit.Test;
import com.sap.sailing.domain.base.BearingWithConfidence;
import com.sap.sailing.domain.base.PositionWithConfidence;
import com.sap.sailing.domain.base.impl.BearingWithConfidenceImpl;
import com.sap.sailing.domain.base.impl.PositionWithConfidenceImpl;
import com.sap.sailing.domain.common.Bearing;
import com.sap.sailing.domain.common.Position;
import com.sap.sailing.domain.common.TimePoint;
import com.sap.sailing.domain.common.confidence.ConfidenceBasedAverager;
import com.sap.sailing.domain.confidence.ConfidenceFactory;
import com.sap.sailing.domain.common.confidence.BearingWithConfidence;
import com.sap.sailing.domain.common.confidence.BearingWithConfidenceCluster;
import com.sap.sailing.domain.common.confidence.HasConfidence;
import com.sap.sailing.domain.common.confidence.HasConfidenceAndIsScalable;
import com.sap.sailing.domain.common.confidence.Weigher;
import com.sap.sailing.domain.common.confidence.impl.BearingWithConfidenceImpl;
import com.sap.sailing.domain.common.confidence.impl.ScalableDoubleWithConfidence;
import com.sap.sailing.domain.common.impl.DegreeBearingImpl;
import com.sap.sailing.domain.common.impl.DegreePosition;
import com.sap.sailing.domain.common.impl.KnotSpeedWithBearingImpl;
import com.sap.sailing.domain.common.impl.MeterDistance;
import com.sap.sailing.domain.common.impl.MillisecondsTimePoint;
import com.sap.sailing.domain.common.impl.NauticalMileDistance;
import com.sap.sailing.domain.common.impl.RadianBearingImpl;
import com.sap.sailing.domain.common.scalablevalue.ScalableValue;
import com.sap.sailing.domain.common.scalablevalue.impl.ScalablePosition;
import com.sap.sailing.domain.confidence.ConfidenceBasedAverager;
import com.sap.sailing.domain.confidence.ConfidenceBasedWindAverager;
import com.sap.sailing.domain.confidence.ConfidenceFactory;
import com.sap.sailing.domain.confidence.HasConfidence;
import com.sap.sailing.domain.confidence.HasConfidenceAndIsScalable;
import com.sap.sailing.domain.confidence.Weigher;
import com.sap.sailing.domain.confidence.impl.ScalableDoubleWithConfidence;
import com.sap.sailing.domain.tracking.Wind;
import com.sap.sailing.domain.tracking.WindWithConfidence;
import com.sap.sailing.domain.tracking.impl.BearingWithConfidenceCluster;
import com.sap.sailing.domain.tracking.impl.ScalableWind;
import com.sap.sailing.domain.tracking.impl.WindImpl;
import com.sap.sailing.domain.tracking.impl.WindWithConfidenceImpl;
@@ -340,6 +342,20 @@ public class ConfidenceTest {
assertEquals(0, average.getObject().getLngDeg(), 0.1);
}
@Test
public void testPositionBasedConfidence() {
// at 1000 meter distance, confidence should be .5; at distance 0, confidence shall be 1.
Weigher<Position> weigher = ConfidenceFactory.INSTANCE.createHyperbolicDistanceWeigher(new MeterDistance(1000));
Position p = new DegreePosition(12, 13);
assertEquals(1., weigher.getConfidence(p, p), 0.00000001);
Position p2 = p.translateGreatCircle(new DegreeBearingImpl(123), new MeterDistance(1000));
assertEquals(.5, weigher.getConfidence(p, p2), 0.001); // somewhat more tolerant; using quick distance in weigher
Position p3 = p.translateGreatCircle(new DegreeBearingImpl(123), new NauticalMileDistance(1000));
final double threshold = 0.001;
assertTrue("Expected confidence in 1000nm distance to be less than "+threshold+" but was "+weigher.getConfidence(p, p3),
weigher.getConfidence(p, p3) < threshold);
}
@Test
public void testPositionWithConfidenceScalingByOne() {
assertScaleAndDownscalePosition(new DegreePosition(0, 45), 1.);
@@ -24,6 +24,7 @@ import com.sap.sailing.domain.base.Sideline;
import com.sap.sailing.domain.base.Waypoint;
import com.sap.sailing.domain.base.impl.BoatClassImpl;
import com.sap.sailing.domain.base.impl.CompetitorImpl;
import com.sap.sailing.domain.base.impl.ControlPointWithTwoMarksImpl;
import com.sap.sailing.domain.base.impl.CourseImpl;
import com.sap.sailing.domain.base.impl.MarkImpl;
import com.sap.sailing.domain.base.impl.RaceDefinitionImpl;
@@ -34,9 +35,10 @@ import com.sap.sailing.domain.racelog.tracking.EmptyGPSFixStore;
import com.sap.sailing.domain.tracking.DynamicTrackedRace;
import com.sap.sailing.domain.tracking.TrackedLeg;
import com.sap.sailing.domain.tracking.impl.DynamicTrackedRaceImpl;
import com.sap.sailing.domain.tracking.impl.DynamicTrackedRegattaImpl;
import com.sap.sailing.domain.tracking.impl.EmptyWindStore;
import com.sap.sailing.domain.tracking.impl.TrackedRegattaImpl;
import com.sap.sse.common.Util;
import com.sap.sse.common.Util.Pair;
import difflib.PatchFailedException;
@@ -186,6 +188,53 @@ public class CourseTest {
course.update(courseToUpdate, DomainFactory.INSTANCE);
assertWaypointIndexes(course);
}
/**
* This test tries to replicate the behavior described in bug 2223. The course was
* "RC-Black Conical -> Orange -> White Gate -> Red -> Yellow -> Finish Pole-Cylinder" and the delta was
* "[[DeleteDelta, position: 1, lines: [Orange, White Gate]], [InsertDelta, position: 4, lines: [White Gate, Red]]]"
* which was computed from the new sequence of control points
* "[Control, RC-Black Conical, Control, Red, Control, White Gate, Control, Red, Control, Yellow, Control, Finish Pole-Cylinder]".
*/
@Test
public void testWaypointDeleteWithSubsequentInsertInOnePatch() throws PatchFailedException {
List<Waypoint> waypoints = new ArrayList<Waypoint>();
final WaypointImpl rcBlackConical = new WaypointImpl(new ControlPointWithTwoMarksImpl(new MarkImpl("RC"), new MarkImpl("Black Conical"), "RC-Black Conical"));
waypoints.add(rcBlackConical);
final WaypointImpl orange = new WaypointImpl(new MarkImpl("Orange"));
waypoints.add(orange);
final WaypointImpl whiteGate = new WaypointImpl(new ControlPointWithTwoMarksImpl(new MarkImpl("White L"), new MarkImpl("White R"), "White Gate"));
waypoints.add(whiteGate);
final WaypointImpl red = new WaypointImpl(new MarkImpl("Red"));
waypoints.add(red);
final WaypointImpl yellow = new WaypointImpl(new MarkImpl("Yellow"));
waypoints.add(yellow);
final WaypointImpl finishPoleCylinder = new WaypointImpl(new ControlPointWithTwoMarksImpl(new MarkImpl("Finish Pole"), new MarkImpl("Cylinder"), "Finish Pole-Cylinder"));
waypoints.add(finishPoleCylinder);
Course course = new CourseImpl("Race 24", waypoints);
assertWaypointIndexes(course);
List<com.sap.sse.common.Util.Pair<ControlPoint, PassingInstruction>> courseToUpdate = new ArrayList<com.sap.sse.common.Util.Pair<ControlPoint, PassingInstruction>>();
courseToUpdate.add(new Pair<>(rcBlackConical.getControlPoint(), rcBlackConical.getPassingInstructions()));
courseToUpdate.add(new Pair<>(red.getControlPoint(), red.getPassingInstructions()));
courseToUpdate.add(new Pair<>(whiteGate.getControlPoint(), whiteGate.getPassingInstructions()));
courseToUpdate.add(new Pair<>(red.getControlPoint(), red.getPassingInstructions()));
courseToUpdate.add(new Pair<>(yellow.getControlPoint(), yellow.getPassingInstructions()));
courseToUpdate.add(new Pair<>(finishPoleCylinder.getControlPoint(), finishPoleCylinder.getPassingInstructions()));
course.update(courseToUpdate, DomainFactory.INSTANCE);
assertWaypointIndexes(course);
List<ControlPoint> newControlPoints = new ArrayList<>();
for (Waypoint newWp : course.getWaypoints()) {
newControlPoints.add(newWp.getControlPoint());
}
assertTrue(Util.equals(Arrays.asList(
rcBlackConical.getControlPoint(),
red.getControlPoint(),
whiteGate.getControlPoint(),
red.getControlPoint(),
yellow.getControlPoint(),
finishPoleCylinder.getControlPoint()),
newControlPoints));
}
@Test
public void testRemoveWaypointFromCourseWithThreeWaypoints() {
@@ -249,7 +298,7 @@ public class CourseTest {
Course course = new CourseImpl("Test Course", waypoints);
assertWaypointIndexes(course);
final Set<CompetitorImpl> hasso = Collections.singleton(AbstractLeaderboardTest.createCompetitor("Hasso"));
DynamicTrackedRace trackedRace = new DynamicTrackedRaceImpl(/* trackedRegatta */new TrackedRegattaImpl(
DynamicTrackedRace trackedRace = new DynamicTrackedRaceImpl(/* trackedRegatta */new DynamicTrackedRegattaImpl(
new RegattaImpl("test", null, new HashSet<Series>(), false, null, "test", null)),
new RaceDefinitionImpl("Test Race", course, new BoatClassImpl("49er", /* upwind start */true), hasso),
Collections.<Sideline> emptyList(), EmptyWindStore.INSTANCE, EmptyGPSFixStore.INSTANCE,/* delayToLiveInMillis */3000,
@@ -279,7 +328,7 @@ public class CourseTest {
waypoints.add(wp2);
Course course = new CourseImpl("Test Course", waypoints);
final Set<CompetitorImpl> hasso = Collections.singleton(AbstractLeaderboardTest.createCompetitor("Hasso"));
DynamicTrackedRace trackedRace = new DynamicTrackedRaceImpl(/* trackedRegatta */ new TrackedRegattaImpl(
DynamicTrackedRace trackedRace = new DynamicTrackedRaceImpl(/* trackedRegatta */ new DynamicTrackedRegattaImpl(
new RegattaImpl("test", null, new HashSet<Series>(), false, null, "test", null)),
new RaceDefinitionImpl("Test Race", course, new BoatClassImpl("49er", /* upwind start */ true),
hasso), Collections.<Sideline> emptyList(),
@@ -0,0 +1,253 @@
package com.sap.sailing.domain.test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import org.junit.Test;
import com.sap.sailing.domain.base.Competitor;
import com.sap.sailing.domain.base.Course;
import com.sap.sailing.domain.base.RaceDefinition;
import com.sap.sailing.domain.base.Regatta;
import com.sap.sailing.domain.base.Sideline;
import com.sap.sailing.domain.base.Waypoint;
import com.sap.sailing.domain.base.impl.BoatClassImpl;
import com.sap.sailing.domain.base.impl.CourseAreaImpl;
import com.sap.sailing.domain.base.impl.CourseImpl;
import com.sap.sailing.domain.base.impl.MarkImpl;
import com.sap.sailing.domain.base.impl.RaceDefinitionImpl;
import com.sap.sailing.domain.base.impl.RegattaImpl;
import com.sap.sailing.domain.base.impl.WaypointImpl;
import com.sap.sailing.domain.common.BoatClassMasterdata;
import com.sap.sailing.domain.leaderboard.impl.LowPoint;
import com.sap.sailing.domain.racelog.impl.EmptyRaceLogStore;
import com.sap.sailing.domain.racelog.tracking.EmptyGPSFixStore;
import com.sap.sailing.domain.tracking.TrackedRegatta;
import com.sap.sailing.domain.tracking.impl.DynamicTrackedRaceImpl;
import com.sap.sailing.domain.tracking.impl.EmptyWindStore;
import com.sap.sailing.domain.tracking.impl.TrackedRaceAsWaypointList;
import com.sap.sailing.domain.tracking.impl.TrackedRaceImpl;
import com.sap.sailing.domain.tracking.impl.TrackedRegattaImpl;
import com.sap.sse.common.Util;
import difflib.DiffUtils;
import difflib.Patch;
import difflib.PatchFailedException;
/**
* Related to bug 2223; updates a course while serialization is in progress and validates that the
* resulting TrackedRace's structures are eventually consistent with the modified course.
*
* @author Axel Uhl (d043530)
*
*/
public class CourseUpdateDuringNonAtomicSerializationTest implements Serializable {
private static final long serialVersionUID = -6207158826716014865L;
private Course course;
private Map<Integer, Waypoint> addCalls;
private Map<Integer, Waypoint> removeCalls;
private TrackedRaceImpl trackedRace;
private TrackedRaceAsWaypointList trackedRaceWaypoints;
public void setUp(int numberOfWaypoints) {
final List<Waypoint> waypoints = new ArrayList<>();
for (int i=0; i<numberOfWaypoints; i++) {
waypoints.add(new WaypointImpl(new MarkImpl("Mark "+i)));
}
addCalls = new HashMap<>();
removeCalls = new HashMap<>();
course = new CourseImpl("Test Course", waypoints);
Regatta regatta = new RegattaImpl(EmptyRaceLogStore.INSTANCE, "Test Regatta",
new BoatClassImpl("505", BoatClassMasterdata._5O5), /* trackedRegattaRegistry */ null,
new LowPoint(), UUID.randomUUID(), new CourseAreaImpl("Alpha", UUID.randomUUID()));
TrackedRegatta trackedRegatta = new TrackedRegattaImpl(regatta);
RaceDefinition race = new RaceDefinitionImpl("Test Race", course, regatta.getBoatClass(), Collections.<Competitor>emptySet());
trackedRace = new DynamicTrackedRaceImpl(trackedRegatta, race, Collections.<Sideline> emptySet(),
EmptyWindStore.INSTANCE, EmptyGPSFixStore.INSTANCE,
/* delayToLiveInMillis */10000, /* millisecondsOverWhichToAverageWind */30000, /* millisecondsOverWhichToAverageSpeed */
7000) {
private static final long serialVersionUID = 9114777576548711763L;
@Override
public void waypointAdded(int zeroBasedIndex, Waypoint waypointThatGotAdded) {
try {
addCalls.put(zeroBasedIndex, waypointThatGotAdded);
} catch (NullPointerException npe) {
// if the reference to the enclosing object hasn't been de-serialized yet, don't fail
}
super.waypointAdded(zeroBasedIndex, waypointThatGotAdded);
}
@Override
public void waypointRemoved(int zeroBasedIndex, Waypoint waypointThatGotRemoved) {
try {
removeCalls.put(zeroBasedIndex, waypointThatGotRemoved);
} catch (NullPointerException npe) {
// if the reference to the enclosing object hasn't been de-serialized yet, don't fail
}
super.waypointRemoved(zeroBasedIndex, waypointThatGotRemoved);
}
};
trackedRaceWaypoints = new TrackedRaceAsWaypointList(trackedRace);
}
@Test
public void simpleStructureConsistencyTest() {
// don't test one waypoint only because the tracked race will report an empty waypoint list in this case
// because there is no leg
for (int numberOfWaypoints = 0; numberOfWaypoints < 5; numberOfWaypoints+=2) {
setUp(numberOfWaypoints);
Iterable<Waypoint> courseWaypoints = course.getWaypoints();
assertEquals(courseWaypoints, trackedRaceWaypoints);
assertTrue(addCalls.isEmpty());
assertTrue(removeCalls.isEmpty());
}
}
@Test
public void testSingleWaypoint() throws PatchFailedException {
// with one waypoint only the tracked race will also report the single waypoint because the
// mark passings collection has it in its key set; so there will be no difference between the
// two lists.
setUp(1);
Iterable<Waypoint> courseWaypoints = course.getWaypoints();
Patch<Waypoint> patch = DiffUtils.diff(trackedRaceWaypoints, courseWaypoints);
patch.applyToInPlace(trackedRaceWaypoints);
assertTrue(Util.isEmpty(trackedRace.getTrackedLegs()));
assertTrue(addCalls.isEmpty());
}
@Test
public void testCourseUpdateEndToEnd() throws PatchFailedException {
setUp(5);
assertEquals(5, Util.size(course.getWaypoints()));
course.addWaypoint(2, new WaypointImpl(new MarkImpl("Mark 2.5")));
assertEquals(6, Util.size(course.getWaypoints()));
assertEquals(course.getWaypoints(), trackedRaceWaypoints);
assertEquals(course.getLegs().size(), Util.size(trackedRace.getTrackedLegs()));
}
@Test
public void testAddingOneWaypointHalfWayIntoSerialization() throws IOException, ClassNotFoundException {
setUp(5);
ByteArrayOutputStream bos = new ByteArrayOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(bos);
oos.writeObject(course); // now the course has been written to the stream and won't be written a second time
// update the course:
course.addWaypoint(2, new WaypointImpl(new MarkImpl("Mark 2.5")));
assertEquals(course.getLegs().size(), Util.size(trackedRace.getTrackedLegs()));
oos.writeObject(trackedRace);
oos.close();
ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
ObjectInputStream ois = new ObjectInputStream(bis);
Course deserializedCourse = (Course) ois.readObject();
TrackedRaceImpl deserializedTrackedRace = (TrackedRaceImpl) ois.readObject();
ois.close();
assertFalse(course.getWaypoints().equals(deserializedCourse.getWaypoints())); // the deserialized course is expected to have one fewer waypoint
assertEquals(Util.size(course.getWaypoints())-1, Util.size(deserializedCourse.getWaypoints()));
assertEquals(Util.size(deserializedTrackedRace.getTrackedLegs())+1, Util.size(deserializedTrackedRace.getRace().getCourse().getWaypoints()));
}
@Test
public void testAddingTwoWaypointsHalfWayIntoSerialization() throws IOException, ClassNotFoundException {
setUp(5);
ByteArrayOutputStream bos = new ByteArrayOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(bos);
oos.writeObject(course); // now the course has been written to the stream and won't be written a second time
// update the course:
course.addWaypoint(2, new WaypointImpl(new MarkImpl("Mark 2.5")));
course.addWaypoint(4, new WaypointImpl(new MarkImpl("Mark 4.5")));
assertEquals(course.getLegs().size(), Util.size(trackedRace.getTrackedLegs()));
oos.writeObject(trackedRace);
oos.close();
ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
ObjectInputStream ois = new ObjectInputStream(bis);
Course deserializedCourse = (Course) ois.readObject();
TrackedRaceImpl deserializedTrackedRace = (TrackedRaceImpl) ois.readObject();
ois.close();
assertFalse(course.getWaypoints().equals(deserializedCourse.getWaypoints())); // the deserialized course is expected to have one fewer waypoint
assertEquals(Util.size(course.getWaypoints())-2, Util.size(deserializedCourse.getWaypoints()));
assertEquals(Util.size(deserializedTrackedRace.getTrackedLegs())+1, Util.size(deserializedTrackedRace.getRace().getCourse().getWaypoints()));
}
@Test
public void testRemovingOneWaypointHalfWayIntoSerialization() throws IOException, ClassNotFoundException {
setUp(5);
ByteArrayOutputStream bos = new ByteArrayOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(bos);
oos.writeObject(course); // now the course has been written to the stream and won't be written a second time
// update the course:
course.removeWaypoint(2);
assertEquals(course.getLegs().size(), Util.size(trackedRace.getTrackedLegs()));
oos.writeObject(trackedRace);
oos.close();
ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
ObjectInputStream ois = new ObjectInputStream(bis);
Course deserializedCourse = (Course) ois.readObject();
TrackedRaceImpl deserializedTrackedRace = (TrackedRaceImpl) ois.readObject();
ois.close();
assertFalse(course.getWaypoints().equals(deserializedCourse.getWaypoints())); // the deserialized course is expected to have one more waypoint
assertEquals(Util.size(course.getWaypoints())+1, Util.size(deserializedCourse.getWaypoints()));
assertEquals(Util.size(deserializedTrackedRace.getTrackedLegs())+1, Util.size(deserializedTrackedRace.getRace().getCourse().getWaypoints()));
}
@Test
public void testRemovingTwoWaypointsHalfWayIntoSerialization() throws IOException, ClassNotFoundException {
setUp(5);
ByteArrayOutputStream bos = new ByteArrayOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(bos);
oos.writeObject(course); // now the course has been written to the stream and won't be written a second time
// update the course:
course.removeWaypoint(2);
course.removeWaypoint(3);
assertEquals(course.getLegs().size(), Util.size(trackedRace.getTrackedLegs()));
oos.writeObject(trackedRace);
oos.close();
ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
ObjectInputStream ois = new ObjectInputStream(bis);
Course deserializedCourse = (Course) ois.readObject();
TrackedRaceImpl deserializedTrackedRace = (TrackedRaceImpl) ois.readObject();
ois.close();
assertFalse(course.getWaypoints().equals(deserializedCourse.getWaypoints())); // the deserialized course is expected to have one fewer waypoint
assertEquals(Util.size(course.getWaypoints())+2, Util.size(deserializedCourse.getWaypoints()));
assertEquals(Util.size(deserializedTrackedRace.getTrackedLegs())+1, Util.size(deserializedTrackedRace.getRace().getCourse().getWaypoints()));
}
@Test
public void testAddingTwoAndRemovingOneWaypointHalfWayIntoSerialization() throws IOException, ClassNotFoundException {
setUp(5);
ByteArrayOutputStream bos = new ByteArrayOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(bos);
oos.writeObject(course); // now the course has been written to the stream and won't be written a second time
// update the course:
course.addWaypoint(2, new WaypointImpl(new MarkImpl("Mark 2.5")));
course.removeWaypoint(3);
course.addWaypoint(4, new WaypointImpl(new MarkImpl("Mark 4.5")));
assertEquals(course.getLegs().size(), Util.size(trackedRace.getTrackedLegs()));
oos.writeObject(trackedRace);
oos.close();
ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
ObjectInputStream ois = new ObjectInputStream(bis);
Course deserializedCourse = (Course) ois.readObject();
TrackedRaceImpl deserializedTrackedRace = (TrackedRaceImpl) ois.readObject();
ois.close();
assertFalse(course.getWaypoints().equals(deserializedCourse.getWaypoints())); // the deserialized course is expected to have one fewer waypoint
assertEquals(Util.size(course.getWaypoints())-1, Util.size(deserializedCourse.getWaypoints()));
assertEquals(Util.size(deserializedTrackedRace.getTrackedLegs())+1, Util.size(deserializedTrackedRace.getRace().getCourse().getWaypoints()));
}
}
@@ -18,6 +18,7 @@ import java.util.UUID;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mockito;
import com.sap.sailing.domain.base.Competitor;
import com.sap.sailing.domain.base.ControlPoint;
@@ -45,9 +46,12 @@ import com.sap.sailing.domain.tractracadapter.impl.ControlPointAdapter;
import com.sap.sailing.domain.tractracadapter.impl.DomainFactoryImpl;
import com.sap.sailing.domain.tractracadapter.impl.RaceCourseReceiver;
import com.sap.sse.common.Util;
import com.tractrac.clientmodule.Race;
import com.tractrac.clientmodule.Route;
import com.tractrac.clientmodule.data.RouteData;
import com.sap.sse.common.Util.Triple;
import com.tractrac.model.lib.api.event.CreateModelException;
import com.tractrac.model.lib.api.event.IRace;
import com.tractrac.model.lib.api.route.IControl;
import com.tractrac.model.lib.api.route.IControlRoute;
import com.tractrac.subscription.lib.api.SubscriberInitializationException;
import difflib.Chunk;
import difflib.Delta;
@@ -60,7 +64,7 @@ public class CourseUpdateTest extends AbstractTracTracLiveTest {
private Course course;
private Regatta domainRegatta;
private DynamicTrackedRegatta trackedRegatta;
private final RouteData[] routeData = new RouteData[1];
private final IControlRoute[] routeData = new IControlRoute[1];
private DomainFactory domainFactory;
public CourseUpdateTest() throws URISyntaxException, MalformedURLException {
@@ -68,29 +72,31 @@ public class CourseUpdateTest extends AbstractTracTracLiveTest {
}
@Before
public void setUp() throws MalformedURLException, IOException, InterruptedException, URISyntaxException, ParseException {
public void setUp() throws MalformedURLException, IOException, InterruptedException, URISyntaxException, SubscriberInitializationException, ParseException, CreateModelException {
super.setUp();
domainFactory = new DomainFactoryImpl(new com.sap.sailing.domain.base.impl.DomainFactoryImpl());
domainRegatta = domainFactory.getOrCreateDefaultRegatta(EmptyRaceLogStore.INSTANCE, getTracTracEvent(), /* trackedRegattaRegistry */ null);
domainRegatta = domainFactory.getOrCreateDefaultRegatta(EmptyRaceLogStore.INSTANCE, getTracTracRace(), /* trackedRegattaRegistry */ null);
trackedRegatta = new DynamicTrackedRegattaImpl(domainRegatta);
IRace tractracRace = getTracTracEvent().getRaces().iterator().next();
ArrayList<Receiver> receivers = new ArrayList<Receiver>();
receivers.add(new RaceCourseReceiver(domainFactory, trackedRegatta, getTracTracEvent(),
receivers.add(new RaceCourseReceiver(domainFactory, trackedRegatta, getTracTracEvent(), tractracRace,
EmptyWindStore.INSTANCE, new DynamicRaceDefinitionSet() {
@Override
public void addRaceDefinition(RaceDefinition race, DynamicTrackedRace trackedRace) {}
}, /* delayToLiveInMillis */ 0l,
/* millisecondsOverWhichToAverageWind */ 30000, /* simulator */ null, /*courseDesignUpdateURI*/ null, /*tracTracUsername*/ null, /*tracTracPassword*/ null) {
public void addRaceDefinition(RaceDefinition race, DynamicTrackedRace trackedRace) {
}
},
/* delayToLiveInMillis */0l, /* millisecondsOverWhichToAverageWind */30000, /* simulator */null, /* courseDesignUpdateURI */
null, /* tracTracUsername */null, /* tracTracPassword */null, getEventSubscriber(), getRaceSubscriber()) {
@Override
protected void handleEvent(com.sap.sse.common.Util.Triple<Route, RouteData, Race> event) {
protected void handleEvent(Triple<IControlRoute, Long, Void> event) {
super.handleEvent(event);
synchronized (routeData) {
routeData[0] = event.getB();
routeData[0] = event.getA();
routeData.notifyAll();
}
}
});
addListenersForStoredDataAndStartController(receivers);
Race tractracRace = getTracTracEvent().getRaceList().iterator().next();
// now we expect that there is no
assertNull(domainFactory.getExistingRaceDefinitionForRace(tractracRace.getId()));
race = domainFactory.getAndWaitForRaceDefinition(tractracRace.getId());
@@ -162,9 +168,8 @@ public class CourseUpdateTest extends AbstractTracTracLiveTest {
public void testLastWaypointRemoved() throws PatchFailedException, InterruptedException {
final boolean[] result = new boolean[1];
waitForRouteData();
final List<com.tractrac.clientmodule.ControlPoint> controlPoints = new ArrayList<com.tractrac.clientmodule.ControlPoint>(
routeData[0].getPoints());
final com.tractrac.clientmodule.ControlPoint removedControlPoint = controlPoints.remove(controlPoints.size()-1);
final List<IControl> controlPoints = new ArrayList<>(routeData[0].getControls());
final IControl removedControlPoint = controlPoints.remove(controlPoints.size()-1);
course.addCourseListener(new CourseListener() {
@Override
public void waypointAdded(int zeroBasedIndex, Waypoint waypointThatGotAdded) {
@@ -187,9 +192,8 @@ public class CourseUpdateTest extends AbstractTracTracLiveTest {
public void testLastButOneWaypointRemoved() throws PatchFailedException, InterruptedException {
final boolean[] result = new boolean[1];
waitForRouteData();
final List<com.tractrac.clientmodule.ControlPoint> controlPoints = new ArrayList<com.tractrac.clientmodule.ControlPoint>(
routeData[0].getPoints());
final com.tractrac.clientmodule.ControlPoint removedControlPoint = controlPoints.remove(1);
final List<IControl> controlPoints = new ArrayList<>(routeData[0].getControls());
final IControl removedControlPoint = controlPoints.remove(1);
course.addCourseListener(new CourseListener() {
@Override
public void waypointAdded(int zeroBasedIndex, Waypoint waypointThatGotAdded) {
@@ -219,11 +223,9 @@ public class CourseUpdateTest extends AbstractTracTracLiveTest {
@Test
public void testWaypointAddedAtEnd() throws PatchFailedException, InterruptedException {
final boolean[] result = new boolean[1];
final com.tractrac.clientmodule.Event event = new com.tractrac.clientmodule.Event(UUID.randomUUID(), "Event1");
final com.tractrac.clientmodule.ControlPoint cp1 = event.addControlPoint(UUID.randomUUID(), "CP1", /* hasTwo */false);
final IControl cp1 = createMockedControlPoint("CP1", 1, UUID.randomUUID());
waitForRouteData();
final List<com.tractrac.clientmodule.ControlPoint> controlPoints = new ArrayList<com.tractrac.clientmodule.ControlPoint>(
routeData[0].getPoints());
final List<IControl> controlPoints = new ArrayList<>(routeData[0].getControls());
controlPoints.add(cp1);
course.addCourseListener(new CourseListener() {
@Override
@@ -247,15 +249,21 @@ public class CourseUpdateTest extends AbstractTracTracLiveTest {
((CourseImpl) course).unlockAfterWrite();
}
}
private IControl createMockedControlPoint(String name, int numberOfMarks, UUID id) {
final IControl cp1 = Mockito.mock(IControl.class);
Mockito.when(cp1.getName()).thenReturn(name);
Mockito.when(cp1.getSize()).thenReturn(numberOfMarks);
Mockito.when(cp1.getId()).thenReturn(id);
return cp1;
}
@Test
public void testTrackedRacesTrackedLegsUpdatedProperly() throws InterruptedException, PatchFailedException {
final boolean[] result = new boolean[1];
final com.tractrac.clientmodule.Event event = new com.tractrac.clientmodule.Event(UUID.randomUUID(), "Event1");
final com.tractrac.clientmodule.ControlPoint cp1 = event.addControlPoint(UUID.randomUUID(), "CP1", /* hasTwo */false);
final IControl cp1 = createMockedControlPoint("CP1", 1, UUID.randomUUID());
waitForRouteData();
final List<com.tractrac.clientmodule.ControlPoint> controlPoints = new ArrayList<com.tractrac.clientmodule.ControlPoint>(
routeData[0].getPoints());
final List<IControl> controlPoints = new ArrayList<>(routeData[0].getControls());
controlPoints.add(cp1);
course.addCourseListener(new CourseListener() {
@Override
@@ -21,10 +21,10 @@ public class EventLeaderboardGroupLinkTest {
@Test
public void testLivelinessAndIteratorStabilityOfUnmodifiableLeaderboardGroupCollection() {
Event e = new EventImpl("E", null, null, "Venue", /* public */ true, UUID.randomUUID());
LeaderboardGroupImpl lg1 = new LeaderboardGroupImpl("lg1", "LG1", /* displayGroupsInReverseOrder */ false, Collections.<Leaderboard>emptyList());
LeaderboardGroupImpl lg2 = new LeaderboardGroupImpl("lg2", "LG2", /* displayGroupsInReverseOrder */ false, Collections.<Leaderboard>emptyList());
LeaderboardGroupImpl lg3 = new LeaderboardGroupImpl("lg3", "LG3", /* displayGroupsInReverseOrder */ false, Collections.<Leaderboard>emptyList());
LeaderboardGroupImpl lg4 = new LeaderboardGroupImpl("lg4", "LG4", /* displayGroupsInReverseOrder */ false, Collections.<Leaderboard>emptyList());
LeaderboardGroupImpl lg1 = new LeaderboardGroupImpl("lg1", "LG1", /* displayName */ null, /* displayGroupsInReverseOrder */ false, Collections.<Leaderboard>emptyList());
LeaderboardGroupImpl lg2 = new LeaderboardGroupImpl("lg2", "LG2", /* displayName */ null, /* displayGroupsInReverseOrder */ false, Collections.<Leaderboard>emptyList());
LeaderboardGroupImpl lg3 = new LeaderboardGroupImpl("lg3", "LG3", /* displayName */ null, /* displayGroupsInReverseOrder */ false, Collections.<Leaderboard>emptyList());
LeaderboardGroupImpl lg4 = new LeaderboardGroupImpl("lg4", "LG4", /* displayName */ null, /* displayGroupsInReverseOrder */ false, Collections.<Leaderboard>emptyList());
e.addLeaderboardGroup(lg1);
Iterable<LeaderboardGroup> lgs = e.getLeaderboardGroups();
Iterator<LeaderboardGroup> iter = lgs.iterator();
@@ -22,6 +22,8 @@ import com.sap.sailing.domain.tracking.impl.AbstractRaceChangeListener;
import com.sap.sailing.domain.tracking.impl.DynamicGPSFixMovingTrackImpl;
import com.sap.sailing.domain.tracking.impl.GPSFixMovingImpl;
import com.sap.sailing.domain.tractracadapter.ReceiverType;
import com.tractrac.model.lib.api.event.CreateModelException;
import com.tractrac.subscription.lib.api.SubscriberInitializationException;
/**
* Receives GPS tracks from a race. One test (if not ignored) stores these tracks in the resources/
@@ -46,8 +48,9 @@ public class FetchTracksAndStoreLocallyTest extends OnlineTracTracBasedTest {
* tests in this class share a single feed execution. The listener fills in the first event received
* into {@link #firstTracked} and {@link #firstData}. All events are converted into {@link GPSFixMovingImpl}
* objects and appended to the {@link DynamicTrackedRace}s.
* @throws SubscriberInitializationException
*/
private void setUp(String regattaName, String raceId) throws MalformedURLException, IOException, InterruptedException, URISyntaxException {
private void setUp(String regattaName, String raceId) throws MalformedURLException, IOException, InterruptedException, URISyntaxException, SubscriberInitializationException, CreateModelException {
super.setUpWithoutLaunchingController(regattaName, raceId);
final RaceChangeListener positionListener = new AbstractRaceChangeListener() {
@Override
@@ -77,7 +80,7 @@ public class FetchTracksAndStoreLocallyTest extends OnlineTracTracBasedTest {
}
@Test
public void storeEntireKielWeek() throws InterruptedException, FileNotFoundException, IOException, URISyntaxException {
public void storeEntireKielWeek() throws InterruptedException, FileNotFoundException, IOException, URISyntaxException, SubscriberInitializationException, CreateModelException {
for (String raceId : new String[] {
"7dce540a-98e4-11e0-85be-406186cbf87c", "6659efe8-98f1-11e0-85be-406186cbf87c",
"be1dc2fe-98fb-11e0-85be-406186cbf87c", "c3ec93e4-98fc-11e0-85be-406186cbf87c",
@@ -136,17 +139,17 @@ public class FetchTracksAndStoreLocallyTest extends OnlineTracTracBasedTest {
}
@Ignore
public void store505Race2() throws InterruptedException, FileNotFoundException, IOException, URISyntaxException {
public void store505Race2() throws InterruptedException, FileNotFoundException, IOException, URISyntaxException, SubscriberInitializationException, CreateModelException {
storeRace("event_20110609_KielerWoch", "357c700a-9d9a-11e0-85be-406186cbf87c");
}
private void storeRace(String regattaName, String raceId) throws MalformedURLException, IOException, InterruptedException,
URISyntaxException, FileNotFoundException {
URISyntaxException, FileNotFoundException, SubscriberInitializationException, CreateModelException {
setUp(regattaName, raceId);
storeTracks();
}
public static void main(String[] args) throws URISyntaxException, FileNotFoundException, IOException, InterruptedException {
public static void main(String[] args) throws URISyntaxException, FileNotFoundException, IOException, InterruptedException, SubscriberInitializationException, CreateModelException {
FetchTracksAndStoreLocallyTest thiz = new FetchTracksAndStoreLocallyTest();
for (int i=1; i<args.length; i++) {
thiz.storeRace(args[0], args[i]);
@@ -0,0 +1,178 @@
package com.sap.sailing.domain.test;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.when;
import java.util.Calendar;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.ExecutionException;
import org.junit.Test;
import com.sap.sailing.domain.base.BoatClass;
import com.sap.sailing.domain.base.Competitor;
import com.sap.sailing.domain.base.ControlPoint;
import com.sap.sailing.domain.base.Course;
import com.sap.sailing.domain.base.CourseArea;
import com.sap.sailing.domain.base.DomainFactory;
import com.sap.sailing.domain.base.Fleet;
import com.sap.sailing.domain.base.RaceColumn;
import com.sap.sailing.domain.base.RaceDefinition;
import com.sap.sailing.domain.base.Regatta;
import com.sap.sailing.domain.base.Series;
import com.sap.sailing.domain.base.Sideline;
import com.sap.sailing.domain.base.Waypoint;
import com.sap.sailing.domain.base.impl.BoatClassImpl;
import com.sap.sailing.domain.base.impl.CompetitorImpl;
import com.sap.sailing.domain.base.impl.CourseImpl;
import com.sap.sailing.domain.base.impl.DomainFactoryImpl;
import com.sap.sailing.domain.base.impl.DynamicBoat;
import com.sap.sailing.domain.base.impl.DynamicTeam;
import com.sap.sailing.domain.base.impl.FleetImpl;
import com.sap.sailing.domain.base.impl.MarkImpl;
import com.sap.sailing.domain.base.impl.RegattaImpl;
import com.sap.sailing.domain.base.impl.SeriesImpl;
import com.sap.sailing.domain.base.impl.WaypointImpl;
import com.sap.sailing.domain.common.Color;
import com.sap.sailing.domain.common.NoWindException;
import com.sap.sailing.domain.common.TimePoint;
import com.sap.sailing.domain.common.dto.LeaderboardDTO;
import com.sap.sailing.domain.common.impl.MillisecondsTimePoint;
import com.sap.sailing.domain.leaderboard.Leaderboard;
import com.sap.sailing.domain.leaderboard.ScoringScheme;
import com.sap.sailing.domain.leaderboard.ThresholdBasedResultDiscardingRule;
import com.sap.sailing.domain.leaderboard.impl.LowPoint;
import com.sap.sailing.domain.leaderboard.impl.RegattaLeaderboardImpl;
import com.sap.sailing.domain.leaderboard.impl.ThresholdBasedResultDiscardingRuleImpl;
import com.sap.sailing.domain.racelog.tracking.EmptyGPSFixStore;
import com.sap.sailing.domain.tracking.DynamicTrackedRegatta;
import com.sap.sailing.domain.tracking.TrackedRace;
import com.sap.sailing.domain.tracking.TrackedRegatta;
import com.sap.sailing.domain.tracking.TrackedRegattaRegistry;
import com.sap.sailing.domain.tracking.impl.DynamicTrackedRaceImpl;
import com.sap.sailing.domain.tracking.impl.EmptyWindStore;
public class LeaderboardCourseChangeTest {
/**
* See bug 2011
*
* @throws NoWindException
* @throws InterruptedException
* @throws ExecutionException
*/
@Test
public void testLeaderboardDTOCreationForCourseChange() throws NoWindException, InterruptedException, ExecutionException {
Date date = Calendar.getInstance().getTime();
TimePoint timePoint = new MillisecondsTimePoint(date);
TrackedRegattaRegistry trackedRegattaRegistry = mock(TrackedRegattaRegistry.class);
Fleet fleet = new FleetImpl("TestFleet");
Series series = createSeries(trackedRegattaRegistry, fleet);
Set<Series> seriesSet = new HashSet<>();
seriesSet.add(series);
BoatClass boatClass = new BoatClassImpl("TestClass", true);
String raceColumnName = "TestRace";
RaceColumn raceColumn = series.addRaceColumn(raceColumnName, trackedRegattaRegistry);
ScoringScheme scoringScheme = new LowPoint();
Regatta mockedRegatta = new RegattaImpl(RegattaImpl.getDefaultName("TestRegatta", boatClass.getName()), boatClass, seriesSet, false, scoringScheme,
UUID.randomUUID(), mock(CourseArea.class));
ControlPoint start = new MarkImpl("Start");
ControlPoint m1 = new MarkImpl("M1");
ControlPoint m2 = new MarkImpl("M2");
ControlPoint finish = new MarkImpl("Finish");
Set<Waypoint> waypoints = new HashSet<>();
Waypoint startWaypoint = new WaypointImpl(start);
waypoints.add(startWaypoint);
Waypoint m1Waypoint1 = new WaypointImpl(m1);
Waypoint m2Waypoint1 = new WaypointImpl(m2);
Waypoint m1Waypoint2 = new WaypointImpl(m1);
Waypoint m2Waypoint2 = new WaypointImpl(m2);
Waypoint m1Waypoint3 = new WaypointImpl(m1);
waypoints.add(m1Waypoint1);
waypoints.add(m2Waypoint1);
waypoints.add(m1Waypoint2);
waypoints.add(m2Waypoint2);
waypoints.add(m1Waypoint3);
Waypoint finishWaypoint = new WaypointImpl(finish);
waypoints.add(finishWaypoint);
Course course = new CourseImpl(raceColumnName, waypoints);
TrackedRace mockedTrackedRace = createSpyedTrackedRace(mockedRegatta, course, timePoint, boatClass);
raceColumn.setTrackedRace(fleet, mockedTrackedRace);
Set<String> raceColumnNames = new HashSet<>();
raceColumnNames.add(raceColumnName);
int[] ruleRaw = { 5, 3, 2 };
ThresholdBasedResultDiscardingRule rule = new ThresholdBasedResultDiscardingRuleImpl(ruleRaw);
Leaderboard leaderboard = new RegattaLeaderboardImpl(mockedRegatta, rule);
DomainFactory baseDomainFactory = new DomainFactoryImpl();
LeaderboardDTO leaderboardDTO = leaderboard.getLeaderboardDTO(timePoint, raceColumnNames, false,
trackedRegattaRegistry, baseDomainFactory, /* fillNetPointsUncorrected */ false);
assertEquals(6, leaderboardDTO.rows.values().iterator().next().fieldsByRaceColumnName.values().iterator()
.next().legDetails.size());
course.removeWaypoint(2);
course.removeWaypoint(3);
leaderboardDTO = leaderboard.getLeaderboardDTO(timePoint, raceColumnNames, false, trackedRegattaRegistry,
baseDomainFactory, /* fillNetPointsUncorrected */ false);
assertEquals(4, leaderboardDTO.rows.values().iterator().next().fieldsByRaceColumnName.values().iterator()
.next().legDetails.size());
}
private TrackedRace createSpyedTrackedRace(Regatta regatta, Course course, TimePoint timePoint, BoatClass boatClass) {
TrackedRegatta mockedTrackedRegatta = createMockedTrackedRegatta(regatta);
RaceDefinition mockedRace = createMockedRace(course, boatClass);
TrackedRace spyedTrackedRace = spy(new DynamicTrackedRaceImpl(mockedTrackedRegatta, mockedRace,
new HashSet<Sideline>(), EmptyWindStore.INSTANCE, EmptyGPSFixStore.INSTANCE, 5000, 20000, 20000));
return spyedTrackedRace;
}
private RaceDefinition createMockedRace(Course course, BoatClass boatClass) {
RaceDefinition mockedRaceDefinition = mock(RaceDefinition.class);
when(mockedRaceDefinition.getCompetitors()).thenReturn(new HashSet<Competitor>());
when(mockedRaceDefinition.getCourse()).thenReturn(course);
when(mockedRaceDefinition.getBoatClass()).thenReturn(new BoatClassImpl("TestClass", true));
when(mockedRaceDefinition.getName()).thenReturn("TestRace");
Iterable<Competitor> competitorSet = createCompetitorSet(boatClass);
when(mockedRaceDefinition.getCompetitors()).thenReturn(competitorSet);
return mockedRaceDefinition;
}
private Iterable<Competitor> createCompetitorSet(BoatClass boatClass) {
Set<Competitor> competitors = new HashSet<>();
DynamicBoat mockedBoat = mock(DynamicBoat.class);
when(mockedBoat.getBoatClass()).thenReturn(boatClass);
competitors.add(new CompetitorImpl(UUID.randomUUID(), "TestCompetitor", Color.BLACK, mock(DynamicTeam.class),
mockedBoat));
return competitors;
}
private TrackedRegatta createMockedTrackedRegatta(Regatta regatta) {
TrackedRegatta mockedTrackedRegatta = mock(DynamicTrackedRegatta.class);
when(mockedTrackedRegatta.getRegatta()).thenReturn(regatta);
return mockedTrackedRegatta;
}
private Series createSeries(TrackedRegattaRegistry trackedRegattaRegistry, Fleet fleet) {
Set<Fleet> fleets = new HashSet<>();
fleets.add(fleet);
Series series = new SeriesImpl("TestSeries", false, fleets, new HashSet<String>(), trackedRegattaRegistry);
return series;
}
}
@@ -14,7 +14,6 @@ import java.util.logging.Logger;
import org.junit.Test;
import com.sap.sailing.domain.base.Competitor;
import com.sap.sailing.domain.base.Fleet;
import com.sap.sailing.domain.base.RaceColumn;
import com.sap.sailing.domain.common.NoWindException;
import com.sap.sailing.domain.common.WindSourceType;
@@ -28,6 +27,8 @@ import com.sap.sailing.domain.leaderboard.impl.ThresholdBasedResultDiscardingRul
import com.sap.sailing.domain.tracking.impl.WindImpl;
import com.sap.sailing.domain.tractracadapter.ReceiverType;
import com.sap.sse.common.Util;
import com.tractrac.model.lib.api.event.CreateModelException;
import com.tractrac.subscription.lib.api.SubscriberInitializationException;
public class LeaderboardForKielWeekTest extends OnlineTracTracBasedTest {
@@ -39,27 +40,26 @@ public class LeaderboardForKielWeekTest extends OnlineTracTracBasedTest {
}
@Test
public void leaderboardWithOneRaceTest() throws URISyntaxException, NoWindException, IOException, InterruptedException {
public void leaderboardWithOneRaceTest() throws URISyntaxException, NoWindException, IOException, InterruptedException, SubscriberInitializationException, CreateModelException {
leaderboard = new FlexibleLeaderboardImpl("Kiel Week 2011 505s", new ThresholdBasedResultDiscardingRuleImpl(new int[] { 3, 6 }),
new LowPoint(), null);
Fleet defaultFleet = leaderboard.getFleet(null);
MillisecondsTimePoint now = MillisecondsTimePoint.now();
loadRace("event_20110609_KielerWoch-505_Race_2.txt", "event_20110609_KielerWoch-505_Race_2.mtb"); // 505 Race 2
Competitor kevin = getCompetitorByName("Kevin");
RaceColumn column = leaderboard.addRace(getTrackedRace(), "Test Race 1", /* medalRace */ false, defaultFleet);
RaceColumn column = leaderboard.addRace(getTrackedRace(), "Test Race 1", /* medalRace */false);
assertEquals(17, leaderboard.getTotalPoints(kevin, now), 0.000000001);
Util.Pair<Competitor, RaceColumn> key = new Util.Pair<Competitor, RaceColumn>(kevin, column);
assertEquals(17, leaderboard.getContent(now).get(key).getTotalPoints(), 0.000000001);
assertEquals(17, leaderboard.getEntry(kevin, column, now).getTotalPoints(), 0.000000001);
loadRace("event_20110609_KielerWoch-505_Race_3.txt", "event_20110609_KielerWoch-505_Race_3.mtb"); // 505 Race 3
column = leaderboard.addRace(getTrackedRace(), "Test Race 2", /* medalRace */ false, defaultFleet);
column = leaderboard.addRace(getTrackedRace(), "Test Race 2", /* medalRace */false);
key = new Util.Pair<Competitor, RaceColumn>(kevin, column);
// In Race 3, Hasso ranked 31st
assertEquals(29, leaderboard.getTotalPoints(kevin, now), 0.000000001);
assertEquals(12, leaderboard.getContent(now).get(key).getTotalPoints(), 0.000000001);
assertEquals(12, leaderboard.getEntry(kevin, column, now).getTotalPoints(), 0.000000001);
loadRace("event_20110609_KielerWoch-505_race_4.txt", "event_20110609_KielerWoch-505_race_4.mtb"); // 505 Race 4
column = leaderboard.addRace(getTrackedRace(), "Test Race 3", /* medalRace */ false, defaultFleet);
column = leaderboard.addRace(getTrackedRace(), "Test Race 3", /* medalRace */false);
key = new Util.Pair<Competitor, RaceColumn>(kevin, column);
// now the first race is discarded because Kevin ranked worst compared to the other two; in race 4 he ranked 10th
assertEquals(22, leaderboard.getTotalPoints(kevin, now), 0.000000001);
@@ -68,18 +68,17 @@ public class LeaderboardForKielWeekTest extends OnlineTracTracBasedTest {
}
private void loadRace(String paramsFile, String storedDataFile) throws MalformedURLException, IOException, InterruptedException,
URISyntaxException {
final String raceName = "505 Race 2 from Kieler Woche 2011";
logger.info("Loading race "+raceName);
URISyntaxException, SubscriberInitializationException, CreateModelException {
logger.info("Loading race from params file "+paramsFile);
URI storedUri = new URI("file:///"+new File("resources/"+storedDataFile).getCanonicalPath().replace('\\', '/'));
super.setUp(new URL("file:///"+new File("resources/"+paramsFile).getCanonicalPath()),
/* liveUri */ null, /* storedUri */ storedUri,
new ReceiverType[] { ReceiverType.RACECOURSE, ReceiverType.RACESTARTFINISH, ReceiverType.MARKPASSINGS });
logger.info("Recording wind for " + raceName);
logger.info("Recording wind for race loaded from params file " + paramsFile);
getTrackedRace().recordWind(new WindImpl(/* position */ null, MillisecondsTimePoint.now(),
new KnotSpeedWithBearingImpl(12, new DegreeBearingImpl(70))), new WindSourceImpl(WindSourceType.WEB));
logger.info("Fixing mark positions for " + raceName);
logger.info("Fixing mark positions for race loaded from params file " + paramsFile);
fixApproximateMarkPositionsForWindReadOut(getTrackedRace(), new MillisecondsTimePoint(new GregorianCalendar(2011, 05, 23).getTime()));
logger.info("Loaded race " + raceName);
logger.info("Loaded race from params file " + paramsFile);
}
}
@@ -102,12 +102,11 @@ public class LeaderboardOfflineTest extends AbstractLeaderboardTest {
public void ensureMedalRaceParamIsIgnoredIfRaceColumnAlreadyExists() {
FlexibleLeaderboard leaderboard = new FlexibleLeaderboardImpl("Test Leaderboard", new ThresholdBasedResultDiscardingRuleImpl(
new int[] { 5, 8 }), new LowPoint(), null);
Fleet defaultFleet = leaderboard.getFleet(null);
final String columnName = "abc";
setupRaces(1, 0);
leaderboard.addRaceColumn(columnName, /* medalRace */ true);
leaderboard.addRace(testRaces.iterator().next(), columnName, /* medalRace */ false, defaultFleet);
leaderboard.addRace(testRaces.iterator().next(), columnName, /* medalRace */false);
assertTrue(leaderboard.getRaceColumnByName(columnName).isMedalRace());
}
@@ -119,7 +118,7 @@ public class LeaderboardOfflineTest extends AbstractLeaderboardTest {
final String columnName = "abc";
setupRaces(1, 0);
leaderboard.addRaceColumn(columnName, /* medalRace */ true);
leaderboard.addRace(testRaces.iterator().next(), columnName, /* medalRace */ false, defaultFleet);
leaderboard.addRace(testRaces.iterator().next(), columnName, /* medalRace */false);
final Set<String> emptySet = Collections.emptySet();
final MillisecondsTimePoint now = MillisecondsTimePoint.now();
final TrackedRegattaRegistry trackedRegattaRegistry = new TrackedRegattaRegistry() {
@@ -147,17 +146,17 @@ public class LeaderboardOfflineTest extends AbstractLeaderboardTest {
InterruptedException {
}
};
LeaderboardDTO leaderboardDTO = leaderboard.getLeaderboardDTO(now, emptySet, /* addOverallDetails */ true, trackedRegattaRegistry, DomainFactory.INSTANCE);
LeaderboardDTO leaderboardDTO = leaderboard.getLeaderboardDTO(now, emptySet, /* addOverallDetails */ true, trackedRegattaRegistry, DomainFactory.INSTANCE, /* fillNetPointsUncorrected */ false);
assertNotNull(leaderboardDTO);
assertSame(leaderboardDTO, leaderboard.getLeaderboardDTO(now, emptySet, /* addOverallDetails */ true, trackedRegattaRegistry, DomainFactory.INSTANCE)); // assert it's cached
assertSame(leaderboardDTO, leaderboard.getLeaderboardDTO(now, emptySet, /* addOverallDetails */ true, trackedRegattaRegistry, DomainFactory.INSTANCE, /* fillNetPointsUncorrected */ false)); // assert it's cached
leaderboard.getRaceColumnByName(columnName).releaseTrackedRace(defaultFleet); // this should clear the cache
LeaderboardDTO leaderboardDTO2 = leaderboard.getLeaderboardDTO(now, emptySet, /* addOverallDetails */ true, trackedRegattaRegistry, DomainFactory.INSTANCE);
LeaderboardDTO leaderboardDTO2 = leaderboard.getLeaderboardDTO(now, emptySet, /* addOverallDetails */ true, trackedRegattaRegistry, DomainFactory.INSTANCE, /* fillNetPointsUncorrected */ false);
assertNotSame(leaderboardDTO, leaderboardDTO2);
assertSame(leaderboardDTO2, leaderboard.getLeaderboardDTO(now, emptySet, /* addOverallDetails */ true, trackedRegattaRegistry, DomainFactory.INSTANCE)); // and cached again
assertSame(leaderboardDTO2, leaderboard.getLeaderboardDTO(now, emptySet, /* addOverallDetails */ true, trackedRegattaRegistry, DomainFactory.INSTANCE, /* fillNetPointsUncorrected */ false)); // and cached again
leaderboard.getRaceColumnByName(columnName).setTrackedRace(defaultFleet, testRaces.iterator().next()); // clear cache again; requires listener(s) to still be attached
LeaderboardDTO leaderboardDTO3 = leaderboard.getLeaderboardDTO(now, emptySet, /* addOverallDetails */ true, trackedRegattaRegistry, DomainFactory.INSTANCE);
LeaderboardDTO leaderboardDTO3 = leaderboard.getLeaderboardDTO(now, emptySet, /* addOverallDetails */ true, trackedRegattaRegistry, DomainFactory.INSTANCE, /* fillNetPointsUncorrected */ false);
assertNotSame(leaderboardDTO2, leaderboardDTO3);
assertSame(leaderboardDTO3, leaderboard.getLeaderboardDTO(now, emptySet, /* addOverallDetails */ true, trackedRegattaRegistry, DomainFactory.INSTANCE)); // and cached again
assertSame(leaderboardDTO3, leaderboard.getLeaderboardDTO(now, emptySet, /* addOverallDetails */ true, trackedRegattaRegistry, DomainFactory.INSTANCE, /* fillNetPointsUncorrected */ false)); // and cached again
}
@Test
@@ -180,7 +179,7 @@ public class LeaderboardOfflineTest extends AbstractLeaderboardTest {
RaceColumn bestScoringRaceColumn = null;
for (TrackedRace race : testRaces) {
i++;
RaceColumn raceColumn = leaderboard.addRace(race, "Test Race " + i, /* medalRace */ false, defaultFleet);
RaceColumn raceColumn = leaderboard.addRace(race, "Test Race " + i, /* medalRace */false);
raceColumnsInLeaderboard.put(race, raceColumn);
if (race.getRank(competitor) < bestScore) {
bestScore = race.getRank(competitor);
@@ -207,8 +206,7 @@ public class LeaderboardOfflineTest extends AbstractLeaderboardTest {
testRace.addCompetitor(c3); // this makes maxPoints==4
FlexibleLeaderboard leaderboard = new FlexibleLeaderboardImpl("Test Leaderboard", new ThresholdBasedResultDiscardingRuleImpl(
new int[] { 2 }), new LowPoint(), null);
Fleet defaultFleet = leaderboard.getFleet(null);
leaderboard.addRace(testRace, "R1", /* medalRace */ false, defaultFleet);
leaderboard.addRace(testRace, "R1", /* medalRace */false);
assertEquals(1., leaderboard.getTotalPoints(competitor, now), 0.00000001);
assertEquals(1., leaderboard.getTotalPoints(c2, now), 0.00000001);
assertEquals(1., leaderboard.getTotalPoints(c3, now), 0.00000001);
@@ -235,10 +233,9 @@ public class LeaderboardOfflineTest extends AbstractLeaderboardTest {
testRace.addCompetitor(c3); // this makes maxPoints==4
FlexibleLeaderboard leaderboard = new FlexibleLeaderboardImpl("Test Leaderboard", new ThresholdBasedResultDiscardingRuleImpl(
new int[] { 2 }), new LowPoint(), null);
Fleet defaultFleet = leaderboard.getFleet(null);
RaceColumn r1 = leaderboard.addRace(testRace, "R1", /* medalRace */ false, defaultFleet);
RaceColumn r1 = leaderboard.addRace(testRace, "R1", /* medalRace */false);
raceColumnsInLeaderboard.put(testRace, r1);
RaceColumn r2 = leaderboard.addRaceColumn("R2", /* medalRace */ false, defaultFleet);
RaceColumn r2 = leaderboard.addRaceColumn("R2", /* medalRace */false);
leaderboard.getScoreCorrection().setMaxPointsReason(competitor, r2, MaxPointsReason.DND); // non-discardable disqualification
// assert that max points were given before discarding...
assertEquals(4.0, leaderboard.getEntry(competitor, r2, MillisecondsTimePoint.now()).getNetPoints(), 0.000000001);
@@ -268,7 +265,7 @@ public class LeaderboardOfflineTest extends AbstractLeaderboardTest {
RaceColumn bestScoringRaceColumn = null;
for (TrackedRace race : testRaces) {
i++;
RaceColumn raceColumn = leaderboard.addRace(race, "Test Race " + i, /* medalRace */ false, defaultFleet);
RaceColumn raceColumn = leaderboard.addRace(race, "Test Race " + i, /* medalRace */false);
raceColumnsInLeaderboard.put(race, raceColumn);
if (race.getRank(competitor) < bestScore) {
bestScore = race.getRank(competitor);
@@ -294,8 +291,7 @@ public class LeaderboardOfflineTest extends AbstractLeaderboardTest {
for (TrackedRace race : testRaces) {
i++;
raceColumnsInLeaderboard.put(race, leaderboard.addRace(race, "Test Race "+i,
/* medalRace */ numberOfUntrackedRaces == 0 && addOneMedalRace && i == testRaces.size(),
defaultFleet));
/* medalRace */numberOfUntrackedRaces == 0 && addOneMedalRace && i == testRaces.size()));
}
// add a few race columns not yet connected to a tracked race
for (int j=0; j<numberOfUntrackedRaces; j++) {
@@ -4,6 +4,7 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
import java.util.ArrayList;
import java.util.Arrays;
@@ -15,6 +16,8 @@ import java.util.List;
import java.util.Map;
import java.util.NavigableSet;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.ExecutionException;
import org.junit.Test;
@@ -26,7 +29,9 @@ import com.sap.sailing.domain.base.RaceColumn;
import com.sap.sailing.domain.base.Regatta;
import com.sap.sailing.domain.base.Series;
import com.sap.sailing.domain.base.Waypoint;
import com.sap.sailing.domain.base.impl.BoatClassImpl;
import com.sap.sailing.domain.base.impl.ControlPointWithTwoMarksImpl;
import com.sap.sailing.domain.base.impl.CourseAreaImpl;
import com.sap.sailing.domain.base.impl.FleetImpl;
import com.sap.sailing.domain.base.impl.MarkImpl;
import com.sap.sailing.domain.base.impl.RegattaImpl;
@@ -37,7 +42,9 @@ import com.sap.sailing.domain.common.MaxPointsReason;
import com.sap.sailing.domain.common.NoWindException;
import com.sap.sailing.domain.common.ScoringSchemeType;
import com.sap.sailing.domain.common.TimePoint;
import com.sap.sailing.domain.common.dto.LeaderboardDTO;
import com.sap.sailing.domain.common.impl.MillisecondsTimePoint;
import com.sap.sailing.domain.common.racelog.tracking.NotRevokableException;
import com.sap.sailing.domain.leaderboard.FlexibleLeaderboard;
import com.sap.sailing.domain.leaderboard.Leaderboard;
import com.sap.sailing.domain.leaderboard.LeaderboardGroup;
@@ -46,14 +53,25 @@ import com.sap.sailing.domain.leaderboard.impl.FlexibleLeaderboardImpl;
import com.sap.sailing.domain.leaderboard.impl.HighPoint;
import com.sap.sailing.domain.leaderboard.impl.HighPointExtremeSailingSeriesOverall;
import com.sap.sailing.domain.leaderboard.impl.HighPointFirstGets10LastBreaksTie;
import com.sap.sailing.domain.leaderboard.impl.HighPointFirstGets10Or8AndLastBreaksTie;
import com.sap.sailing.domain.leaderboard.impl.LeaderboardGroupImpl;
import com.sap.sailing.domain.leaderboard.impl.LowPoint;
import com.sap.sailing.domain.leaderboard.impl.RegattaLeaderboardImpl;
import com.sap.sailing.domain.leaderboard.impl.ThresholdBasedResultDiscardingRuleImpl;
import com.sap.sailing.domain.leaderboard.meta.LeaderboardGroupMetaLeaderboard;
import com.sap.sailing.domain.racelog.RaceLog;
import com.sap.sailing.domain.racelog.analyzing.impl.AdditionalScoringInformationFinder;
import com.sap.sailing.domain.racelog.impl.EmptyRaceLogStore;
import com.sap.sailing.domain.racelog.impl.RaceLogEventAuthorImpl;
import com.sap.sailing.domain.racelog.scoring.AdditionalScoringInformationEvent;
import com.sap.sailing.domain.racelog.scoring.AdditionalScoringInformationType;
import com.sap.sailing.domain.racelog.scoring.impl.AdditionalScoringInformationEventImpl;
import com.sap.sailing.domain.racelog.state.RaceState;
import com.sap.sailing.domain.racelog.state.impl.RaceStateImpl;
import com.sap.sailing.domain.test.mock.MockedTrackedRaceWithStartTimeAndRanks;
import com.sap.sailing.domain.tracking.MarkPassing;
import com.sap.sailing.domain.tracking.TrackedRace;
import com.sap.sailing.domain.tracking.TrackedRegattaRegistry;
import com.sap.sailing.domain.tracking.impl.MarkPassingImpl;
import com.sap.sailing.domain.tracking.impl.TimedComparator;
import com.sap.sailing.util.impl.ArrayListNavigableSet;
@@ -191,10 +209,10 @@ public class LeaderboardScoringAndRankingTest extends AbstractLeaderboardTest {
List<Competitor> rankedCompetitorsWithOneRaceMissingInQ2 = leaderboard.getCompetitorsFromBestToWorst(later);
// scores: C1=1, C2=2, C3=3, C4=5, C5=7, C6=4, C7=6, C8=8, C9=4, C10=5
// ordered by scores: C1, C2, C3, C6/C9, C4/C10, C7, C5, C8
// ordered primarily by number of races: C6, C4, C7, C5, C8, C1, C2, C3, C9, C10
assertEquals(Arrays.asList(new Competitor[] { competitors.get(5), competitors.get(3), competitors.get(6),
competitors.get(4), competitors.get(7), competitors.get(0), competitors.get(1), competitors.get(2),
competitors.get(8), competitors.get(9) }), rankedCompetitorsWithOneRaceMissingInQ2);
// incomplete fleets are ordered now also by scores
assertEquals(Arrays.asList(new Competitor[] { competitors.get(0), competitors.get(1), competitors.get(2),
competitors.get(5), competitors.get(8), competitors.get(3), competitors.get(9), competitors.get(6),
competitors.get(4), competitors.get(7) }), rankedCompetitorsWithOneRaceMissingInQ2);
double[] points = new double[] { 1, 2, 3, 5, 7, 4, 6, 8, 4, 5 };
for (int i=0; i<9; i++) {
assertEquals(points[i], leaderboard.getTotalPoints(competitors.get(i), later), 0.000000001);
@@ -262,10 +280,10 @@ public class LeaderboardScoringAndRankingTest extends AbstractLeaderboardTest {
List<Competitor> rankedCompetitorsWithOneRaceMissingInQ2 = leaderboard.getCompetitorsFromBestToWorst(later);
// scores: C1=1, C2=2, C3=3, C4=5, C5=7, C6=4, C7=6, C8=8, C9=4, C10=5
// ordered by scores: C1, C2, C3, C6/C9, C4/C10, C7, C5, C8
// ordered primarily by number of races: C6, C4, C7, C5, C8, C1, C2, C3, C9, C10
assertEquals(Arrays.asList(new Competitor[] { competitors.get(5), competitors.get(3), competitors.get(6),
competitors.get(4), competitors.get(7), competitors.get(0), competitors.get(1), competitors.get(2),
competitors.get(8), competitors.get(9) }), rankedCompetitorsWithOneRaceMissingInQ2);
// incomplete fleets are ordered now also by scores
assertEquals(Arrays.asList(new Competitor[] { competitors.get(0), competitors.get(1), competitors.get(2),
competitors.get(5), competitors.get(8), competitors.get(3), competitors.get(9), competitors.get(6),
competitors.get(4), competitors.get(7) }), rankedCompetitorsWithOneRaceMissingInQ2);
double[] points = new double[] { 1, 2, 3, 5, 7, 4, 6, 8, 4, 5 };
for (int i=0; i<9; i++) {
assertEquals(points[i], leaderboard.getTotalPoints(competitors.get(i), later), 0.000000001);
@@ -722,10 +740,12 @@ public class LeaderboardScoringAndRankingTest extends AbstractLeaderboardTest {
private void checkScoresAfterSomeRaces(Leaderboard leaderboard, List<RaceColumn> raceColumnsToConsider,
double[][] scoresAfterNRaces, TimePoint timePoint, Competitor[] competitors) throws NoWindException {
for (int competitorIndex=0; competitorIndex<scoresAfterNRaces.length; competitorIndex++) {
final Set<RaceColumn> discardedRaceColumns = leaderboard.getResultDiscardingRule()
.getDiscardedRaceColumns(competitors[competitorIndex], leaderboard, raceColumnsToConsider, timePoint);
for (int raceColumnIndex=0; raceColumnIndex<raceColumnsToConsider.size(); raceColumnIndex++) {
assertEquals(scoresAfterNRaces[competitorIndex][raceColumnIndex],
leaderboard.getTotalPoints(competitors[competitorIndex], raceColumnsToConsider.get(raceColumnIndex),
raceColumnsToConsider, timePoint), 0.00000001);
timePoint, discardedRaceColumns), 0.00000001);
}
}
}
@@ -789,6 +809,84 @@ public class LeaderboardScoringAndRankingTest extends AbstractLeaderboardTest {
assertEquals(rankedCompetitors.indexOf(c[0]), rankedCompetitors.indexOf(c[1])-1);
}
@Test
public void testAdditionalScoreInformationLeadsToChangedScoreForOneColumn() throws NoWindException {
TrackedRegattaRegistry trackedRegattaRegistry = mock(TrackedRegattaRegistry.class);
Regatta dummyRegatta = new RegattaImpl(EmptyRaceLogStore.INSTANCE , "Dummy", new BoatClassImpl("Extreme40", false), trackedRegattaRegistry, new HighPointFirstGets10Or8AndLastBreaksTie(), "578876345345", new CourseAreaImpl("Humba", UUID.randomUUID()));
trackedRegattaRegistry.getOrCreateTrackedRegatta(dummyRegatta);
Competitor[] competitors = createCompetitors(10).toArray(new Competitor[0]);
TimePoint now = MillisecondsTimePoint.now();
TimePoint later = new MillisecondsTimePoint(now.asMillis()+1000);
FlexibleLeaderboard leaderboardHighPoint10Or8AndLastBreaksTie = new FlexibleLeaderboardImpl("Test ESS Highpoint 10Or8AndLastBreaksTie", new ThresholdBasedResultDiscardingRuleImpl(/* discarding thresholds */ new int[0]),
new HighPointFirstGets10Or8AndLastBreaksTie(), null);
leaderboardHighPoint10Or8AndLastBreaksTie.addRace(new MockedTrackedRaceWithStartTimeAndRanks(now, Arrays.asList(competitors), dummyRegatta), "R1", /* medalRace */ false);
assertTrue(leaderboardHighPoint10Or8AndLastBreaksTie.getScoringScheme().getScoreComparator(/* nullScoresAreBetter */ false).compare(
leaderboardHighPoint10Or8AndLastBreaksTie.getTotalPoints(competitors[0], later), leaderboardHighPoint10Or8AndLastBreaksTie.getTotalPoints(competitors[3], later)) < 0); // c0 better than c3
assertEquals(10, leaderboardHighPoint10Or8AndLastBreaksTie.getCompetitorsFromBestToWorst(later).size());
assertEquals(new Double(10), leaderboardHighPoint10Or8AndLastBreaksTie.getTotalPoints(competitors[0], later));
assertEquals(new Double(9), leaderboardHighPoint10Or8AndLastBreaksTie.getTotalPoints(competitors[1], later));
assertEquals(new Double(1), leaderboardHighPoint10Or8AndLastBreaksTie.getTotalPoints(competitors[9], later));
leaderboardHighPoint10Or8AndLastBreaksTie.addRace(new MockedTrackedRaceWithStartTimeAndRanks(now, Arrays.asList(competitors), dummyRegatta), "R2", /* medalRace */ false);
assertEquals(new Double(20), leaderboardHighPoint10Or8AndLastBreaksTie.getTotalPoints(competitors[0], later));
assertEquals(new Double(18), leaderboardHighPoint10Or8AndLastBreaksTie.getTotalPoints(competitors[1], later));
assertEquals(new Double(2), leaderboardHighPoint10Or8AndLastBreaksTie.getTotalPoints(competitors[9], later));
RaceLog raceLogForRace2 = leaderboardHighPoint10Or8AndLastBreaksTie.getRaceColumnByName("R2").getRaceLog(leaderboardHighPoint10Or8AndLastBreaksTie.getFleet(null));
raceLogForRace2.add(new AdditionalScoringInformationEventImpl(now, new RaceLogEventAuthorImpl("Plopp", 1), later, "12345678", Collections.<Competitor>emptyList(), 0, AdditionalScoringInformationType.UNKNOWN));
assertEquals(new Double(20), leaderboardHighPoint10Or8AndLastBreaksTie.getTotalPoints(competitors[0], later));
assertEquals(new Double(18), leaderboardHighPoint10Or8AndLastBreaksTie.getTotalPoints(competitors[1], later));
assertEquals(new Double(2), leaderboardHighPoint10Or8AndLastBreaksTie.getTotalPoints(competitors[9], later));
raceLogForRace2.add(new AdditionalScoringInformationEventImpl(now, new RaceLogEventAuthorImpl("Plopp", 1), later.plus(Duration.ONE_MINUTE), "123456789873773762", Collections.<Competitor>emptyList(), 0, AdditionalScoringInformationType.MAX_POINTS_DECREASE_MAX_SCORE));
assertEquals(new Double(18), leaderboardHighPoint10Or8AndLastBreaksTie.getTotalPoints(competitors[0], later));
assertEquals(new Double(16), leaderboardHighPoint10Or8AndLastBreaksTie.getTotalPoints(competitors[1], later));
assertEquals(new Double(2), leaderboardHighPoint10Or8AndLastBreaksTie.getTotalPoints(competitors[9], later));
leaderboardHighPoint10Or8AndLastBreaksTie.addRace(new MockedTrackedRaceWithStartTimeAndRanks(now, Arrays.asList(competitors), dummyRegatta), "R3", /* medalRace */ false);
assertEquals(new Double(28), leaderboardHighPoint10Or8AndLastBreaksTie.getTotalPoints(competitors[0], later));
assertEquals(new Double(25), leaderboardHighPoint10Or8AndLastBreaksTie.getTotalPoints(competitors[1], later));
assertEquals(new Double(3), leaderboardHighPoint10Or8AndLastBreaksTie.getTotalPoints(competitors[9], later));
AdditionalScoringInformationFinder finder = new AdditionalScoringInformationFinder(raceLogForRace2);
AdditionalScoringInformationEvent event = finder.analyze(/*filterBy*/AdditionalScoringInformationType.MAX_POINTS_DECREASE_MAX_SCORE);
assert event != null;
try {
raceLogForRace2.revokeEvent(new RaceLogEventAuthorImpl("Plopp", 1), event);
} catch (NotRevokableException e) {
e.printStackTrace();
}
event = finder.analyze(/*filterBy*/AdditionalScoringInformationType.MAX_POINTS_DECREASE_MAX_SCORE);
assert event == null;
assertEquals(new Double(30), leaderboardHighPoint10Or8AndLastBreaksTie.getTotalPoints(competitors[0], later));
assertEquals(new Double(3), leaderboardHighPoint10Or8AndLastBreaksTie.getTotalPoints(competitors[9], later));
RaceState raceStateForRace2 = RaceStateImpl.create(raceLogForRace2, new RaceLogEventAuthorImpl("Simon", 1));
assertFalse(raceStateForRace2.isAdditionalScoringInformationEnabled(AdditionalScoringInformationType.MAX_POINTS_DECREASE_MAX_SCORE));
raceStateForRace2.setAdditionalScoringInformationEnabled(later.plus(Duration.ONE_MINUTE).plus(Duration.ONE_SECOND), /*enable*/true, AdditionalScoringInformationType.MAX_POINTS_DECREASE_MAX_SCORE);
assertTrue(raceStateForRace2.isAdditionalScoringInformationEnabled(AdditionalScoringInformationType.MAX_POINTS_DECREASE_MAX_SCORE));
assertEquals(new Double(28), leaderboardHighPoint10Or8AndLastBreaksTie.getTotalPoints(competitors[0], later));
assertEquals(new Double(3), leaderboardHighPoint10Or8AndLastBreaksTie.getTotalPoints(competitors[9], later));
raceStateForRace2.setAdditionalScoringInformationEnabled(later.plus(Duration.ONE_MINUTE).plus(Duration.ONE_SECOND.plus(10000)), /*enable*/false, AdditionalScoringInformationType.MAX_POINTS_DECREASE_MAX_SCORE);
assertFalse(raceStateForRace2.isAdditionalScoringInformationEnabled(AdditionalScoringInformationType.MAX_POINTS_DECREASE_MAX_SCORE));
assertEquals(new Double(30), leaderboardHighPoint10Or8AndLastBreaksTie.getTotalPoints(competitors[0], later));
assertEquals(new Double(3), leaderboardHighPoint10Or8AndLastBreaksTie.getTotalPoints(competitors[9], later));
LeaderboardDTO leaderboardDTO = null;
try {
leaderboardDTO = leaderboardHighPoint10Or8AndLastBreaksTie.getLeaderboardDTO(later.plus(Duration.ONE_HOUR), Collections.<String>emptyList(), false, trackedRegattaRegistry, DomainFactory.INSTANCE, false);
} catch (InterruptedException e) {
e.printStackTrace();
} catch (ExecutionException e) {
e.printStackTrace();
}
assert leaderboardDTO != null;
assertEquals(30.0, leaderboardDTO.rows.get(leaderboardDTO.competitors.get(0)).totalPoints, 0.000000000001);
raceStateForRace2.setAdditionalScoringInformationEnabled(later.plus(Duration.ONE_MINUTE).plus(Duration.ONE_SECOND.plus(20000)), /*enable*/true, AdditionalScoringInformationType.MAX_POINTS_DECREASE_MAX_SCORE);
try {
leaderboardDTO = leaderboardHighPoint10Or8AndLastBreaksTie.getLeaderboardDTO(later.plus(Duration.ONE_HOUR), Collections.<String>emptyList(), false, trackedRegattaRegistry, DomainFactory.INSTANCE, false);
} catch (InterruptedException e) {
e.printStackTrace();
} catch (ExecutionException e) {
e.printStackTrace();
}
assertEquals(28.0, leaderboardDTO.rows.get(leaderboardDTO.competitors.get(0)).totalPoints, 0.000000000001);
assertEquals(25.0, leaderboardDTO.rows.get(leaderboardDTO.competitors.get(1)).totalPoints, 0.000000000001);
}
@Test
public void testCompetitorsRankedEleventhOrLowerGetOnePointScore() throws NoWindException {
Competitor[] competitors = createCompetitors(16).toArray(new Competitor[0]);
@@ -796,8 +894,9 @@ public class LeaderboardScoringAndRankingTest extends AbstractLeaderboardTest {
TimePoint later = new MillisecondsTimePoint(now.asMillis()+1000);
FlexibleLeaderboard leaderboardHighPoint10LastBreaksTie = new FlexibleLeaderboardImpl("Test ESS Highpoint 10LastBreaksTie", new ThresholdBasedResultDiscardingRuleImpl(/* discarding thresholds */ new int[0]),
new HighPointFirstGets10LastBreaksTie(), null);
leaderboardHighPoint10LastBreaksTie.addRace(new MockedTrackedRaceWithStartTimeAndRanks(now, Arrays.asList(competitors)), "R1", /* medalRace */ false,
leaderboardHighPoint10LastBreaksTie.getFleet(null));
leaderboardHighPoint10LastBreaksTie
.addRace(new MockedTrackedRaceWithStartTimeAndRanks(now, Arrays.asList(competitors)), "R1", /* medalRace */
false);
assertTrue(leaderboardHighPoint10LastBreaksTie.getScoringScheme().getScoreComparator(/* nullScoresAreBetter */ false).compare(
leaderboardHighPoint10LastBreaksTie.getTotalPoints(competitors[0], later), leaderboardHighPoint10LastBreaksTie.getTotalPoints(competitors[3], later)) < 0); // c0 better than c3
assertEquals(16, leaderboardHighPoint10LastBreaksTie.getCompetitorsFromBestToWorst(later).size());
@@ -806,12 +905,12 @@ public class LeaderboardScoringAndRankingTest extends AbstractLeaderboardTest {
// Normal HighPoint leaderboard has no max so that winner gets as many points as there are competitors
FlexibleLeaderboard leaderboardHighPoint = new FlexibleLeaderboardImpl("Test ESS Highpoint", new ThresholdBasedResultDiscardingRuleImpl(/* discarding thresholds */ new int[0]),
new HighPoint(), null);
leaderboardHighPoint.addRace(new MockedTrackedRaceWithStartTimeAndRanks(now, Arrays.asList(competitors)), "R1", /* medalRace */ false,
leaderboardHighPoint.getFleet(null));
leaderboardHighPoint.addRace(new MockedTrackedRaceWithStartTimeAndRanks(now, Arrays.asList(competitors)), "R1", /* medalRace */
false);
assertEquals(16, leaderboardHighPoint.getCompetitorsFromBestToWorst(later).size());
assertEquals(new Double(16), leaderboardHighPoint.getTotalPoints(competitors[0], later));
LeaderboardGroup leaderboardGroup = new LeaderboardGroupImpl("ESS", "ESS", /* displayGroupsInReverseOrder */ false,
Arrays.asList(new Leaderboard[] { leaderboardHighPoint10LastBreaksTie }));
LeaderboardGroup leaderboardGroup = new LeaderboardGroupImpl("ESS", "ESS", /* displayName */ null,
/* displayGroupsInReverseOrder */ false, Arrays.asList(new Leaderboard[] { leaderboardHighPoint10LastBreaksTie }));
LeaderboardGroupMetaLeaderboard leaderboardHighPointESSOverall = new LeaderboardGroupMetaLeaderboard(
leaderboardGroup, new HighPointExtremeSailingSeriesOverall(), new ThresholdBasedResultDiscardingRuleImpl(/* discarding thresholds */ new int[0]));
assertEquals(16, leaderboardHighPointESSOverall.getCompetitorsFromBestToWorst(later).size());
@@ -845,29 +944,29 @@ public class LeaderboardScoringAndRankingTest extends AbstractLeaderboardTest {
TimePoint later = new MillisecondsTimePoint(now.asMillis()+1000);
FlexibleLeaderboard leaderboard1 = new FlexibleLeaderboardImpl("Leaderboard 1", new ThresholdBasedResultDiscardingRuleImpl(/* discarding thresholds */ new int[0]),
new HighPoint(), null);
leaderboard1.addRace(new MockedTrackedRaceWithStartTimeAndRanks(now, Arrays.asList(f1)), "R1", /* medalRace */ false,
leaderboard1.getFleet(null));
leaderboard1.addRace(new MockedTrackedRaceWithStartTimeAndRanks(now, Arrays.asList(f2)), "R2", /* medalRace */ false,
leaderboard1.getFleet(null));
leaderboard1.addRace(new MockedTrackedRaceWithStartTimeAndRanks(now, Arrays.asList(f1)), "R1", /* medalRace */
false);
leaderboard1.addRace(new MockedTrackedRaceWithStartTimeAndRanks(now, Arrays.asList(f2)), "R2", /* medalRace */
false);
assertTrue(leaderboard1.getScoringScheme().getScoreComparator(/* nullScoresAreBetter */ false).compare(
leaderboard1.getTotalPoints(c[0], later), leaderboard1.getTotalPoints(c[3], later)) < 0); // c0 better than c3
FlexibleLeaderboard leaderboard2 = new FlexibleLeaderboardImpl("Leaderboard 3", new ThresholdBasedResultDiscardingRuleImpl(/* discarding thresholds */ new int[0]),
new HighPoint(), null);
leaderboard2.addRace(new MockedTrackedRaceWithStartTimeAndRanks(now, Arrays.asList(f3)), "R1", /* medalRace */ false,
leaderboard1.getFleet(null));
leaderboard2.addRace(new MockedTrackedRaceWithStartTimeAndRanks(now, Arrays.asList(f4)), "R2", /* medalRace */ false,
leaderboard1.getFleet(null));
leaderboard2.addRace(new MockedTrackedRaceWithStartTimeAndRanks(now, Arrays.asList(f3)), "R1", /* medalRace */
false);
leaderboard2.addRace(new MockedTrackedRaceWithStartTimeAndRanks(now, Arrays.asList(f4)), "R2", /* medalRace */
false);
assertTrue(leaderboard2.getScoringScheme().getScoreComparator(/* nullScoresAreBetter */ false).compare(
leaderboard2.getTotalPoints(c[3], later), leaderboard2.getTotalPoints(c[0], later)) < 0); // c3 better than c0
FlexibleLeaderboard leaderboard3 = new FlexibleLeaderboardImpl("Leaderboard 3", new ThresholdBasedResultDiscardingRuleImpl(/* discarding thresholds */ new int[0]),
new HighPoint(), null);
leaderboard3.addRace(new MockedTrackedRaceWithStartTimeAndRanks(now, Arrays.asList(f5)), "R1", /* medalRace */ false,
leaderboard1.getFleet(null));
leaderboard3.addRace(new MockedTrackedRaceWithStartTimeAndRanks(now, Arrays.asList(f6)), "R2", /* medalRace */ false,
leaderboard1.getFleet(null));
leaderboard3.addRace(new MockedTrackedRaceWithStartTimeAndRanks(now, Arrays.asList(f5)), "R1", /* medalRace */
false);
leaderboard3.addRace(new MockedTrackedRaceWithStartTimeAndRanks(now, Arrays.asList(f6)), "R2", /* medalRace */
false);
assertTrue(leaderboard3.getCompetitorsFromBestToWorst(later).indexOf(c[3]) <
leaderboard3.getCompetitorsFromBestToWorst(later).indexOf(c[0])); // c3 better than c0; won last race
LeaderboardGroup leaderboardGroup = new LeaderboardGroupImpl("Leaderboard Group", "Leaderboard Group", false, Arrays.asList(leaderboard1,
LeaderboardGroup leaderboardGroup = new LeaderboardGroupImpl("Leaderboard Group", "Leaderboard Group", /* displayName */ null, false, Arrays.asList(leaderboard1,
leaderboard2, leaderboard3));
leaderboardGroup.setOverallLeaderboard(new LeaderboardGroupMetaLeaderboard(leaderboardGroup, new HighPointExtremeSailingSeriesOverall(),
new ThresholdBasedResultDiscardingRuleImpl(new int[0])));
@@ -894,18 +993,18 @@ public class LeaderboardScoringAndRankingTest extends AbstractLeaderboardTest {
TimePoint later = new MillisecondsTimePoint(now.asMillis()+1000);
FlexibleLeaderboard leaderboard1 = new FlexibleLeaderboardImpl("Leaderboard 1", new ThresholdBasedResultDiscardingRuleImpl(/* discarding thresholds */ new int[0]),
new HighPointFirstGets10LastBreaksTie(), null);
leaderboard1.addRace(new MockedTrackedRaceWithStartTimeAndRanks(now, Arrays.asList(regattaRace1_1)), "R1", /* medalRace */ false,
leaderboard1.getFleet(null));
leaderboard1.addRace(new MockedTrackedRaceWithStartTimeAndRanks(now, Arrays.asList(regattaRace2_1)), "R2", /* medalRace */ false,
leaderboard1.getFleet(null));
leaderboard1.addRace(new MockedTrackedRaceWithStartTimeAndRanks(now, Arrays.asList(regattaRace1_1)), "R1", /* medalRace */
false);
leaderboard1.addRace(new MockedTrackedRaceWithStartTimeAndRanks(now, Arrays.asList(regattaRace2_1)), "R2", /* medalRace */
false);
FlexibleLeaderboard leaderboard2 = new FlexibleLeaderboardImpl("Leaderboard 2", new ThresholdBasedResultDiscardingRuleImpl(/* discarding thresholds */ new int[0]),
new HighPointFirstGets10LastBreaksTie(), null);
leaderboard2.addRace(new MockedTrackedRaceWithStartTimeAndRanks(now, Arrays.asList(regattaRace1_2)), "R1", /* medalRace */ false,
leaderboard2.getFleet(null));
leaderboard2.addRace(new MockedTrackedRaceWithStartTimeAndRanks(now, Arrays.asList(regattaRace2_2)), "R2", /* medalRace */ false,
leaderboard2.getFleet(null));
leaderboard2.addRace(new MockedTrackedRaceWithStartTimeAndRanks(now, Arrays.asList(regattaRace3_2)), "R3", /* medalRace */ false,
leaderboard2.getFleet(null));
leaderboard2.addRace(new MockedTrackedRaceWithStartTimeAndRanks(now, Arrays.asList(regattaRace1_2)), "R1", /* medalRace */
false);
leaderboard2.addRace(new MockedTrackedRaceWithStartTimeAndRanks(now, Arrays.asList(regattaRace2_2)), "R2", /* medalRace */
false);
leaderboard2.addRace(new MockedTrackedRaceWithStartTimeAndRanks(now, Arrays.asList(regattaRace3_2)), "R3", /* medalRace */
false);
// [C2, C3, C4, C5, C6, C7, C1, C11, C8, C9, C10, C12]
// [29, 25, 22, 19, 16, 12, 13, 11, 10, 7, 4, 3]
List<Competitor> rankedCompetitorsInLeaderboard = leaderboard2.getCompetitorsFromBestToWorst(later);
@@ -920,8 +1019,8 @@ public class LeaderboardScoringAndRankingTest extends AbstractLeaderboardTest {
assertEquals(4, leaderboard2.getTotalPoints(c[9], later), 0.000000001);
assertEquals(3, leaderboard2.getTotalPoints(c[11], later), 0.000000001);
LeaderboardGroup leaderboardGroup = new LeaderboardGroupImpl("Leaderboard Group ESS Overall", "Leaderboard Group", false,
Arrays.asList(leaderboard1, leaderboard2));
LeaderboardGroup leaderboardGroup = new LeaderboardGroupImpl("Leaderboard Group ESS Overall", "Leaderboard Group", /* displayName */ null,
false, Arrays.asList(leaderboard1, leaderboard2));
leaderboardGroup.setOverallLeaderboard(new LeaderboardGroupMetaLeaderboard(leaderboardGroup, new HighPointExtremeSailingSeriesOverall(),
new ThresholdBasedResultDiscardingRuleImpl(new int[0])));
leaderboardGroup.getOverallLeaderboard().setSuppressed(c[c.length-1], true);
@@ -956,9 +1055,8 @@ public class LeaderboardScoringAndRankingTest extends AbstractLeaderboardTest {
public TimePoint getEndOfRace() {
return endOfR1;
}
}, "R1", /* medalRace */ false,
leaderboard1.getFleet(null));
RaceColumn r2 = leaderboard1.addRaceColumn("R2", /* medalRace */ false, new Fleet[] { new FleetImpl("Default Fleet") });
}, "R1", /* medalRace */false);
RaceColumn r2 = leaderboard1.addRaceColumn("R2", /* medalRace */false);
leaderboard1.getScoreCorrection().correctScore(c[0], r2, 123.);
assertEquals(2. + 123., leaderboard1.getTotalPoints(c[0], afterEndOfR1), 0.00000001); // correction expected to apply after end of last tracked race before the corrected column
assertEquals(2. + 0., leaderboard1.getTotalPoints(c[0], withinR1), 0.00000001); // correction expected NOT to apply before end of last tracked race before the corrected column
@@ -984,15 +1082,13 @@ public class LeaderboardScoringAndRankingTest extends AbstractLeaderboardTest {
public TimePoint getEndOfRace() {
return endOfR1;
}
}, "R1", /* medalRace */ false,
leaderboard1.getFleet(null));
}, "R1", /* medalRace */false);
RaceColumn r2 = leaderboard1.addRace(new MockedTrackedRaceWithStartTimeAndRanks(afterEndOfR1, Arrays.asList(c2)) {
private static final long serialVersionUID = 8705622361027154428L;
public TimePoint getEndOfRace() {
return afterEndOfR1;
}
}, "R2", /* medalRace */ false,
leaderboard1.getFleet(null));
}, "R2", /* medalRace */false);
leaderboard1.getScoreCorrection().correctScore(c1[0], r2, .9);
assertEquals(1. + .9, leaderboard1.getTotalPoints(c1[0], afterEndOfR1), 0.00000001);
assertEquals(1, leaderboard1.getTotalRankOfCompetitor(c1[0], afterEndOfR1));
@@ -1032,8 +1128,8 @@ public class LeaderboardScoringAndRankingTest extends AbstractLeaderboardTest {
};
trackedRace.getRace().getCourse().addWaypoint(0, start);
trackedRace.getRace().getCourse().addWaypoint(1, finish);
RaceColumn r1 = leaderboard1.addRace(trackedRace, "R1", /* medalRace */ false, leaderboard1.getFleet(null));
RaceColumn r2 = leaderboard1.addRaceColumn("R2", /* medalRace */ false, new Fleet[] { new FleetImpl("Default Fleet") });
RaceColumn r1 = leaderboard1.addRace(trackedRace, "R1", /* medalRace */false);
RaceColumn r2 = leaderboard1.addRaceColumn("R2", /* medalRace */false);
leaderboard1.getScoreCorrection().correctScore(c[0], r2, 123.);
assertEquals(2. + 123., leaderboard1.getTotalPoints(c[0], afterEndOfR1), 0.00000001); // correction expected to apply after end of last tracked race before the corrected column
assertEquals(2. + 0., leaderboard1.getTotalPoints(c[0], withinR1), 0.00000001); // correction expected NOT to apply before end of last tracked race before the corrected column
@@ -1156,7 +1252,7 @@ public class LeaderboardScoringAndRankingTest extends AbstractLeaderboardTest {
series.add(medalSeries);
}
Regatta regatta = new RegattaImpl(regattaBaseName, boatClass, series, /* persistent */ false, scoringScheme, "123", null);
Regatta regatta = new RegattaImpl(RegattaImpl.getDefaultName(regattaBaseName, boatClass.getName()), boatClass, series, /* persistent */ false, scoringScheme, "123", null);
return regatta;
}
@@ -1220,7 +1316,8 @@ public class LeaderboardScoringAndRankingTest extends AbstractLeaderboardTest {
Series finalSeries = new SeriesImpl("After", /* isMedal */false, afterFleets, finalRaceColumnNames, /* trackedRegattaRegistry */ null);
series.add(finalSeries);
}
Regatta regatta = new RegattaImpl("Test Regatta",DomainFactory.INSTANCE.getOrCreateBoatClass("Extreme40", /* typicallyStartsUpwind */ false),
final BoatClass boatClass = DomainFactory.INSTANCE.getOrCreateBoatClass("Extreme40", /* typicallyStartsUpwind */ false);
Regatta regatta = new RegattaImpl(RegattaImpl.getDefaultName("Test Regatta", boatClass.getName()), boatClass,
series, /* persistent */false, DomainFactory.INSTANCE.createScoringScheme(ScoringSchemeType.HIGH_POINT_FIRST_GETS_TEN), "123", /* course area */null);
List<Competitor> competitors = createCompetitors(12);
final int firstYellowCompetitorIndex = 3;
@@ -16,6 +16,7 @@ import com.sap.sailing.domain.test.measurements.MeasurementCase;
import com.sap.sailing.domain.test.measurements.MeasurementXMLFile;
import com.sap.sailing.util.impl.LockUtil;
import com.sap.sailing.util.impl.NamedReentrantReadWriteLock;
import com.sap.sse.common.Util;
public class LockTraceTest {
private static class LockingThread extends Thread {
@@ -47,18 +48,18 @@ public class LockTraceTest {
public void testReentrantReadLocking() {
NamedReentrantReadWriteLock lock = new NamedReentrantReadWriteLock("testReentrantReadLocking-Lock", /* fair */ true);
LockUtil.lockForRead(lock);
assertTrue(lock.getReaders().contains(Thread.currentThread()));
assertEquals(1, lock.getReaders().size());
assertTrue(Util.contains(lock.getReaders(), Thread.currentThread()));
assertEquals(1, Util.size(lock.getReaders()));
LockUtil.lockForRead(lock);
assertTrue(lock.getReaders().contains(Thread.currentThread()));
assertEquals(2, lock.getReaders().size());
assertTrue(Util.contains(lock.getReaders(), Thread.currentThread()));
assertEquals(2, Util.size(lock.getReaders()));
LockUtil.unlockAfterRead(lock);
assertTrue(lock.getReaders().contains(Thread.currentThread()));
assertEquals(1, lock.getReaders().size());
assertTrue(Util.contains(lock.getReaders(), Thread.currentThread()));
assertEquals(1, Util.size(lock.getReaders()));
LockUtil.unlockAfterRead(lock);
assertFalse(lock.getReaders().contains(Thread.currentThread()));
assertFalse(Util.contains(lock.getReaders(), Thread.currentThread()));
assertEquals(0, lock.getReadHoldCount());
assertEquals(0, lock.getReaders().size());
assertEquals(0, Util.size(lock.getReaders()));
}
@Test
@@ -67,15 +68,15 @@ public class LockTraceTest {
LockUtil.lockForWrite(lock);
assertTrue(lock.getWriter() == Thread.currentThread());
LockUtil.lockForRead(lock); // reentrant read while holding write
assertTrue(lock.getReaders().contains(Thread.currentThread()));
assertTrue(Util.contains(lock.getReaders(), Thread.currentThread()));
LockUtil.lockForWrite(lock); // reentrant write
assertTrue(lock.getWriter() == Thread.currentThread());
assertTrue(lock.getReaders().contains(Thread.currentThread()));
assertTrue(Util.contains(lock.getReaders(), Thread.currentThread()));
LockUtil.unlockAfterRead(lock);
assertFalse(lock.getReaders().contains(Thread.currentThread()));
assertFalse(Util.contains(lock.getReaders(), Thread.currentThread()));
assertEquals(0, lock.getReadHoldCount());
assertTrue(lock.getWriter() == Thread.currentThread());
assertFalse(lock.getReaders().contains(Thread.currentThread()));
assertFalse(Util.contains(lock.getReaders(), Thread.currentThread()));
assertEquals(0, lock.getReadHoldCount());
LockUtil.unlockAfterWrite(lock);
assertTrue(lock.getWriter() == Thread.currentThread());
@@ -28,6 +28,8 @@ import com.sap.sailing.domain.common.impl.WindSourceImpl;
import com.sap.sailing.domain.tracking.Maneuver;
import com.sap.sailing.domain.tracking.impl.WindImpl;
import com.sap.sailing.domain.tractracadapter.ReceiverType;
import com.tractrac.model.lib.api.event.CreateModelException;
import com.tractrac.subscription.lib.api.SubscriberInitializationException;
public class ManeuverAnalysis505Test extends AbstractManeuverDetectionTestCase {
public ManeuverAnalysis505Test() throws MalformedURLException, URISyntaxException {
@@ -35,7 +37,7 @@ public class ManeuverAnalysis505Test extends AbstractManeuverDetectionTestCase {
}
@Before
public void setUp() throws URISyntaxException, IOException, InterruptedException, ParseException {
public void setUp() throws URISyntaxException, IOException, InterruptedException, ParseException, SubscriberInitializationException, CreateModelException {
super.setUp();
URI storedUri = new URI("file:///"+new File("resources/event_20110609_KielerWoch-505_Race_2.mtb").getCanonicalPath().replace('\\', '/'));
super.setUp(new URL("file:///"+new File("resources/event_20110609_KielerWoch-505_Race_2.txt").getCanonicalPath()),
@@ -39,6 +39,8 @@ import com.sap.sailing.domain.tracking.impl.GPSFixImpl;
import com.sap.sailing.domain.tracking.impl.TrackedLegImpl;
import com.sap.sailing.domain.tracking.impl.WindImpl;
import com.sap.sailing.domain.tractracadapter.ReceiverType;
import com.tractrac.model.lib.api.event.CreateModelException;
import com.tractrac.subscription.lib.api.SubscriberInitializationException;
public class ManeuverAnalysisIDMChampionsFinalTest extends AbstractManeuverDetectionTestCase {
@@ -47,7 +49,7 @@ public class ManeuverAnalysisIDMChampionsFinalTest extends AbstractManeuverDetec
}
@Before
public void setUp() throws URISyntaxException, IOException, InterruptedException, ParseException {
public void setUp() throws URISyntaxException, IOException, InterruptedException, ParseException, SubscriberInitializationException, CreateModelException {
super.setUp();
URI storedUri = new URI("file:///"+new File("resources/event_20110929_Internatio-Champions_Cup_Final.mtb").getCanonicalPath().replace('\\', '/'));
super.setUp(new URL("file:///"+new File("resources/event_20110929_Internatio-Champions_Cup_Final.txt").getCanonicalPath()),
@@ -28,6 +28,8 @@ import com.sap.sailing.domain.common.impl.WindSourceImpl;
import com.sap.sailing.domain.tracking.Maneuver;
import com.sap.sailing.domain.tracking.impl.WindImpl;
import com.sap.sailing.domain.tractracadapter.ReceiverType;
import com.tractrac.model.lib.api.event.CreateModelException;
import com.tractrac.subscription.lib.api.SubscriberInitializationException;
public class ManeuverAnalysisQingdao2014Test extends AbstractManeuverDetectionTestCase {
public ManeuverAnalysisQingdao2014Test() throws MalformedURLException, URISyntaxException {
@@ -41,7 +43,7 @@ public class ManeuverAnalysisQingdao2014Test extends AbstractManeuverDetectionTe
@Before
public void setUp() throws URISyntaxException, IOException, InterruptedException, ParseException {
public void setUp() throws URISyntaxException, IOException, InterruptedException, ParseException, SubscriberInitializationException, CreateModelException {
super.setUp();
URI storedUri = new URI("file:///"+new File("resources/event_20140429_ESSQingdao-Race_4.mtb").getCanonicalPath().replace('\\', '/'));
super.setUp(
@@ -39,6 +39,8 @@ import com.sap.sailing.domain.tracking.Maneuver;
import com.sap.sailing.domain.tracking.MarkPassing;
import com.sap.sailing.domain.tracking.impl.WindImpl;
import com.sap.sailing.domain.tractracadapter.ReceiverType;
import com.tractrac.model.lib.api.event.CreateModelException;
import com.tractrac.subscription.lib.api.SubscriberInitializationException;
public class ManeuverDetectionOnKielerWoche505Race2DataTest extends OnlineTracTracBasedTest {
@@ -46,10 +48,10 @@ public class ManeuverDetectionOnKielerWoche505Race2DataTest extends OnlineTracTr
}
@Before
public void setUp() throws MalformedURLException, IOException, InterruptedException, URISyntaxException, ParseException {
public void setUp() throws MalformedURLException, IOException, InterruptedException, URISyntaxException, ParseException, SubscriberInitializationException, CreateModelException {
super.setUp();
URI storedUri = new URI("file:///"+new File("resources/event_20110609_KielerWoch-505_Race_2.mtb").getCanonicalPath().replace('\\', '/'));
super.setUp(new URL("file:///"+new File("resources/event_20110609_KielerWoch-505_Race_2.txt").getCanonicalPath()),
URI storedUri = new URI("file:////"+new File("resources/event_20110609_KielerWoch-505_Race_2.mtb").getCanonicalPath().replace('\\', '/'));
super.setUp(new URL("file:////"+new File("resources/event_20110609_KielerWoch-505_Race_2.txt").getCanonicalPath()),
/* liveUri */ null, /* storedUri */ storedUri,
new ReceiverType[] { ReceiverType.MARKPASSINGS, ReceiverType.RACECOURSE, ReceiverType.RAWPOSITIONS });
OnlineTracTracBasedTest.fixApproximateMarkPositionsForWindReadOut(getTrackedRace(), new MillisecondsTimePoint(new GregorianCalendar(2011, 05, 23).getTime()));
@@ -36,6 +36,8 @@ import com.sap.sailing.domain.tracking.MarkPassing;
import com.sap.sailing.domain.tracking.impl.GPSFixImpl;
import com.sap.sailing.domain.tracking.impl.WindImpl;
import com.sap.sailing.domain.tractracadapter.ReceiverType;
import com.tractrac.model.lib.api.event.CreateModelException;
import com.tractrac.subscription.lib.api.SubscriberInitializationException;
public class ManeuverDetectionOnMdM2011SemifinalTest extends OnlineTracTracBasedTest {
@@ -48,7 +50,7 @@ public class ManeuverDetectionOnMdM2011SemifinalTest extends OnlineTracTracBased
}
@Before
public void setUp() throws MalformedURLException, IOException, InterruptedException, URISyntaxException, ParseException {
public void setUp() throws MalformedURLException, IOException, InterruptedException, URISyntaxException, ParseException, SubscriberInitializationException, CreateModelException {
super.setUp();
super.setUp("event_20110505_SailingTea", // Semifinale
/* raceId */ "01ea3604-02ef-11e1-9efc-406186cbf87c", new ReceiverType[] { ReceiverType.MARKPASSINGS, ReceiverType.RACECOURSE, ReceiverType.RAWPOSITIONS });
@@ -0,0 +1,118 @@
package com.sap.sailing.domain.test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import static org.mockito.Matchers.anyObject;
import static org.mockito.Matchers.same;
import static org.mockito.Mockito.doCallRealMethod;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import org.junit.Before;
import org.junit.Test;
import com.sap.sailing.domain.base.Mark;
import com.sap.sailing.domain.base.impl.MarkImpl;
import com.sap.sailing.domain.common.TimePoint;
import com.sap.sailing.domain.common.impl.DegreeBearingImpl;
import com.sap.sailing.domain.common.impl.DegreePosition;
import com.sap.sailing.domain.common.impl.KnotSpeedWithBearingImpl;
import com.sap.sailing.domain.common.impl.MillisecondsTimePoint;
import com.sap.sailing.domain.tracking.DynamicTrackedRace;
import com.sap.sailing.domain.tracking.GPSFixMoving;
import com.sap.sailing.domain.tracking.impl.DynamicGPSFixTrackImpl;
import com.sap.sailing.domain.tracking.impl.DynamicTrackedRaceImpl;
import com.sap.sailing.domain.tracking.impl.GPSFixMovingImpl;
public class MarkPositionTimeFilterTest {
private DynamicTrackedRace trackedRace;
private MarkImpl m;
private DynamicGPSFixTrackImpl<Mark> track;
@Before
public void setUp() {
trackedRace = mock(DynamicTrackedRaceImpl.class);
m = new MarkImpl("Test Mark");
track = new DynamicGPSFixTrackImpl<Mark>(m, /* millisecondsOverWhichToAverage */ 5000);
when(trackedRace.getOrCreateTrack(m)).thenReturn(track);
doCallRealMethod().when(trackedRace).recordFix(same(m), (GPSFixMoving) anyObject());
}
@Test
public void generalSetupTest() {
assertSame(track, trackedRace.getOrCreateTrack(m));
}
@Test
public void testAddFixForMark() {
trackedRace.recordFix(m, new GPSFixMovingImpl(new DegreePosition(12, 13), MillisecondsTimePoint.now(),
new KnotSpeedWithBearingImpl(12, new DegreeBearingImpl(123))));
track.lockForRead();
try {
assertEquals(1, track.getRawFixes().size());
} finally {
track.unlockAfterRead();
}
}
@Test
public void testAddFixForMarkWithinTrackingTimeRange() {
TimePoint start = MillisecondsTimePoint.now();
TimePoint fix = start.plus(10000);
TimePoint end = fix.plus(10000);
when(trackedRace.getStartOfTracking()).thenReturn(start);
when(trackedRace.getEndOfTracking()).thenReturn(end);
trackedRace.recordFix(m, new GPSFixMovingImpl(new DegreePosition(12, 13), fix,
new KnotSpeedWithBearingImpl(12, new DegreeBearingImpl(123))));
track.lockForRead();
try {
assertEquals(1, track.getRawFixes().size());
} finally {
track.unlockAfterRead();
}
}
@Test
public void testAddFixForMarkOutsideTrackingTimeRange() {
TimePoint start = MillisecondsTimePoint.now();
TimePoint end = start.plus(10000);
TimePoint fix = end.plus(10000);
when(trackedRace.getStartOfTracking()).thenReturn(start);
when(trackedRace.getEndOfTracking()).thenReturn(end);
trackedRace.recordFix(m, new GPSFixMovingImpl(new DegreePosition(12, 13), fix,
new KnotSpeedWithBearingImpl(12, new DegreeBearingImpl(123))));
track.lockForRead();
try {
assertTrue(track.getRawFixes().isEmpty());
} finally {
track.unlockAfterRead();
}
}
@Test
public void testAddFixForMarkFirstOutsideTrackingTimeRangeThenWithin() {
TimePoint start = MillisecondsTimePoint.now();
TimePoint end = start.plus(10000);
TimePoint fix = end.plus(10000);
when(trackedRace.getStartOfTracking()).thenReturn(start);
when(trackedRace.getEndOfTracking()).thenReturn(end);
trackedRace.recordFix(m, new GPSFixMovingImpl(new DegreePosition(12, 13), fix,
new KnotSpeedWithBearingImpl(12, new DegreeBearingImpl(123))));
track.lockForRead();
try {
assertTrue(track.getRawFixes().isEmpty());
} finally {
track.unlockAfterRead();
}
when(trackedRace.getEndOfTracking()).thenReturn(fix.plus(10000));
trackedRace.recordFix(m, new GPSFixMovingImpl(new DegreePosition(12, 13), fix,
new KnotSpeedWithBearingImpl(12, new DegreeBearingImpl(123))));
track.lockForRead();
try {
assertEquals(1, track.getRawFixes().size());
} finally {
track.unlockAfterRead();
}
}
}
@@ -2,7 +2,6 @@ package com.sap.sailing.domain.test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotSame;
import static org.junit.Assert.assertSame;
import java.io.FileNotFoundException;
import java.io.IOException;
@@ -22,6 +21,8 @@ import com.sap.sailing.domain.tractracadapter.DomainFactory;
import com.sap.sailing.domain.tractracadapter.TracTracConnectionConstants;
import com.sap.sailing.domain.tractracadapter.TracTracRaceTracker;
import com.sap.sailing.domain.tractracadapter.impl.DomainFactoryImpl;
import com.tractrac.model.lib.api.event.CreateModelException;
import com.tractrac.subscription.lib.api.SubscriberInitializationException;
public class MultipleClassesInRegattaTest {
private static final boolean tractracTunnel = Boolean.valueOf(System.getProperty("tractrac.tunnel", "false"));
@@ -38,7 +39,7 @@ public class MultipleClassesInRegattaTest {
}
@Test
public void testLoadTwoRacesWithEqualEventNameButDifferentClasses() throws MalformedURLException, FileNotFoundException, URISyntaxException {
public void testLoadTwoRacesWithEqualEventNameButDifferentClasses() throws MalformedURLException, FileNotFoundException, URISyntaxException, CreateModelException, SubscriberInitializationException {
String httpAndHost = "http://" + TracTracConnectionConstants.HOST_NAME;
String liveURI = "tcp://" + TracTracConnectionConstants.HOST_NAME + ":" + TracTracConnectionConstants.PORT_LIVE;
String storedURI = "tcp://" + TracTracConnectionConstants.HOST_NAME + ":" + TracTracConnectionConstants.PORT_STORED;
@@ -55,31 +56,30 @@ public class MultipleClassesInRegattaTest {
httpAndHost+"/events/event_20110505_SailingTea/clientparams.php?event=event_20110505_SailingTea&race=cce678c8-97e6-11e0-9aed-406186cbf87c"),
new URI(liveURI), new URI(storedURI), new URI(courseDesignUpdateURI),
/* startOfTracking */ null, /* endOfTracking */ null, /* delayToLiveInMillis */ 0l, /* simulateWithStartTimeNow */ false,
EmptyRaceLogStore.INSTANCE, EmptyWindStore.INSTANCE, EmptyGPSFixStore.INSTANCE, tracTracUsername, tracTracPassword, TracTracConnectionConstants.ONLINE_STATUS, new DummyTrackedRegattaRegistry());
EmptyRaceLogStore.INSTANCE, EmptyWindStore.INSTANCE, EmptyGPSFixStore.INSTANCE, tracTracUsername, tracTracPassword, TracTracConnectionConstants.ONLINE_STATUS, TracTracConnectionConstants.ONLINE_VISIBILITY, new DummyTrackedRegattaRegistry());
kiwotest2 = domainFactory
.createRaceTracker(
new URL(
httpAndHost+"/events/event_20110505_SailingTea/clientparams.php?event=event_20110505_SailingTea&race=11290bd6-97e7-11e0-9aed-406186cbf87c"),
new URI(liveURI), new URI(storedURI), new URI(courseDesignUpdateURI),
/* startOfTracking */ null, /* endOfTracking */ null, /* delayToLiveInMillis */ 0l, /* simulateWithStartTimeNow */ false, EmptyRaceLogStore.INSTANCE, EmptyWindStore.INSTANCE, EmptyGPSFixStore.INSTANCE, tracTracUsername, tracTracPassword, TracTracConnectionConstants.ONLINE_STATUS, new DummyTrackedRegattaRegistry());
/* startOfTracking */ null, /* endOfTracking */ null, /* delayToLiveInMillis */ 0l, /* simulateWithStartTimeNow */ false, EmptyRaceLogStore.INSTANCE, EmptyWindStore.INSTANCE, EmptyGPSFixStore.INSTANCE, tracTracUsername, tracTracPassword, TracTracConnectionConstants.ONLINE_STATUS, TracTracConnectionConstants.ONLINE_VISIBILITY, new DummyTrackedRegattaRegistry());
kiwotest3 = domainFactory
.createRaceTracker(
new URL(
httpAndHost+"/events/event_20110505_SailingTea/clientparams.php?event=event_20110505_SailingTea&race=39635b24-97e7-11e0-9aed-406186cbf87c"),
new URI(liveURI), new URI(storedURI), new URI(courseDesignUpdateURI),
/* startOfTracking */ null, /* endOfTracking */ null, /* delayToLiveInMillis */ 0l, /* simulateWithStartTimeNow */ false, EmptyRaceLogStore.INSTANCE, EmptyWindStore.INSTANCE, EmptyGPSFixStore.INSTANCE, tracTracUsername, tracTracPassword, TracTracConnectionConstants.ONLINE_STATUS, new DummyTrackedRegattaRegistry());
/* startOfTracking */ null, /* endOfTracking */ null, /* delayToLiveInMillis */ 0l, /* simulateWithStartTimeNow */ false, EmptyRaceLogStore.INSTANCE, EmptyWindStore.INSTANCE, EmptyGPSFixStore.INSTANCE, tracTracUsername, tracTracPassword, TracTracConnectionConstants.ONLINE_STATUS, TracTracConnectionConstants.ONLINE_VISIBILITY, new DummyTrackedRegattaRegistry());
weym470may112014_2 = domainFactory
.createRaceTracker(
new URL(
httpAndHost+"/events/event_20110505_SailingTea/clientparams.php?event=event_20110505_SailingTea&race=04498426-7dfd-11e0-8236-406186cbf87c"),
new URI(liveURI), new URI(storedURI), new URI(courseDesignUpdateURI),
/* startOfTracking */ null, /* endOfTracking */ null, /* delayToLiveInMillis */ 0l, /* simulateWithStartTimeNow */ false, EmptyRaceLogStore.INSTANCE, EmptyWindStore.INSTANCE, EmptyGPSFixStore.INSTANCE, tracTracUsername, tracTracPassword, TracTracConnectionConstants.ONLINE_STATUS, new DummyTrackedRegattaRegistry());
/* startOfTracking */ null, /* endOfTracking */ null, /* delayToLiveInMillis */ 0l, /* simulateWithStartTimeNow */ false, EmptyRaceLogStore.INSTANCE, EmptyWindStore.INSTANCE, EmptyGPSFixStore.INSTANCE, tracTracUsername, tracTracPassword, TracTracConnectionConstants.ONLINE_STATUS, TracTracConnectionConstants.ONLINE_VISIBILITY, new DummyTrackedRegattaRegistry());
assertEquals("STG", kiwotest1.getRegatta().getBoatClass().getName());
assertEquals("505", kiwotest2.getRegatta().getBoatClass().getName());
assertEquals("49er", kiwotest3.getRegatta().getBoatClass().getName());
assertEquals("STG", weym470may112014_2.getRegatta().getBoatClass().getName());
assertSame(weym470may112014_2.getRegatta(), kiwotest1.getRegatta());
assertNotSame(kiwotest1.getRegatta(), kiwotest2.getRegatta());
assertNotSame(kiwotest1.getRegatta(), kiwotest3.getRegatta());
assertNotSame(kiwotest2.getRegatta(), kiwotest3.getRegatta());
@@ -92,9 +92,9 @@ public class OfflineSerializationTest extends AbstractSerializationTest {
DomainFactory receiverDomainFactory = new DomainFactoryImpl();
Event e = new EventImpl("Event Name", MillisecondsTimePoint.now(), MillisecondsTimePoint.now().plus(
Duration.ONE_DAY.times(10)), "At Home", /* is public */true, UUID.randomUUID());
LeaderboardGroup lg1 = new LeaderboardGroupImpl("LG1", "LG1 Description", /* displayGroupsInReverseOrder */ false, Collections.<Leaderboard> emptyList());
LeaderboardGroup lg1 = new LeaderboardGroupImpl("LG1", "LG1 Description", /* displayName */ null, /* displayGroupsInReverseOrder */ false, Collections.<Leaderboard> emptyList());
e.addLeaderboardGroup(lg1);
LeaderboardGroup lg2 = new LeaderboardGroupImpl("LG2", "LG2 Description", /* displayGroupsInReverseOrder */ false, Collections.<Leaderboard> emptyList());
LeaderboardGroup lg2 = new LeaderboardGroupImpl("LG2", "LG2 Description", /* displayName */ null, /* displayGroupsInReverseOrder */ false, Collections.<Leaderboard> emptyList());
e.addLeaderboardGroup(lg2);
Event deserialized = cloneBySerialization(e, receiverDomainFactory);
assertEquals(Util.size(e.getLeaderboardGroups()), Util.size(deserialized.getLeaderboardGroups()));
@@ -118,7 +118,7 @@ public class OfflineSerializationTest extends AbstractSerializationTest {
@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()));
LeaderboardGroup leaderboardGroup = new LeaderboardGroupImpl("LeaderboardGroup", "Test Leaderboard Group", /* displayGroupsInReverseOrder */ false, Arrays.asList(new Leaderboard[] { leaderboard }));
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(), new ThresholdBasedResultDiscardingRuleImpl(new int[0]));
leaderboardGroup.setOverallLeaderboard(overallLeaderboard);
final double FACTOR = 2.0;
@@ -39,7 +39,12 @@ import com.sap.sailing.domain.tractracadapter.Receiver;
import com.sap.sailing.domain.tractracadapter.ReceiverType;
import com.sap.sailing.domain.tractracadapter.TracTracConnectionConstants;
import com.sap.sailing.domain.tractracadapter.impl.DomainFactoryImpl;
import com.tractrac.clientmodule.Race;
import com.tractrac.model.lib.api.event.CreateModelException;
import com.tractrac.model.lib.api.event.IRace;
import com.tractrac.subscription.lib.api.SubscriberInitializationException;
import com.tractrac.subscription.lib.api.event.IConnectionStatusListener;
import com.tractrac.subscription.lib.api.event.ILiveDataEvent;
import com.tractrac.subscription.lib.api.event.IStoredDataEvent;
/**
* Connects to TracTrac data. Subclasses should implement a @Before method which calls
@@ -74,14 +79,14 @@ public abstract class OnlineTracTracBasedTest extends AbstractTracTracLiveTest {
@Before
public void setUp() throws MalformedURLException, IOException, InterruptedException, URISyntaxException, ParseException {
public void setUp() throws MalformedURLException, IOException, InterruptedException, URISyntaxException, ParseException, SubscriberInitializationException, CreateModelException {
domainFactory = new DomainFactoryImpl(new com.sap.sailing.domain.base.impl.DomainFactoryImpl());
// keep superclass implementation from automatically setting up for a Weymouth event and force subclasses
// to select a race
}
protected void setUp(String regattaName, String raceId, ReceiverType... receiverTypes) throws MalformedURLException,
IOException, InterruptedException, URISyntaxException {
IOException, InterruptedException, URISyntaxException, SubscriberInitializationException, CreateModelException {
setUpWithoutLaunchingController(regattaName, raceId);
finishSetUp(receiverTypes);
}
@@ -93,7 +98,7 @@ public abstract class OnlineTracTracBasedTest extends AbstractTracTracLiveTest {
}
protected void setUp(URL paramUrl, URI liveUri, URI storedUri, ReceiverType... receiverTypes)
throws MalformedURLException, IOException, InterruptedException, URISyntaxException {
throws MalformedURLException, IOException, InterruptedException, URISyntaxException, SubscriberInitializationException, CreateModelException {
setUpWithoutLaunchingController(paramUrl, liveUri, storedUri);
finishSetUp(receiverTypes);
}
@@ -102,17 +107,36 @@ public abstract class OnlineTracTracBasedTest extends AbstractTracTracLiveTest {
throws InterruptedException {
setStoredDataLoaded(false);
ArrayList<Receiver> receivers = new ArrayList<Receiver>();
for (Receiver r : domainFactory.getUpdateReceivers(trackedRegatta, getTracTracEvent(), EmptyWindStore.INSTANCE,
/* startOfTracking */null, /* endOfTracking */null, /* delayToLiveInMillis */0l, /* simulator */ null,
new DynamicRaceDefinitionSet() {
@Override
public void addRaceDefinition(RaceDefinition race, DynamicTrackedRace trackedRace) {
}
}, /* trackedRegattaRegistry */ null, /*courseDesignUpdateURI*/ null, /*tracTracUsername*/ null, /*tracTracPassword*/ null, receiverTypes)) {
for (Receiver r : domainFactory.getUpdateReceivers(trackedRegatta, getTracTracRace(), EmptyWindStore.INSTANCE, /* delayToLiveInMillis */0l, /* simulator */null, new DynamicRaceDefinitionSet() {
@Override
public void addRaceDefinition(RaceDefinition race, DynamicTrackedRace trackedRace) {
}
},
/* trackedRegattaRegistry */null,
/* courseDesignUpdateURI */null, /* tracTracUsername */null, null, /* tracTracPassword */
getEventSubscriber(), getRaceSubscriber(), receiverTypes)) {
receivers.add(r);
}
getRaceSubscriber().subscribeConnectionStatus(new IConnectionStatusListener() {
@Override
public void stopped(Object o) {}
@Override
public void gotStoredDataEvent(IStoredDataEvent storedDataEvent) {
if (storedDataEvent.getProgress() == 1.0) {
synchronized (semaphor) {
storedDataLoaded = true;
semaphor.notifyAll();
}
}
}
@Override
public void gotLiveDataEvent(ILiveDataEvent liveDataEvent) {}
});
addListenersForStoredDataAndStartController(receivers);
Race tractracRace = getTracTracEvent().getRaceList().iterator().next();
IRace tractracRace = getTracTracRace();
// we used to expect here that there is no RaceDefinition for the TracTrac race yet; however,
// loading the race from an .mtb file stored locally, things work so fast that the race arrives through
// a background thread (actually the RaceCourseReceiver) that it's initialized before we can check it here.
@@ -138,14 +162,13 @@ public abstract class OnlineTracTracBasedTest extends AbstractTracTracLiveTest {
trackedRace = getTrackedRegatta().getTrackedRace(race);
}
private void setStoredDataLoaded(boolean storedDataLoaded) {
this.storedDataLoaded = storedDataLoaded;
}
protected void setUpWithoutLaunchingController(String regattaName, String raceId) throws FileNotFoundException, MalformedURLException,
URISyntaxException {
URISyntaxException, SubscriberInitializationException, CreateModelException {
final URL paramUrl = new URL("http://" + TracTracConnectionConstants.HOST_NAME + "/events/"+regattaName+"/clientparams.php?event="+regattaName+"&race="+raceId);
final URI liveUri = tractracTunnel ? new URI("tcp://"+tractracTunnelHost+":"+TracTracConnectionConstants.PORT_TUNNEL_LIVE) : new URI("tcp://" + TracTracConnectionConstants.HOST_NAME + ":" + TracTracConnectionConstants.PORT_LIVE);
final URI storedUri = tractracTunnel ? new URI("tcp://"+tractracTunnelHost+":"+TracTracConnectionConstants.PORT_TUNNEL_STORED) : new URI("tcp://" + TracTracConnectionConstants.HOST_NAME + ":" + TracTracConnectionConstants.PORT_STORED);
@@ -154,12 +177,12 @@ public abstract class OnlineTracTracBasedTest extends AbstractTracTracLiveTest {
protected void setUpWithoutLaunchingController(final URL paramUrl, final URI liveUri, final URI storedUri)
throws FileNotFoundException, MalformedURLException {
throws FileNotFoundException, MalformedURLException, URISyntaxException, SubscriberInitializationException, CreateModelException {
super.setUp(paramUrl, liveUri, storedUri);
if (domainFactory == null) {
domainFactory = new DomainFactoryImpl(new com.sap.sailing.domain.base.impl.DomainFactoryImpl());
}
domainEvent = domainFactory.getOrCreateDefaultRegatta(EmptyRaceLogStore.INSTANCE, getTracTracEvent(), /* trackedRegattaRegistry */ null);
domainEvent = domainFactory.getOrCreateDefaultRegatta(EmptyRaceLogStore.INSTANCE, getTracTracRace(), /* trackedRegattaRegistry */ null);
trackedRegatta = new DynamicTrackedRegattaImpl(domainEvent);
}
@@ -217,18 +240,6 @@ public abstract class OnlineTracTracBasedTest extends AbstractTracTracLiveTest {
this.trackedRace = race;
}
/**
* When all stored data has been transmitted, notify the semaphor for tests to start processing
*/
@Override
public void storedDataEnd() {
super.storedDataEnd();
synchronized (semaphor) {
storedDataLoaded = true;
semaphor.notifyAll();
}
}
protected String getExpectedEventName() {
return "Kieler Woche";
}
@@ -22,6 +22,8 @@ import com.sap.sailing.domain.common.impl.MillisecondsTimePoint;
import com.sap.sailing.domain.common.impl.WindSourceImpl;
import com.sap.sailing.domain.tracking.impl.WindImpl;
import com.sap.sailing.domain.tractracadapter.ReceiverType;
import com.tractrac.model.lib.api.event.CreateModelException;
import com.tractrac.subscription.lib.api.SubscriberInitializationException;
public class PassingInstructionParserTest extends OnlineTracTracBasedTest {
@@ -30,7 +32,7 @@ public class PassingInstructionParserTest extends OnlineTracTracBasedTest {
}
@Before
public void setUp() throws MalformedURLException, IOException, InterruptedException, URISyntaxException, ParseException {
public void setUp() throws MalformedURLException, IOException, InterruptedException, URISyntaxException, ParseException, SubscriberInitializationException, CreateModelException {
super.setUp();
URI storedUri = new URI("file:///"+new File("resources/event_20131112_ESSFlorian-Race_1.mtb").getCanonicalPath().replace('\\', '/'));
super.setUp(new URL("file:///"+new File("resources/event_20131112_ESSFlorian-Race_1.txt").getCanonicalPath()),
@@ -9,13 +9,12 @@ import java.util.Collections;
import org.junit.Test;
import com.maptrack.client.io.TypeController;
import com.sap.sailing.domain.common.Position;
import com.sap.sailing.domain.tractracadapter.DomainFactory;
import com.sap.sailing.domain.tractracadapter.Receiver;
import com.tractrac.clientmodule.ControlPoint;
import com.tractrac.clientmodule.data.ControlPointPositionData;
import com.tractrac.clientmodule.data.ICallbackData;
import com.tractrac.model.lib.api.data.IPosition;
import com.tractrac.model.lib.api.route.IControl;
import com.tractrac.subscription.lib.api.control.IControlPointPositionListener;
public class PositionConversionTest extends AbstractTracTracLiveTest {
@@ -31,8 +30,8 @@ public class PositionConversionTest extends AbstractTracTracLiveTest {
@Test
public void testReceiptOfControlPointPosition() {
final ControlPoint[] firstTracked = new ControlPoint[1];
final ControlPointPositionData[] firstData = new ControlPointPositionData[1];
final IControl[] firstTracked = new IControl[1];
final IPosition[] firstData = new IPosition[1];
final Object semaphor = new Object();
Receiver receiver = new Receiver() {
@@ -40,27 +39,6 @@ public class PositionConversionTest extends AbstractTracTracLiveTest {
public void stopPreemptively() {
}
@Override
public Iterable<TypeController> getTypeControllersAndStart() {
TypeController listener = ControlPointPositionData.subscribe(getTracTracEvent(),
new ICallbackData<ControlPoint, ControlPointPositionData>() {
private boolean first = true;
public void gotData(ControlPoint tracked, ControlPointPositionData record,
boolean isLiveData) {
if (first) {
synchronized (semaphor) {
firstTracked[0] = tracked;
firstData[0] = record;
semaphor.notifyAll();
}
first = false;
}
}
}, /* fromTime */0 /* means ALL */, /* toTime */Long.MAX_VALUE);
return Collections.singleton(listener);
}
@Override
public void stopAfterProcessingQueuedEvents() {
}
@@ -76,6 +54,25 @@ public class PositionConversionTest extends AbstractTracTracLiveTest {
@Override
public void stopAfterNotReceivingEventsForSomeTime(long timeoutInMilliseconds) {
}
@Override
public void subscribe() {
getRaceSubscriber().subscribeControlPositions(new IControlPointPositionListener() {
private boolean first = true;
@Override
public void gotControlPointPosition(IControl control, IPosition position, int controlPointNumber) {
if (first) {
synchronized (semaphor) {
firstTracked[0] = control;
firstData[0] = position;
semaphor.notifyAll();
}
first = false;
}
}
});
}
};
addListenersForStoredDataAndStartController(Collections.singleton(receiver));
synchronized (semaphor) {
@@ -240,4 +240,56 @@ public class PositionTest {
assertEquals(p6.getDistanceToLine(p1, p4).getMeters(), p6.getDistance(p1).scale(-1).getMeters(), delta);
assertEquals(right.getDistanceToLine(p1, p6).getMeters(), right.getDistance(p1).getMeters(), delta);
}
@Test
public void testQuickApproximateDistance1() {
Position p1 = new DegreePosition(0, 0);
Position p2 = new DegreePosition(1, 0);
assertEquals(60., p1.getQuickApproximateNauticalMileDistance(p2), 0.001);
}
@Test
public void testQuickApproximateDistance2() {
Position p1 = new DegreePosition(0, 0);
Position p2 = new DegreePosition(0, 1);
assertEquals(60., p1.getQuickApproximateNauticalMileDistance(p2), 0.001);
}
@Test
public void testQuickApproximateDistanceDiagonalNearEquator() {
Position p1 = new DegreePosition(0, 0);
Position p2 = new DegreePosition(0.1, 0.1);
assertEquals(p1.getDistance(p2).getNauticalMiles(), p1.getQuickApproximateNauticalMileDistance(p2), 0.01 * p1.getDistance(p2).getNauticalMiles());
}
@Test
public void testQuickApproximateDistanceDiagonalFarFromEquator() {
Position p1 = new DegreePosition(49, 8);
Position p2 = new DegreePosition(50, 9);
assertEquals(p1.getDistance(p2).getNauticalMiles(), p1.getQuickApproximateNauticalMileDistance(p2), 0.01 * p1.getDistance(p2).getNauticalMiles());
}
@Test
public void testQuickApproximateLongDistanceDiagonalFarFromEquator() {
Position p1 = new DegreePosition(20, -4);
Position p2 = new DegreePosition(50, 9);
assertEquals(p1.getDistance(p2).getNauticalMiles(), p1.getQuickApproximateNauticalMileDistance(p2), 0.01 * p1.getDistance(p2).getNauticalMiles());
}
@Test
public void performanceComparisonQuickAndFullDistance() {
Position p1 = new DegreePosition(20, -4);
Position p2 = new DegreePosition(50, 9);
long startFull = System.currentTimeMillis();
int numberOfExecutions = 1000000;
for (int i=0; i<numberOfExecutions; i++) {
p1.getDistance(p2);
}
long endFull = System.currentTimeMillis();
for (int i=0; i<numberOfExecutions; i++) {
p1.getQuickApproximateNauticalMileDistance(p2);
}
long endQuick = System.currentTimeMillis();
System.out.println("Full: "+(endFull-startFull)+"ms; Quick: "+(endQuick-endFull)+"ms");
}
}
@@ -1,6 +1,5 @@
package com.sap.sailing.domain.test;
import static org.junit.Assert.assertNotSame;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;
@@ -11,7 +10,6 @@ import org.junit.Test;
import com.sap.sailing.domain.base.Fleet;
import com.sap.sailing.domain.base.RaceColumn;
import com.sap.sailing.domain.base.impl.FleetImpl;
import com.sap.sailing.domain.leaderboard.FlexibleLeaderboard;
import com.sap.sailing.domain.leaderboard.impl.FlexibleLeaderboardImpl;
import com.sap.sailing.domain.leaderboard.impl.LowPoint;
@@ -76,18 +74,15 @@ public class RaceLogAttachOnTrackedRaceTest {
}
@Test
public void testAttachSpecificFleets() {
Fleet[] fleets = new Fleet[] { new FleetImpl("A"), new FleetImpl("B") };
Fleet aFleet = fleets[0];
Fleet bFleet = fleets[1];
RaceColumn column = leaderboard.addRaceColumn("R1", false, fleets);
public void testAttachToDefaultFleet() {
RaceColumn column = leaderboard.addRaceColumn("R1", false);
TrackedRace trackedRace = new MyMockedTrackedRace();
column.setTrackedRace(aFleet, trackedRace);
Fleet defaultFleet = leaderboard.getFleet(null);
column.setTrackedRace(defaultFleet, trackedRace);
assertSame(column.getRaceLog(aFleet), trackedRace.getRaceLog(column.getRaceLogIdentifier(aFleet)));
assertNotSame(column.getRaceLog(bFleet), trackedRace.getRaceLog(column.getRaceIdentifier(bFleet)));
assertSame(column.getRaceLog(defaultFleet), trackedRace.getRaceLog(column.getRaceLogIdentifier(defaultFleet)));
}
@Test
@@ -48,11 +48,12 @@ import com.sap.sailing.domain.tracking.DynamicTrackedRace;
import com.sap.sailing.domain.tracking.MarkPassing;
import com.sap.sailing.domain.tracking.TrackedLeg;
import com.sap.sailing.domain.tracking.TrackedRegatta;
import com.sap.sailing.domain.tracking.WindPositionMode;
import com.sap.sailing.domain.tracking.impl.DynamicTrackedRaceImpl;
import com.sap.sailing.domain.tracking.impl.DynamicTrackedRegattaImpl;
import com.sap.sailing.domain.tracking.impl.EmptyWindStore;
import com.sap.sailing.domain.tracking.impl.GPSFixImpl;
import com.sap.sailing.domain.tracking.impl.GPSFixMovingImpl;
import com.sap.sailing.domain.tracking.impl.TrackedRegattaImpl;
import com.sap.sailing.domain.tracking.impl.WindImpl;
public class ReachingLegTest extends TrackBasedTest {
@@ -86,9 +87,9 @@ public class ReachingLegTest extends TrackBasedTest {
protected DynamicTrackedRace createTrackedRace(String regattaName, String raceName, String boatClassName,
Iterable<Competitor> competitors, TimePoint timePointForFixes) {
BoatClassImpl boatClass = new BoatClassImpl(boatClassName, /* typicallyStartsUpwind */ true);
Regatta regatta = new RegattaImpl(EmptyRaceLogStore.INSTANCE, regattaName, boatClass, /* trackedRegattaRegistry */ null,
Regatta regatta = new RegattaImpl(EmptyRaceLogStore.INSTANCE, RegattaImpl.getDefaultName(regattaName, boatClass.getName()), boatClass, /* trackedRegattaRegistry */ null,
DomainFactory.INSTANCE.createScoringScheme(ScoringSchemeType.LOW_POINT), "123", null);
TrackedRegatta trackedRegatta = new TrackedRegattaImpl(regatta);
TrackedRegatta trackedRegatta = new DynamicTrackedRegattaImpl(regatta);
List<Waypoint> waypoints = new ArrayList<Waypoint>();
// create a two-lap upwind/downwind course:
MarkImpl left = new MarkImpl("Left lee gate buoy");
@@ -190,8 +191,8 @@ public class ReachingLegTest extends TrackBasedTest {
assertEquals(0.,
getTrackedRace().getTrack(plattner).getEstimatedPosition(timePointInReaching, /* extrapolate */false)
.getDistance(windwardMarkPos).getMeters(), 0.00001);
Distance hungersDistanceToLeader = getTrackedRace().getWindwardDistanceToOverallLeader(hunger, timePointInReaching);
Distance plattnersDistanceToLeader = getTrackedRace().getWindwardDistanceToOverallLeader(plattner, timePointInReaching);
Distance hungersDistanceToLeader = getTrackedRace().getWindwardDistanceToOverallLeader(hunger, timePointInReaching, WindPositionMode.LEG_MIDDLE);
Distance plattnersDistanceToLeader = getTrackedRace().getWindwardDistanceToOverallLeader(plattner, timePointInReaching, WindPositionMode.LEG_MIDDLE);
assertEquals(0., hungersDistanceToLeader.getMeters(), 0.00001);
assertEquals(distanceOfReachingLeg.getMeters(), plattnersDistanceToLeader.getMeters(), 0.001);
}
@@ -220,8 +221,8 @@ public class ReachingLegTest extends TrackBasedTest {
assertEquals(0.,
getTrackedRace().getTrack(plattner).getEstimatedPosition(timePointInReaching, /* extrapolate */false)
.getDistance(windwardMarkPos).getMeters(), 0.00001);
Distance hungersDistanceToLeader = getTrackedRace().getWindwardDistanceToOverallLeader(hunger, timePointInReaching);
Distance plattnersDistanceToLeader = getTrackedRace().getWindwardDistanceToOverallLeader(plattner, timePointInReaching);
Distance hungersDistanceToLeader = getTrackedRace().getWindwardDistanceToOverallLeader(hunger, timePointInReaching, WindPositionMode.LEG_MIDDLE);
Distance plattnersDistanceToLeader = getTrackedRace().getWindwardDistanceToOverallLeader(plattner, timePointInReaching, WindPositionMode.LEG_MIDDLE);
assertEquals(0., hungersDistanceToLeader.getMeters(), 0.00001);
assertEquals(distanceOfReachingLeg.getMeters(), plattnersDistanceToLeader.getMeters(), 0.001);
}
@@ -250,8 +251,8 @@ public class ReachingLegTest extends TrackBasedTest {
assertEquals(0.,
getTrackedRace().getTrack(plattner).getEstimatedPosition(timePointInReaching, /* extrapolate */false)
.getDistance(windwardMarkPos).getMeters(), 0.00001);
Distance hungersDistanceToLeader = getTrackedRace().getWindwardDistanceToOverallLeader(hunger, timePointInReaching);
Distance plattnersDistanceToLeader = getTrackedRace().getWindwardDistanceToOverallLeader(plattner, timePointInReaching);
Distance hungersDistanceToLeader = getTrackedRace().getWindwardDistanceToOverallLeader(hunger, timePointInReaching, WindPositionMode.LEG_MIDDLE);
Distance plattnersDistanceToLeader = getTrackedRace().getWindwardDistanceToOverallLeader(plattner, timePointInReaching, WindPositionMode.LEG_MIDDLE);
assertEquals(0., hungersDistanceToLeader.getMeters(), 0.00001);
assertEquals(distanceOfReachingLeg.getMeters(), plattnersDistanceToLeader.getMeters(), 0.001);
}
@@ -285,8 +286,8 @@ public class ReachingLegTest extends TrackBasedTest {
assertEquals(0.,
getTrackedRace().getTrack(plattner).getEstimatedPosition(timePointToConsider, /* extrapolate */false)
.getDistance(leewardPos).getMeters(), 0.00001);
Distance hungersDistanceToLeader = getTrackedRace().getWindwardDistanceToOverallLeader(hunger, timePointToConsider);
Distance plattnersDistanceToLeader = getTrackedRace().getWindwardDistanceToOverallLeader(plattner, timePointToConsider);
Distance hungersDistanceToLeader = getTrackedRace().getWindwardDistanceToOverallLeader(hunger, timePointToConsider, WindPositionMode.LEG_MIDDLE);
Distance plattnersDistanceToLeader = getTrackedRace().getWindwardDistanceToOverallLeader(plattner, timePointToConsider, WindPositionMode.LEG_MIDDLE);
assertEquals(0., hungersDistanceToLeader.getMeters(), 0.00001);
assertEquals(distanceOfReachingLeg.getMeters()+windwardDistanceOfUpwindLeg.getMeters(), plattnersDistanceToLeader.getMeters(), 0.001);
}
@@ -329,8 +330,8 @@ public class ReachingLegTest extends TrackBasedTest {
assertEquals(0.,
getTrackedRace().getTrack(plattner).getEstimatedPosition(timePointToConsider, /* extrapolate */false)
.getDistance(leewardPos).getMeters(), 0.00001);
Distance schomaekersDistanceToLeader = getTrackedRace().getWindwardDistanceToOverallLeader(schomaeker, timePointToConsider);
Distance plattnersDistanceToLeader = getTrackedRace().getWindwardDistanceToOverallLeader(plattner, timePointToConsider);
Distance schomaekersDistanceToLeader = getTrackedRace().getWindwardDistanceToOverallLeader(schomaeker, timePointToConsider, WindPositionMode.LEG_MIDDLE);
Distance plattnersDistanceToLeader = getTrackedRace().getWindwardDistanceToOverallLeader(plattner, timePointToConsider, WindPositionMode.LEG_MIDDLE);
assertEquals(0., schomaekersDistanceToLeader.getMeters(), 0.00001);
// distance to leading Schomaeker expected to be the entire upwind distance plus the offset distance plus half the downwind
assertEquals(distanceOfReachingLeg.getMeters()+windwardDistanceOfUpwindLeg.getMeters()*1.5, plattnersDistanceToLeader.getMeters(), 0.001);
@@ -370,7 +371,7 @@ public class ReachingLegTest extends TrackBasedTest {
getTrackedRace().getTrack(plattner).getEstimatedPosition(timePointToConsider, /* extrapolate */
false)).getMeters(), 0.00001);
// however, projected onto the leg their distance should be 0
Distance plattnersDistanceToLeader = getTrackedRace().getWindwardDistanceToOverallLeader(plattner, timePointToConsider);
Distance plattnersDistanceToLeader = getTrackedRace().getWindwardDistanceToOverallLeader(plattner, timePointToConsider, WindPositionMode.LEG_MIDDLE);
assertEquals(0., plattnersDistanceToLeader.getMeters(), 0.00001);
}
}
@@ -6,13 +6,11 @@ import static org.junit.Assert.assertTrue;
import java.net.MalformedURLException;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.junit.Before;
import org.junit.Test;
import com.maptrack.client.io.TypeController;
import com.sap.sailing.domain.base.RaceDefinition;
import com.sap.sailing.domain.base.Waypoint;
import com.sap.sailing.domain.racelog.impl.EmptyRaceLogStore;
@@ -25,14 +23,15 @@ import com.sap.sailing.domain.tractracadapter.DomainFactory;
import com.sap.sailing.domain.tractracadapter.Receiver;
import com.sap.sailing.domain.tractracadapter.ReceiverType;
import com.sap.sailing.domain.tractracadapter.impl.ControlPointAdapter;
import com.tractrac.clientmodule.Race;
import com.tractrac.clientmodule.RaceCompetitor;
import com.tractrac.clientmodule.data.ICallbackData;
import com.tractrac.clientmodule.data.MarkPassingsData;
import com.tractrac.model.lib.api.data.IControlPassing;
import com.tractrac.model.lib.api.data.IControlPassings;
import com.tractrac.model.lib.api.event.IRace;
import com.tractrac.model.lib.api.event.IRaceCompetitor;
import com.tractrac.subscription.lib.api.control.IControlPassingsListener;
public class ReceiveMarkPassingDataTest extends AbstractTracTracLiveTest {
final private Object semaphor = new Object();
final private MarkPassingsData[] firstData = new MarkPassingsData[1];
final private IControlPassings[] firstData = new IControlPassings[1];
private RaceDefinition raceDefinition;
public ReceiveMarkPassingDataTest() throws URISyntaxException,
@@ -48,30 +47,8 @@ public class ReceiveMarkPassingDataTest extends AbstractTracTracLiveTest {
*/
@Before
public void setupListener() {
final Race race = getTracTracEvent().getRaceList().iterator().next();
final IRace race = getTracTracRace();
Receiver receiver = new Receiver() {
@Override
public Iterable<TypeController> getTypeControllersAndStart() {
final TypeController[] markPassingsListener = new TypeController[1];
markPassingsListener[0] = MarkPassingsData.subscribe(race,
new ICallbackData<RaceCompetitor, MarkPassingsData>() {
private boolean first = true;
@Override
public void gotData(RaceCompetitor route, MarkPassingsData record, boolean isLiveData) {
if (first) {
synchronized (semaphor) {
firstData[0] = record;
semaphor.notifyAll();
getController().remove(markPassingsListener[0]);
}
first = false;
}
}
});
return Collections.singleton(markPassingsListener[0]);
}
@Override
public void stopPreemptively() {
}
@@ -91,17 +68,41 @@ public class ReceiveMarkPassingDataTest extends AbstractTracTracLiveTest {
@Override
public void stopAfterNotReceivingEventsForSomeTime(long timeoutInMilliseconds) {
}
@Override
public void subscribe() {
getRaceSubscriber().subscribeControlPassings(new IControlPassingsListener() {
private boolean first = true;
@Override
public void gotControlPassings(IRaceCompetitor raceCompetitor, IControlPassings controlPassings) {
if (first) {
synchronized (semaphor) {
firstData[0] = controlPassings;
semaphor.notifyAll();
getRaceSubscriber().unsubscribeControlPassings(this);
}
first = false;
}
}
});
}
};
List<Receiver> receivers = new ArrayList<Receiver>();
receivers.add(receiver);
for (Receiver r : DomainFactory.INSTANCE.getUpdateReceivers(
new DynamicTrackedRegattaImpl(DomainFactory.INSTANCE.getOrCreateDefaultRegatta(EmptyRaceLogStore.INSTANCE, getTracTracEvent(), /* trackedRegattaRegistry */ null)),
getTracTracEvent(), EmptyWindStore.INSTANCE, /* startOfTracking */ null, /* endOfTracking */ null, /* delayToLiveInMillis */ 0l,
/* simulator */ null, new DynamicRaceDefinitionSet() {
new DynamicTrackedRegattaImpl(DomainFactory.INSTANCE.getOrCreateDefaultRegatta(
EmptyRaceLogStore.INSTANCE, getTracTracRace(), /* trackedRegattaRegistry */null)),
getTracTracEvent().getRaces().iterator().next(), EmptyWindStore.INSTANCE, /* delayToLiveInMillis */ 0l,
/* simulator */null,
new DynamicRaceDefinitionSet() {
@Override
public void addRaceDefinition(RaceDefinition race, DynamicTrackedRace trackedRace) {}
},
/* trackedRegattaRegistry */ null, /*courseDesignUpdateURI*/ null, /*tracTracUsername*/ null, /*tracTracPassword*/ null, ReceiverType.RACECOURSE, ReceiverType.MARKPOSITIONS, ReceiverType.RACESTARTFINISH, ReceiverType.RAWPOSITIONS)) {
public void addRaceDefinition(RaceDefinition race, DynamicTrackedRace trackedRace) {
}
}, /* trackedRegattaRegistry */null,
/* courseDesignUpdateURI */null, /* tracTracUsername */null, null, /* tracTracPassword */
getEventSubscriber(), getRaceSubscriber(), ReceiverType.RACECOURSE, ReceiverType.MARKPOSITIONS, ReceiverType.RACESTARTFINISH,
ReceiverType.RAWPOSITIONS)) {
receivers.add(r);
}
addListenersForStoredDataAndStartController(receivers);
@@ -132,14 +133,14 @@ public class ReceiveMarkPassingDataTest extends AbstractTracTracLiveTest {
}
assertNotNull(firstData[0]);
assertTrue(firstData[0].getPassings().size() > 0);
MarkPassingsData.Entry entry = firstData[0].getPassings().iterator().next();
IControlPassing entry = firstData[0].getPassings().iterator().next();
assertNotNull(entry);
// we expect to find the mark passings in order, so as we traverse the course for
// its waypoints and compare their control points to the control point received,
// the first waypoint is used
boolean found = false;
for (Waypoint waypoint : raceDefinition.getCourse().getWaypoints()) {
if (waypoint.getControlPoint() == DomainFactory.INSTANCE.getOrCreateControlPoint(new ControlPointAdapter(entry.getControlPoint()))) {
if (waypoint.getControlPoint() == DomainFactory.INSTANCE.getOrCreateControlPoint(new ControlPointAdapter(entry.getControl()))) {
found = true;
}
}
@@ -4,13 +4,10 @@ import static org.junit.Assert.assertNotNull;
import java.net.MalformedURLException;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.List;
import org.junit.Before;
import org.junit.Test;
import com.maptrack.client.io.TypeController;
import com.sap.sailing.domain.base.Competitor;
import com.sap.sailing.domain.base.RaceDefinition;
import com.sap.sailing.domain.base.Regatta;
@@ -65,8 +62,7 @@ public class ReceiveTrackingDataTest extends AbstractTracTracLiveTest {
}
}
};
List<TypeController> listeners = new ArrayList<TypeController>();
Regatta regatta = domainFactory.getOrCreateDefaultRegatta(EmptyRaceLogStore.INSTANCE, getTracTracEvent(), /* trackedRegattaRegistry */ null);
Regatta regatta = domainFactory.getOrCreateDefaultRegatta(EmptyRaceLogStore.INSTANCE, getTracTracRace(), /* trackedRegattaRegistry */ null);
DynamicTrackedRegatta trackedRegatta = new DynamicTrackedRegattaImpl(regatta);
trackedRegatta.addRaceListener(new RaceListener() {
@Override
@@ -78,24 +74,27 @@ public class ReceiveTrackingDataTest extends AbstractTracTracLiveTest {
public void raceRemoved(TrackedRace trackedRace) {
}
});
for (Receiver receiver : domainFactory.getUpdateReceivers(trackedRegatta, getTracTracEvent(), /* start of tracking */ null,
/* end of tracking */null, /* delayToLiveInMillis */0l, /* simulator */ null,
EmptyWindStore.INSTANCE, new DynamicRaceDefinitionSet() {
@Override
public void addRaceDefinition(RaceDefinition race, DynamicTrackedRace trackedRace) {
}
}, /* trackedRegattaRegistry */ null, /*courseDesignUpdateURI*/ null, /*tracTracUsername*/ null, /*tracTracPassword*/ null)) {
for (TypeController raceListener : receiver.getTypeControllersAndStart()) {
listeners.add(raceListener);
}
for (Receiver receiver : domainFactory
.getUpdateReceivers(trackedRegatta, /* delayToLiveInMillis */0l,
/* simulator */null, EmptyWindStore.INSTANCE, new DynamicRaceDefinitionSet() {
@Override
public void addRaceDefinition(RaceDefinition race, DynamicTrackedRace trackedRace) {
}
},
/* trackedRegattaRegistry */null, getTracTracRace(), null, /* courseDesignUpdateURI */
/* tracTracUsername */null, /* tracTracPassword */null, getEventSubscriber(), getRaceSubscriber())) {
receiver.subscribe();
getRaceSubscriber().start();
}
addListenersForStoredDataAndStartController(domainFactory.getUpdateReceivers(trackedRegatta, getTracTracEvent(),
/* start of tracking */null, /* end of tracking */null, /* delayToLiveInMillis */0l, /* simulateWithStartTimeNow */
/* simulator */ null, EmptyWindStore.INSTANCE, new DynamicRaceDefinitionSet() {
@Override
public void addRaceDefinition(RaceDefinition race, DynamicTrackedRace trackedRace) {
}
}, /* trackedRegattaRegistry */ null, /*courseDesignUpdateURI*/ null, /*tracTracUsername*/ null, /*tracTracPassword*/ null));
addListenersForStoredDataAndStartController(domainFactory
.getUpdateReceivers(trackedRegatta, /* delayToLiveInMillis */0l, null, /* simulator */
EmptyWindStore.INSTANCE, /* simulateWithStartTimeNow */
new DynamicRaceDefinitionSet() {
@Override
public void addRaceDefinition(RaceDefinition race, DynamicTrackedRace trackedRace) {
}
}, /* trackedRegattaRegistry */null, getTracTracRace(), null, /* courseDesignUpdateURI */
/* tracTracUsername */null, /* tracTracPassword */null, getEventSubscriber(), getRaceSubscriber()));
}
@Test
@@ -9,14 +9,12 @@ import java.util.Collections;
import org.junit.Test;
import com.maptrack.client.io.TypeController;
import com.sap.sailing.domain.base.Course;
import com.sap.sailing.domain.tractracadapter.DomainFactory;
import com.sap.sailing.domain.tractracadapter.Receiver;
import com.tractrac.model.lib.api.route.IControlRoute;
import com.sap.sse.common.Util;
import com.tractrac.clientmodule.Route;
import com.tractrac.clientmodule.data.ICallbackData;
import com.tractrac.clientmodule.data.RouteData;
import com.tractrac.subscription.lib.api.control.IControlRouteChangeListener;
public class RouteAssemblyTest extends AbstractTracTracLiveTest {
@@ -27,8 +25,7 @@ public class RouteAssemblyTest extends AbstractTracTracLiveTest {
@Test
public void testReceiveRouteData() {
final Route[] firstRoute = new Route[1];
final RouteData[] firstData = new RouteData[1];
final IControlRoute[] firstRoute = new IControlRoute[1];
final Object semaphor = new Object();
Receiver receiver = new Receiver() {
@@ -36,29 +33,6 @@ public class RouteAssemblyTest extends AbstractTracTracLiveTest {
public void stopPreemptively() {
}
@Override
public Iterable<TypeController> getTypeControllersAndStart() {
final TypeController routeListener[] = new TypeController[1];
routeListener[0] = RouteData.subscribe(getTracTracEvent().getRaceList().iterator().next(),
new ICallbackData<Route, RouteData>() {
private boolean first = true;
@Override
public void gotData(Route route, RouteData record, boolean isLiveData) {
if (first) {
synchronized (semaphor) {
firstRoute[0] = route;
firstData[0] = record;
semaphor.notifyAll();
getController().remove(routeListener[0]);
}
first = false;
}
}
});
return Collections.singleton(routeListener[0]);
}
@Override
public void stopAfterProcessingQueuedEvents() {
}
@@ -74,6 +48,25 @@ public class RouteAssemblyTest extends AbstractTracTracLiveTest {
@Override
public void stopAfterNotReceivingEventsForSomeTime(long timeoutInMilliseconds) {
}
@Override
public void subscribe() {
getRaceSubscriber().subscribeRouteChanges(new IControlRouteChangeListener() {
private boolean first = true;
@Override
public void gotRouteChange(IControlRoute controlRoute, long timeStamp) {
if (first) {
synchronized (semaphor) {
firstRoute[0] = controlRoute;
semaphor.notifyAll();
getRaceSubscriber().unsubscribeRouteChanges(this);
}
first = false;
}
}
});
}
};
addListenersForStoredDataAndStartController(Collections.singleton(receiver));
synchronized (semaphor) {
@@ -87,8 +80,7 @@ public class RouteAssemblyTest extends AbstractTracTracLiveTest {
}
}
assertNotNull(firstRoute[0]);
assertNotNull(firstData[0]);
Course course = DomainFactory.INSTANCE.createCourse(firstRoute[0].getName(), getTracTracControlPointsWithPassingInstructions(firstData[0].getPoints()));
Course course = DomainFactory.INSTANCE.createCourse(firstRoute[0].getName(), getTracTracControlPointsWithPassingInstructions(firstRoute[0].getControls()));
assertNotNull(course);
assertEquals("windward-leeward training", course.getName());
assertEquals(3, Util.size(course.getWaypoints()));
@@ -29,7 +29,9 @@ import com.sap.sailing.domain.tracking.DynamicGPSFixTrack;
import com.sap.sailing.domain.tracking.GPSFixMoving;
import com.sap.sailing.domain.tracking.impl.WindImpl;
import com.sap.sailing.domain.tractracadapter.ReceiverType;
import com.tractrac.model.lib.api.event.CreateModelException;
import com.sap.sse.common.Util;
import com.tractrac.subscription.lib.api.SubscriberInitializationException;
public class SerializationWithOnlineRaceTest extends OnlineTracTracBasedTest {
public SerializationWithOnlineRaceTest() throws MalformedURLException, URISyntaxException {
@@ -37,7 +39,7 @@ public class SerializationWithOnlineRaceTest extends OnlineTracTracBasedTest {
}
@Before
public void setUp() throws URISyntaxException, IOException, InterruptedException, ParseException {
public void setUp() throws URISyntaxException, IOException, InterruptedException, ParseException, SubscriberInitializationException, CreateModelException {
super.setUp();
URI storedUri = new URI("file:///"+new File("resources/event_20110609_KielerWoch-505_Race_2.mtb").getCanonicalPath().replace('\\', '/'));
super.setUp(new URL("file:///"+new File("resources/event_20110609_KielerWoch-505_Race_2.txt").getCanonicalPath()),
@@ -19,6 +19,7 @@ import com.sap.sailing.util.SmartFutureCache;
import com.sap.sailing.util.SmartFutureCache.EmptyUpdateInterval;
import com.sap.sailing.util.impl.LockUtil;
import com.sap.sailing.util.impl.NamedReentrantReadWriteLock;
import com.sap.sse.common.Util;
/**
* When the thread reading a value from the cache holds a fair read lock, and another thread is trying to obtain the
@@ -88,15 +89,15 @@ public class SmartFutureCacheDeadlockTest {
@Test
public void testBasicLockingAndUnlockingWithScripts() throws InterruptedException {
logger.info("starting testBasicLockingAndUnlockingWithScripts");
assertFalse(lock.getReaders().contains(readerThread));
assertFalse(Util.contains(lock.getReaders(), readerThread));
try {
reader.performAndWait(Command.LOCK_FOR_READ);
assertTrue(lock.getReaders().contains(readerThread));
assertTrue(Util.contains(lock.getReaders(), readerThread));
writer.perform(Command.LOCK_FOR_WRITE);
assertNull(lock.getWriter());
} finally {
reader.performAndWait(Command.UNLOCK_AFTER_READ);
assertFalse(lock.getReaders().contains(readerThread));
assertFalse(Util.contains(lock.getReaders(), readerThread));
writer.performAndWait(Command.UNLOCK_AFTER_WRITE);
}
}
@@ -195,7 +196,7 @@ public class SmartFutureCacheDeadlockTest {
writerThread.join();
assertFalse(reader.isRunning());
assertFalse(writer.isRunning());
assertTrue(lock.getReaders().isEmpty());
assertTrue(Util.isEmpty(lock.getReaders()));
assertNull(lock.getWriter());
}
@@ -24,6 +24,8 @@ import com.sap.sailing.domain.common.impl.WindSourceImpl;
import com.sap.sailing.domain.tracking.TrackedLegOfCompetitor;
import com.sap.sailing.domain.tracking.impl.WindImpl;
import com.sap.sailing.domain.tractracadapter.ReceiverType;
import com.tractrac.model.lib.api.event.CreateModelException;
import com.tractrac.subscription.lib.api.SubscriberInitializationException;
public class TimeInLegProgressesTest extends OnlineTracTracBasedTest {
public TimeInLegProgressesTest() throws MalformedURLException, URISyntaxException {
@@ -31,7 +33,7 @@ public class TimeInLegProgressesTest extends OnlineTracTracBasedTest {
}
@Before
public void setUp() throws URISyntaxException, IOException, InterruptedException, ParseException {
public void setUp() throws URISyntaxException, IOException, InterruptedException, ParseException, SubscriberInitializationException, CreateModelException {
super.setUp();
URI storedUri = new URI("file:///"+new File("resources/event_20110609_KielerWoch-505_Race_2.mtb").getCanonicalPath().replace('\\', '/'));
super.setUp(new URL("file:///"+new File("resources/event_20110609_KielerWoch-505_Race_2.txt").getCanonicalPath()),
@@ -0,0 +1,51 @@
package com.sap.sailing.domain.test;
import static org.junit.Assert.fail;
import java.util.Timer;
import java.util.TimerTask;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.Timeout;
/**
* Tests around the Timer class; e.g., does it kill a timer if a task throws an exception?
*
* @author Axel Uhl (d043530)
*
*/
public class TimerTest {
@Rule
public Timeout AbstractTracTracLiveTestTimeout = new Timeout(10 * 1000);
@Test
public void exceptionInTask() throws InterruptedException {
Timer t = new Timer("Test");
final TimerTask taskThrowingException = new TimerTask() {
@Override
public void run() {
throw new RuntimeException("An exception that may or may not kill the timer");
}
};
t.schedule(taskThrowingException, 1l);
try {
for (int i = 0; i < 100; i++) {
Thread.sleep(10);
final boolean[] result = new boolean[1];
t.schedule(new TimerTask() {
@Override
public void run() {
synchronized (result) {
result[0] = true;
result.notifyAll();
}
}
}, 1l);
}
fail("Expected IllegalStateException because task terminating abnormally cancels the timer");
} catch (IllegalStateException e) {
// expected
}
}
}
@@ -4,6 +4,7 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.UUID;
import com.sap.sailing.domain.base.Competitor;
import com.sap.sailing.domain.base.ControlPoint;
@@ -41,10 +42,10 @@ import com.sap.sailing.domain.tracking.DynamicTrackedRace;
import com.sap.sailing.domain.tracking.MarkPassing;
import com.sap.sailing.domain.tracking.TrackedRegatta;
import com.sap.sailing.domain.tracking.impl.DynamicTrackedRaceImpl;
import com.sap.sailing.domain.tracking.impl.DynamicTrackedRegattaImpl;
import com.sap.sailing.domain.tracking.impl.EmptyWindStore;
import com.sap.sailing.domain.tracking.impl.GPSFixImpl;
import com.sap.sailing.domain.tracking.impl.MarkPassingImpl;
import com.sap.sailing.domain.tracking.impl.TrackedRegattaImpl;
import com.sap.sailing.domain.tracking.impl.WindImpl;
public abstract class TrackBasedTest {
@@ -59,7 +60,7 @@ public abstract class TrackBasedTest {
}
public static CompetitorImpl createCompetitor(String competitorName) {
return new CompetitorImpl(123, competitorName, Color.RED, new TeamImpl("STG", Collections.singleton(
return new CompetitorImpl(UUID.randomUUID(), competitorName, Color.RED, new TeamImpl("STG", Collections.singleton(
new PersonImpl(competitorName, new NationalityImpl("GER"),
/* dateOfBirth */null, "This is famous " + competitorName)), new PersonImpl("Rigo van Maas",
new NationalityImpl("NED"),
@@ -96,9 +97,9 @@ public abstract class TrackBasedTest {
public static DynamicTrackedRace createTestTrackedRace(String regattaName, String raceName, String boatClassName,
Iterable<Competitor> competitors, TimePoint timePointForFixes) {
BoatClassImpl boatClass = new BoatClassImpl(boatClassName, /* typicallyStartsUpwind */ true);
Regatta regatta = new RegattaImpl(EmptyRaceLogStore.INSTANCE, regattaName, boatClass, /* trackedRegattaRegistry */ null,
Regatta regatta = new RegattaImpl(EmptyRaceLogStore.INSTANCE, RegattaImpl.getDefaultName(regattaName, boatClass.getName()), boatClass, /* trackedRegattaRegistry */ null,
DomainFactory.INSTANCE.createScoringScheme(ScoringSchemeType.LOW_POINT), "123", null);
TrackedRegatta trackedRegatta = new TrackedRegattaImpl(regatta);
TrackedRegatta trackedRegatta = new DynamicTrackedRegattaImpl(regatta);
List<Waypoint> waypoints = new ArrayList<Waypoint>();
// create a two-lap upwind/downwind course:
MarkImpl left = new MarkImpl("Left lee gate buoy");
@@ -26,6 +26,7 @@ import com.sap.sailing.domain.base.Boat;
import com.sap.sailing.domain.base.Timed;
import com.sap.sailing.domain.base.impl.BoatClassImpl;
import com.sap.sailing.domain.base.impl.BoatImpl;
import com.sap.sailing.domain.common.AbstractBearing;
import com.sap.sailing.domain.common.Bearing;
import com.sap.sailing.domain.common.Distance;
import com.sap.sailing.domain.common.Position;
@@ -43,6 +44,7 @@ import com.sap.sailing.domain.tracking.DynamicGPSFixTrack;
import com.sap.sailing.domain.tracking.GPSFix;
import com.sap.sailing.domain.tracking.GPSFixMoving;
import com.sap.sailing.domain.tracking.GPSFixTrack;
import com.sap.sailing.domain.tracking.impl.CompactGPSFixMovingImpl;
import com.sap.sailing.domain.tracking.impl.DistanceCache;
import com.sap.sailing.domain.tracking.impl.DynamicGPSFixMovingTrackImpl;
import com.sap.sailing.domain.tracking.impl.DynamicGPSFixTrackImpl;
@@ -852,7 +854,7 @@ public class TrackTest {
true), null), /* millisecondsOverWhichToAverage */5000, /* no smoothening */null);
TimePoint now1 = MillisecondsTimePoint.now();
TimePoint now2 = addMillisToTimepoint(now1, 1000); // 1s
DegreeBearingImpl bearing = new DegreeBearingImpl(90);
AbstractBearing bearing = new DegreeBearingImpl(90);
Position position1 = new DegreePosition(1, 2);
Position position2 = position1.translateGreatCircle(bearing, new MeterDistance(1));
GPSFixMovingImpl myGpsFix1 = new GPSFixMovingImpl(position1, now1, new MeterPerSecondSpeedWithDegreeBearingImpl(1, bearing));
@@ -873,7 +875,7 @@ public class TrackTest {
true), null), /* millisecondsOverWhichToAverage */5000, /* no smoothening */null);
TimePoint now1 = MillisecondsTimePoint.now();
TimePoint now2 = addMillisToTimepoint(now1, 1000); // 1s
DegreeBearingImpl bearing = new DegreeBearingImpl(90);
AbstractBearing bearing = new DegreeBearingImpl(90);
Position position1 = new DegreePosition(1, 2);
Position position2 = position1.translateGreatCircle(bearing, new MeterDistance(1));
GPSFixMovingImpl myGpsFix1 = new GPSFixMovingImpl(position1, now1, new MeterPerSecondSpeedWithDegreeBearingImpl(10, bearing));
@@ -894,7 +896,7 @@ public class TrackTest {
true), null), /* millisecondsOverWhichToAverage */5000, /* no smoothening */null);
TimePoint now1 = MillisecondsTimePoint.now();
TimePoint now2 = addMillisToTimepoint(now1, 1000); // 1s
DegreeBearingImpl bearing = new DegreeBearingImpl(90);
AbstractBearing bearing = new DegreeBearingImpl(90);
Position position1 = new DegreePosition(1, 2);
Position position2 = position1.translateGreatCircle(bearing, new MeterDistance(1));
GPSFixMovingImpl myGpsFix1 = new GPSFixMovingImpl(position1, now1, new MeterPerSecondSpeedWithDegreeBearingImpl(0.1, bearing));
@@ -1053,4 +1055,33 @@ public class TrackTest {
assertEquals(3, track.getAverageIntervalBetweenFixes().asMillis());
assertEquals(3, track.getAverageIntervalBetweenRawFixes().asMillis());
}
@Test
public void testEstimatedSpeedCaching() {
GPSFixMoving originalFix = new GPSFixMovingImpl(new DegreePosition(12, 34), MillisecondsTimePoint.now(),
new KnotSpeedWithBearingImpl(9, new DegreeBearingImpl(123)));
GPSFixMoving fix = new CompactGPSFixMovingImpl(originalFix);
assertFalse(fix.isEstimatedSpeedCached());
final KnotSpeedWithBearingImpl estimatedSpeed = new KnotSpeedWithBearingImpl(9.1, new DegreeBearingImpl(124));
fix.cacheEstimatedSpeed(estimatedSpeed);
assertTrue(fix.isEstimatedSpeedCached());
SpeedWithBearing cachedEstimatedSpeed = fix.getCachedEstimatedSpeed();
assertEquals(estimatedSpeed, cachedEstimatedSpeed);
fix.invalidateEstimatedSpeedCache();
assertFalse(fix.isEstimatedSpeedCached());
}
@Test
public void testEstimatedSpeedCachingOnTrack() {
GPSFixMoving compactFix3 = track.getFirstFixAtOrAfter(gpsFix3.getTimePoint());
assertFalse(compactFix3.isEstimatedSpeedCached());
SpeedWithBearing fix3EstimatedSpeed = track.getEstimatedSpeed(gpsFix3.getTimePoint());
assertTrue(compactFix3.isEstimatedSpeedCached());
assertEquals(fix3EstimatedSpeed, compactFix3.getCachedEstimatedSpeed());
assertEquals(fix3EstimatedSpeed, track.getEstimatedSpeed(gpsFix3.getTimePoint())); // fetch again from the cache
// assuming that all test fixes are within a few milliseconds and the averaging interval is much larger than that,
// adding a single fix in the middle should invalidate the cache
track.add(new GPSFixMovingImpl(gpsFix3.getPosition(), gpsFix3.getTimePoint().plus(1), gpsFix3.getSpeed()));
assertFalse(compactFix3.isEstimatedSpeedCached());
}
}
@@ -0,0 +1,99 @@
package com.sap.sailing.domain.test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import java.util.Arrays;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Matchers;
import com.sap.sailing.domain.base.Course;
import com.sap.sailing.domain.base.Mark;
import com.sap.sailing.domain.base.RaceDefinition;
import com.sap.sailing.domain.base.Waypoint;
import com.sap.sailing.domain.base.impl.MarkImpl;
import com.sap.sailing.domain.base.impl.WaypointImpl;
import com.sap.sailing.domain.common.Position;
import com.sap.sailing.domain.common.TimePoint;
import com.sap.sailing.domain.common.impl.DegreePosition;
import com.sap.sailing.domain.common.impl.MillisecondsTimePoint;
import com.sap.sailing.domain.tracking.DynamicGPSFixTrack;
import com.sap.sailing.domain.tracking.GPSFix;
import com.sap.sailing.domain.tracking.TrackedRace;
import com.sap.sailing.domain.tracking.impl.DynamicGPSFixTrackImpl;
import com.sap.sailing.domain.tracking.impl.DynamicTrackedRaceImpl;
import com.sap.sailing.domain.tracking.impl.GPSFixImpl;
/**
* Tests the calculation of the center of the course, particularly the
* {@link TrackedRace#getCenterOfCourse(com.sap.sailing.domain.common.TimePoint)} method.
*
* @author Axel Uhl (D043530)
*
*/
public class TrackedRaceCenterTest {
private Mark mark1;
private Mark mark2;
private Waypoint wp1;
private Waypoint wp2;
private Course course;
private DynamicGPSFixTrack<Mark, GPSFix> mark1Track;
private DynamicGPSFixTrack<Mark, GPSFix> mark2Track;
private DynamicTrackedRaceImpl trackedRace;
@Before
public void setUp() {
trackedRace = mock(DynamicTrackedRaceImpl.class);
when(trackedRace.getCenterOfCourse(Matchers.any(TimePoint.class))).thenCallRealMethod();
when(trackedRace.getApproximatePosition(Matchers.any(Waypoint.class), Matchers.any(TimePoint.class))).thenCallRealMethod();
RaceDefinition race = mock(RaceDefinition.class);
when(trackedRace.getRace()).thenReturn(race);
course = mock(Course.class);
when(race.getCourse()).thenReturn(course);
mark1 = new MarkImpl("1");
mark2 = new MarkImpl("2");
wp1 = new WaypointImpl(mark1);
wp2 = new WaypointImpl(mark2);
when(course.getWaypoints()).thenReturn(Arrays.asList(new Waypoint[] { wp1, wp2 }));
mark1Track = new DynamicGPSFixTrackImpl<Mark>(mark1, /* millisecondsOverWhichToAverage */ 10);
mark2Track = new DynamicGPSFixTrackImpl<Mark>(mark1, /* millisecondsOverWhichToAverage */ 10);
when(trackedRace.getOrCreateTrack(mark1)).thenReturn(mark1Track);
when(trackedRace.getOrCreateTrack(mark2)).thenReturn(mark2Track);
}
@Test
public void testSimpleAverage() {
MillisecondsTimePoint now = MillisecondsTimePoint.now();
Position mark1Pos = new DegreePosition(10, 10);
mark1Track.add(new GPSFixImpl(mark1Pos, now));
Position mark2Pos = new DegreePosition(20, 10);
mark2Track.add(new GPSFixImpl(mark2Pos, now));
Position center = trackedRace.getCenterOfCourse(now);
assertEquals(15, center.getLatDeg(), 0.00001);
assertEquals(10, center.getLngDeg(), 0.00001);
}
@Test
public void testTriangle() {
Mark mark3 = new MarkImpl("3");
Waypoint wp3 = new WaypointImpl(mark3);
when(course.getWaypoints()).thenReturn(Arrays.asList(new Waypoint[] { wp1, wp2, wp3 }));
DynamicGPSFixTrackImpl<Mark> mark3Track = new DynamicGPSFixTrackImpl<Mark>(mark3, /* millisecondsOverWhichToAverage */ 10);
when(trackedRace.getOrCreateTrack(mark3)).thenReturn(mark3Track);
MillisecondsTimePoint now = MillisecondsTimePoint.now();
Position mark1Pos = new DegreePosition(0, 0);
mark1Track.add(new GPSFixImpl(mark1Pos, now));
Position mark2Pos = new DegreePosition(0, 10);
mark2Track.add(new GPSFixImpl(mark2Pos, now));
Position mark3Pos = new DegreePosition(10, 5);
mark3Track.add(new GPSFixImpl(mark3Pos, now));
Position center = trackedRace.getCenterOfCourse(now);
assertTrue(2 < center.getLatDeg() && center.getLatDeg() < 8);
assertEquals(5, center.getLngDeg(), 0.00001);
}
}
@@ -11,7 +11,9 @@ import java.net.URL;
import java.nio.charset.Charset;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.Timeout;
import com.sap.sailing.domain.base.Competitor;
import com.sap.sailing.domain.racelog.impl.EmptyRaceLogStore;
@@ -21,18 +23,22 @@ import com.sap.sailing.domain.tractracadapter.DomainFactory;
import com.sap.sailing.domain.tractracadapter.TracTracConnectionConstants;
import com.sap.sailing.domain.tractracadapter.TracTracRaceTracker;
import com.sap.sailing.domain.tractracadapter.impl.DomainFactoryImpl;
import com.tractrac.model.lib.api.event.CreateModelException;
import com.tractrac.subscription.lib.api.SubscriberInitializationException;
public class UnicodeCharactersInCompetitorNamesTest {
protected static final boolean tractracTunnel = Boolean.valueOf(System.getProperty("tractrac.tunnel", "false"));
protected static final String tractracTunnelHost = System.getProperty("tractrac.tunnel.host", "localhost");
private DomainFactory domainFactory;
@Rule public Timeout AbstractTracTracLiveTestTimeout = new Timeout(2 * 60 * 1000);
@Before
public void setUp() {
domainFactory = new DomainFactoryImpl(new com.sap.sailing.domain.base.impl.DomainFactoryImpl());
}
public static void main(String[] args) throws URISyntaxException, IOException, InterruptedException {
public static void main(String[] args) throws URISyntaxException, IOException, InterruptedException, CreateModelException, SubscriberInitializationException {
UnicodeCharactersInCompetitorNamesTest t = new UnicodeCharactersInCompetitorNamesTest();
t.setUp();
t.readJSONURLAndCheckCompetitorNames();
@@ -40,7 +46,7 @@ public class UnicodeCharactersInCompetitorNamesTest {
}
@Test
public void testFindUnicodeCharactersInCompetitorNames() throws MalformedURLException, FileNotFoundException, URISyntaxException, IOException, InterruptedException {
public void testFindUnicodeCharactersInCompetitorNames() throws MalformedURLException, FileNotFoundException, URISyntaxException, IOException, InterruptedException, CreateModelException, SubscriberInitializationException {
TracTracRaceTracker fourtyninerYellow_2 = domainFactory
.createRaceTracker(
new URL(
@@ -56,11 +62,10 @@ public class UnicodeCharactersInCompetitorNamesTest {
+ TracTracConnectionConstants.PORT_STORED),
new URI("http://tracms.traclive.dk/update_course"),
/* startOfTracking */null, /* endOfTracking */null, /* delayToLiveInMillis */0l,
/* simulateWithStartTimeNow */ false, EmptyRaceLogStore.INSTANCE, EmptyWindStore.INSTANCE, EmptyGPSFixStore.INSTANCE, "tracTest", "tracTest", "",
/* simulateWithStartTimeNow */ false, EmptyRaceLogStore.INSTANCE, EmptyWindStore.INSTANCE, EmptyGPSFixStore.INSTANCE, "tracTest", "tracTest", "", "",
new DummyTrackedRegattaRegistry());
Iterable<Competitor> competitors = fourtyninerYellow_2.getRacesHandle().getRaces().iterator().next()
.getCompetitors();
Iterable<Competitor> competitors = fourtyninerYellow_2.getRacesHandle().getRace().getCompetitors();
for (Competitor competitor : competitors) {
System.out.println(competitor.getName());
}
@@ -26,9 +26,9 @@ import com.sap.sailing.domain.common.impl.MillisecondsTimePoint;
import com.sap.sailing.domain.racelog.tracking.EmptyGPSFixStore;
import com.sap.sailing.domain.tracking.MarkPassing;
import com.sap.sailing.domain.tracking.impl.DynamicTrackedRaceImpl;
import com.sap.sailing.domain.tracking.impl.DynamicTrackedRegattaImpl;
import com.sap.sailing.domain.tracking.impl.EmptyWindStore;
import com.sap.sailing.domain.tracking.impl.MarkPassingImpl;
import com.sap.sailing.domain.tracking.impl.TrackedRegattaImpl;
import com.sap.sse.common.Util;
public class UpdateMarkPassingTest {
@@ -43,7 +43,7 @@ public class UpdateMarkPassingTest {
when(race.getBoatClass()).thenReturn(new BoatClassImpl("49er", /* typicallyStartsUpwind */ true));
when(race.getCompetitors()).thenReturn(Collections.singleton(competitor));
DynamicTrackedRaceImpl trackedRace = new DynamicTrackedRaceImpl(
/* trackedRegatta */new TrackedRegattaImpl(new RegattaImpl("test", null, new HashSet<Series>(), false, null,
/* trackedRegatta */new DynamicTrackedRegattaImpl(new RegattaImpl("test", null, new HashSet<Series>(), false, null,
"test", null)), race, Collections.<Sideline> emptyList(), EmptyWindStore.INSTANCE, EmptyGPSFixStore.INSTANCE,
/* delayToLiveInMillis */1000, /* millisecondsOverWhichToAverageWind */30000,
/* millisecondsOverWhichToAverageSpeed */30000);
@@ -17,7 +17,6 @@ import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
import com.sap.sailing.domain.base.RaceDefinition;
import com.sap.sailing.domain.common.Position;
import com.sap.sailing.domain.common.TimePoint;
import com.sap.sailing.domain.common.TrackedRaceStatusEnum;
import com.sap.sailing.domain.common.WindSource;
@@ -82,7 +81,7 @@ public class WindEstimationLockingUnderLoadTest {
RaceDefinition mockedRaceDefinition = mock(RaceDefinition.class);
when(result.getRace()).thenReturn(mockedRaceDefinition);
when(mockedRaceDefinition.getName()).thenReturn("Test Race");
when(result.getEstimatedWindDirectionWithConfidence((Position) any(), (TimePoint) any())).thenAnswer(new Answer<WindWithConfidence<TimePoint>>() {
when(result.getEstimatedWindDirectionWithConfidence((TimePoint) any())).thenAnswer(new Answer<WindWithConfidence<TimePoint>>() {
public WindWithConfidence<TimePoint> answer(InvocationOnMock invocation) {
return randomWindOrNull();
}
@@ -137,7 +136,7 @@ public class WindEstimationLockingUnderLoadTest {
@Override
public void run() {
TimePoint now = MillisecondsTimePoint.now();
for (int i = 0; i < 100000; i++) {
for (int i = 0; i < 10000; i++) {
final WindImpl wind = new WindImpl(new DegreePosition(49, 8), now, new KnotSpeedWithBearingImpl(
/* speedInKnots */12., new DegreeBearingImpl(47)));
addMeasuredWindFix(wind);
@@ -150,7 +149,7 @@ public class WindEstimationLockingUnderLoadTest {
@Override
public void run() {
TimePoint now = MillisecondsTimePoint.now();
for (int i=0; i<100000; i++) {
for (int i=0; i<10000; i++) {
estimationTrack.getAveragedWind(/* position */ null, now);
now = now.plus(10); // the cache quantizes to a full second; so not all time points will automatically fetch uncached values
}
@@ -142,14 +142,14 @@ public class WindEstimationOnConstructedTracksTest extends StoredTrackBasedTest
setBearingForCompetitor(competitors.get(1), now, 45); // on the same tack, should give no read-out
setBearingForCompetitor(competitors.get(2), now, 135);
setBearingForCompetitor(competitors.get(3), now, 225); // on the same tack, should give no read-out
Wind estimatedWindDirection = getTrackedRace().getEstimatedWindDirection(/* position */ null, now);
Wind estimatedWindDirection = getTrackedRace().getEstimatedWindDirection(now);
// less precision because downwind estimation has less confidence
assertEquals(180., estimatedWindDirection.getBearing().getDegrees(), 0.00000001);
CombinedWindTrackImpl combinedTrack = new CombinedWindTrackImpl(getTrackedRace(), WindSourceType.COMBINED.getBaseConfidence());
Wind combinedWindDirection = combinedTrack.getAveragedWind(/* position */ null, now);
//Since the course layout makes a wind estimation around 7� and the confidence of the cluster based wind estimation is not
// way higher that that of the course layout wind, we will not end up with exactly 180 deg.
assertEquals(180.2, combinedWindDirection.getBearing().getDegrees(), 0.1);
// The course layout makes a wind estimation around 7deg. The confidence of the cluster based wind estimation is a lot
// higher that that of the course layout wind (currently at approximately 10E-13), we will end up quite near 180 deg.
assertEquals(180.0, combinedWindDirection.getBearing().getDegrees(), 0.2);
}
/**
@@ -254,7 +254,7 @@ public class WindEstimationOnConstructedTracksTest extends StoredTrackBasedTest
MillisecondsTimePoint now = MillisecondsTimePoint.now();
setBearingForCompetitor(competitors.get(0), now, 320);
setBearingForCompetitor(competitors.get(1), now, 50);
Wind estimatedWindDirection = getTrackedRace().getEstimatedWindDirection(/* position */ null, now);
Wind estimatedWindDirection = getTrackedRace().getEstimatedWindDirection(now);
assertEquals(185., estimatedWindDirection.getBearing().getDegrees(), 0.00000001);
}
@@ -265,7 +265,7 @@ public class WindEstimationOnConstructedTracksTest extends StoredTrackBasedTest
setBearingForCompetitor(competitors.get(0), now, 320);
setBearingForCompetitor(competitors.get(1), now, 50);
setBearingForCompetitor(competitors.get(2), new MillisecondsTimePoint(0), 100); // this shouldn't disturb the estimation because it's too old
Wind estimatedWindDirection = getTrackedRace().getEstimatedWindDirection(/* position */ null, now);
Wind estimatedWindDirection = getTrackedRace().getEstimatedWindDirection(now);
assertEquals(185., estimatedWindDirection.getBearing().getDegrees(), 0.00000001);
}
@@ -277,7 +277,7 @@ public class WindEstimationOnConstructedTracksTest extends StoredTrackBasedTest
setBearingForCompetitor(competitors.get(0), now, 320);
setBearingForCompetitor(competitors.get(1), now, 50);
setBearingForCompetitor(competitors.get(2), markPassingTimePoint, 100); // this shouldn't disturb the estimation because it's too old
Wind estimatedWindDirection = getTrackedRace().getEstimatedWindDirection(/* position */ null, now);
Wind estimatedWindDirection = getTrackedRace().getEstimatedWindDirection(now);
assertEquals(185., estimatedWindDirection.getBearing().getDegrees(), 0.00000001);
}
@@ -287,7 +287,7 @@ public class WindEstimationOnConstructedTracksTest extends StoredTrackBasedTest
MillisecondsTimePoint now = MillisecondsTimePoint.now();
setBearingForCompetitor(competitors.get(0), now, 320);
setBearingForCompetitor(competitors.get(1), now, 330); // on the same tack, should give no read-out
Wind nullWind = getTrackedRace().getEstimatedWindDirection(/* position */null, now);
Wind nullWind = getTrackedRace().getEstimatedWindDirection(now);
assertNull(
"Shouldn't have been able to determine estimated wind direction because no two distinct direction clusters found upwind nor downwind",
nullWind);
@@ -301,7 +301,7 @@ public class WindEstimationOnConstructedTracksTest extends StoredTrackBasedTest
setBearingForCompetitor(competitors.get(1), now, 330); // on the same tack, should give no read-out
setBearingForCompetitor(competitors.get(2), now, 135);
setBearingForCompetitor(competitors.get(3), now, 145); // on the same tack, should give no read-out
Wind nullWind = getTrackedRace().getEstimatedWindDirection(/* position */null, now);
Wind nullWind = getTrackedRace().getEstimatedWindDirection(now);
assertNull(
"Shouldn't have been able to determine estimated wind direction because no two distinct direction clusters found upwind nor downwind",
nullWind);
@@ -315,7 +315,7 @@ public class WindEstimationOnConstructedTracksTest extends StoredTrackBasedTest
setBearingForCompetitor(competitors.get(1), now, 330); // on the same tack, should give no read-out
setBearingForCompetitor(competitors.get(2), now, 135);
setBearingForCompetitor(competitors.get(3), now, 220); // on the same tack, should give no read-out
Wind estimatedWindDirection = getTrackedRace().getEstimatedWindDirection(/* position */ null, now);
Wind estimatedWindDirection = getTrackedRace().getEstimatedWindDirection(now);
assertEquals(177.5, estimatedWindDirection.getBearing().getDegrees(), 0.00000001);
}
@@ -327,7 +327,7 @@ public class WindEstimationOnConstructedTracksTest extends StoredTrackBasedTest
setBearingForCompetitor(competitors.get(1), now, 45); // on the same tack, should give no read-out
setBearingForCompetitor(competitors.get(2), now, 135);
setBearingForCompetitor(competitors.get(3), now, 225); // on the same tack, should give no read-out
Wind estimatedWindDirection = getTrackedRace().getEstimatedWindDirection(/* position */ null, now);
Wind estimatedWindDirection = getTrackedRace().getEstimatedWindDirection(now);
assertEquals(180., estimatedWindDirection.getBearing().getDegrees(), 0.00000001);
}
@@ -32,7 +32,9 @@ import com.sap.sailing.domain.tracking.WindTrack;
import com.sap.sailing.domain.tracking.impl.TrackBasedEstimationWindTrackImpl;
import com.sap.sailing.domain.tracking.impl.WindImpl;
import com.sap.sailing.domain.tractracadapter.ReceiverType;
import com.tractrac.model.lib.api.event.CreateModelException;
import com.sap.sse.common.Util;
import com.tractrac.subscription.lib.api.SubscriberInitializationException;
public class WindEstimationOnKielerWoche505Race2DataTest extends OnlineTracTracBasedTest {
@@ -40,7 +42,7 @@ public class WindEstimationOnKielerWoche505Race2DataTest extends OnlineTracTracB
}
@Before
public void setUp() throws MalformedURLException, IOException, InterruptedException, URISyntaxException, ParseException {
public void setUp() throws MalformedURLException, IOException, InterruptedException, URISyntaxException, ParseException, SubscriberInitializationException, CreateModelException {
super.setUp();
URI storedUri = new URI("file:///"+new File("resources/event_20110609_KielerWoch-505_Race_2.mtb").getCanonicalPath().replace('\\', '/'));
super.setUp(new URL("file:///"+new File("resources/event_20110609_KielerWoch-505_Race_2.txt").getCanonicalPath()),
@@ -56,7 +58,7 @@ public class WindEstimationOnKielerWoche505Race2DataTest extends OnlineTracTracB
/**
* Checks that the {@link TrackBasedEstimationWindTrackImpl} data structure works. It does so by comparing the
* results obtained from such a track with the results of immediately calling
* {@link TrackedRace#getEstimatedWindDirection(com.sap.sailing.domain.base.Position, TimePoint)}. The results
* {@link TrackedRace#getEstimatedWindDirection(TimePoint)}. The results
* may not accurately equal each other because the track may consider more estimation values before and after
* the time point for which the estimation is requested.
*/
@@ -68,7 +70,7 @@ public class WindEstimationOnKielerWoche505Race2DataTest extends OnlineTracTracB
TrackBasedEstimationWindTrackImpl estimatedWindTrack = new TrackBasedEstimationWindTrackImpl(getTrackedRace(),
WindTrack.DEFAULT_MILLISECONDS_OVER_WHICH_TO_AVERAGE_WIND, WindSourceType.TRACK_BASED_ESTIMATION.getBaseConfidence(),
/* delay for cache invalidation in milliseconds */ 0l);
Wind estimatedWindDirection = getTrackedRace().getEstimatedWindDirection(/* position */ null, middle);
Wind estimatedWindDirection = getTrackedRace().getEstimatedWindDirection(middle);
assertNotNull(estimatedWindDirection);
Wind estimationBasedOnTrack = estimatedWindTrack.getAveragedWind(null, middle);
assertEquals(estimatedWindDirection.getFrom().getDegrees(), estimationBasedOnTrack.getFrom().getDegrees(), 5.);
@@ -92,7 +94,7 @@ public class WindEstimationOnKielerWoche505Race2DataTest extends OnlineTracTracB
// mark and are already going upwind again, and Lehmann is tacking, hence has a direction change.
TimePoint middle = new MillisecondsTimePoint(1308839250105l);
assertTrue(getTrackedRace().getTrack(getCompetitorByName("Lehmann")).hasDirectionChange(middle, /* minimumDegreeDifference */ 9.));
Wind estimatedWindDirection = getTrackedRace().getEstimatedWindDirection(/* position */ null, middle);
Wind estimatedWindDirection = getTrackedRace().getEstimatedWindDirection(middle);
assertNotNull(estimatedWindDirection);
assertEquals(241., estimatedWindDirection.getFrom().getDegrees(), 3.); // expect wind from 241 +/- 3 degrees
}
@@ -105,7 +107,7 @@ public class WindEstimationOnKielerWoche505Race2DataTest extends OnlineTracTracB
assertTrue(getTrackedRace().getTrack(getCompetitorByName("K.chlin")).hasDirectionChange(middle, /* minimumDegreeDifference */ 15.));
assertTrue(getTrackedRace().getTrack(getCompetitorByName("Neulen")).hasDirectionChange(middle, /* minimumDegreeDifference */ 15.));
assertTrue(getTrackedRace().getTrack(getCompetitorByName("Findel")).hasDirectionChange(middle, /* minimumDegreeDifference */ 15.));
Wind estimatedWindDirection = getTrackedRace().getEstimatedWindDirection(/* position */ null, middle);
Wind estimatedWindDirection = getTrackedRace().getEstimatedWindDirection(middle);
assertNotNull(estimatedWindDirection);
assertEquals(241., estimatedWindDirection.getFrom().getDegrees(), 4.); // expect wind from 241 +/- 3 degrees
}
@@ -61,7 +61,7 @@ public class WindEstimationOnStoredTracksTest extends StoredTrackBasedTestWithTr
getTrackedRace().recordWind(new WindImpl(markPositions.get("Windward mark"), somewhenOnAnUpwind,
new KnotSpeedWithBearingImpl(
/* speedInKnots */14.7, new DegreeBearingImpl(90))), new WindSourceImpl(WindSourceType.WEB));
Wind estimatedWindDirection = getTrackedRace().getEstimatedWindDirection(/* position */ null, somewhenOnAnUpwind);
Wind estimatedWindDirection = getTrackedRace().getEstimatedWindDirection(somewhenOnAnUpwind);
assertNotNull(estimatedWindDirection);
}
@@ -7,9 +7,11 @@ import static org.junit.Assert.assertTrue;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.junit.Test;
@@ -30,26 +32,36 @@ import com.sap.sailing.domain.base.impl.PersonImpl;
import com.sap.sailing.domain.base.impl.RaceDefinitionImpl;
import com.sap.sailing.domain.base.impl.RegattaImpl;
import com.sap.sailing.domain.base.impl.TeamImpl;
import com.sap.sailing.domain.common.Bearing;
import com.sap.sailing.domain.common.Color;
import com.sap.sailing.domain.common.Position;
import com.sap.sailing.domain.common.ScoringSchemeType;
import com.sap.sailing.domain.common.TimePoint;
import com.sap.sailing.domain.confidence.ConfidenceFactory;
import com.sap.sailing.domain.common.confidence.Weigher;
import com.sap.sailing.domain.common.confidence.impl.PositionAndTimePointWeigher;
import com.sap.sailing.domain.common.impl.DegreeBearingImpl;
import com.sap.sailing.domain.common.impl.DegreePosition;
import com.sap.sailing.domain.common.impl.KnotSpeedWithBearingImpl;
import com.sap.sailing.domain.common.impl.MeterDistance;
import com.sap.sailing.domain.common.impl.MillisecondsTimePoint;
import com.sap.sailing.domain.confidence.ConfidenceBasedWindAverager;
import com.sap.sailing.domain.racelog.impl.EmptyRaceLogStore;
import com.sap.sailing.domain.racelog.tracking.EmptyGPSFixStore;
import com.sap.sailing.domain.tracking.DynamicTrackedRace;
import com.sap.sailing.domain.tracking.MarkPassing;
import com.sap.sailing.domain.tracking.Wind;
import com.sap.sailing.domain.tracking.WindTrack;
import com.sap.sailing.domain.tracking.WindWithConfidence;
import com.sap.sailing.domain.tracking.impl.DynamicTrackedRaceImpl;
import com.sap.sailing.domain.tracking.impl.DynamicTrackedRegattaImpl;
import com.sap.sailing.domain.tracking.impl.EmptyWindStore;
import com.sap.sailing.domain.tracking.impl.MarkPassingImpl;
import com.sap.sailing.domain.tracking.impl.WindImpl;
import com.sap.sailing.domain.tracking.impl.WindTrackImpl;
import com.sap.sailing.domain.tracking.impl.WindWithConfidenceImpl;
import com.sap.sse.common.Util;
import com.sap.sse.common.Util.Pair;
public class WindTest {
private static final int AVERAGING_INTERVAL_MILLIS = 30000 /* 30s averaging interval */;
@@ -265,7 +277,7 @@ public class WindTest {
new BoatClassImpl("505", /* typicallyStartsUpwind */true), null));
final BoatClass boatClass = domainFactory.getOrCreateBoatClass("ESS40");
DynamicTrackedRace trackedRace = new DynamicTrackedRaceImpl(new DynamicTrackedRegattaImpl(
new RegattaImpl(EmptyRaceLogStore.INSTANCE, "Test Regatta", boatClass,
new RegattaImpl(EmptyRaceLogStore.INSTANCE, RegattaImpl.getDefaultName("Test Regatta", boatClass.getName()), boatClass,
/* trackedRegattaRegistry */ null, domainFactory.createScoringScheme(ScoringSchemeType.LOW_POINT), "123", null)),
new RaceDefinitionImpl("Test Race",
new CourseImpl("Test Course", Arrays.asList(new Waypoint[] { w1, w2, w3 })),
@@ -282,6 +294,60 @@ public class WindTest {
new MarkPassingImpl(finish, w3, competitor)
}));
assertFalse(boatClass.typicallyStartsUpwind());
assertNull(trackedRace.getEstimatedWindDirection(new DegreePosition(0, 0), MillisecondsTimePoint.now()));
assertNull(trackedRace.getEstimatedWindDirection(MillisecondsTimePoint.now()));
}
@Test
public void testWindAveragingBasedOnPosition() {
Weigher<Pair<Position, TimePoint>> timeWeigherThatPretendsToAlsoWeighPositions = new PositionAndTimePointWeigher(
/* halfConfidenceAfterMilliseconds */10000l, new MeterDistance(1000));
ConfidenceBasedWindAverager<Pair<Position, TimePoint>> averager = ConfidenceFactory.INSTANCE
.createWindAverager(timeWeigherThatPretendsToAlsoWeighPositions);
TimePoint now = MillisecondsTimePoint.now();
final DegreePosition p1 = new DegreePosition(0, 0);
WindWithConfidence<Pair<Position, TimePoint>> w1 = new WindWithConfidenceImpl<>(
new WindImpl(p1, now, new KnotSpeedWithBearingImpl(10, new DegreeBearingImpl(90))),
/* confidence */ 1.0, new Pair<Position, TimePoint>(p1, now), /* useSpeed */ true);
final Position p2 = p1.translateGreatCircle(new DegreeBearingImpl(0), new MeterDistance(1000));
WindWithConfidence<Pair<Position, TimePoint>> w2 = new WindWithConfidenceImpl<>(
new WindImpl(p2, now, new KnotSpeedWithBearingImpl(20, new DegreeBearingImpl(0))),
/* confidence */ 1.0, new Pair<Position, TimePoint>(p2, now), /* useSpeed */ true);
List<WindWithConfidence<Pair<Position, TimePoint>>> fixes = new ArrayList<>();
fixes.add(w1);
fixes.add(w2);
WindWithConfidence<Pair<Position, TimePoint>> averageAtP1 = averager.getAverage(fixes, new Pair<Position, TimePoint>(p1, now));
WindWithConfidence<Pair<Position, TimePoint>> averageAtP2 = averager.getAverage(fixes, new Pair<Position, TimePoint>(p2, now));
// first careful assertion: at p1 where wind is from the west (to the east), wind should be further from the
// west (further to the east) than at p2 where wind is from the south (to the north).
final Bearing averageAtP1Bearing = averageAtP1.getObject().getBearing();
assertTrue(Math.abs(averageAtP1Bearing.getDifferenceTo(w1.getObject().getBearing()).getDegrees()) <
Math.abs(averageAtP1Bearing.getDifferenceTo(w2.getObject().getBearing()).getDegrees()));
// ...and vice versa
final Bearing averageAtP2Bearing = averageAtP2.getObject().getBearing();
assertTrue(Math.abs(averageAtP2Bearing.getDifferenceTo(w2.getObject().getBearing()).getDegrees()) <
Math.abs(averageAtP2Bearing.getDifferenceTo(w1.getObject().getBearing()).getDegrees()));
// expect the arithmetic average at the point which is in the middle between the two positions
Position middleBetweenP1AndP2 = p1.translateGreatCircle(p1.getBearingGreatCircle(p2), p1.getDistance(p2).scale(.5));
WindWithConfidence<Pair<Position, TimePoint>> averageAtMiddleBetweenP1AndP2 = averager.getAverage(fixes,
new Pair<Position, TimePoint>(middleBetweenP1AndP2, now));
assertEquals(15, averageAtMiddleBetweenP1AndP2.getObject().getKnots(), 0.00001);
assertEquals(45, averageAtMiddleBetweenP1AndP2.getObject().getBearing().getDegrees(), 0.00001);
// now try again with distance 2km and demand the difference between the position-dependent readings to be greater
final Position p3 = p1.translateGreatCircle(new DegreeBearingImpl(0), new MeterDistance(2000));
WindWithConfidence<Pair<Position, TimePoint>> w3 = new WindWithConfidenceImpl<>(
new WindImpl(p3, now, new KnotSpeedWithBearingImpl(20, new DegreeBearingImpl(0))),
/* confidence */ 1.0, new Pair<Position, TimePoint>(p3, now), /* useSpeed */ true);
List<WindWithConfidence<Pair<Position, TimePoint>>> fixesFurtherApart = new ArrayList<>();
fixesFurtherApart.add(w1);
fixesFurtherApart.add(w3);
WindWithConfidence<Pair<Position, TimePoint>> averageFurtherApartAtP1 = averager.getAverage(fixesFurtherApart, new Pair<Position, TimePoint>(p1, now));
WindWithConfidence<Pair<Position, TimePoint>> averageAtP3 = averager.getAverage(fixesFurtherApart, new Pair<Position, TimePoint>(p3, now));
assertTrue(averageFurtherApartAtP1.getObject().getKnots() < averageAtP1.getObject().getKnots());
assertTrue(averageAtP3.getObject().getKnots() > averageAtP2.getObject().getKnots());
assertTrue(Math.abs(averageFurtherApartAtP1.getObject().getBearing().getDifferenceTo(w1.getObject().getBearing()).getDegrees())
< Math.abs(averageAtP1.getObject().getBearing().getDifferenceTo(w1.getObject().getBearing()).getDegrees()));
assertTrue(Math.abs(averageAtP3.getObject().getBearing().getDifferenceTo(w3.getObject().getBearing()).getDegrees())
< Math.abs(averageAtP2.getObject().getBearing().getDifferenceTo(w3.getObject().getBearing()).getDegrees()));
}
}
@@ -39,7 +39,9 @@ import com.sap.sailing.domain.tracking.GPSFixMoving;
import com.sap.sailing.domain.tracking.MarkPassing;
import com.sap.sailing.domain.tracking.impl.WindImpl;
import com.sap.sailing.domain.tractracadapter.ReceiverType;
import com.tractrac.model.lib.api.event.CreateModelException;
import com.sap.sse.common.Util;
import com.tractrac.subscription.lib.api.SubscriberInitializationException;
public abstract class AbstractMarkPassingTest extends OnlineTracTracBasedTest {
@@ -60,7 +62,7 @@ public abstract class AbstractMarkPassingTest extends OnlineTracTracBasedTest {
}
private void setUp(String raceNumber) throws IOException, InterruptedException, URISyntaxException, ParseException {
private void setUp(String raceNumber) throws IOException, InterruptedException, URISyntaxException, ParseException, SubscriberInitializationException, CreateModelException {
super.setUp();
URI storedUri = new URI("file:///" + new File("resources/" + getFileName() + raceNumber + ".mtb").getCanonicalPath().replace('\\', '/'));
super.setUp(new URL("file:///" + new File("resources/" + getFileName() + raceNumber + ".txt").getCanonicalPath()),
@@ -84,7 +86,7 @@ public abstract class AbstractMarkPassingTest extends OnlineTracTracBasedTest {
protected abstract String getFileName();
protected void testRace(String raceNumber) throws IOException, InterruptedException, URISyntaxException, ParseException {
protected void testRace(String raceNumber) throws IOException, InterruptedException, URISyntaxException, ParseException, SubscriberInitializationException, CreateModelException {
setUp(raceNumber);
testWholeRace();
testMiddleOfRace(2);
@@ -92,9 +94,7 @@ public abstract class AbstractMarkPassingTest extends OnlineTracTracBasedTest {
}
private void testWholeRace() {
LinkedHashMap<Competitor, LinkedHashMap<Waypoint, MarkPassing>> computedPasses = new LinkedHashMap<>();
// Get calculatedMarkPasses
long time = System.currentTimeMillis();
final MarkPassingCalculator markPassCreator = new MarkPassingCalculator(getTrackedRace(), true);
@@ -38,10 +38,10 @@ import com.sap.sailing.domain.racelog.tracking.EmptyGPSFixStore;
import com.sap.sailing.domain.tracking.DynamicTrackedRace;
import com.sap.sailing.domain.tracking.GPSFixMoving;
import com.sap.sailing.domain.tracking.impl.DynamicTrackedRaceImpl;
import com.sap.sailing.domain.tracking.impl.DynamicTrackedRegattaImpl;
import com.sap.sailing.domain.tracking.impl.EmptyWindStore;
import com.sap.sailing.domain.tracking.impl.GPSFixImpl;
import com.sap.sailing.domain.tracking.impl.GPSFixMovingImpl;
import com.sap.sailing.domain.tracking.impl.TrackedRegattaImpl;
import com.sap.sse.common.Util;
public class AbstractMockedRaceMarkPassingTest {
@@ -63,11 +63,12 @@ public class AbstractMockedRaceMarkPassingTest {
Waypoint w1 = new WaypointImpl(cp, PassingInstruction.Line);
Waypoint w2 = new WaypointImpl(m, PassingInstruction.Port);
Waypoint w3 = new WaypointImpl(cp, PassingInstruction.Line);
Regatta r = new RegattaImpl("regatta", new BoatClassImpl("boat", true), Arrays.asList(new SeriesImpl("Series", true, Arrays.asList(new FleetImpl("fleet")),
final BoatClassImpl boatClass = new BoatClassImpl("boat", true);
Regatta r = new RegattaImpl(RegattaImpl.getDefaultName("regatta", boatClass.getName()), boatClass, Arrays.asList(new SeriesImpl("Series", true, Arrays.asList(new FleetImpl("fleet")),
new ArrayList<String>(), null)), true, new HighPoint(), "ID", new CourseAreaImpl("area", new UUID(5, 5)));
Course course = new CourseImpl("course", Arrays.asList(w1, w2, w3));
RaceDefinition race = new RaceDefinitionImpl("Performance Race", course, new BoatClassImpl("boat", true), Arrays.asList(bob));
trackedRace = new DynamicTrackedRaceImpl(new TrackedRegattaImpl(r), race, new ArrayList<Sideline>(), new EmptyWindStore(), EmptyGPSFixStore.INSTANCE, 0, 10000, 10000);
RaceDefinition race = new RaceDefinitionImpl("Performance Race", course, boatClass, Arrays.asList(bob));
trackedRace = new DynamicTrackedRaceImpl(new DynamicTrackedRegattaImpl(r), race, new ArrayList<Sideline>(), new EmptyWindStore(), EmptyGPSFixStore.INSTANCE, 0, 10000, 10000);
trackedRace.setStartTimeReceived(new MillisecondsTimePoint(System.currentTimeMillis() - 120000));
List<MillisecondsTimePoint> tps = Arrays.asList(new MillisecondsTimePoint(System.currentTimeMillis()), new MillisecondsTimePoint(System.currentTimeMillis() - 30000),
new MillisecondsTimePoint(System.currentTimeMillis() + 30000));
@@ -7,6 +7,9 @@ import java.text.ParseException;
import org.junit.Test;
import com.tractrac.model.lib.api.event.CreateModelException;
import com.tractrac.subscription.lib.api.SubscriberInitializationException;
public class FlorianopolisMarkPassingTest extends AbstractMarkPassingTest {
public FlorianopolisMarkPassingTest() throws MalformedURLException, URISyntaxException {
@@ -14,64 +17,64 @@ public class FlorianopolisMarkPassingTest extends AbstractMarkPassingTest {
}
@Test
public void testRace3() throws IOException, InterruptedException, URISyntaxException, ParseException {
public void testRace1() throws IOException, InterruptedException, URISyntaxException, ParseException, SubscriberInitializationException, CreateModelException {
testRace("3");
}
@Test
public void testRace4() throws IOException, InterruptedException, URISyntaxException, ParseException {
public void testRace4() throws IOException, InterruptedException, URISyntaxException, ParseException, SubscriberInitializationException, CreateModelException {
testRace("4");
}
/*
* Test ignored on master branch to quicken the hudson build.
*
* @Test public void testRace1() throws IOException, InterruptedException, URISyntaxException, ParseException {
* @Test public void testRace1() throws IOException, InterruptedException, URISyntaxException, ParseException, SubscriberInitializationException, CreateModelException {
* testRace("1"); }
*
* @Test public void testRace2() throws IOException, InterruptedException, URISyntaxException, ParseException {
* @Test public void testRace2() throws IOException, InterruptedException, URISyntaxException, ParseException, SubscriberInitializationException, CreateModelException {
* testRace("2"); }
*
* @Test public void testRace5() throws IOException, InterruptedException, URISyntaxException, ParseException {
* @Test public void testRace5() throws IOException, InterruptedException, URISyntaxException, ParseException, SubscriberInitializationException, CreateModelException {
* testRace("5"); }
*
* @Test public void testRace6() throws IOException, InterruptedException, URISyntaxException, ParseException {
* @Test public void testRace6() throws IOException, InterruptedException, URISyntaxException, ParseException, SubscriberInitializationException, CreateModelException {
* testRace("6"); }
*
* @Test public void testRace7() throws IOException, InterruptedException, URISyntaxException, ParseException {
* @Test public void testRace7() throws IOException, InterruptedException, URISyntaxException, ParseException, SubscriberInitializationException, CreateModelException {
* testRace("7"); }
*
* @Test public void testRace8() throws IOException, InterruptedException, URISyntaxException, ParseException {
* @Test public void testRace8() throws IOException, InterruptedException, URISyntaxException, ParseException, SubscriberInitializationException, CreateModelException {
* testRace("8"); }
*
* @Test public void testRace10() throws IOException, InterruptedException, URISyntaxException, ParseException {
* @Test public void testRace10() throws IOException, InterruptedException, URISyntaxException, ParseException, SubscriberInitializationException, CreateModelException {
* testRace("10"); }
*
* @Test public void testRace11() throws IOException, InterruptedException, URISyntaxException, ParseException {
* @Test public void testRace11() throws IOException, InterruptedException, URISyntaxException, ParseException, SubscriberInitializationException, CreateModelException {
* testRace("11"); }
*
* @Test public void testRace12() throws IOException, InterruptedException, URISyntaxException, ParseException {
* @Test public void testRace12() throws IOException, InterruptedException, URISyntaxException, ParseException, SubscriberInitializationException, CreateModelException {
* testRace("12"); }
*
* @Test public void testRace13() throws IOException, InterruptedException, URISyntaxException, ParseException {
* @Test public void testRace13() throws IOException, InterruptedException, URISyntaxException, ParseException, SubscriberInitializationException, CreateModelException {
* testRace("13"); }
*
* @Test public void testRace14() throws IOException, InterruptedException, URISyntaxException, ParseException {
* @Test public void testRace14() throws IOException, InterruptedException, URISyntaxException, ParseException, SubscriberInitializationException, CreateModelException {
* testRace("14"); }
*
* @Test public void testRace16() throws IOException, InterruptedException, URISyntaxException, ParseException {
* @Test public void testRace16() throws IOException, InterruptedException, URISyntaxException, ParseException, SubscriberInitializationException, CreateModelException {
* testRace("16"); }
*
* @Test public void testRace17() throws IOException, InterruptedException, URISyntaxException, ParseException {
* @Test public void testRace17() throws IOException, InterruptedException, URISyntaxException, ParseException, SubscriberInitializationException, CreateModelException {
* testRace("17"); }
*
* @Test public void testRace19() throws IOException, InterruptedException, URISyntaxException, ParseException {
* @Test public void testRace19() throws IOException, InterruptedException, URISyntaxException, ParseException, SubscriberInitializationException, CreateModelException {
* testRace("19"); }
*
* @Test public void testRace22() throws IOException, InterruptedException, URISyntaxException, ParseException {
* @Test public void testRace22() throws IOException, InterruptedException, URISyntaxException, ParseException, SubscriberInitializationException, CreateModelException {
* testRace("22"); }
*
* @Test public void testRace24() throws IOException, InterruptedException, URISyntaxException, ParseException {
* @Test public void testRace24() throws IOException, InterruptedException, URISyntaxException, ParseException, SubscriberInitializationException, CreateModelException {
* testRace("24"); }
*/
@@ -7,6 +7,9 @@ import java.text.ParseException;
import org.junit.Test;
import com.tractrac.model.lib.api.event.CreateModelException;
import com.tractrac.subscription.lib.api.SubscriberInitializationException;
public class KW470MarkPassingTest extends AbstractMarkPassingTest {
public KW470MarkPassingTest() throws MalformedURLException, URISyntaxException {
@@ -14,17 +17,17 @@ public class KW470MarkPassingTest extends AbstractMarkPassingTest {
}
@Test
public void testRace4() throws IOException, InterruptedException, URISyntaxException, ParseException {
public void testRace4() throws IOException, InterruptedException, URISyntaxException, ParseException, SubscriberInitializationException, CreateModelException {
testRace("4");
}
/*
* Ignored on master branch
*
* @Test public void testRace5() throws IOException, InterruptedException, URISyntaxException, ParseException {
* @Test public void testRace5() throws IOException, InterruptedException, URISyntaxException, ParseException, SubscriberInitializationException, CreateModelException {
* testRace("5"); }
*
* @Test public void testRace6() throws IOException, InterruptedException, URISyntaxException, ParseException {
* @Test public void testRace6() throws IOException, InterruptedException, URISyntaxException, ParseException, SubscriberInitializationException, CreateModelException {
* testRace("6"); }
*/
@@ -7,6 +7,9 @@ import java.text.ParseException;
import org.junit.Ignore;
import com.tractrac.model.lib.api.event.CreateModelException;
import com.tractrac.subscription.lib.api.SubscriberInitializationException;
public class Kiel2011505MarkPassingTest extends AbstractMarkPassingTest {
public Kiel2011505MarkPassingTest() throws MalformedURLException, URISyntaxException {
@@ -14,15 +17,15 @@ public class Kiel2011505MarkPassingTest extends AbstractMarkPassingTest {
}
@Ignore
public void testRace2() throws IOException, InterruptedException, URISyntaxException, ParseException {
public void testRace2() throws IOException, InterruptedException, URISyntaxException, ParseException, SubscriberInitializationException, CreateModelException {
testRace("2");
}
@Ignore
public void testRace3() throws IOException, InterruptedException, URISyntaxException, ParseException {
public void testRace3() throws IOException, InterruptedException, URISyntaxException, ParseException, SubscriberInitializationException, CreateModelException {
testRace("3");
}
@Ignore
public void testRace4() throws IOException, InterruptedException, URISyntaxException, ParseException {
public void testRace4() throws IOException, InterruptedException, URISyntaxException, ParseException, SubscriberInitializationException, CreateModelException {
testRace("4");
}
@@ -7,6 +7,9 @@ import java.text.ParseException;
import org.junit.Ignore;
import com.tractrac.model.lib.api.event.CreateModelException;
import com.tractrac.subscription.lib.api.SubscriberInitializationException;
public class Kiel2013505Test extends AbstractMarkPassingTest {
public Kiel2013505Test() throws MalformedURLException, URISyntaxException {
@@ -14,7 +17,7 @@ public class Kiel2013505Test extends AbstractMarkPassingTest {
}
@Ignore
public void testRace5() throws IOException, InterruptedException, URISyntaxException, ParseException {
public void testRace5() throws IOException, InterruptedException, URISyntaxException, ParseException, SubscriberInitializationException, CreateModelException {
testRace("5");
}
@@ -6,6 +6,7 @@ import java.io.IOException;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Random;
import junit.framework.Assert;
@@ -13,7 +14,6 @@ import org.junit.AfterClass;
import org.junit.Test;
import com.sap.sailing.domain.common.impl.MillisecondsTimePoint;
import com.sap.sailing.domain.markpassingcalculation.AbstractCandidateFinder;
import com.sap.sailing.domain.markpassingcalculation.Candidate;
import com.sap.sailing.domain.markpassingcalculation.CandidateChooser;
import com.sap.sailing.domain.markpassingcalculation.CandidateFinder;
@@ -32,6 +32,9 @@ public class MarkPassingCalculatorPerformanceTest extends AbstractMockedRaceMark
super();
}
protected Random rnd = new Random();
protected long time;
@AfterClass
public static void createXMLFile() throws IOException {
MeasurementXMLFile performanceReport = new MeasurementXMLFile(MarkPassingCalculatorPerformanceTest.class);
@@ -44,7 +47,7 @@ public class MarkPassingCalculatorPerformanceTest extends AbstractMockedRaceMark
@Test
public void testFinder() {
AbstractCandidateFinder f = new CandidateFinder(trackedRace);
CandidateFinder f = new CandidateFinder(trackedRace);
List<GPSFix> fixesAdded = new ArrayList<>();
for (int i = 0; i < 1000; i++) {
GPSFixMoving fix = rndFix();
@@ -55,47 +58,38 @@ public class MarkPassingCalculatorPerformanceTest extends AbstractMockedRaceMark
f.getCandidateDeltas(bob, fixesAdded);
time = System.currentTimeMillis() - time;
result.put("FinderPerformance", time);
Assert.assertTrue(time < 2000);
System.out.println(time);
Assert.assertTrue(time < 3000);
}
@Test
public void testChooser() {
long time = timeToAddCandidatesToChooser(500, 1);
long time = timeToAddCandidatesToChooser(100, 1, 25);
System.out.println(time);
result.put("ChooserPerformance", time);
assertTrue(time < 800);
assertTrue(time < 2000);
}
private long timeToAddCandidatesToChooser(int numberOfCandidates, int numberToAdd) {
ArrayList<Candidate> newCans = new ArrayList<>();
for (int i = 0; i < numberOfCandidates; i++) {
newCans.add(randomCan());
}
time = System.currentTimeMillis();
CandidateChooser c = new CandidateChooser(trackedRace);
c.calculateMarkPassDeltas(bob, new Util.Pair<Iterable<Candidate>, Iterable<Candidate>>(newCans, new ArrayList<Candidate>()));
time = System.currentTimeMillis() - time;
ArrayList<Long> times = new ArrayList<>();
for (int i = 0; i < 100; i++) {
ArrayList<Candidate> old = new ArrayList<>();
ArrayList<Candidate> ne = new ArrayList<>();
for (int j = 0; j < numberToAdd; j++) {
ne.add(randomCan());
private long timeToAddCandidatesToChooser(int numberOfTimesAdding, int numberToAddEachTime, int numberOfRepititions) {
long totalTime = 0;
for (int i = 0; i < numberOfRepititions; i++) {
CandidateChooser c = new CandidateChooser(trackedRace);
for (int j = 0; j < numberOfTimesAdding; j++) {
List<Candidate> newCandidates = new ArrayList<>();
for (int k = 0; k < numberToAddEachTime; k++) {
newCandidates.add(randomCan());
}
time = System.currentTimeMillis();
c.calculateMarkPassDeltas(bob, new Util.Pair<Iterable<Candidate>, Iterable<Candidate>>(newCandidates, new ArrayList<Candidate>()));
totalTime += System.currentTimeMillis() - time;
}
time = System.currentTimeMillis();
c.calculateMarkPassDeltas(bob, new Util.Pair<Iterable<Candidate>, Iterable<Candidate>>(ne, old));
times.add(System.currentTimeMillis() - time);
old = ne;
}
long total = 0;
for (long l : times) {
total = total + l;
}
return total / times.size();
return totalTime / numberOfRepititions;
}
private Candidate randomCan() {
int id = rnd.nextInt(3);
return new Candidate(id + 1, new MillisecondsTimePoint((long) (System.currentTimeMillis() - 300000 + (Math.random() * (7800000)))), 0.5 + 0.5 * Math.random(),
waypoints.get(id), true, true, "Test");
return new Candidate(id + 1, new MillisecondsTimePoint((long) (rnd.nextDouble() * 200000)),
0.5 + 0.5 * rnd.nextDouble(), Util.get(trackedRace.getRace().getCourse().getWaypoints(), id), true, true, null);
}
}
@@ -43,6 +43,8 @@ import com.sap.sailing.domain.tracking.GPSFixMoving;
import com.sap.sailing.domain.tracking.MarkPassing;
import com.sap.sailing.domain.tracking.impl.WindImpl;
import com.sap.sailing.domain.tractracadapter.ReceiverType;
import com.tractrac.model.lib.api.event.CreateModelException;
import com.tractrac.subscription.lib.api.SubscriberInitializationException;
/**
* Tests the mark passing algorithm by using the data provided by an {@link OnlineTracTracBasedTest}. Subclasses may
@@ -66,7 +68,7 @@ public abstract class MartinAbstractMarkPassingTest extends OnlineTracTracBasedT
super();
}
public void setUp() throws IOException, InterruptedException, URISyntaxException, ParseException {
public void setUp() throws IOException, InterruptedException, URISyntaxException, ParseException, SubscriberInitializationException, CreateModelException {
super.setUp();
String raceID = "357c700a-9d9a-11e0-85be-406186cbf87c";
if (!loadData(raceID) && !forceReload) {
@@ -7,6 +7,9 @@ import java.text.ParseException;
import org.junit.Test;
import com.tractrac.model.lib.api.event.CreateModelException;
import com.tractrac.subscription.lib.api.SubscriberInitializationException;
public class OBMR2012VRMarkPassingTest extends AbstractMarkPassingTest {
public OBMR2012VRMarkPassingTest() throws MalformedURLException, URISyntaxException {
@@ -14,43 +17,43 @@ public class OBMR2012VRMarkPassingTest extends AbstractMarkPassingTest {
}
@Test
public void testRaceFr11() throws IOException, InterruptedException, URISyntaxException, ParseException {
public void testRaceFr11() throws IOException, InterruptedException, URISyntaxException, ParseException, SubscriberInitializationException, CreateModelException {
testRace("Fr_Fleet_1_1");
}
@Test
public void testRaceFr12() throws IOException, InterruptedException, URISyntaxException, ParseException {
public void testRaceFr12() throws IOException, InterruptedException, URISyntaxException, ParseException, SubscriberInitializationException, CreateModelException {
testRace("Fr_Fleet_1_2");
}
/*
* Ignored on master branch.
*
* @Test public void testRaceFr13() throws IOException, InterruptedException, URISyntaxException, ParseException {
* @Test public void testRaceFr13() throws IOException, InterruptedException, URISyntaxException, ParseException, SubscriberInitializationException, CreateModelException {
* testRace("Fr_Fleet_1_3"); }
*
* @Test public void testRaceFr21() throws IOException, InterruptedException, URISyntaxException, ParseException {
* @Test public void testRaceFr21() throws IOException, InterruptedException, URISyntaxException, ParseException, SubscriberInitializationException, CreateModelException {
* testRace("Fr_Fleet_2_1"); }
*
* @Test public void testRaceFr22() throws IOException, InterruptedException, URISyntaxException, ParseException {
* @Test public void testRaceFr22() throws IOException, InterruptedException, URISyntaxException, ParseException, SubscriberInitializationException, CreateModelException {
* testRace("Fr_Fleet_2_2"); }
*
* @Test public void testRaceFr23() throws IOException, InterruptedException, URISyntaxException, ParseException {
* @Test public void testRaceFr23() throws IOException, InterruptedException, URISyntaxException, ParseException, SubscriberInitializationException, CreateModelException {
* testRace("Fr_Fleet_2_3"); }
*
* @Test public void testRaceSaVm11() throws IOException, InterruptedException, URISyntaxException, ParseException {
* @Test public void testRaceSaVm11() throws IOException, InterruptedException, URISyntaxException, ParseException, SubscriberInitializationException, CreateModelException {
* testRace("Sa-Vm_Fleet_1_1"); }
*
* @Test public void testRaceSaVm12() throws IOException, InterruptedException, URISyntaxException, ParseException {
* @Test public void testRaceSaVm12() throws IOException, InterruptedException, URISyntaxException, ParseException, SubscriberInitializationException, CreateModelException {
* testRace("Sa-Vm_Fleet_1_2"); }
*
* @Test public void testRaceSaVm13() throws IOException, InterruptedException, URISyntaxException, ParseException {
* @Test public void testRaceSaVm13() throws IOException, InterruptedException, URISyntaxException, ParseException, SubscriberInitializationException, CreateModelException {
* testRace("Sa-Vm_Fleet_1_3"); }
*
* @Test public void testRaceSaVm21() throws IOException, InterruptedException, URISyntaxException, ParseException {
* @Test public void testRaceSaVm21() throws IOException, InterruptedException, URISyntaxException, ParseException, SubscriberInitializationException, CreateModelException {
* testRace("Sa-Vm_Fleet_2_1"); }
*
* @Test public void testRaceSaVm22() throws IOException, InterruptedException, URISyntaxException, ParseException {
* @Test public void testRaceSaVm22() throws IOException, InterruptedException, URISyntaxException, ParseException, SubscriberInitializationException, CreateModelException {
* testRace("Sa-Vm_Fleet_2_2"); }
*/
@@ -1,6 +1,7 @@
package com.sap.sailing.domain.test.mock;
import java.io.Serializable;
import java.util.Collections;
import java.util.List;
import java.util.NavigableSet;
import java.util.TreeSet;
@@ -9,7 +10,6 @@ import com.sap.sailing.domain.base.BoatClass;
import com.sap.sailing.domain.base.Competitor;
import com.sap.sailing.domain.base.CourseArea;
import com.sap.sailing.domain.base.CourseBase;
import com.sap.sailing.domain.base.Event;
import com.sap.sailing.domain.base.Leg;
import com.sap.sailing.domain.base.Mark;
import com.sap.sailing.domain.base.RaceColumnListener;
@@ -28,10 +28,12 @@ import com.sap.sailing.domain.common.Position;
import com.sap.sailing.domain.common.RegattaAndRaceIdentifier;
import com.sap.sailing.domain.common.RegattaIdentifier;
import com.sap.sailing.domain.common.Speed;
import com.sap.sailing.domain.common.SpeedWithBearing;
import com.sap.sailing.domain.common.Tack;
import com.sap.sailing.domain.common.TimePoint;
import com.sap.sailing.domain.common.WindSource;
import com.sap.sailing.domain.common.WindSourceType;
import com.sap.sailing.domain.common.racelog.Flags;
import com.sap.sailing.domain.leaderboard.ScoringScheme;
import com.sap.sailing.domain.racelog.RaceLog;
import com.sap.sailing.domain.racelog.tracking.GPSFixStore;
@@ -45,6 +47,7 @@ import com.sap.sailing.domain.tracking.GPSFixMoving;
import com.sap.sailing.domain.tracking.LineDetails;
import com.sap.sailing.domain.tracking.Maneuver;
import com.sap.sailing.domain.tracking.MarkPassing;
import com.sap.sailing.domain.tracking.RaceAbortedListener;
import com.sap.sailing.domain.tracking.RaceChangeListener;
import com.sap.sailing.domain.tracking.RaceListener;
import com.sap.sailing.domain.tracking.StartTimeChangedListener;
@@ -53,6 +56,8 @@ import com.sap.sailing.domain.tracking.TrackedLegOfCompetitor;
import com.sap.sailing.domain.tracking.TrackedRace;
import com.sap.sailing.domain.tracking.TrackedRaceStatus;
import com.sap.sailing.domain.tracking.Wind;
import com.sap.sailing.domain.tracking.WindLegTypeAndLegBearingCache;
import com.sap.sailing.domain.tracking.WindPositionMode;
import com.sap.sailing.domain.tracking.WindStore;
import com.sap.sailing.domain.tracking.WindTrack;
import com.sap.sailing.domain.tracking.WindWithConfidence;
@@ -282,7 +287,7 @@ public class MockedTrackedRace implements DynamicTrackedRace {
}
@Override
public Wind getEstimatedWindDirection(Position position, TimePoint timePoint) {
public Wind getEstimatedWindDirection(TimePoint timePoint) {
// TODO Auto-generated method stub
return null;
}
@@ -366,12 +371,6 @@ public class MockedTrackedRace implements DynamicTrackedRace {
return null;
}
@Override
public String getBaseName() {
// TODO Auto-generated method stub
return null;
}
@Override
public Iterable<? extends Series> getSeries() {
// TODO Auto-generated method stub
@@ -450,9 +449,9 @@ public class MockedTrackedRace implements DynamicTrackedRace {
}
@Override
public Event getEvent() {
public boolean useStartTimeInference() {
// TODO Auto-generated method stub
return null;
return false;
}
@Override
@@ -460,11 +459,17 @@ public class MockedTrackedRace implements DynamicTrackedRace {
// TODO Auto-generated method stub
}
@Override
public void setUseStartTimeInference(boolean useStartTimeInference) {
// TODO Auto-generated method stub
}
};
}
@Override
public Iterable<TrackedRace> getTrackedRaces() {
public Iterable<DynamicTrackedRace> getTrackedRaces() {
// TODO Auto-generated method stub
return null;
}
@@ -538,6 +543,12 @@ public class MockedTrackedRace implements DynamicTrackedRace {
// TODO Auto-generated method stub
return null;
}
@Override
public Tack getTack(SpeedWithBearing speedWithBearing, Wind wind, TimePoint timePoint) {
// TODO Auto-generated method stub
return null;
}
@Override
public Wind getDirectionFromStartToNextMark(TimePoint at) {
@@ -587,7 +598,7 @@ public class MockedTrackedRace implements DynamicTrackedRace {
}
@Override
public Distance getWindwardDistanceToOverallLeader(Competitor competitor, TimePoint timePoint)
public Distance getWindwardDistanceToOverallLeader(Competitor competitor, TimePoint timePoint, WindPositionMode windPositionMode)
throws NoWindException {
// TODO Auto-generated method stub
return null;
@@ -607,14 +618,12 @@ public class MockedTrackedRace implements DynamicTrackedRace {
@Override
public Iterable<WindSource> getWindSources(WindSourceType type) {
// TODO Auto-generated method stub
return null;
return Collections.emptyList();
}
@Override
public Iterable<WindSource> getWindSources() {
// TODO Auto-generated method stub
return null;
return Collections.emptyList();
}
@Override
@@ -625,7 +634,7 @@ public class MockedTrackedRace implements DynamicTrackedRace {
}
@Override
public WindWithConfidence<TimePoint> getEstimatedWindDirectionWithConfidence(Position position, TimePoint timePoint) {
public WindWithConfidence<TimePoint> getEstimatedWindDirectionWithConfidence(TimePoint timePoint) {
// TODO Auto-generated method stub
return null;
}
@@ -678,6 +687,13 @@ public class MockedTrackedRace implements DynamicTrackedRace {
return null;
}
@Override
public Distance getAverageAbsoluteCrossTrackError(Competitor competitor, TimePoint timePoint,
boolean waitForLatestAnalyses, WindLegTypeAndLegBearingCache cache) {
// TODO Auto-generated method stub
return null;
}
@Override
public WindTrack getOrCreateWindTrack(WindSource windSource) {
// TODO Auto-generated method stub
@@ -957,6 +973,13 @@ public class MockedTrackedRace implements DynamicTrackedRace {
return null;
}
@Override
public Distance getAverageSignedCrossTrackError(Competitor competitor, TimePoint timePoint,
boolean waitForLatestAnalyses, WindLegTypeAndLegBearingCache cache) {
// TODO Auto-generated method stub
return null;
}
@Override
public Distance getAverageSignedCrossTrackError(Competitor competitor, TimePoint from, TimePoint to,
boolean upwindOnly, boolean waitForLatestAnalysis) throws NoWindException {
@@ -965,9 +988,27 @@ public class MockedTrackedRace implements DynamicTrackedRace {
}
@Override
public void waitUntilLoadingFromGPSFixStoreComplete() throws InterruptedException {
public void waitForLoadingFromGPSFixStoreToFinishRunning(RaceLog forRaceLog) throws InterruptedException {
// TODO Auto-generated method stub
}
@Override
public void addRaceAbortedListener(RaceAbortedListener listener) {
// TODO Auto-generated method stub
}
@Override
public void onAbortedByRaceCommittee(Flags flag) {
// TODO Auto-generated method stub
}
@Override
public Position getCenterOfCourse(TimePoint at) {
// TODO Auto-generated method stub
return null;
}
}
@@ -66,6 +66,15 @@ public class MockedTrackedRaceWithFixedRank extends MockedTrackedRace {
public Serializable getId() {
return null;
}
@Override
public Competitor getCompetitorById(Serializable competitorID) {
if (competitorID.equals(MockedTrackedRaceWithFixedRank.this.competitor.getId())) {
return MockedTrackedRaceWithFixedRank.this.competitor;
} else {
return null;
}
}
}
@Override
@@ -32,6 +32,16 @@ public class MockedTrackedRaceWithFixedRankAndManyCompetitors extends MockedTrac
public Iterable<Competitor> getCompetitors() {
return competitors;
}
@Override
public Competitor getCompetitorById(Serializable competitorID) {
for (Competitor competitor : competitors) {
if (competitorID.equals(competitor.getId())) {
return competitor;
}
}
return null;
}
@Override
public BoatClass getBoatClass() {
return null;
@@ -10,6 +10,7 @@ import com.sap.sailing.domain.base.Competitor;
import com.sap.sailing.domain.base.Leg;
import com.sap.sailing.domain.base.Mark;
import com.sap.sailing.domain.base.RaceDefinition;
import com.sap.sailing.domain.base.Regatta;
import com.sap.sailing.domain.base.Sideline;
import com.sap.sailing.domain.base.SpeedWithConfidence;
import com.sap.sailing.domain.base.Waypoint;
@@ -20,6 +21,7 @@ import com.sap.sailing.domain.common.NoWindException;
import com.sap.sailing.domain.common.Position;
import com.sap.sailing.domain.common.RegattaAndRaceIdentifier;
import com.sap.sailing.domain.common.Speed;
import com.sap.sailing.domain.common.SpeedWithBearing;
import com.sap.sailing.domain.common.Tack;
import com.sap.sailing.domain.common.TimePoint;
import com.sap.sailing.domain.common.WindSource;
@@ -33,6 +35,7 @@ import com.sap.sailing.domain.tracking.GPSFixTrack;
import com.sap.sailing.domain.tracking.LineDetails;
import com.sap.sailing.domain.tracking.Maneuver;
import com.sap.sailing.domain.tracking.MarkPassing;
import com.sap.sailing.domain.tracking.RaceAbortedListener;
import com.sap.sailing.domain.tracking.RaceChangeListener;
import com.sap.sailing.domain.tracking.StartTimeChangedListener;
import com.sap.sailing.domain.tracking.TrackedLeg;
@@ -41,9 +44,12 @@ import com.sap.sailing.domain.tracking.TrackedRace;
import com.sap.sailing.domain.tracking.TrackedRaceStatus;
import com.sap.sailing.domain.tracking.TrackedRegatta;
import com.sap.sailing.domain.tracking.Wind;
import com.sap.sailing.domain.tracking.WindLegTypeAndLegBearingCache;
import com.sap.sailing.domain.tracking.WindPositionMode;
import com.sap.sailing.domain.tracking.WindStore;
import com.sap.sailing.domain.tracking.WindTrack;
import com.sap.sailing.domain.tracking.WindWithConfidence;
import com.sap.sailing.domain.tracking.impl.DynamicTrackedRegattaImpl;
import com.sap.sse.common.Util;
/**
@@ -58,6 +64,7 @@ public class MockedTrackedRaceWithStartTimeAndRanks implements TrackedRace {
private static final long serialVersionUID = 2708044935347796930L;
private final TimePoint startTime;
private final List<Competitor> competitorsFromBestToWorst;
private final Regatta regatta;
private RaceDefinition race;
/**
@@ -66,7 +73,11 @@ public class MockedTrackedRaceWithStartTimeAndRanks implements TrackedRace {
* mocked tracked race
*/
public MockedTrackedRaceWithStartTimeAndRanks(TimePoint startTime, List<Competitor> competitorsFromBestToWorst) {
super();
this(startTime, competitorsFromBestToWorst, null);
}
public MockedTrackedRaceWithStartTimeAndRanks(TimePoint startTime, List<Competitor> competitorsFromBestToWorst, Regatta regatta) {
this.regatta = regatta;
this.startTime = startTime;
// copies the list to make sure that later modifications to the list passed to this constructor don't affect the ranking produced by this race
this.competitorsFromBestToWorst = new ArrayList<Competitor>(competitorsFromBestToWorst);
@@ -222,14 +233,12 @@ public class MockedTrackedRaceWithStartTimeAndRanks implements TrackedRace {
@Override
public Iterable<WindSource> getWindSources(WindSourceType type) {
// TODO Auto-generated method stub
return null;
return Collections.emptyList();
}
@Override
public Iterable<WindSource> getWindSources() {
// TODO Auto-generated method stub
return null;
return Collections.emptyList();
}
@Override
@@ -305,7 +314,7 @@ public class MockedTrackedRaceWithStartTimeAndRanks implements TrackedRace {
}
@Override
public Wind getEstimatedWindDirection(Position position, TimePoint timePoint) {
public Wind getEstimatedWindDirection(TimePoint timePoint) {
// TODO Auto-generated method stub
return null;
}
@@ -315,11 +324,16 @@ public class MockedTrackedRaceWithStartTimeAndRanks implements TrackedRace {
// TODO Auto-generated method stub
return null;
}
@Override
public Tack getTack(SpeedWithBearing speedWithBearing, Wind wind, TimePoint timePoint) {
// TODO Auto-generated method stub
return null;
}
@Override
public TrackedRegatta getTrackedRegatta() {
// TODO Auto-generated method stub
return null;
return new DynamicTrackedRegattaImpl(regatta);
}
@Override
@@ -372,7 +386,7 @@ public class MockedTrackedRaceWithStartTimeAndRanks implements TrackedRace {
}
@Override
public Distance getWindwardDistanceToOverallLeader(Competitor competitor, TimePoint timePoint)
public Distance getWindwardDistanceToOverallLeader(Competitor competitor, TimePoint timePoint, WindPositionMode windPositionMode)
throws NoWindException {
// TODO Auto-generated method stub
return null;
@@ -398,7 +412,7 @@ public class MockedTrackedRaceWithStartTimeAndRanks implements TrackedRace {
}
@Override
public WindWithConfidence<TimePoint> getEstimatedWindDirectionWithConfidence(Position position, TimePoint timePoint) {
public WindWithConfidence<TimePoint> getEstimatedWindDirectionWithConfidence(TimePoint timePoint) {
// TODO Auto-generated method stub
return null;
}
@@ -415,6 +429,13 @@ public class MockedTrackedRaceWithStartTimeAndRanks implements TrackedRace {
return null;
}
@Override
public Distance getAverageAbsoluteCrossTrackError(Competitor competitor, TimePoint timePoint,
boolean waitForLatestAnalyses, WindLegTypeAndLegBearingCache cache) {
// TODO Auto-generated method stub
return null;
}
@Override
public WindStore getWindStore() {
// TODO Auto-generated method stub
@@ -604,6 +625,13 @@ public class MockedTrackedRaceWithStartTimeAndRanks implements TrackedRace {
return null;
}
@Override
public Distance getAverageSignedCrossTrackError(Competitor competitor, TimePoint timePoint,
boolean waitForLatestAnalyses, WindLegTypeAndLegBearingCache cache) {
// TODO Auto-generated method stub
return null;
}
@Override
public Distance getAverageSignedCrossTrackError(Competitor competitor, TimePoint from, TimePoint to,
boolean upwindOnly, boolean waitForLatestAnalysis) throws NoWindException {
@@ -611,16 +639,28 @@ public class MockedTrackedRaceWithStartTimeAndRanks implements TrackedRace {
return null;
}
@Override
public GPSFixStore getGPSFixStore() {
// TODO Auto-generated method stub
return null;
}
@Override
public GPSFixStore getGPSFixStore() {
// TODO Auto-generated method stub
return null;
}
@Override
public void waitUntilLoadingFromGPSFixStoreComplete() throws InterruptedException {
public void waitForLoadingFromGPSFixStoreToFinishRunning(RaceLog forRaceLog) throws InterruptedException {
// TODO Auto-generated method stub
}
@Override
public void addRaceAbortedListener(RaceAbortedListener listener) {
// TODO Auto-generated method stub
}
@Override
public Position getCenterOfCourse(TimePoint at) {
// TODO Auto-generated method stub
return null;
}
}