Downloads Documentation Community Contribute Demo






Show Sidebar
Login | Register
Show
Ignore:
Timestamp:
08/09/08 16:18:42 (5 months ago)
Author:
mcunderlik
Message:

data_synchronization_bidirectional branch: fixed unit tests to work with Junit4 changes.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • openmrs/branches/data_synchronization_bidirectional/test/api/org/openmrs/test/synchronization/engine/SyncConceptTest.java

    r5133 r5215  
    1414package org.openmrs.test.synchronization.engine; 
    1515 
     16import static org.junit.Assert.assertEquals; 
     17import static org.junit.Assert.assertNotSame; 
     18import static org.junit.Assert.assertTrue; 
     19import static org.junit.Assert.assertFalse; 
     20import static org.junit.Assert.assertNull; 
     21import static org.junit.Assert.assertNotNull; 
     22import org.junit.Test; 
     23 
    1624import java.util.HashSet; 
    1725import java.util.Locale; 
     
    2937import org.openmrs.api.ConceptService; 
    3038import org.openmrs.api.context.Context; 
     39import org.springframework.test.annotation.NotTransactional; 
    3140 
    3241/** 
     
    4049    } 
    4150 
     51        @Test 
     52    @NotTransactional 
    4253        public void testSaveConceptCoded() throws Exception { 
    4354                runSyncTest(new SyncTestHelper() { 
     
    7283                        } 
    7384                }); 
    74         }                
     85        } 
     86         
     87        @Test 
     88    @NotTransactional 
    7589        public void testSaveConceptNumeric() throws Exception { 
    7690                runSyncTest(new SyncTestHelper() { 
     
    97111                                assertEquals(cs.getConcept(conceptId).getName().getName(), "SOMETHING NUMERIC"); 
    98112                                ConceptNumeric cn = cs.getConceptNumeric(conceptId); 
    99                                 assertEquals("Concept numeric absolute low values do not match", 0d, cn.getLowAbsolute()); 
    100                                 assertEquals("Concept nuermic high critical values do not match", 100d, cn.getHiCritical()); 
     113                                assertEquals("Concept numeric absolute low values do not match", (Double)0d, cn.getLowAbsolute()); 
     114                                assertEquals("Concept nuermic high critical values do not match", (Double)100d, cn.getHiCritical()); 
    101115                                assertEquals("Concept numeric datatypes does not match", "Numeric", cn.getDatatype().getName()); 
    102116                                assertEquals("Concept numeric classes does not match", "Question", cn.getConceptClass().getName()); 
     
    106120        } 
    107121         
    108          
    109  
    110          
    111          
    112          
     122        @Test 
     123    @NotTransactional 
    113124        public void testSaveConceptSet() throws Exception { 
    114125                runSyncTest(new SyncTestHelper() { 
     
    186197                                 
    187198                                ConceptNumeric cn = cs.getConceptNumeric(conceptNumericId); 
    188                                 assertEquals("Concept numeric absolute low values do not match", 0d, cn.getLowAbsolute()); 
    189                                 assertEquals("Concept numeric critical high values do not match", 100d, cn.getHiCritical()); 
     199                                assertEquals("Concept numeric absolute low values do not match", (Double)0d, cn.getLowAbsolute()); 
     200                                assertEquals("Concept numeric critical high values do not match", (Double)100d, cn.getHiCritical()); 
    190201                                assertEquals("Concept numeric datatypes do not match", "Numeric", cn.getDatatype().getName()); 
    191202                                assertEquals("Concept numeric classes do not match", "Question", cn.getConceptClass().getName()); 
     
    220231        }                
    221232         
    222  
     233        @Test 
     234    @NotTransactional 
    223235        public void testEditConcepts() throws Exception { 
    224236                runSyncTest(new SyncTestHelper() { 
     
    248260                                Concept wt = cs.getConceptByName("WEIGHT"); 
    249261                                ConceptNumeric weight = cs.getConceptNumeric(wt.getConceptId()); 
    250                                 assertEquals("Failed to change property on a numeric concept", weight.getHiCritical(), 200d); 
     262                                assertEquals("Failed to change property on a numeric concept",(Double) 200d, weight.getHiCritical()); 
    251263                                 
    252264                                Concept malaria = cs.getConceptByName("MALARIA"); 
     
    264276        } 
    265277 
    266          
     278        @Test 
     279    @NotTransactional 
    267280        public void testAddNameToConcept() throws Exception { 
    268281                runSyncTest(new SyncTestHelper() {