From 87bdccbe9843e38174ad345b8e474b1cded9f985 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Thu, 25 Jan 2018 20:14:42 +1300 Subject: Static imports for junit --- .../traccar/processing/ComputedAttributesTest.java | 24 ++++++++++++---------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'test/org/traccar/processing') 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()); } -- cgit v1.2.3