← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 19928: minor fix, ignore two tests in schema/query-service which are now invalid (since we don't expose ...

 

------------------------------------------------------------
revno: 19928
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2015-09-02 13:04:09 +0700
message:
  minor fix, ignore two tests in schema/query-service which are now invalid (since we don't expose type/numberType in web-api anymore)
modified:
  dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/query/QueryServiceTest.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/QueryServiceTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/query/QueryServiceTest.java	2015-06-04 09:25:32 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/query/QueryServiceTest.java	2015-09-02 06:04:09 +0000
@@ -36,6 +36,7 @@
 import org.hisp.dhis.schema.Schema;
 import org.hisp.dhis.schema.SchemaService;
 import org.jfree.data.time.Year;
+import org.junit.Ignore;
 import org.junit.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 
@@ -62,21 +63,27 @@
     private void createDataElements()
     {
         DataElement dataElementA = createDataElement( 'A' );
+        dataElementA.setType( DataElement.VALUE_TYPE_INT );
         dataElementA.setNumberType( DataElement.VALUE_TYPE_NUMBER );
 
         DataElement dataElementB = createDataElement( 'B' );
+        dataElementB.setType( DataElement.VALUE_TYPE_INT );
         dataElementB.setNumberType( DataElement.VALUE_TYPE_BOOL );
 
         DataElement dataElementC = createDataElement( 'C' );
+        dataElementC.setType( DataElement.VALUE_TYPE_INT );
         dataElementC.setNumberType( DataElement.VALUE_TYPE_INT );
 
         DataElement dataElementD = createDataElement( 'D' );
+        dataElementD.setType( DataElement.VALUE_TYPE_INT );
         dataElementD.setNumberType( DataElement.VALUE_TYPE_NUMBER );
 
         DataElement dataElementE = createDataElement( 'E' );
+        dataElementE.setType( DataElement.VALUE_TYPE_INT );
         dataElementE.setNumberType( DataElement.VALUE_TYPE_BOOL );
 
         DataElement dataElementF = createDataElement( 'F' );
+        dataElementF.setType( DataElement.VALUE_TYPE_INT );
         dataElementF.setNumberType( DataElement.VALUE_TYPE_INT );
 
         dataElementA.setCreated( Year.parseYear( "2001" ).getStart() );
@@ -376,47 +383,28 @@
         createDataElements();
         Query query = Query.from( schemaService.getDynamicSchema( DataElement.class ) );
 
-        Result result = queryService.query( query, new ResultTransformer()
-        {
-            @Override
-            public Result transform( MutableResult result )
-            {
-                return new Result();
-            }
-        } );
+        Result result = queryService.query( query, result1 -> new Result() );
 
         assertEquals( 0, result.size() );
 
-        result = queryService.query( query, new ResultTransformer()
-        {
-            @Override
-            public Result transform( MutableResult result )
-            {
-                return new Result( result.getItems() );
-            }
-        } );
+        result = queryService.query( query, result1 -> new Result( result1.getItems() ) );
 
         assertEquals( 6, result.size() );
 
-        result = queryService.query( query, new ResultTransformer()
-        {
-            @Override
-            public Result transform( MutableResult result )
+        result = queryService.query( query, result1 -> {
+            Iterator<? extends IdentifiableObject> iterator = result1.getItems().iterator();
+
+            while ( iterator.hasNext() )
             {
-                Iterator<? extends IdentifiableObject> iterator = result.getItems().iterator();
+                IdentifiableObject identifiableObject = iterator.next();
 
-                while ( iterator.hasNext() )
+                if ( identifiableObject.getUid().equals( "deabcdefghD" ) )
                 {
-                    IdentifiableObject identifiableObject = iterator.next();
-
-                    if ( identifiableObject.getUid().equals( "deabcdefghD" ) )
-                    {
-                        iterator.remove();
-                    }
+                    iterator.remove();
                 }
-
-                return result;
             }
+
+            return result1;
         } );
 
         assertEquals( 5, result.size() );
@@ -525,6 +513,7 @@
     }
 
     @Test
+    @Ignore
     public void testNumberTypeNumber()
     {
         createDataElements();
@@ -543,6 +532,7 @@
     }
 
     @Test
+    @Ignore
     public void testNumberTypeBoolOrInt()
     {
         createDataElements();