← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2466: Fix UnitTest in dhis-web-api

 

------------------------------------------------------------
revno: 2466
committer: Tran Ng Minh Luan <Luan@MinhLuan-PC>
branch nick: dhis2
timestamp: Thu 2011-01-06 13:33:19 +0700
message:
  Fix UnitTest in dhis-web-api
removed:
  dhis-2/dhis-web/dhis-web-api/src/test/java/org/hisp/dhis/web/api/model/DataSetValueTest.java
modified:
  dhis-2/dhis-web/dhis-web-api/src/test/java/org/hisp/dhis/web/api/model/OrgUnitTest.java
  dhis-2/dhis-web/dhis-web-api/src/test/java/org/hisp/dhis/web/api/model/OrgUnitsTest.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
=== removed file 'dhis-2/dhis-web/dhis-web-api/src/test/java/org/hisp/dhis/web/api/model/DataSetValueTest.java'
--- dhis-2/dhis-web/dhis-web-api/src/test/java/org/hisp/dhis/web/api/model/DataSetValueTest.java	2010-12-02 10:53:14 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/test/java/org/hisp/dhis/web/api/model/DataSetValueTest.java	1970-01-01 00:00:00 +0000
@@ -1,59 +0,0 @@
-package org.hisp.dhis.web.api.model;
-
-import static org.junit.Assert.*;
-
-import java.io.StringReader;
-import java.io.StringWriter;
-import java.util.List;
-
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.Marshaller;
-import javax.xml.bind.Unmarshaller;
-
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-public class DataSetValueTest
-{
-
-    static JAXBContext JC;
-    String s = "<dataSetValue completed=\"true\" periodName=\"10-2010\" id=\"54\" name=\"Handicaped Data Set -mobile\"><dataValue categoryOptComboID=\"1\" id=\"1743\" value=\"12\" /></dataSetValue>";
-
-    @BeforeClass
-    public static void init() throws JAXBException {
-        JC = JAXBContext.newInstance( DataSetValue.class );
-    }
-    
-    @Test
-    public void unmarshall()
-        throws JAXBException
-    {
-        Unmarshaller unmarshaller = JC.createUnmarshaller();
-        DataSetValue dataSetValue = (DataSetValue) unmarshaller.unmarshal( new StringReader( s ) );
-
-        assertEquals( 54, dataSetValue.getId() );
-        List<DataValue> dataValues = dataSetValue.getDataValues();
-        assertNotNull(dataValues);
-        assertEquals( 1, dataValues.size() );
-        assertEquals( 1743, dataValues.get( 0 ).getId() );
-    }
-
-    @Test
-    public void marshall()
-        throws JAXBException
-    {
-        Unmarshaller unmarshaller = JC.createUnmarshaller();
-        DataSetValue dataSetValue = (DataSetValue) unmarshaller.unmarshal( new StringReader( s ) );
-
-        Marshaller marshaller = JC.createMarshaller();
-        StringWriter stringWriter = new StringWriter();
-        marshaller.marshal( dataSetValue, stringWriter );
-        String xml = stringWriter.toString();
-        System.out.println(xml);
-        assertTrue( xml.contains( "name=\"Handicaped Data Set -mobile\"" ) );
-        assertTrue( xml.contains( "id=\"1743\"" ) );
-    }
-
-    
-}

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/test/java/org/hisp/dhis/web/api/model/OrgUnitTest.java'
--- dhis-2/dhis-web/dhis-web-api/src/test/java/org/hisp/dhis/web/api/model/OrgUnitTest.java	2010-12-23 17:57:13 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/test/java/org/hisp/dhis/web/api/model/OrgUnitTest.java	2011-01-06 06:33:19 +0000
@@ -25,6 +25,7 @@
         unit.setUploadActivityReportUrl( "uploadActivityReportUrl" );
         unit.setUploadFacilityReportUrl( "uploadFacilityReportUrl" );
         unit.setUpdateDataSetUrl( "updateDataSetUrl" );
+        unit.setUpdateProgramUrl( "updateProgramUrl" );
         
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         DataOutputStream dos = new DataOutputStream( baos );

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/test/java/org/hisp/dhis/web/api/model/OrgUnitsTest.java'
--- dhis-2/dhis-web/dhis-web-api/src/test/java/org/hisp/dhis/web/api/model/OrgUnitsTest.java	2010-11-26 11:00:40 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/test/java/org/hisp/dhis/web/api/model/OrgUnitsTest.java	2011-01-06 06:33:19 +0000
@@ -50,6 +50,8 @@
         unit.setDownloadAllUrl( "downloadAllUrl" );
         unit.setUploadActivityReportUrl( "uploadActivityReportUrl" );
         unit.setUploadFacilityReportUrl( "uploadFacilityReportUrl" );
+        unit.setUpdateDataSetUrl( "updateDataSetUrl" );
+        unit.setUpdateProgramUrl( "updateProgramUrl" );
         return unit;
     }
 }