dataset error "NO such Table Exception"

am runnug a data set test in my module but am getting a "No Such Table Exeption . here is my dataset

<?xml version='1.0' encoding='UTF-8'?>

  <facelist_multipart multipart_id="1" patient_id="1" />

my test class

package org.openmrs.module.facelist;

import org.junit.Assert; import org.junit.Test; import org.openmrs.api.context.Context; import org.openmrs.module.facelist.Service.MultipartService; import org.openmrs.test.BaseModuleContextSensitiveTest;


  • Tests the MyModuleService class and all of its methods **/ public class MyModuleServiceTest extends BaseModuleContextSensitiveTest {

     public void shouldreturnId() throws Exception {
     	MultipartService muiltipartService = Context.getService(MultipartService.class);
     	Assert.assertEquals( muiltipartService.getMultipart(1).getPatient_ID(),1);


test configuration file

<?xml version="1.0" encoding="UTF-8"?>

	<mapping resource="Multipart.hbm.xml"/>


and my testing application context file

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns=""
	<bean id="sessionFactory" class="org.openmrs.api.db.hibernate.HibernateSessionFactoryBean">
    <property name="configLocations">
            <value>classpath*: ManagingMultipart-hibernate.cfg.xml</value>
    <property name="mappingJarLocations">
        <ref bean="mappingJarResources" />
    <!--  default properties must be set in the -->


@dkayiwa @tendomart

Give a detailed error log

thx @tendomart… i had already given the link to the error log in the post as “No such Table Exception”

Have you mapped it in the TestingApplicationContext.xml file as here?

And here?

1 Like

Why do you have a space in classpath*: ManagingMultipart-hibernate.cfg.xml in the TestApplicationContext.xml file?

1 Like

thx so much sir dan…

i had no included this

<!DOCTYPE hibernate-configuration PUBLIC
	"-//Hibernate/Hibernate Configuration DTD 3.0//EN"

in the my managingMultipart-hibernate-cfg.xml file …it now works pretty fine

yes sir mr wycliff your ryt, wen i removed it , it now works

one problem i now have , to be sincere i have never written a test unit for a controler , i have read about using the mocker concept , but ive not sen an example of how its used n openmrs , coz wat i tried out doesnt work in open mrs …can i gte an example sir

Here are some examples