aboutsummaryrefslogtreecommitdiff
path: root/test/org/traccar/processing
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2018-01-25 20:14:42 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2018-01-26 08:41:45 +1300
commit87bdccbe9843e38174ad345b8e474b1cded9f985 (patch)
tree4b2f90ad2b9a5d32410ab9579fb4135b5ac95bfa /test/org/traccar/processing
parent8535983fea8c09046c53f2ebf388bbf3fae594ce (diff)
downloadtraccar-server-87bdccbe9843e38174ad345b8e474b1cded9f985.tar.gz
traccar-server-87bdccbe9843e38174ad345b8e474b1cded9f985.tar.bz2
traccar-server-87bdccbe9843e38174ad345b8e474b1cded9f985.zip
Static imports for junit
Diffstat (limited to 'test/org/traccar/processing')
-rw-r--r--test/org/traccar/processing/ComputedAttributesTest.java24
1 files changed, 13 insertions, 11 deletions
diff --git a/test/org/traccar/processing/ComputedAttributesTest.java b/test/org/traccar/processing/ComputedAttributesTest.java
index fe898ff54..88ebfd9a9 100644
--- a/test/org/traccar/processing/ComputedAttributesTest.java
+++ b/test/org/traccar/processing/ComputedAttributesTest.java
@@ -7,6 +7,8 @@ import org.junit.Test;
import org.traccar.model.Attribute;
import org.traccar.model.Position;
+import static org.junit.Assert.assertEquals;
+
public class ComputedAttributesTest {
@Test
@@ -26,41 +28,41 @@ public class ComputedAttributesTest {
Attribute attribute = new Attribute();
attribute.setExpression("adc1");
- Assert.assertEquals(128, computedAttributesHandler.computeAttribute(attribute, position));
+ assertEquals(128, computedAttributesHandler.computeAttribute(attribute, position));
attribute.setExpression("!booleanFlag");
- Assert.assertEquals(false, computedAttributesHandler.computeAttribute(attribute, position));
+ assertEquals(false, computedAttributesHandler.computeAttribute(attribute, position));
attribute.setExpression("adc2 * 2 + 50");
- Assert.assertEquals(250, computedAttributesHandler.computeAttribute(attribute, position));
+ assertEquals(250, computedAttributesHandler.computeAttribute(attribute, position));
attribute.setExpression("(bitFlag & 4) != 0");
- Assert.assertEquals(true, computedAttributesHandler.computeAttribute(attribute, position));
+ assertEquals(true, computedAttributesHandler.computeAttribute(attribute, position));
attribute.setExpression("if (event == 42) \"lowBattery\"");
- Assert.assertEquals("lowBattery", computedAttributesHandler.computeAttribute(attribute, position));
+ assertEquals("lowBattery", computedAttributesHandler.computeAttribute(attribute, position));
attribute.setExpression("speed > 5 && valid");
- Assert.assertEquals(false, computedAttributesHandler.computeAttribute(attribute, position));
+ assertEquals(false, computedAttributesHandler.computeAttribute(attribute, position));
attribute.setExpression("fixTime");
- Assert.assertEquals(date, computedAttributesHandler.computeAttribute(attribute, position));
+ assertEquals(date, computedAttributesHandler.computeAttribute(attribute, position));
attribute.setExpression("math:pow(adc1, 2)");
- Assert.assertEquals(16384.0, computedAttributesHandler.computeAttribute(attribute, position));
+ assertEquals(16384.0, computedAttributesHandler.computeAttribute(attribute, position));
// modification tests
attribute.setExpression("adc1 = 256");
computedAttributesHandler.computeAttribute(attribute, position);
- Assert.assertEquals(128, position.getInteger("adc1"));
+ assertEquals(128, position.getInteger("adc1"));
attribute.setExpression("result = \"fail\"");
computedAttributesHandler.computeAttribute(attribute, position);
- Assert.assertEquals("success", position.getString("result"));
+ assertEquals("success", position.getString("result"));
attribute.setExpression("fixTime = \"2017-10-18 10:00:01\"");
computedAttributesHandler.computeAttribute(attribute, position);
- Assert.assertEquals(date, position.getFixTime());
+ assertEquals(date, position.getFixTime());
}