JAL-2808 revised util.matcher package, 2 filter conditions per feature
[jalview.git] / test / jalview / util / matcher / ConditionTest.java
diff --git a/test/jalview/util/matcher/ConditionTest.java b/test/jalview/util/matcher/ConditionTest.java
new file mode 100644 (file)
index 0000000..11a0630
--- /dev/null
@@ -0,0 +1,31 @@
+package jalview.util.matcher;
+
+import static org.testng.Assert.assertEquals;
+
+import java.util.Locale;
+
+import org.testng.annotations.Test;
+
+public class ConditionTest
+{
+  @Test
+  public void testToString()
+  {
+    Locale.setDefault(Locale.UK);
+    assertEquals(Condition.Contains.toString(), "Contains");
+    assertEquals(Condition.NotContains.toString(), "Does not contain");
+    assertEquals(Condition.Matches.toString(), "Matches");
+    assertEquals(Condition.NotMatches.toString(), "Does not match");
+    assertEquals(Condition.LT.toString(), "Is less than");
+    assertEquals(Condition.LE.toString(), "Is less than or equal to");
+    assertEquals(Condition.GT.toString(), "Is greater than");
+    assertEquals(Condition.GE.toString(), "Is greater than or equal to");
+    assertEquals(Condition.EQ.toString(), "Is equal to");
+    assertEquals(Condition.NE.toString(), "Is not equal to");
+
+    /*
+     * repeat call to get coverage of cached value
+     */
+    assertEquals(Condition.NE.toString(), "Is not equal to");
+  }
+}