← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 15438: Fixed compilation/test error in tracker

 

------------------------------------------------------------
revno: 15438
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2014-05-27 17:40:29 +0200
message:
  Fixed compilation/test error in tracker
modified:
  dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityAuditServiceTest.java
  dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityAuditStoreTest.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-tracker/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityAuditServiceTest.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityAuditServiceTest.java	2014-05-16 15:26:10 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityAuditServiceTest.java	2014-05-27 15:40:29 +0000
@@ -65,8 +65,6 @@
 
     private TrackedEntityAudit auditB;
 
-    private TrackedEntityAudit auditC;
-
     private TrackedEntityInstance entityInstanceA;
 
     private TrackedEntityInstance entityInstanceB;
@@ -92,8 +90,7 @@
         today = cal.getTime();
 
         auditA = new TrackedEntityAudit( entityInstanceA, "test", today, TrackedEntityAudit.MODULE_ENTITY_INSTANCE_DASHBOARD );
-        auditB = new TrackedEntityAudit( entityInstanceA, "test", today, TrackedEntityAudit.MODULE_TABULAR_REPORT );
-        auditC = new TrackedEntityAudit( entityInstanceB, "test", today, TrackedEntityAudit.MODULE_ENTITY_INSTANCE_DASHBOARD );
+        auditB = new TrackedEntityAudit( entityInstanceB, "test", today, TrackedEntityAudit.MODULE_ENTITY_INSTANCE_DASHBOARD );
     }
 
     @Test
@@ -141,16 +138,14 @@
     {
         auditService.saveTrackedEntityAudit( auditA );
         auditService.saveTrackedEntityAudit( auditB );
-        auditService.saveTrackedEntityAudit( auditC );
 
         Collection<TrackedEntityAudit> audits = auditService.getTrackedEntityAudits( entityInstanceA );
-        assertEquals( 2, audits.size() );
+        assertEquals( 1, audits.size() );
         assertTrue( audits.contains( auditA ) );
+
+        audits = auditService.getTrackedEntityAudits( entityInstanceB );
+        assertEquals( 1, audits.size() );
         assertTrue( audits.contains( auditB ) );
-
-        audits = auditService.getTrackedEntityAudits( entityInstanceB );
-        assertEquals( 1, audits.size() );
-        assertTrue( audits.contains( auditC ) );
     }
 
     @Test

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityAuditStoreTest.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityAuditStoreTest.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityAuditStoreTest.java	2014-05-27 15:40:29 +0000
@@ -63,8 +63,6 @@
 
     private TrackedEntityAudit auditB;
 
-    private TrackedEntityAudit auditC;
-
     private TrackedEntityInstance entityInstanceA;
 
     private TrackedEntityInstance entityInstanceB;
@@ -90,8 +88,7 @@
         today = cal.getTime();
 
         auditA = new TrackedEntityAudit( entityInstanceA, "test", today, TrackedEntityAudit.MODULE_ENTITY_INSTANCE_DASHBOARD );
-        auditB = new TrackedEntityAudit( entityInstanceA, "test", today, TrackedEntityAudit.MODULE_TABULAR_REPORT );
-        auditC = new TrackedEntityAudit( entityInstanceB, "test", today, TrackedEntityAudit.MODULE_ENTITY_INSTANCE_DASHBOARD );
+        auditB = new TrackedEntityAudit( entityInstanceB, "test", today, TrackedEntityAudit.MODULE_ENTITY_INSTANCE_DASHBOARD );
     }
 
     @Test
@@ -99,16 +96,14 @@
     {
         auditStore.save( auditA );
         auditStore.save( auditB );
-        auditStore.save( auditC );
 
         Collection<TrackedEntityAudit> entityInstanceAudits = auditStore.get( entityInstanceA );
-        assertEquals( 2, entityInstanceAudits.size() );
+        assertEquals( 1, entityInstanceAudits.size() );
         assertTrue( entityInstanceAudits.contains( auditA ) );
+
+        entityInstanceAudits = auditStore.get( entityInstanceB );
+        assertEquals( 1, entityInstanceAudits.size() );
         assertTrue( entityInstanceAudits.contains( auditB ) );
-
-        entityInstanceAudits = auditStore.get( entityInstanceB );
-        assertEquals( 1, entityInstanceAudits.size() );
-        assertTrue( entityInstanceAudits.contains( auditC ) );
     }
 
     @Test
@@ -120,6 +115,5 @@
         TrackedEntityAudit entityInstanceAudit = auditStore.get( entityInstanceAId, "test", today,
             TrackedEntityAudit.MODULE_ENTITY_INSTANCE_DASHBOARD );
         assertEquals( auditA, entityInstanceAudit );
-
     }
 }