Skip to content

Commit

Permalink
TRUNK-3944: Responded to review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
rkorytkowski committed Jun 4, 2013
1 parent 92bd88f commit 56c743b
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.Ignore;
import org.junit.Test;
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 @@ -919,6 +925,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 @@ -1389,10 +1397,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 56c743b

Please sign in to comment.