dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #29631
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 14985: more test fixes
------------------------------------------------------------
revno: 14985
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2014-04-25 16:59:08 +0545
message:
more test fixes
modified:
dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityAttributeStoreTest.java
dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceReminderServiceTest.java
dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentitydatavalue/TrackedEntityDataValueServiceTest.java
dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentitydatavalue/TrackedEntityDataValueStoreTest.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/TrackedEntityAttributeStoreTest.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityAttributeStoreTest.java 2014-04-15 03:48:38 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityAttributeStoreTest.java 2014-04-25 11:14:08 +0000
@@ -73,6 +73,7 @@
List<TrackedEntityAttribute> attributesA = new ArrayList<TrackedEntityAttribute>();
attributesA.add( attributeA );
attributesA.add( attributeB );
+
attributeGroup = createTrackedEntityAttributeGroup( 'A', attributesA );
}
=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceReminderServiceTest.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceReminderServiceTest.java 2014-03-26 14:01:14 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceReminderServiceTest.java 2014-04-25 11:14:08 +0000
@@ -121,6 +121,7 @@
orgUnits.add( organisationUnit );
user = new User();
+ user.setAutoFields();
user.setSurname( "A" );
user.setFirstName( "B" );
user.setPhoneNumber( "111-222-333" );
=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentitydatavalue/TrackedEntityDataValueServiceTest.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentitydatavalue/TrackedEntityDataValueServiceTest.java 2014-03-26 14:01:14 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentitydatavalue/TrackedEntityDataValueServiceTest.java 2014-04-25 11:14:08 +0000
@@ -28,17 +28,6 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
-import java.util.Calendar;
-import java.util.Collection;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.Set;
-
import org.hisp.dhis.DhisSpringTest;
import org.hisp.dhis.dataelement.DataElement;
import org.hisp.dhis.dataelement.DataElementService;
@@ -57,9 +46,16 @@
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
+import java.util.Calendar;
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.Set;
+
+import static org.junit.Assert.*;
+
/**
* @author Chau Thu Tran
- *
* @version $ TrackedEntityDataValueServiceTest.java Nov 5, 2013 3:11:48 PM $
*/
public class TrackedEntityDataValueServiceTest
@@ -125,16 +121,18 @@
dataElementService.addDataElement( dataElementA );
dataElementService.addDataElement( dataElementB );
- entityInstance = createTrackedEntityInstance( 'A', organisationUnit );
+ entityInstance = createTrackedEntityInstance( 'A', organisationUnit );
entityInstanceService.addTrackedEntityInstance( entityInstance );
Program program = createProgram( 'A', new HashSet<ProgramStage>(), organisationUnit );
programService.addProgram( program );
- ProgramStage stageA = new ProgramStage( "A", program );
+ ProgramStage stageA = createProgramStage( 'A', 0 );
+ stageA.setProgram( program );
programStageService.saveProgramStage( stageA );
- ProgramStage stageB = new ProgramStage( "B", program );
+ ProgramStage stageB = createProgramStage( 'B', 0 );
+ stageB.setProgram( program );
programStageService.saveProgramStage( stageB );
Set<ProgramStage> programStages = new HashSet<ProgramStage>();
@@ -305,7 +303,7 @@
@Test
public void testGetDataValuesByDataElement()
{
- dataValueService.saveTrackedEntityDataValue( dataValueA );
+ dataValueService.saveTrackedEntityDataValue( dataValueA );
dataValueService.saveTrackedEntityDataValue( dataValueB );
dataValueService.saveTrackedEntityDataValue( dataValueC );
dataValueService.saveTrackedEntityDataValue( dataValueD );
=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentitydatavalue/TrackedEntityDataValueStoreTest.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentitydatavalue/TrackedEntityDataValueStoreTest.java 2014-03-26 14:01:14 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentitydatavalue/TrackedEntityDataValueStoreTest.java 2014-04-25 11:14:08 +0000
@@ -131,10 +131,12 @@
Program program = createProgram( 'A', new HashSet<ProgramStage>(), organisationUnit );
programService.addProgram( program );
- ProgramStage stageA = new ProgramStage( "A", program );
+ ProgramStage stageA = createProgramStage( 'A', 0 );
+ stageA.setProgram( program );
programStageService.saveProgramStage( stageA );
- ProgramStage stageB = new ProgramStage( "B", program );
+ ProgramStage stageB = createProgramStage( 'B', 0 );
+ stageB.setProgram( program );
programStageService.saveProgramStage( stageB );
Set<ProgramStage> programStages = new HashSet<ProgramStage>();