dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #07175
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2027: Fixed test error
------------------------------------------------------------
revno: 2027
committer: Lars <larshelg@larshelg-laptop>
branch nick: trunk
timestamp: Wed 2010-09-01 06:42:39 +0200
message:
Fixed test error
modified:
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataset/DataEntryFormServiceTest.java
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataset/DataEntryFormStoreTest.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/dataset/DataEntryFormServiceTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataset/DataEntryFormServiceTest.java 2010-08-31 14:34:31 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataset/DataEntryFormServiceTest.java 2010-09-01 04:42:39 +0000
@@ -157,26 +157,6 @@
}
@Test
- public void testGetDataEntryFormByDataSet()
- {
- DataSet dataSetA = new DataSet( "DataSet-A", periodType );
-
- dataSetService.addDataSet( dataSetA );
-
- DataEntryForm dataEntryForm = new DataEntryForm( "DataEntryForm-A" );
-
- int id = dataEntryFormService.addDataEntryForm( dataEntryForm );
-
-
- DataSet dataSetB = new DataSet( "DataSet-B", periodType );
-
- dataSetService.addDataSet( dataSetB );
-
- assertEquals( dataSetA.getDataEntryForm().getId(), id );
- assertNull( dataSetB.getDataEntryForm() );
- }
-
- @Test
public void testGetAllDataEntryForms()
{
DataSet dataSetA = new DataSet( "DataSet-A", periodType );
@@ -201,21 +181,20 @@
@Test
public void testGetAvailableDataSets()
{
+ DataEntryForm dataEntryFormA = new DataEntryForm( "DataEntryForm-A" );
+ DataEntryForm dataEntryFormB = new DataEntryForm( "DataEntryForm-B" );
+
DataSet dataSetA = new DataSet( "DataSet-A", periodType );
DataSet dataSetB = new DataSet( "DataSet-B", periodType );
DataSet dataSetC = new DataSet( "DataSet-C", periodType );
+ dataSetA.setDataEntryForm( dataEntryFormA );
+ dataSetB.setDataEntryForm( dataEntryFormB );
+
dataSetService.addDataSet( dataSetA );
dataSetService.addDataSet( dataSetB );
dataSetService.addDataSet( dataSetC );
- DataEntryForm dataEntryFormA = new DataEntryForm( "DataEntryForm-A" );
- DataEntryForm dataEntryFormB = new DataEntryForm( "DataEntryForm-B" );
-
- dataEntryFormService.addDataEntryForm( dataEntryFormA );
- dataEntryFormService.addDataEntryForm( dataEntryFormB );
-
-
List<DataSet> dataSets = dataSetService.getAvailableDataSets();
assertEquals( dataSets.size(), 1 );
@@ -224,21 +203,20 @@
@Test
public void testGetAssignedDataSets()
{
+ DataEntryForm dataEntryFormA = new DataEntryForm( "DataEntryForm-A" );
+ DataEntryForm dataEntryFormB = new DataEntryForm( "DataEntryForm-B" );
+
DataSet dataSetA = new DataSet( "DataSet-A", periodType );
DataSet dataSetB = new DataSet( "DataSet-B", periodType );
DataSet dataSetC = new DataSet( "DataSet-C", periodType );
+ dataSetA.setDataEntryForm( dataEntryFormA );
+ dataSetB.setDataEntryForm( dataEntryFormB );
+
dataSetService.addDataSet( dataSetA );
dataSetService.addDataSet( dataSetB );
dataSetService.addDataSet( dataSetC );
- DataEntryForm dataEntryFormA = new DataEntryForm( "DataEntryForm-A" );
- DataEntryForm dataEntryFormB = new DataEntryForm( "DataEntryForm-B" );
-
- dataEntryFormService.addDataEntryForm( dataEntryFormA );
- dataEntryFormService.addDataEntryForm( dataEntryFormB );
-
-
List<DataSet> dataSets = dataSetService.getAssignedDataSets();
assertEquals( dataSets.size(), 2 );
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataset/DataEntryFormStoreTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataset/DataEntryFormStoreTest.java 2010-04-12 21:23:33 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataset/DataEntryFormStoreTest.java 2010-09-01 04:42:39 +0000
@@ -143,23 +143,6 @@
assertNull( dataEntryFormStore.getDataEntryFormByName( "DataEntryForm-X" ) );
}
-// @Test
-// public void testGetDataEntryFormByDataSet()
-// throws Exception
-// {
-//
-// DataEntryForm dataEntryForm = new DataEntryForm( "DataEntryForm-A" );
-//
-// int id = dataEntryFormStore.addDataEntryForm( dataEntryForm );
-//
-// DataSet dataSetB = new DataSet( "DataSet-B", periodType );
-//
-// dataSetStore.addDataSet( dataSetB );
-//
-// assertEquals( dataEntryFormStore.getDataEntryFormByDataSet( dataSetA ).getId(), id );
-// assertNull( dataEntryFormStore.getDataEntryFormByDataSet( dataSetB ) );
-// }
-
@Test
public void testGetAllDataEntryForms()
{