Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BAH-643 Upgrade dependencies and where necessary the code to java 8 #59

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ deploy.sh
openelis/WebContent/.sass-cache
openElisCore.css
OpenElis.zip
.java-version
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ OpenElis
forked from OpenElis_v3.1_r2013_02_21 branch in svn

*Requirements to build OpeneLIS*
* `java` version <= "1.7"
* `java` version <= "1.8"
* `ant` version <= "1.9.1"
* `ruby` version <= "2.2" and `gem install compass`

Expand Down
4 changes: 2 additions & 2 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@
</target>


<target name="compile" depends="init, java.compile,jasper.compile, compass.compile"
<target name="compile" depends="init, java.compile, jasper.compile, compass.compile"
description="compile the source ">
</target>

<target name="java.compile"
description="compile the source ">
<mkdir dir="${target}"/>
<javac srcdir="${src}" destdir="${target}" encoding="iso-8859-1" classpathref="lib" source="1.7" target="1.7" debug="on"/>
<javac srcdir="${src}" destdir="${target}" encoding="iso-8859-1" classpathref="lib" source="1.8" target="1.8" debug="on"/>
<copy todir="${target}">
<fileset dir="${src}" includes="**/*.xml"/>
<fileset dir="${src}" includes="**/*.properties"/>
Expand Down
Binary file removed build/lib/commons-collections-2.1.1.jar
Binary file not shown.
Binary file added build/lib/commons-collections-3.2.2.jar
Binary file not shown.
Binary file added build/lib/ecj-4.3.1.jar
Binary file not shown.
Binary file removed build/lib/jasperreports-3.7.2.jar
Binary file not shown.
Binary file added build/lib/jasperreports-6.3.1.jar
Binary file not shown.
Binary file removed build/lib/jdt-compiler-3.1.1.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added openelis/WebContent/WEB-INF/lib/ecj-4.3.1.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -170,17 +170,17 @@ public boolean processRequest(Map parameters, HttpServletRequest request,

//turn subreport jasper files into JasperReport objects to pass in as parameters
JasperReport providerDetailsReport = (JasperReport) JRLoader
.loadObject(providerDetailsReportFile.getPath());
.loadObject(providerDetailsReportFile);
JasperReport projectDetailsReport = (JasperReport) JRLoader
.loadObject(projectDetailsReportFile.getPath());
.loadObject(projectDetailsReportFile);
JasperReport sourceTypeDetailsReport = (JasperReport) JRLoader
.loadObject(sourceTypeDetailsReportFile.getPath());
.loadObject(sourceTypeDetailsReportFile);
JasperReport patientDetailsReport = (JasperReport) JRLoader
.loadObject(patientDetailsReportFile.getPath());
.loadObject(patientDetailsReportFile);
JasperReport testResultsReport = (JasperReport) JRLoader
.loadObject(testResultsReportFile.getPath());
.loadObject(testResultsReportFile);
JasperReport resultValueReport = (JasperReport) JRLoader
.loadObject(resultValueReportFile.getPath());
.loadObject(resultValueReportFile);

parameters.put("Provider_Details", providerDetailsReport);
parameters.put("Project_Details", projectDetailsReport);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ private Order getOrderWithPriority(ResultSet accessionResultSet, String comments
accessionResultSet.getBoolean("is_printed"),
accessionResultSet.getInt("pending_tests_count"),
accessionResultSet.getInt("pending_validation_count"),
accessionResultSet.getInt("referred_test_count"),
accessionResultSet.getInt("referred_tests_count"),
accessionResultSet.getInt("total_test_count"),
accessionResultSet.getDate("collection_date"),
accessionResultSet.getDate("entered_date"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
import java.util.Map;

public class CommonReportPrintAction extends BaseAction {

Expand All @@ -58,7 +58,7 @@ protected ActionForward performAction(ActionMapping mapping, ActionForm form, Ht
reportCreator.initializeReport(dynaForm);
reportCreator.setReportPath(getReportPath());

HashMap<String, String> parameterMap = (HashMap<String, String>) reportCreator.getReportParameters();
Map<String, Object> parameterMap = reportCreator.getReportParameters();
parameterMap.put("SUBREPORT_DIR", getReportPath());

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.Collections;

import net.sf.jasperreports.engine.JasperRunManager;
import net.sf.jasperreports.engine.data.JRBeanCollectionDataSource;
Expand Down Expand Up @@ -68,15 +70,15 @@ public void initializeReport(BaseActionForm dynaForm) {
}

@Override
public HashMap<String, ?> getReportParameters() throws IllegalStateException {
return new HashMap<String, String>();
public Map<String, Object> getReportParameters() throws IllegalStateException {
return Collections.emptyMap();
}

@Override
public byte[] runReport() throws Exception {
List<byte[]> byteList = generateReports();
if (byteList.isEmpty()) {
HashMap<String, String> parameterMap = new HashMap<String, String>();
HashMap<String, Object> parameterMap = new HashMap<String, Object>();
parameterMap.put("SUBREPORT_DIR", reportPath);
parameterMap.put("directorName", ConfigurationProperties.getInstance().getPropertyValue(Property.labDirectorName));
List<ErrorMessages> errorMsgs = new ArrayList<ErrorMessages>();
Expand Down Expand Up @@ -150,7 +152,7 @@ protected byte[] createReport(String reportName) {
reportCreator.setReportPath(reportPath);

@SuppressWarnings("unchecked")
HashMap<String, String> parameterMap = (HashMap<String, String>) reportCreator.getReportParameters();
Map<String, Object> parameterMap = reportCreator.getReportParameters();
parameterMap.put("SUBREPORT_DIR", reportPath);
handledOrders.addAll(reportCreator.getReportedOrders());
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/
package us.mn.state.health.lims.reports.action.implementation;

import java.util.HashMap;
import java.util.Map;
import java.util.List;

import us.mn.state.health.lims.common.action.BaseActionForm;
Expand All @@ -31,7 +31,7 @@ public interface IReportCreator {
public String getContentType();
public String getResponseHeaderName();
public String getResponseHeaderContent();
public HashMap<String, ?> getReportParameters() throws IllegalStateException;
public Map<String, Object> getReportParameters() throws IllegalStateException;
public byte[] runReport( ) throws Exception;
public void setReportPath( String path);
public List<String> getReportedOrders();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ public JRDataSource getReportDataSource() throws IllegalStateException {
return new JRBeanCollectionDataSource(reportItems);
}

public HashMap<String, ?> getReportParameters() throws IllegalStateException {
return new HashMap<String, String>();
public Map<String, Object> getReportParameters() throws IllegalStateException {
return Collections.emptyMap();
}

public void initializeReport(BaseActionForm dynaForm) {
Expand Down Expand Up @@ -226,7 +226,8 @@ private void addIntakeItems() throws LIMSInvalidConfigurationException {
List<ObservationHistory> initialRegisteredList = observationHistoryDAO.getObservationHistoryByDictonaryValues(initialRegisteredID);

fillDataForRecords(notRegisteredList, "Pas d'inscription initiale");
fillDataForRecords(initialRegisteredList, "Entr�e non valid�");
fillDataForRecords(initialRegisteredList, "Entrée non validé");

}

private void fillDataForRecords(List<ObservationHistory> observationList, String category) throws LIMSInvalidConfigurationException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package us.mn.state.health.lims.reports.action.implementation;


import java.util.HashMap;
import java.util.Map;
import java.util.List;

import net.sf.jasperreports.engine.JRDataSource;
Expand Down Expand Up @@ -116,7 +116,7 @@ protected void createReportItems() {
reportPatient = null;
}

public HashMap<String, ?> getReportParameters() throws IllegalStateException {
public Map<String, Object> getReportParameters() throws IllegalStateException {
return super.getReportParameters();
}
public JRDataSource getReportDataSource() throws IllegalStateException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public byte[] runReport( ) throws Exception {
*/
public abstract JRDataSource getReportDataSource() throws IllegalStateException;

public HashMap<String, ?> getReportParameters() throws IllegalStateException {
public Map<String, Object> getReportParameters() throws IllegalStateException {
if (!initialized) {
throw new IllegalStateException("initializeReport not called first");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@


import java.util.HashMap;
import java.util.Map;
import java.util.List;

import javax.servlet.ServletOutputStream;
Expand Down Expand Up @@ -81,7 +82,7 @@ protected ActionForward performAction(ActionMapping mapping, ActionForm form, Ht
workplanReport = getWorkplanReport(workplanType, workplanName);

//set jasper report parameters
HashMap<String, ?> parameterMap = workplanReport.getParameters();
Map<String, Object> parameterMap = workplanReport.getParameters();

//prepare report
List<?> workplanRows = workplanReport.prepareRows(dynaForm);
Expand Down Expand Up @@ -173,4 +174,4 @@ public IWorkplanReport getWorkplanReport(String testType, String name) {


}

Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package us.mn.state.health.lims.workplan.reports;

import java.util.HashMap;
import java.util.Map;
import java.util.List;

import us.mn.state.health.lims.common.action.BaseActionForm;
Expand All @@ -41,7 +42,7 @@ public String getFileName() {
return fileName;
}

public HashMap<String, Object> getParameters() {
public Map<String, Object> getParameters() {
parameterMap.put("testSection", testSection);
return parameterMap;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@

package us.mn.state.health.lims.workplan.reports;

import java.util.HashMap;
import java.util.Map;
import java.util.List;

import us.mn.state.health.lims.common.action.BaseActionForm;
import us.mn.state.health.lims.test.beanItems.TestResultItem;

public interface IWorkplanReport {

public HashMap<String, ?> getParameters();
public Map<String, Object> getParameters();

public String getFileName();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package org.bahmni.feed.openelis.feed.event;

import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
import org.bahmni.feed.openelis.feed.contract.openmrs.encounter.OpenMRSEncounter;
import org.bahmni.feed.openelis.utils.AuditingService;
import org.bahmni.webclients.HttpClient;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.powermock.core.classloader.annotations.PowerMockIgnore;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
import us.mn.state.health.lims.login.daoimpl.LoginDAOImpl;
Expand All @@ -24,17 +24,16 @@

@RunWith(PowerMockRunner.class)
@PrepareForTest({Logger.class, EncounterFeedWorker.class})
public class EncounterFeedWorkerTest {
@PowerMockIgnore("javax.management.*")
public class
EncounterFeedWorkerTest {

@Mock
private HttpClient httpClient;

@Mock
private OpenMRSEncounter openMRSEncounter;

@Mock
private Logger logger;

@Mock
private LoginDAOImpl loginDAO;

Expand All @@ -60,9 +59,7 @@ public void setUp() throws Exception {
whenNew(SiteInformationDAOImpl.class).withNoArguments().thenReturn(siteInformationDAO);
whenNew(AuditingService.class).withArguments(loginDAO, siteInformationDAO).thenReturn(auditingService);

when(LogManager.getLogger(EncounterFeedWorker.class)).thenReturn(logger);
when(openMRSEncounter.getEncounterUuid()).thenReturn("encounter uuid");
doNothing().when(logger).info("Processing encounter with ID='encounter uuid'");
when(auditingService.getSysUserId()).thenReturn("1");
}

Expand Down