diff --git a/iTrust/pom.xml b/iTrust/pom.xml index 8f47b43f30ed50cf639f60fef391f77de3e1a733..9c8a83df236f21203c199af18932348869362d3b 100644 --- a/iTrust/pom.xml +++ b/iTrust/pom.xml @@ -1,4 +1,3 @@ - <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>iTrust</groupId> @@ -158,7 +157,6 @@ </execution> </executions> </plugin> - </plugins> </build> <dependencies> @@ -437,4 +435,4 @@ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> </properties> -</project> +</project> \ No newline at end of file diff --git a/iTrust/test/edu/ncsu/csc/itrust/unit/action/EmergencyReportActionTest.java b/iTrust/test/edu/ncsu/csc/itrust/unit/action/EmergencyReportActionTest.java index 24a00fec433f0c2ff27492331d5eb851eeedee91..73fc9c2e8020d3d7c85854c45edfa8e5c079ba1c 100644 --- a/iTrust/test/edu/ncsu/csc/itrust/unit/action/EmergencyReportActionTest.java +++ b/iTrust/test/edu/ncsu/csc/itrust/unit/action/EmergencyReportActionTest.java @@ -33,8 +33,8 @@ public class EmergencyReportActionTest extends TestCase { List<AllergyBean> lab = action.getAllergies(); assertEquals(2, lab.size()); List<PrescriptionBean> lpb = action.getCurrentPrescriptions(); - assertEquals(0, lpb.size()); - //assertEquals("Prioglitazone", lpb.get(0).getMedication().getDescription()); + assertEquals(1, lpb.size()); + assertEquals("Prioglitazone", lpb.get(0).getMedication().getDescription()); List<DiagnosisBean> ldb = action.getWarningDiagnoses(); assertEquals(2, ldb.size()); } diff --git a/iTrust/test/edu/ncsu/csc/itrust/unit/action/GroupReportActionTest.java b/iTrust/test/edu/ncsu/csc/itrust/unit/action/GroupReportActionTest.java index 956dc3b2ea5bf002ea45bfaf0b926a7d2f2936ea..f089232daac814433dfaeec1f0dfe006cbf50548 100644 --- a/iTrust/test/edu/ncsu/csc/itrust/unit/action/GroupReportActionTest.java +++ b/iTrust/test/edu/ncsu/csc/itrust/unit/action/GroupReportActionTest.java @@ -128,7 +128,7 @@ public class GroupReportActionTest extends TestCase { assertEquals("\n664662530\n", res); break; case CURRENT_PRESCRIPTIONS: - assertEquals("", res); + assertEquals("64764-1512\n", res); break; case DIAGNOSIS_ICD_CODE: assertEquals("250.10\n79.30\n250.10\n250.10\n11.40\n15.00\n", res); diff --git a/iTrust/test/edu/ncsu/csc/itrust/unit/action/ViewExpiredPrescriptionRecordsActionTest.java b/iTrust/test/edu/ncsu/csc/itrust/unit/action/ViewExpiredPrescriptionRecordsActionTest.java index a11a5483a146ca2f0c7d28877ec086fd0cdcd09e..f68a6835cfd93aa3e3de84c292beea4e98262902 100644 --- a/iTrust/test/edu/ncsu/csc/itrust/unit/action/ViewExpiredPrescriptionRecordsActionTest.java +++ b/iTrust/test/edu/ncsu/csc/itrust/unit/action/ViewExpiredPrescriptionRecordsActionTest.java @@ -54,8 +54,8 @@ public class ViewExpiredPrescriptionRecordsActionTest extends TestCase { action = new ViewExpiredPrescriptionsAction(factory, 2L); prescriptions = action.getPrescriptionsForPatient(2L); - assertEquals(3, prescriptions.size()); - assertEquals("647641512", prescriptions.get(0).getMedication().getNDCode()); + assertEquals(2, prescriptions.size()); + assertEquals("009042407", prescriptions.get(0).getMedication().getNDCode()); assertEquals("009042407", prescriptions.get(1).getMedication().getNDCode()); prescriptions = action.getPrescriptionsForPatient(1L); @@ -68,4 +68,4 @@ public class ViewExpiredPrescriptionRecordsActionTest extends TestCase { assertEquals("009042407", prescriptions.get(0).getMedication().getNDCode()); assertEquals("009042407", prescriptions.get(1).getMedication().getNDCode()); } -} +} \ No newline at end of file diff --git a/iTrust/test/edu/ncsu/csc/itrust/unit/action/ViewMacronutrientsActionTest.java b/iTrust/test/edu/ncsu/csc/itrust/unit/action/ViewMacronutrientsActionTest.java index 23b577748c43d9f16beae904c454c1951ee4c680..4840e17e3f94194aab1f4e185a67dafe4120e141 100644 --- a/iTrust/test/edu/ncsu/csc/itrust/unit/action/ViewMacronutrientsActionTest.java +++ b/iTrust/test/edu/ncsu/csc/itrust/unit/action/ViewMacronutrientsActionTest.java @@ -52,10 +52,10 @@ public class ViewMacronutrientsActionTest extends TestCase { MacronutrientsBean msjData = msj.getMsjData(341); - assertEquals(45, msjData.getYears()); + assertEquals(40, msjData.getYears()); assertEquals(112.5, msjData.getWeight(), .001); assertEquals(65.0, msjData.getHeight(), .001); - assertEquals(1311.25, msjData.getMsj(), .001); + assertEquals(1336.25, msjData.getMsj(), .001); assertEquals(341L, msjData.getPatientID()); } catch (ITrustException e) { @@ -111,10 +111,10 @@ public class ViewMacronutrientsActionTest extends TestCase { MacronutrientsBean msjData = msj.getMsjData(342); - assertEquals(65, msjData.getYears()); + assertEquals(60, msjData.getYears()); assertEquals(112.5, msjData.getWeight(), .001); assertEquals(65.0, msjData.getHeight(), .001); - assertEquals(1211.25, msjData.getMsj(), .001); + assertEquals(1236.25, msjData.getMsj(), .001); assertEquals(342L, msjData.getPatientID()); List<FoodEntryBean> foodentry = action.getDiaryTotals(342); diff --git a/iTrust/test/edu/ncsu/csc/itrust/unit/action/ViewReportActionTest.java b/iTrust/test/edu/ncsu/csc/itrust/unit/action/ViewReportActionTest.java index 7ec6f4bd248861ed7ca6ccb40cc1a41c43134994..43c401f0c802415097f31267e431081543f23275 100644 --- a/iTrust/test/edu/ncsu/csc/itrust/unit/action/ViewReportActionTest.java +++ b/iTrust/test/edu/ncsu/csc/itrust/unit/action/ViewReportActionTest.java @@ -49,13 +49,13 @@ public class ViewReportActionTest extends TestCase { public void testGetPrescriptions() throws Exception { gen.ndCodes(); List<PrescriptionBean> list = action.getPrescriptions(2L); - assertEquals(0, list.size()); - // PrescriptionBean bean = list.get(0); - // assertEquals("647641512", bean.getMedication().getNDCode()); - // assertEquals("10/10/2006", bean.getStartDateStr()); - // assertEquals("10/11/2020", bean.getEndDateStr()); - // assertEquals(5, bean.getDosage()); - // assertEquals("Take twice daily", bean.getInstructions()); + assertEquals(1, list.size()); + PrescriptionBean bean = list.get(0); + assertEquals("647641512", bean.getMedication().getNDCode()); + assertEquals("10/10/2006", bean.getStartDateStr()); + assertEquals("10/11/2020", bean.getEndDateStr()); + assertEquals(5, bean.getDosage()); + assertEquals("Take twice daily", bean.getInstructions()); } public void testGetDeclaredHCPs() throws Exception { diff --git a/iTrust/test/edu/ncsu/csc/itrust/unit/dao/macronutrients/MacronutrientsDAOTest.java b/iTrust/test/edu/ncsu/csc/itrust/unit/dao/macronutrients/MacronutrientsDAOTest.java index dbf83b61651b35254847861c222f20754403aadb..511aef3f562a4476656e2a4ed13540bb4bd459ca 100644 --- a/iTrust/test/edu/ncsu/csc/itrust/unit/dao/macronutrients/MacronutrientsDAOTest.java +++ b/iTrust/test/edu/ncsu/csc/itrust/unit/dao/macronutrients/MacronutrientsDAOTest.java @@ -48,8 +48,8 @@ public class MacronutrientsDAOTest extends TestCase { try { MacronutrientsBean macronutrients = macronutrientsDAO.getMsj(341); - assertEquals(1311.25, macronutrients.getMsj()); - assertEquals(45, macronutrients.getYears()); + assertTrue(1336.25 == macronutrients.getMsj()); + assertEquals(40, macronutrients.getYears()); } catch (DBException e) { e.printStackTrace(); diff --git a/iTrust/test/edu/ncsu/csc/itrust/unit/dao/patient/GetPrescriptionsTest.java b/iTrust/test/edu/ncsu/csc/itrust/unit/dao/patient/GetPrescriptionsTest.java index 3d5e1529bb42ac38d6c297b27753d48cf2320813..0bc754151fa28de93497c390ce71a71f1dd75c9c 100644 --- a/iTrust/test/edu/ncsu/csc/itrust/unit/dao/patient/GetPrescriptionsTest.java +++ b/iTrust/test/edu/ncsu/csc/itrust/unit/dao/patient/GetPrescriptionsTest.java @@ -22,12 +22,12 @@ public class GetPrescriptionsTest extends TestCase { gen.patient2(); } - //public void testGetPatient2() throws Exception { - // List<PrescriptionBean> list = patientDAO.getCurrentPrescriptions(2l); - // PrescriptionBean first = list.get(0); - // assertEquals("Take twice daily", first.getInstructions()); - // assertEquals("10/11/2020", first.getEndDateStr()); - //} + public void testGetPatient2() throws Exception { + List<PrescriptionBean> list = patientDAO.getCurrentPrescriptions(2l); + PrescriptionBean first = list.get(0); + assertEquals("Take twice daily", first.getInstructions()); + assertEquals("10/11/2020", first.getEndDateStr()); + } public void testNotPatient200() throws Exception { List<DiagnosisBean> diagnoses = patientDAO.getDiagnoses(200L); @@ -38,7 +38,7 @@ public class GetPrescriptionsTest extends TestCase { List<PrescriptionBean> list; list = patientDAO.getExpiredPrescriptions(2); - assertEquals(3, list.size()); + assertEquals(2, list.size()); list = patientDAO.getExpiredPrescriptions(1); assertEquals(0, list.size()); @@ -48,6 +48,6 @@ public class GetPrescriptionsTest extends TestCase { List<PrescriptionBean> list; list = patientDAO.getCurrentPrescriptions(2); - assertEquals(0, list.size()); + assertEquals(1, list.size()); } } diff --git a/iTrust/test/edu/ncsu/csc/itrust/unit/report/MedicalReportFilterTest.java b/iTrust/test/edu/ncsu/csc/itrust/unit/report/MedicalReportFilterTest.java index e91b276f42345741daf41494445c018c417422e1..3c0b9b13e7aa75df24d62f3e8db856a3433ccce2 100644 --- a/iTrust/test/edu/ncsu/csc/itrust/unit/report/MedicalReportFilterTest.java +++ b/iTrust/test/edu/ncsu/csc/itrust/unit/report/MedicalReportFilterTest.java @@ -81,10 +81,10 @@ public class MedicalReportFilterTest extends TestCase { public void testFilterByCurrentPrescriptions() throws Exception { filter = new MedicalReportFilter(MedicalReportFilterType.CURRENT_PRESCRIPTIONS, "647641512", factory); List<PatientBean> res = filter.filter(allPatients); - assertEquals(6, res.size()); - assertTrue(res.get(0).getMID() == 99L); - assertTrue(res.get(1).getMID() == 10L); - assertTrue(res.get(2).getMID() == 11L); + assertEquals(7, res.size()); + assertTrue(res.get(0).getMID() == 2L); + assertTrue(res.get(1).getMID() == 99L); + assertTrue(res.get(2).getMID() == 10L); } public void testFilterByCurrentPrescriptionsNoResult() {