Skip to content

Commit 96da3e8

Browse files
committed
Use hamcrest for unit test PR
#3412
1 parent c95787b commit 96da3e8

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

app/display/runtime/src/test/java/org/csstudio/display/builder/runtime/test/WidgetRuntimeTest.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package org.csstudio.display.builder.runtime.test;
22

3-
import static org.junit.Assert.assertTrue;
3+
import static org.hamcrest.CoreMatchers.equalTo;
4+
import static org.hamcrest.MatcherAssert.assertThat;
45
import static org.junit.jupiter.api.Assertions.fail;
56

67
import java.util.ArrayList;
@@ -37,7 +38,7 @@ public void testWriteAction()
3738
//PVUtil.writePV(pv_name, initValue, 0);
3839
double readValue = PVUtil.getDouble(pv);
3940
//Test in standard way
40-
assertTrue("Write succeed", readValue == initValue);
41+
assertThat(readValue, equalTo(initValue));
4142

4243
//Test with WidgetRuntime (write Action)
4344
ActionButtonWidget widget = new ActionButtonWidget();
@@ -63,7 +64,8 @@ public void testWriteAction()
6364
//Test the new value
6465
readValue = PVUtil.getDouble(pv);
6566
//Test if the new value is ok
66-
assertTrue("Write succeed", readValue == newValue);
67+
assertThat(readValue, equalTo(newValue));
68+
6769
} catch (Exception e) {
6870
e.printStackTrace();
6971
fail(e);

0 commit comments

Comments
 (0)