← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 20166: Test fix

 

------------------------------------------------------------
revno: 20166
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2015-09-15 14:25:44 +0200
message:
  Test fix
modified:
  dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/dashboard/DashboardServiceTest.java
  dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/interpretation/InterpretationServiceTest.java
  dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/DhisConvenienceTest.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-reporting/src/test/java/org/hisp/dhis/dashboard/DashboardServiceTest.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/dashboard/DashboardServiceTest.java	2015-09-15 10:15:00 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/dashboard/DashboardServiceTest.java	2015-09-15 12:25:44 +0000
@@ -64,8 +64,8 @@
     @Override
     public void setUpTest()
     {
-        chartA = new Chart( "A" );
-        chartB = new Chart( "B" );
+        chartA = createChart( 'A' );
+        chartB = createChart( 'B' );
 
         chartService.addChart( chartA );
         chartService.addChart( chartB );

=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/interpretation/InterpretationServiceTest.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/interpretation/InterpretationServiceTest.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/interpretation/InterpretationServiceTest.java	2015-09-15 12:25:44 +0000
@@ -78,7 +78,7 @@
 
         setDependency( interpretationService, "currentUserService", new MockCurrentUserService( userA ), CurrentUserService.class );
 
-        chartA = new Chart( "ChartA" );
+        chartA = createChart( 'A' );
         chartService.addChart( chartA );
 
         interpretationA = new Interpretation( chartA, null, "Interpration of chart A" );

=== modified file 'dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/DhisConvenienceTest.java'
--- dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/DhisConvenienceTest.java	2015-09-15 09:54:24 +0000
+++ dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/DhisConvenienceTest.java	2015-09-15 12:25:44 +0000
@@ -32,6 +32,7 @@
 import org.apache.commons.logging.LogFactory;
 import org.hisp.dhis.analytics.AggregationType;
 import org.hisp.dhis.chart.Chart;
+import org.hisp.dhis.chart.ChartType;
 import org.hisp.dhis.common.CodeGenerator;
 import org.hisp.dhis.common.DimensionalObject;
 import org.hisp.dhis.common.ValueType;
@@ -111,6 +112,7 @@
 import javax.xml.xpath.XPath;
 import javax.xml.xpath.XPathExpressionException;
 import javax.xml.xpath.XPathFactory;
+
 import java.io.File;
 import java.io.PrintWriter;
 import java.io.StringReader;
@@ -1075,14 +1077,23 @@
 
         return legendSet;
     }
-
-    public static Chart createChart( char uniqueCharacter, List<Indicator> indicators, List<Period> periods,
-        List<OrganisationUnit> units )
+    
+    public static Chart createChart( char uniqueCharacter )
     {
         Chart chart = new Chart();
         chart.setAutoFields();
-
         chart.setName( "Chart" + uniqueCharacter );
+        chart.setType( ChartType.COLUMN );
+        
+        return chart;
+        
+    }
+
+    public static Chart createChart( char uniqueCharacter, List<Indicator> indicators, List<Period> periods,
+        List<OrganisationUnit> units )
+    {
+        Chart chart = createChart( uniqueCharacter );
+
         chart.addAllDataDimensionItems( indicators );
         chart.setPeriods( periods );
         chart.setOrganisationUnits( units );