Skip to content

Commit

Permalink
TRUNK-3944: Responded to review comments
Browse files Browse the repository at this point in the history
(cherry picked from commit 56c743b)
  • Loading branch information
rkorytkowski committed Jun 4, 2013
1 parent f757782 commit 0be5408
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions api/src/test/java/org/openmrs/api/ConceptServiceTest.java
Expand Up @@ -36,6 +36,7 @@
import junit.framework.Assert;

import org.apache.commons.collections.CollectionUtils;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.openmrs.Concept;
Expand Down Expand Up @@ -96,6 +97,11 @@ public void runBeforeAllTests() throws Exception {
conceptService = Context.getConceptService();
}

@After
public void revertToDefaultLocale() throws Exception {
Context.setLocale(Locale.US);
}

/**
* Test getting a concept by name and by partial name.
*
Expand Down Expand Up @@ -928,6 +934,8 @@ public void getConceptByName_shouldFindConceptsWithNamesInMoreGenericLocales() t
public void getConceptByName_shouldFindConceptsWithNamesInSameSpecificLocale() throws Exception {
executeDataSet(INITIAL_CONCEPTS_XML);

Context.setLocale(Locale.UK);

// make sure that concepts are found that have a specific locale on them
Assert.assertNotNull(Context.getConceptService().getConceptByName("Numeric name with en_GB locale"));
}
Expand Down Expand Up @@ -1403,10 +1411,10 @@ public void saveConceptStopWord_shouldSaveConceptStopWordIntoDatabase() throws E
@Test
@Verifies(value = "should assign default Locale ", method = "saveConceptStopWord(ConceptStopWord)")
public void saveConceptStopWord_shouldSaveConceptStopWordAssignDefaultLocaleIsItNull() throws Exception {
ConceptStopWord conceptStopWord = new ConceptStopWord("The", Locale.UK);
ConceptStopWord conceptStopWord = new ConceptStopWord("The");
conceptService.saveConceptStopWord(conceptStopWord);

List<String> conceptStopWords = conceptService.getConceptStopWords(Locale.UK);
List<String> conceptStopWords = conceptService.getConceptStopWords(Locale.US);
assertEquals(2, conceptStopWords.size());
}

Expand Down

0 comments on commit 0be5408

Please sign in to comment.