dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #28147
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 14034: compilation fixes for trackedEntity* tests
------------------------------------------------------------
revno: 14034
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Sat 2014-02-15 10:50:30 +0700
message:
compilation fixes for trackedEntity* tests
modified:
dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityAttributeOptionServiceTest.java
dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityAttributeOptionStoreTest.java
dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentityattributevalue/TrackedEntityAttributeValueServiceTest.java
dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentityattributevalue/TrackedEntityAttributeValueStoreTest.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/TrackedEntityAttributeOptionServiceTest.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityAttributeOptionServiceTest.java 2014-02-07 20:25:49 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityAttributeOptionServiceTest.java 2014-02-15 03:50:30 +0000
@@ -27,31 +27,20 @@
package org.hisp.dhis.trackedentity;
-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 org.hisp.dhis.DhisSpringTest;
-import org.hisp.dhis.trackedentity.TrackedEntityAttribute;
-import org.hisp.dhis.trackedentity.TrackedEntityAttributeOption;
-import org.hisp.dhis.trackedentity.TrackedEntityAttributeOptionService;
-import org.hisp.dhis.trackedentity.TrackedEntityAttributeService;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
+import static org.junit.Assert.*;
+
/**
* @author Chau Thu Tran
- *
* @version $ TrackedEntityAttributeOptionServiceTest.java Nov 5, 2013 4:25:29 PM $
*/
public class TrackedEntityAttributeOptionServiceTest
extends DhisSpringTest
{
@Autowired
- private TrackedEntityAttributeOptionService attributeOptionService;
-
- @Autowired
private TrackedEntityAttributeService attributeService;
private TrackedEntityAttributeOption attributeOptionA;
@@ -81,75 +70,75 @@
@Test
public void testAddTrackedEntityAttributeOption()
{
- int idA = attributeOptionService.addTrackedEntityAttributeOption( attributeOptionA );
- int idB = attributeOptionService.addTrackedEntityAttributeOption( attributeOptionB );
+ int idA = attributeService.addTrackedEntityAttributeOption( attributeOptionA );
+ int idB = attributeService.addTrackedEntityAttributeOption( attributeOptionB );
- assertNotNull( attributeOptionService.get( idA ) );
- assertNotNull( attributeOptionService.get( idB ) );
+ assertNotNull( attributeService.getTrackedEntityAttributeOption( (idA) ) );
+ assertNotNull( attributeService.getTrackedEntityAttributeOption( idB ) );
}
@Test
public void testDeleteTrackedEntityAttributeGroup()
{
- int idA = attributeOptionService.addTrackedEntityAttributeOption( attributeOptionA );
- int idB = attributeOptionService.addTrackedEntityAttributeOption( attributeOptionB );
-
- assertNotNull( attributeOptionService.get( idA ) );
- assertNotNull( attributeOptionService.get( idB ) );
-
- attributeOptionService.deleteTrackedEntityAttributeOption( attributeOptionA );
-
- assertNull( attributeOptionService.get( idA ) );
- assertNotNull( attributeOptionService.get( idB ) );
-
- attributeOptionService.deleteTrackedEntityAttributeOption( attributeOptionB );
-
- assertNull( attributeOptionService.get( idA ) );
- assertNull( attributeOptionService.get( idB ) );
+ int idA = attributeService.addTrackedEntityAttributeOption( attributeOptionA );
+ int idB = attributeService.addTrackedEntityAttributeOption( attributeOptionB );
+
+ assertNotNull( attributeService.getTrackedEntityAttributeOption( idA ) );
+ assertNotNull( attributeService.getTrackedEntityAttributeOption( idB ) );
+
+ attributeService.deleteTrackedEntityAttributeOption( attributeOptionA );
+
+ assertNull( attributeService.getTrackedEntityAttributeOption( idA ) );
+ assertNotNull( attributeService.getTrackedEntityAttributeOption( idB ) );
+
+ attributeService.deleteTrackedEntityAttributeOption( attributeOptionB );
+
+ assertNull( attributeService.getTrackedEntityAttributeOption( idA ) );
+ assertNull( attributeService.getTrackedEntityAttributeOption( idB ) );
}
@Test
public void testUpdateTrackedEntityAttributeOption()
{
- int idA = attributeOptionService.addTrackedEntityAttributeOption( attributeOptionA );
+ int idA = attributeService.addTrackedEntityAttributeOption( attributeOptionA );
- assertNotNull( attributeOptionService.get( idA ) );
+ assertNotNull( attributeService.getTrackedEntityAttributeOption( idA ) );
attributeOptionA.setName( "B" );
- attributeOptionService.updateTrackedEntityAttributeOption( attributeOptionA );
+ attributeService.updateTrackedEntityAttributeOption( attributeOptionA );
- assertEquals( "B", attributeOptionService.get( idA ).getName() );
+ assertEquals( "B", attributeService.getTrackedEntityAttributeOption( idA ).getName() );
}
@Test
public void testGetTrackedEntityAttributeGroupById()
{
- int idA = attributeOptionService.addTrackedEntityAttributeOption( attributeOptionA );
- int idB = attributeOptionService.addTrackedEntityAttributeOption( attributeOptionB );
+ int idA = attributeService.addTrackedEntityAttributeOption( attributeOptionA );
+ int idB = attributeService.addTrackedEntityAttributeOption( attributeOptionB );
- assertEquals( attributeOptionA, attributeOptionService.get( idA ) );
- assertEquals( attributeOptionB, attributeOptionService.get( idB ) );
+ assertEquals( attributeOptionA, attributeService.getTrackedEntityAttributeOption( idA ) );
+ assertEquals( attributeOptionB, attributeService.getTrackedEntityAttributeOption( idB ) );
}
@Test
public void testGetTrackedEntityAttributeGroupByName()
{
- int idA = attributeOptionService.addTrackedEntityAttributeOption( attributeOptionA );
-
- assertNotNull( attributeOptionService.get( idA ) );
-
- assertEquals( attributeOptionA, attributeOptionService.get( attributeA, "AttributeOptionA" ) );
+ int idA = attributeService.addTrackedEntityAttributeOption( attributeOptionA );
+
+ assertNotNull( attributeService.getTrackedEntityAttributeOption( idA ) );
+
+ assertEquals( attributeOptionA, attributeService.getTrackedEntityAttributeOption( attributeA, "AttributeOptionA" ) );
}
@Test
public void testGetTrackedEntityAttributeOptionByAttribute()
{
- attributeOptionService.addTrackedEntityAttributeOption( attributeOptionA );
- attributeOptionService.addTrackedEntityAttributeOption( attributeOptionB );
- attributeOptionService.addTrackedEntityAttributeOption( attributeOptionC );
+ attributeService.addTrackedEntityAttributeOption( attributeOptionA );
+ attributeService.addTrackedEntityAttributeOption( attributeOptionB );
+ attributeService.addTrackedEntityAttributeOption( attributeOptionC );
- assertTrue( equals( attributeOptionService.get( attributeA ), attributeOptionA, attributeOptionB ) );
- assertTrue( equals( attributeOptionService.get( attributeB ), attributeOptionC ) );
+ assertTrue( equals( attributeService.getTrackedEntityAttributeOption( attributeA ), attributeOptionA, attributeOptionB ) );
+ assertTrue( equals( attributeService.getTrackedEntityAttributeOption( attributeB ), attributeOptionC ) );
}
}
\ No newline at end of file
=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityAttributeOptionStoreTest.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityAttributeOptionStoreTest.java 2014-02-07 20:25:49 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityAttributeOptionStoreTest.java 2014-02-15 03:50:30 +0000
@@ -27,30 +27,20 @@
package org.hisp.dhis.trackedentity;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
import org.hisp.dhis.DhisSpringTest;
-import org.hisp.dhis.trackedentity.TrackedEntityAttribute;
-import org.hisp.dhis.trackedentity.TrackedEntityAttributeOption;
-import org.hisp.dhis.trackedentity.TrackedEntityAttributeOptionStore;
-import org.hisp.dhis.trackedentity.TrackedEntityAttributeService;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
+import static org.junit.Assert.*;
+
/**
* @author Chau Thu Tran
- *
* @version $ TrackedEntityAttributeOptionStoreTest.java Nov 5, 2013 4:43:12 PM $
*/
public class TrackedEntityAttributeOptionStoreTest
extends DhisSpringTest
{
@Autowired
- private TrackedEntityAttributeOptionStore attributeOptionStore;
-
- @Autowired
private TrackedEntityAttributeService attributeService;
private TrackedEntityAttributeOption attributeOptionA;
@@ -80,22 +70,22 @@
@Test
public void testGetTrackedEntityAttributeGroupByName()
{
- int idA = attributeOptionStore.save( attributeOptionA );
-
- assertNotNull( attributeOptionStore.get( idA ) );
-
- assertEquals( attributeOptionA, attributeOptionStore.get( attributeA, "AttributeOptionA" ) );
+ int idA = attributeService.addTrackedEntityAttributeOption( attributeOptionA );
+
+ assertNotNull( attributeService.getTrackedEntityAttributeOption( idA ) );
+
+ assertEquals( attributeOptionA, attributeService.getTrackedEntityAttributeOption( attributeA, "AttributeOptionA" ) );
}
@Test
public void testGetTrackedEntityAttributeOptionByAttribute()
{
- attributeOptionStore.save( attributeOptionA );
- attributeOptionStore.save( attributeOptionB );
- attributeOptionStore.save( attributeOptionC );
+ attributeService.addTrackedEntityAttributeOption( attributeOptionA );
+ attributeService.addTrackedEntityAttributeOption( attributeOptionB );
+ attributeService.addTrackedEntityAttributeOption( attributeOptionC );
- assertTrue( equals( attributeOptionStore.get( attributeA ), attributeOptionA, attributeOptionB ) );
- assertTrue( equals( attributeOptionStore.get( attributeB ), attributeOptionC ) );
+ assertTrue( equals( attributeService.getTrackedEntityAttributeOption( attributeA ), attributeOptionA, attributeOptionB ) );
+ assertTrue( equals( attributeService.getTrackedEntityAttributeOption( attributeB ), attributeOptionC ) );
}
}
\ No newline at end of file
=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentityattributevalue/TrackedEntityAttributeValueServiceTest.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentityattributevalue/TrackedEntityAttributeValueServiceTest.java 2014-02-07 20:25:49 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentityattributevalue/TrackedEntityAttributeValueServiceTest.java 2014-02-15 03:50:30 +0000
@@ -41,7 +41,6 @@
import org.hisp.dhis.organisationunit.OrganisationUnitService;
import org.hisp.dhis.trackedentity.TrackedEntityAttribute;
import org.hisp.dhis.trackedentity.TrackedEntityAttributeOption;
-import org.hisp.dhis.trackedentity.TrackedEntityAttributeOptionService;
import org.hisp.dhis.trackedentity.TrackedEntityAttributeService;
import org.hisp.dhis.trackedentity.TrackedEntityInstance;
import org.hisp.dhis.trackedentity.TrackedEntityInstanceService;
@@ -69,9 +68,6 @@
@Autowired
private TrackedEntityAttributeService attributeService;
- @Autowired
- private TrackedEntityAttributeOptionService attributeOptionService;
-
private TrackedEntityAttribute attributeA;
private TrackedEntityAttribute attributeB;
@@ -131,8 +127,8 @@
attributeOpionA = createTrackedEntityAttributeOption( 'A', attributeC );
attributeOpionB = createTrackedEntityAttributeOption( 'B', attributeC );
- attributeOptionService.addTrackedEntityAttributeOption( attributeOpionA );
- attributeOptionService.addTrackedEntityAttributeOption( attributeOpionB );
+ attributeService.addTrackedEntityAttributeOption( attributeOpionA );
+ attributeService.addTrackedEntityAttributeOption( attributeOpionB );
attributeValueA = new TrackedEntityAttributeValue( attributeA, entityInstanceA, "A" );
attributeValueB = new TrackedEntityAttributeValue( attributeB, entityInstanceA, "B" );
=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentityattributevalue/TrackedEntityAttributeValueStoreTest.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentityattributevalue/TrackedEntityAttributeValueStoreTest.java 2014-02-07 20:25:49 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentityattributevalue/TrackedEntityAttributeValueStoreTest.java 2014-02-15 03:50:30 +0000
@@ -40,7 +40,6 @@
import org.hisp.dhis.organisationunit.OrganisationUnitService;
import org.hisp.dhis.trackedentity.TrackedEntityAttribute;
import org.hisp.dhis.trackedentity.TrackedEntityAttributeOption;
-import org.hisp.dhis.trackedentity.TrackedEntityAttributeOptionService;
import org.hisp.dhis.trackedentity.TrackedEntityAttributeService;
import org.hisp.dhis.trackedentity.TrackedEntityInstance;
import org.hisp.dhis.trackedentity.TrackedEntityInstanceService;
@@ -67,9 +66,6 @@
@Autowired
private TrackedEntityAttributeService attributeService;
- @Autowired
- private TrackedEntityAttributeOptionService attributeOptionService;
-
private TrackedEntityAttribute attributeA;
private TrackedEntityAttribute attributeB;
@@ -125,8 +121,8 @@
attributeOpionA = createTrackedEntityAttributeOption( 'A', attributeC );
attributeOpionB = createTrackedEntityAttributeOption( 'B', attributeC );
- attributeOptionService.addTrackedEntityAttributeOption( attributeOpionA );
- attributeOptionService.addTrackedEntityAttributeOption( attributeOpionB );
+ attributeService.addTrackedEntityAttributeOption( attributeOpionA );
+ attributeService.addTrackedEntityAttributeOption( attributeOpionB );
attributeValueA = new TrackedEntityAttributeValue( attributeA, entityInstanceA, "A" );
attributeValueB = new TrackedEntityAttributeValue( attributeB, entityInstanceA, "B" );