Skip to content

Commit

Permalink
Revert "Fix failing unit tests on 1.10.x - TRUNK-4182"
Browse files Browse the repository at this point in the history
This reverts commit 62d6759.
  • Loading branch information
wluyima committed Dec 17, 2013
1 parent 62d6759 commit 39be2c3
Show file tree
Hide file tree
Showing 5 changed files with 90 additions and 25 deletions.
5 changes: 1 addition & 4 deletions api/src/main/java/org/openmrs/validator/OrderValidator.java
Expand Up @@ -75,10 +75,7 @@ public void validate(Object obj, Errors errors) {
ValidationUtils.rejectIfEmpty(errors, "voided", "error.null");
ValidationUtils.rejectIfEmpty(errors, "concept", "Concept.noConceptSelected");
ValidationUtils.rejectIfEmpty(errors, "patient", "error.null");

//TODO commented out because of this commit:
//https://github.com/openmrs/openmrs-core/commit/6360b0e78ee98f75eef10bf37d7cbda2e67d5ce9
//ValidationUtils.rejectIfEmpty(errors, "orderType", "error.null");
ValidationUtils.rejectIfEmpty(errors, "orderType", "error.null");

Date startDate = order.getStartDate();
if (startDate != null) {
Expand Down
Expand Up @@ -14,10 +14,7 @@ public class OrderEditorTest extends BaseContextSensitiveTest {
public void setAsText_shouldSetUsingId() throws Exception {
OrderEditor editor = new OrderEditor();
editor.setAsText("2");

//TODO commented out because of this commit:
//https://github.com/openmrs/openmrs-core/commit/6360b0e78ee98f75eef10bf37d7cbda2e67d5ce9
//Assert.assertNotNull(editor.getValue());
Assert.assertNotNull(editor.getValue());
}

/**
Expand All @@ -28,9 +25,6 @@ public void setAsText_shouldSetUsingId() throws Exception {
public void setAsText_shouldSetUsingUuid() throws Exception {
OrderEditor editor = new OrderEditor();
editor.setAsText("dfca4077-493c-496b-8312-856ee5d1cc26");

//TODO commented out because of this commit:
//https://github.com/openmrs/openmrs-core/commit/6360b0e78ee98f75eef10bf37d7cbda2e67d5ce9
//Assert.assertNotNull(editor.getValue());
Assert.assertNotNull(editor.getValue());
}
}
Expand Up @@ -14,10 +14,7 @@ public class OrderTypeEditorTest extends BaseContextSensitiveTest {
public void setAsText_shouldSetUsingId() throws Exception {
OrderTypeEditor editor = new OrderTypeEditor();
editor.setAsText("1");

//TODO commented out because of this commit:
//https://github.com/openmrs/openmrs-core/commit/6360b0e78ee98f75eef10bf37d7cbda2e67d5ce9
//Assert.assertNotNull(editor.getValue());
Assert.assertNotNull(editor.getValue());
}

/**
Expand All @@ -28,9 +25,6 @@ public void setAsText_shouldSetUsingId() throws Exception {
public void setAsText_shouldSetUsingUuid() throws Exception {
OrderTypeEditor editor = new OrderTypeEditor();
editor.setAsText("84ce45a8-5e7c-48f7-a581-ca1d17d63a62");

//TODO commented out because of this commit:
//https://github.com/openmrs/openmrs-core/commit/6360b0e78ee98f75eef10bf37d7cbda2e67d5ce9
//Assert.assertNotNull(editor.getValue());
Assert.assertNotNull(editor.getValue());
}
}
Expand Up @@ -146,10 +146,7 @@ public void validate_shouldFailValidationIfOrderTypeIsNull() throws Exception {
Assert.assertFalse(errors.hasFieldErrors("discontinued"));
Assert.assertFalse(errors.hasFieldErrors("concept"));
Assert.assertFalse(errors.hasFieldErrors("patient"));

//TODO commented out because of this commit:
//https://github.com/openmrs/openmrs-core/commit/6360b0e78ee98f75eef10bf37d7cbda2e67d5ce9
//Assert.assertTrue(errors.hasFieldErrors("orderType"));
Assert.assertTrue(errors.hasFieldErrors("orderType"));
}

/**
Expand Down
85 changes: 84 additions & 1 deletion web/src/main/resources/openmrs-servlet.xml
Expand Up @@ -130,6 +130,13 @@
<property name="order"><value>99</value></property>
<property name="mappings">
<props>
<prop key="/admin/orders/order.list">orderList</prop>
<prop key="/admin/orders/orderDrug.list">orderListByPatient</prop>
<prop key="/admin/orders/orderDrug.form">orderDrugForm</prop>
<prop key="/admin/orders/order.form">orderForm</prop>
<prop key="/admin/orders/orderType.list">orderTypeList</prop>
<prop key="/admin/orders/orderType.form">orderTypeForm</prop>

<prop key="admin/patients/patient.form">patientForm</prop>
<prop key="admin/patients/mergePatients.form">mergePatientsForm</prop>

Expand Down Expand Up @@ -304,8 +311,81 @@
<property name="successView"><value>personObs.form</value></property>
</bean>

<!-- ====== /Observation Sector ====== -->

<!-- ========================== -->
<!-- ====== Order Sector ====== -->
<!-- ========================== -->

<!-- ** Order Type ** -->
<!--this is the optional method of declaring values in the constructor-->
<!--<bean id="orderTypeList" class="org.openmrs.web.controller.OrderTypeListController" />-->
<!--<bean id="orderTypeForm" class="org.openmrs.web.controller.OrderTypeFormController" />-->

<bean id="orderTypeList" class="org.openmrs.web.controller.order.OrderTypeListController">
<property name="commandName"><value>orderTypeList</value></property>
<property name="formView"><value>/admin/orders/orderTypeList</value></property>
<property name="successView"><value>orderType.list</value></property>
</bean>

<!-- Form Controller for the add/edit order types page -->

<bean id="orderTypeForm" class="org.openmrs.web.controller.order.OrderTypeFormController">
<property name="commandName"><value>orderType</value></property>
<property name="validator">
<ref bean="orderTypeValidator" />
</property>
<property name="formView"><value>/admin/orders/orderTypeForm</value></property>
<property name="successView"><value>orderType.list</value></property>
</bean>
<!-- ** /Order Type ** -->
<!-- ====== /Order Sector ====== -->


<!-- ** Order ** -->
<bean id="orderList" class="org.openmrs.web.controller.order.OrderListController">
<property name="commandName"><value>orderList</value></property>
<property name="formView"><value>/admin/orders/orderList</value></property>
<property name="successView"><value>order.list</value></property>
</bean>

<!-- Form Controller for the add/edit order types page -->
<bean id="orderForm" class="org.openmrs.web.controller.order.OrderFormController">
<property name="commandName"><value>order</value></property>
<property name="validator">
<ref bean="orderValidator" />
</property>
<property name="formView"><value>/admin/orders/orderForm</value></property>
<property name="successView"><value>order.list</value></property>
</bean>

<bean id="orderDrugList" class="org.openmrs.web.controller.order.OrderDrugListController">
<property name="commandName"><value>orderDrugList</value></property>
<property name="formView"><value>/admin/orders/orderDrugList</value></property>
<property name="successView"><value>orderDrug.list</value></property>
</bean>

<!-- Form Controller for the add/edit order types page -->
<bean id="orderDrugForm" class="org.openmrs.web.controller.order.OrderDrugFormController">
<property name="commandName"><value>order</value></property>
<property name="validator">
<ref bean="drugOrderValidator" />
</property>
<property name="formView"><value>/admin/orders/orderDrugForm</value></property>
<property name="successView"><value>../../patientDashboard.form</value></property>
</bean>
<!-- ** /Order ** -->

<!-- ** Order Placement ** -->
<bean id="orderListByPatient"
class="org.openmrs.web.controller.order.OrderListByPatientController">
<property name="commandName"><value>orderDrugList</value></property>
<property name="formView"><value>/admin/orders/orderListByPatient</value></property>
<property name="successView"><value>orderDrug.list</value></property>
</bean>

<!-- ** /Order Placement ** -->
<!-- ====== /Order Sector ====== -->

<!-- ** Patient ** -->
<bean id="patientForm" class="org.openmrs.web.controller.patient.PatientFormController">
<property name="commandName"><value>patient</value></property>
Expand Down Expand Up @@ -993,6 +1073,9 @@
<prop key="org.openmrs.Concept">
org.openmrs.web.taglib.fieldgen.ConceptHandler
</prop>
<prop key="org.openmrs.OrderType">
org.openmrs.web.taglib.fieldgen.OrderTypeHandler
</prop>
<prop key="org.openmrs.Encounter">
org.openmrs.web.taglib.fieldgen.EncounterHandler
</prop>
Expand Down

0 comments on commit 39be2c3

Please sign in to comment.