← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 20947: test for In operator Enum

 

------------------------------------------------------------
revno: 20947
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2015-11-04 15:35:57 +0700
message:
  test for In operator Enum
modified:
  dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/query/OperatorTest.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/query/OperatorTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/query/OperatorTest.java	2015-11-04 08:29:32 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/query/OperatorTest.java	2015-11-04 08:35:57 +0000
@@ -365,4 +365,21 @@
         assertTrue( operator.test( "d" ) );
         assertFalse( operator.test( "e" ) );
     }
+
+    enum TestEnum
+    {
+        A, B, C
+    }
+
+    @Test
+    public void testInEnum()
+    {
+        In operator = new In( "[A,B]" );
+
+        assertTrue( operator.test( TestEnum.A ) );
+        assertTrue( operator.test( TestEnum.B ) );
+        assertFalse( operator.test( TestEnum.C ) );
+        assertFalse( operator.test( 123 ) );
+        assertFalse( operator.test( "abc" ) );
+    }
 }