← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 20991: EqualOperator test for Enums

 

------------------------------------------------------------
revno: 20991
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2015-11-09 15:59:51 +0700
message:
  EqualOperator test for Enums
modified:
  dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/query/InMemoryQueryEngineTest.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/InMemoryQueryEngineTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/query/InMemoryQueryEngineTest.java	2015-11-09 08:22:59 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/query/InMemoryQueryEngineTest.java	2015-11-09 08:59:51 +0000
@@ -150,6 +150,19 @@
     }
 
     @Test
+    public void getEqQueryEnum()
+    {
+        Query query = Query.from( schemaService.getDynamicSchema( DataElement.class ) );
+        query.setObjects( dataElements );
+        query.add( Restrictions.eq( "valueType", ValueType.INTEGER ) );
+        List<? extends IdentifiableObject> objects = queryEngine.query( query );
+
+        assertEquals( 2, objects.size() );
+        assertTrue( collectionContainsUid( objects, "deabcdefghC" ) );
+        assertTrue( collectionContainsUid( objects, "deabcdefghF" ) );
+    }
+
+    @Test
     public void getNeQuery()
     {
         Query query = Query.from( schemaService.getDynamicSchema( DataElement.class ) );