Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,10 +13,12 @@ | |
*/ | ||
package org.openmrs.api; | ||
|
||
import static org.hamcrest.Matchers.containsInAnyOrder; | ||
import static org.junit.Assert.assertEquals; | ||
import static org.junit.Assert.assertFalse; | ||
import static org.junit.Assert.assertNotNull; | ||
import static org.junit.Assert.assertNull; | ||
import static org.junit.Assert.assertThat; | ||
import static org.junit.Assert.assertTrue; | ||
import static org.openmrs.test.TestUtil.containsId; | ||
|
||
|
@@ -33,6 +35,9 @@ | |
import junit.framework.Assert; | ||
|
||
import org.apache.commons.collections.CollectionUtils; | ||
import org.hamcrest.Description; | ||
import org.hamcrest.Matcher; | ||
import org.hamcrest.TypeSafeMatcher; | ||
import org.junit.Before; | ||
import org.junit.Ignore; | ||
import org.junit.Test; | ||
|
@@ -58,6 +63,7 @@ | |
import org.openmrs.GlobalProperty; | ||
import org.openmrs.Location; | ||
import org.openmrs.Obs; | ||
import org.openmrs.OpenmrsObject; | ||
import org.openmrs.Patient; | ||
import org.openmrs.Person; | ||
import org.openmrs.User; | ||
|
@@ -915,8 +921,6 @@ public void getConceptByName_shouldFindConceptsWithNamesInMoreGenericLocales() t | |
@Verifies(value = "should find concepts with names in same specific locale", method = "getConceptByName(String)") | ||
public void getConceptByName_shouldFindConceptsWithNamesInSameSpecificLocale() throws Exception { | ||
executeDataSet(INITIAL_CONCEPTS_XML); | ||
// sanity check | ||
Assert.assertEquals(Context.getLocale(), Locale.UK); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
rkorytkowski
Author
Member
|
||
|
||
// make sure that concepts are found that have a specific locale on them | ||
Assert.assertNotNull(Context.getConceptService().getConceptByName("Numeric name with en_GB locale")); | ||
|
@@ -1365,12 +1369,21 @@ public void getConceptsByConceptSet_shouldReturnAllConceptsInSet() throws Except | |
|
||
List<Concept> conceptSet = conceptService.getConceptsByConceptSet(concept); | ||
|
||
Assert.assertEquals(5, conceptSet.size()); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
rkorytkowski
Author
Member
|
||
Assert.assertEquals(true, conceptSet.contains(conceptService.getConcept(2))); | ||
Assert.assertEquals(true, conceptSet.contains(conceptService.getConcept(3))); | ||
Assert.assertEquals(true, conceptSet.contains(conceptService.getConcept(4))); | ||
Assert.assertEquals(true, conceptSet.contains(conceptService.getConcept(5))); | ||
Assert.assertEquals(true, conceptSet.contains(conceptService.getConcept(6))); | ||
assertThat(conceptSet, containsInAnyOrder(hasId(2), hasId(3), hasId(4), hasId(5), hasId(6))); | ||
} | ||
|
||
private Matcher<? super OpenmrsObject> hasId(final Integer id) { | ||
This comment has been minimized.
Sorry, something went wrong.
rkorytkowski
Author
Member
|
||
return new TypeSafeMatcher<OpenmrsObject>() { | ||
|
||
@Override | ||
public void describeTo(Description description) { | ||
} | ||
|
||
@Override | ||
protected boolean matchesSafely(OpenmrsObject item) { | ||
return id.equals(item.getId()); | ||
} | ||
}; | ||
} | ||
|
||
/** | ||
|
@@ -1393,7 +1406,7 @@ 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"); | ||
ConceptStopWord conceptStopWord = new ConceptStopWord("The", Locale.UK); | ||
This comment has been minimized.
Sorry, something went wrong.
dkayiwa
Member
|
||
conceptService.saveConceptStopWord(conceptStopWord); | ||
|
||
List<String> conceptStopWords = conceptService.getConceptStopWords(Locale.UK); | ||
|
@@ -1416,7 +1429,7 @@ public void getConceptStopWords_shouldReturnDefaultLocaleConceptStopWordsIfLocal | |
@Test | ||
@Verifies(value = "should put generated concept stop word id onto returned concept stop word", method = "saveConceptStopWord(ConceptStopWord)") | ||
public void saveConceptStopWord_shouldSaveReturnConceptStopWordWithId() throws Exception { | ||
ConceptStopWord conceptStopWord = new ConceptStopWord("A"); | ||
ConceptStopWord conceptStopWord = new ConceptStopWord("A", Locale.UK); | ||
This comment has been minimized.
Sorry, something went wrong. |
||
ConceptStopWord savedConceptStopWord = conceptService.saveConceptStopWord(conceptStopWord); | ||
|
||
assertNotNull(savedConceptStopWord.getId()); | ||
|
@@ -1459,9 +1472,8 @@ public void saveConceptStopWord_shouldSaveConceptStopWordInUppercase() throws Ex | |
@Verifies(value = "should return list of concept stop word for given locale", method = "getConceptStopWords(Locale)") | ||
public void getConceptStopWords_shouldReturnListOfConceptStopWordsForGivenLocale() throws Exception { | ||
List<String> conceptStopWords = conceptService.getConceptStopWords(Locale.ENGLISH); | ||
assertEquals(2, conceptStopWords.size()); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong. |
||
assertEquals("A", conceptStopWords.get(0)); | ||
assertEquals("AN", conceptStopWords.get(1)); | ||
|
||
assertThat(conceptStopWords, containsInAnyOrder("A", "AN")); | ||
} | ||
|
||
/** | ||
|
@@ -2065,19 +2077,19 @@ public void getConceptReferenceTerms_shouldReturnUniqueTermsWithACodeOrNameConta | |
for (ConceptReferenceTerm conceptReferenceTerm : matches) | ||
Assert.assertTrue(uniqueTerms.add(conceptReferenceTerm)); | ||
} | ||
|
||
/** | ||
/** | ||
* @see ConceptService#getConceptsByAnswer(ConceptClass) | ||
*/ | ||
@Test | ||
public void getConceptsByAnswer_shouldFindAnswersForConcept() throws Exception { | ||
Concept concept = conceptService.getConcept(7); | ||
Assert.assertNotNull(concept); | ||
List<Concept> concepts = conceptService.getConceptsByAnswer(concept); | ||
Assert.assertEquals(1, concepts.size()); | ||
Assert.assertEquals(21, concepts.get(0).getId().intValue()); | ||
Concept concept = conceptService.getConcept(7); | ||
Assert.assertNotNull(concept); | ||
List<Concept> concepts = conceptService.getConceptsByAnswer(concept); | ||
Assert.assertEquals(1, concepts.size()); | ||
Assert.assertEquals(21, concepts.get(0).getId().intValue()); | ||
} | ||
/** | ||
* @see ConceptService#getConceptsByClass(ConceptClass) | ||
* @verifies not fail due to no name in search | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,7 @@ | |
import org.apache.commons.logging.Log; | ||
import org.apache.commons.logging.LogFactory; | ||
import org.junit.Assert; | ||
import org.junit.Ignore; | ||
import org.junit.Test; | ||
import org.openmrs.Concept; | ||
import org.openmrs.GlobalProperty; | ||
|
@@ -39,6 +40,7 @@ | |
import org.openmrs.test.Verifies; | ||
import org.openmrs.util.OpenmrsConstants; | ||
import org.openmrs.util.OpenmrsUtil; | ||
import org.springframework.test.annotation.DirtiesContext; | ||
|
||
import ca.uhn.hl7v2.HL7Exception; | ||
import ca.uhn.hl7v2.app.Application; | ||
|
@@ -185,6 +187,7 @@ public void parseHL7String_shouldParseTheGivenStringIntoMessage() throws Excepti | |
* @see {@link HL7Service#processHL7Message(Message)} | ||
*/ | ||
@Test | ||
@Ignore("TRUNK-3945") | ||
This comment has been minimized.
Sorry, something went wrong.
dkayiwa
Member
|
||
@Verifies(value = "should parse message type supplied by module", method = "processHL7Message(Message)") | ||
public void processHL7Message_shouldParseMessageTypeSuppliedByModule() throws Exception { | ||
Properties props = super.getRuntimeProperties(); | ||
|
@@ -234,6 +237,7 @@ public void processHL7Message_shouldParseMessageTypeSuppliedByModule() throws Ex | |
* @see {@link HL7Service#processHL7InQueue(HL7InQueue)} | ||
*/ | ||
@Test | ||
@Ignore("TRUNK-3945") | ||
This comment has been minimized.
Sorry, something went wrong. |
||
@Verifies(value = "should parse oru r01 message using overridden parser provided by a module", method = "processHL7InQueue(HL7InQueue)") | ||
public void processHL7InQueue_shouldParseOruR01MessageUsingOverriddenParserProvidedByAModule() throws Exception { | ||
executeDataSet("org/openmrs/hl7/include/ORUTest-initialData.xml"); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,11 +15,12 @@ | |
|
||
import junit.framework.Assert; | ||
|
||
import org.junit.Ignore; | ||
import org.junit.Test; | ||
import org.openmrs.api.context.Context; | ||
|
||
@StartModule( { "org/openmrs/module/include/dssmodule-1.44.omod", "org/openmrs/module/include/atd-0.51.omod" }) | ||
public class StartModuleAnnotatioTest extends BaseModuleContextSensitiveTest { | ||
public class StartModuleAnnotatioTest extends BaseContextSensitiveTest { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
djazayeri
Member
|
||
|
||
@Test | ||
public void shouldStartModules() throws Exception { | ||
|
Did you intentionally remove this assert? :)