-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added unit test for DetectedObjectInteraction
Moved unit tests for mosiac objects into object lib
- Loading branch information
1 parent
c699981
commit d552372
Showing
3 changed files
with
53 additions
and
9 deletions.
There are no files selected for viewing
47 changes: 47 additions & 0 deletions
47
...src/test/java/org/eclipse/mosaic/interactions/detector/DetectedObjectInteractionTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package org.eclipse.mosaic.interactions.detector; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
import static org.junit.Assert.assertNotEquals; | ||
|
||
import org.eclipse.mosaic.lib.geo.CartesianPoint; | ||
import org.eclipse.mosaic.lib.math.Vector3d; | ||
import org.eclipse.mosaic.lib.objects.detector.DetectedObject; | ||
import org.eclipse.mosaic.lib.objects.detector.DetectionType; | ||
import org.eclipse.mosaic.lib.objects.detector.Size; | ||
import org.junit.Before; | ||
import org.junit.Test; | ||
|
||
public class DetectedObjectInteractionTest { | ||
|
||
private DetectedObjectInteraction interaction; | ||
@Before | ||
public void setUp() throws Exception { | ||
interaction = new DetectedObjectInteraction(0, null); | ||
} | ||
|
||
@Test | ||
public void testGetterSetterConstructor() { | ||
DetectedObject detectedObject = new DetectedObject( | ||
DetectionType.CAR, | ||
0.7, | ||
"sensor2", | ||
"projection String2", | ||
"Object7", | ||
CartesianPoint.xyz(-1.1, -2, -3.2), | ||
new Vector3d(1, 1, 1), | ||
new Vector3d(.1, .2, .3), | ||
new Size(2, 1, .5)); | ||
Double[] covarianceMatrix = new Double[] { 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0 }; | ||
detectedObject.setPositionCovariance(covarianceMatrix); | ||
detectedObject.setVelocityCovariance(covarianceMatrix); | ||
detectedObject.setAngularVelocityCovariance(covarianceMatrix); | ||
|
||
interaction.setDetectedObject(detectedObject); | ||
|
||
assertEquals(detectedObject, interaction.getDetectedObject()); | ||
|
||
DetectedObjectInteraction interaction2 = new DetectedObjectInteraction(0, detectedObject); | ||
|
||
assertNotEquals(interaction, interaction2); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters