← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 11883: Minor fixes

 

------------------------------------------------------------
revno: 11883
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2013-09-03 17:24:51 +0200
message:
  Minor fixes
removed:
  dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/dashboard/DashboardStoreTest.java
modified:
  dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/event/BaseEventService.java
  dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/ActivityReportingServiceImpl.java
  dhis-2/dhis-support/dhis-support-xml/src/main/java/org/amplecode/staxwax/framework/XMLPipe.java
  dhis-2/dhis-support/dhis-support-xml/src/test/java/org/amplecode/staxwax/reader/XMLReaderTest.java
  dhis-2/dhis-support/dhis-support-xml/src/test/java/org/amplecode/staxwax/writer/XMLWriterTest.java
  dhis-2/dhis-web/dhis-web-api-fred/src/test/java/org/hisp/dhis/web/webapi/v1/utils/OrganisationUnitToFacilityConverterTest.java
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/user/CurrentUserController.java
  dhis-2/dhis-web/dhis-web-appmanager/src/main/java/org/hisp/dhis/appmanager/action/AddAppAction.java
  dhis-2/dhis-web/dhis-web-appmanager/src/main/java/org/hisp/dhis/appmanager/action/AppSettingsAction.java
  dhis-2/dhis-web/dhis-web-appmanager/src/main/java/org/hisp/dhis/appmanager/action/DeleteAppAction.java
  dhis-2/dhis-web/dhis-web-appmanager/src/main/resources/META-INF/dhis/beans.xml
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/UploadAnonymousEventAction.java
  tools/dhis-i18n-resourceeditor/src/main/java/org/hisp/dhis/i18nresourceeditor/gui/I18nResourceEditorGUI.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-dxf2/src/main/java/org/hisp/dhis/dxf2/event/BaseEventService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/event/BaseEventService.java	2013-09-03 09:40:41 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/event/BaseEventService.java	2013-09-03 15:24:51 +0000
@@ -28,6 +28,12 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementService;
 import org.hisp.dhis.dxf2.InputValidationService;
@@ -54,13 +60,6 @@
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
 /**
  * @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
  */
@@ -498,18 +497,6 @@
         }
     }
 
-    private List<Event> convertProgramStageInstances( List<ProgramStageInstance> programStageInstances )
-    {
-        List<Event> events = new ArrayList<Event>();
-
-        for ( ProgramStageInstance programStageInstance : programStageInstances )
-        {
-            events.add( convertProgramStageInstance( programStageInstance ) );
-        }
-
-        return events;
-    }
-
     private Event convertProgramStageInstance( ProgramStageInstance programStageInstance )
     {
         if ( programStageInstance == null )

=== modified file 'dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/ActivityReportingServiceImpl.java'
--- dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/ActivityReportingServiceImpl.java	2013-09-03 01:35:55 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/ActivityReportingServiceImpl.java	2013-09-03 15:24:51 +0000
@@ -1717,7 +1717,7 @@
     public org.hisp.dhis.api.mobile.model.LWUITmodel.Patient findLatestPatient()
         throws NotAllowedException
     {
-        Patient patient = (Patient) this.patientService.getPatient( this.patientId );
+        Patient patient = patientService.getPatient( this.patientId );
 
         org.hisp.dhis.api.mobile.model.LWUITmodel.Patient patientMobile = getPatientModel( patient );
         return patientMobile;

=== removed file 'dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/dashboard/DashboardStoreTest.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/dashboard/DashboardStoreTest.java	2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/dashboard/DashboardStoreTest.java	1970-01-01 00:00:00 +0000
@@ -1,122 +0,0 @@
-package org.hisp.dhis.dashboard;
-
-/*
- * Copyright (c) 2004-2013, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * Neither the name of the HISP project nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * 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.hisp.dhis.report.Report.TYPE_JASPER_REPORT_TABLE;
-
-import org.hibernate.NonUniqueObjectException;
-import org.hisp.dhis.DhisSpringTest;
-import org.hisp.dhis.common.GenericStore;
-import org.hisp.dhis.report.Report;
-import org.hisp.dhis.report.ReportService;
-import org.hisp.dhis.reporttable.ReportTable;
-import org.hisp.dhis.user.User;
-import org.hisp.dhis.user.UserService;
-import org.junit.Test;
-
-/**
- * @author Lars Helge Overland
- */
-public class DashboardStoreTest
-    extends DhisSpringTest
-{
-    private UserService userService;
-    
-    private ReportService reportService;
-    
-    private GenericStore<DashboardContent> dashboardContentStore;
-    
-    private User userA;
-    
-    private Report reportA;
-    
-    private DashboardContent contentA;
-    private DashboardContent contentB;
-    
-    @Override
-    @SuppressWarnings("unchecked")
-    public void setUpTest()
-    {
-        userService = (UserService) getBean( UserService.ID );
-        
-        reportService = (ReportService) getBean( ReportService.ID );
-
-        dashboardContentStore = (GenericStore<DashboardContent>) getBean( "org.hisp.dhis.dashboard.DashboardContentStore" );
-        
-        userA = createUser( 'A' );
-        userService.addUser( userA );
-        
-        reportA = new Report( "ReportA", TYPE_JASPER_REPORT_TABLE, "DesignA", new ReportTable() );
-        reportService.saveReport( reportA );
-        
-        contentA = new DashboardContent();
-        contentB = new DashboardContent();
-    }
-    
-    @Test
-    public void saveGet()
-    {
-        contentA.setUser( userA );
-        contentA.getReports().add( reportA );
-        
-        dashboardContentStore.save( contentA );
-        
-        assertEquals( contentA, dashboardContentStore.get( userA.getId() ) );
-        assertEquals( userA, dashboardContentStore.get( userA.getId() ).getUser() );
-        assertEquals( reportA, dashboardContentStore.get( userA.getId() ).getReports().iterator().next() );
-    }
-    
-    @Test(expected=NonUniqueObjectException.class)
-    public void duplicate()
-    {
-        contentA.setUser( userA );
-        contentB.setUser( userA );
-        
-        dashboardContentStore.save( contentA );
-        dashboardContentStore.save( contentB );        
-    }
-        
-    @Test
-    public void delete()
-    {
-        contentA.setUser( userA );
-        contentA.getReports().add( reportA );
-        
-        dashboardContentStore.save( contentA );
-        
-        assertNotNull( dashboardContentStore.get( userA.getId() ) );
-        
-        dashboardContentStore.delete( contentA );
-        
-        assertNull( dashboardContentStore.get( userA.getId() ) );
-    }
-}

=== modified file 'dhis-2/dhis-support/dhis-support-xml/src/main/java/org/amplecode/staxwax/framework/XMLPipe.java'
--- dhis-2/dhis-support/dhis-support-xml/src/main/java/org/amplecode/staxwax/framework/XMLPipe.java	2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-support/dhis-support-xml/src/main/java/org/amplecode/staxwax/framework/XMLPipe.java	2013-09-03 15:24:51 +0000
@@ -190,7 +190,7 @@
         {
             throw new UnsupportedOperationException( "Unused functionality.  Not implemented" );
         }
-    };
+    }
 
     private class PipeWriter
         implements XMLEventWriter
@@ -265,5 +265,5 @@
             // not a real stream ... no handle to close
             return;
         }
-    };
+    }
 }

=== modified file 'dhis-2/dhis-support/dhis-support-xml/src/test/java/org/amplecode/staxwax/reader/XMLReaderTest.java'
--- dhis-2/dhis-support/dhis-support-xml/src/test/java/org/amplecode/staxwax/reader/XMLReaderTest.java	2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-support/dhis-support-xml/src/test/java/org/amplecode/staxwax/reader/XMLReaderTest.java	2013-09-03 15:24:51 +0000
@@ -29,7 +29,7 @@
  */
 import java.io.ByteArrayInputStream;
 import javax.xml.stream.XMLStreamException;
-import static junit.framework.Assert.assertEquals;
+import static org.junit.Assert.assertEquals;
 
 import java.io.InputStream;
 import java.net.URL;

=== modified file 'dhis-2/dhis-support/dhis-support-xml/src/test/java/org/amplecode/staxwax/writer/XMLWriterTest.java'
--- dhis-2/dhis-support/dhis-support-xml/src/test/java/org/amplecode/staxwax/writer/XMLWriterTest.java	2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-support/dhis-support-xml/src/test/java/org/amplecode/staxwax/writer/XMLWriterTest.java	2013-09-03 15:24:51 +0000
@@ -28,9 +28,9 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertTrue;
-import static junit.framework.Assert.fail;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;

=== modified file 'dhis-2/dhis-web/dhis-web-api-fred/src/test/java/org/hisp/dhis/web/webapi/v1/utils/OrganisationUnitToFacilityConverterTest.java'
--- dhis-2/dhis-web/dhis-web-api-fred/src/test/java/org/hisp/dhis/web/webapi/v1/utils/OrganisationUnitToFacilityConverterTest.java	2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-web/dhis-web-api-fred/src/test/java/org/hisp/dhis/web/webapi/v1/utils/OrganisationUnitToFacilityConverterTest.java	2013-09-03 15:24:51 +0000
@@ -122,6 +122,7 @@
     }
 
     @Test
+    @SuppressWarnings("unchecked")
     public void testDataSets()
     {
         OrganisationUnit organisationUnit = new OrganisationUnit( "OrgUnit1" );

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/user/CurrentUserController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/user/CurrentUserController.java	2013-08-30 15:36:39 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/user/CurrentUserController.java	2013-09-03 15:24:51 +0000
@@ -306,7 +306,6 @@
         JacksonUtils.toJsonWithView( response.getOutputStream(), userOrganisationUnits, viewClass );
     }
 
-    @SuppressWarnings( "unchecked" )
     @RequestMapping( value = { "/assignedPrograms" }, produces = { "application/json", "text/*" } )
     public void getPrograms( HttpServletResponse response, @RequestParam Map<String, String> parameters,
         @RequestParam( defaultValue = "1" ) Integer type )

=== modified file 'dhis-2/dhis-web/dhis-web-appmanager/src/main/java/org/hisp/dhis/appmanager/action/AddAppAction.java'
--- dhis-2/dhis-web/dhis-web-appmanager/src/main/java/org/hisp/dhis/appmanager/action/AddAppAction.java	2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-web/dhis-web-appmanager/src/main/java/org/hisp/dhis/appmanager/action/AddAppAction.java	2013-09-03 15:24:51 +0000
@@ -28,15 +28,13 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import com.fasterxml.jackson.core.JsonParseException;
-import com.fasterxml.jackson.databind.DeserializationFeature;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.opensymphony.xwork2.Action;
 import java.io.BufferedInputStream;
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.InputStream;
+
 import javax.servlet.http.HttpServletRequest;
+
 import org.apache.ant.compress.taskdefs.Unzip;
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.logging.Log;
@@ -47,11 +45,15 @@
 import org.hisp.dhis.appmanager.App;
 import org.hisp.dhis.appmanager.AppManagerService;
 import org.hisp.dhis.i18n.I18n;
-import org.hisp.dhis.security.authority.SystemAuthoritiesProvider;
 import org.hisp.dhis.system.util.StreamUtils;
 import org.hisp.dhis.util.ContextUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 
+import com.fasterxml.jackson.core.JsonParseException;
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.opensymphony.xwork2.Action;
+
 /**
  * @author Saptarshi Purkayastha
  */
@@ -69,13 +71,6 @@
     @Autowired
     private AppManagerService appManagerService;
 
-    private SystemAuthoritiesProvider authoritiesProvider;
-
-    public void setAuthoritiesProvider( SystemAuthoritiesProvider authoritiesProvider )
-    {
-        this.authoritiesProvider = authoritiesProvider;
-    }
-
     // -------------------------------------------------------------------------
     // Input & Output
     // -------------------------------------------------------------------------

=== modified file 'dhis-2/dhis-web/dhis-web-appmanager/src/main/java/org/hisp/dhis/appmanager/action/AppSettingsAction.java'
--- dhis-2/dhis-web/dhis-web-appmanager/src/main/java/org/hisp/dhis/appmanager/action/AppSettingsAction.java	2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-web/dhis-web-appmanager/src/main/java/org/hisp/dhis/appmanager/action/AppSettingsAction.java	2013-09-03 15:24:51 +0000
@@ -31,15 +31,16 @@
 import java.io.File;
 import java.util.List;
 
+import javax.servlet.http.HttpServletRequest;
+
 import org.apache.struts2.ServletActionContext;
 import org.hisp.dhis.appmanager.App;
 import org.hisp.dhis.appmanager.AppManagerService;
 import org.hisp.dhis.i18n.I18n;
+import org.hisp.dhis.util.ContextUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 
 import com.opensymphony.xwork2.Action;
-import javax.servlet.http.HttpServletRequest;
-import org.hisp.dhis.util.ContextUtils;
 
 /**
  * @author Saptarshi Purkayastha

=== modified file 'dhis-2/dhis-web/dhis-web-appmanager/src/main/java/org/hisp/dhis/appmanager/action/DeleteAppAction.java'
--- dhis-2/dhis-web/dhis-web-appmanager/src/main/java/org/hisp/dhis/appmanager/action/DeleteAppAction.java	2013-08-30 07:56:02 +0000
+++ dhis-2/dhis-web/dhis-web-appmanager/src/main/java/org/hisp/dhis/appmanager/action/DeleteAppAction.java	2013-09-03 15:24:51 +0000
@@ -28,8 +28,8 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import com.opensymphony.xwork2.Action;
 import java.io.File;
+
 import org.apache.commons.io.FileUtils;
 import org.apache.struts2.ServletActionContext;
 import org.hisp.dhis.appmanager.App;
@@ -38,6 +38,8 @@
 import org.hisp.dhis.security.authority.SystemAuthoritiesProvider;
 import org.springframework.beans.factory.annotation.Autowired;
 
+import com.opensymphony.xwork2.Action;
+
 /**
  * @author Saptarshi Purkayastha
  */

=== modified file 'dhis-2/dhis-web/dhis-web-appmanager/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-appmanager/src/main/resources/META-INF/dhis/beans.xml	2013-05-27 07:31:56 +0000
+++ dhis-2/dhis-web/dhis-web-appmanager/src/main/resources/META-INF/dhis/beans.xml	2013-09-03 15:24:51 +0000
@@ -4,9 +4,7 @@
 
   <bean id="org.hisp.dhis.appmanager.action.NoAction" class="org.hisp.dhis.appmanager.action.NoAction" scope="prototype" />
 
-  <bean id="org.hisp.dhis.appmanager.action.AddAppAction" class="org.hisp.dhis.appmanager.action.AddAppAction" scope="prototype">
-    <property name="authoritiesProvider" ref="org.hisp.dhis.security.authority.SystemAuthoritiesProvider" />
-  </bean>
+  <bean id="org.hisp.dhis.appmanager.action.AddAppAction" class="org.hisp.dhis.appmanager.action.AddAppAction" scope="prototype" />
   
   <bean id="org.hisp.dhis.appmanager.action.AppSettingsAction" class="org.hisp.dhis.appmanager.action.AppSettingsAction" scope="prototype" />
   

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/UploadAnonymousEventAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/UploadAnonymousEventAction.java	2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/UploadAnonymousEventAction.java	2013-09-03 15:24:51 +0000
@@ -108,6 +108,7 @@
     // -------------------------------------------------------------------------
 
     @Override
+    @SuppressWarnings("unchecked")
     public String execute() throws Exception
     {
         ServletInputStream inputStream = ServletActionContext.getRequest().getInputStream();

=== modified file 'tools/dhis-i18n-resourceeditor/src/main/java/org/hisp/dhis/i18nresourceeditor/gui/I18nResourceEditorGUI.java'
--- tools/dhis-i18n-resourceeditor/src/main/java/org/hisp/dhis/i18nresourceeditor/gui/I18nResourceEditorGUI.java	2013-08-19 08:06:13 +0000
+++ tools/dhis-i18n-resourceeditor/src/main/java/org/hisp/dhis/i18nresourceeditor/gui/I18nResourceEditorGUI.java	2013-09-03 15:24:51 +0000
@@ -145,7 +145,7 @@
     private JFileChooser fcDHIS2resource = new JFileChooser();
     // Help tab
     private JEditorPane txtHelp = new JEditorPane();
-    private JFrame parent = (JFrame) this;
+    private JFrame parent = this;
     private JPanel panelHelp = new JPanel();
     private JButton cmdHelp = new JButton("Basic help");
     private JButton cmdHelpAdvanced = new JButton("More help ");