Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: openmrs/openmrs-core
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 99c68e1b6a92
Choose a base ref
...
head repository: openmrs/openmrs-core
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: e7d0ac7b675b
Choose a head ref
  • 3 commits
  • 2 files changed
  • 2 contributors

Commits on Nov 20, 2013

  1. TRUNK-4113 Modify the ObsValidator to allow the storage of obs text l…

    …arger than 50 chars
    Dedunu Dhananjaya committed Nov 20, 2013
    Copy the full SHA
    8d8e5e1 View commit details
  2. TRUNK-4113 Modify the ObsValidator to allow the storage of obs text l…

    …arger than 50 chars
    Dedunu Dhananjaya committed Nov 20, 2013
    Copy the full SHA
    e6b5558 View commit details

Commits on Nov 21, 2013

  1. Merge pull request #461 from dedunumax/TRUNK-4113

    TRUNK-4113 Modify the ObsValidator to allow the storage of obs text larger than 50 chars
    dkayiwa committed Nov 21, 2013
    Copy the full SHA
    e7d0ac7 View commit details
Showing with 10 additions and 3 deletions.
  1. +1 −1 api/src/main/java/org/openmrs/validator/ObsValidator.java
  2. +9 −2 api/src/test/java/org/openmrs/validator/ObsValidatorTest.java
2 changes: 1 addition & 1 deletion api/src/main/java/org/openmrs/validator/ObsValidator.java
Original file line number Diff line number Diff line change
@@ -38,7 +38,7 @@
@Handler(supports = { Obs.class }, order = 50)
public class ObsValidator implements Validator {

public final static int VALUE_TEXT_MAX_LENGTH = 50;
public final static int VALUE_TEXT_MAX_LENGTH = 1000;

/**
* @see org.springframework.validation.Validator#supports(java.lang.Class)
11 changes: 9 additions & 2 deletions api/src/test/java/org/openmrs/validator/ObsValidatorTest.java
Original file line number Diff line number Diff line change
@@ -304,8 +304,15 @@ public void validate_shouldFailValidationIfValueTextIsGreaterThanTheMaximumLengt
obs.setPerson(Context.getPersonService().getPerson(2));
obs.setConcept(Context.getConceptService().getConcept(19));
obs.setObsDatetime(new Date());
obs
.setValueText("the limit of valueText is 50. So we are trying to test it with more than 50 characters and this is the test text 1");

// Generate 1800+ characters length text.
String valueText = "";
for (int i = 0; i < 20; i++) {
valueText = valueText
+ "This text should not exceed 1000 characters. Below code will generate a text more than 1000";
}

obs.setValueText(valueText);

Errors errors = new BindException(obs, "obs");
new ObsValidator().validate(obs, errors);