AnsweredAssumed Answered

A question of unit testing in Grails

Question asked by oldreaper on Apr 2, 2012
Can someone help to identify the error of a simple unit testing in Grails

| Loading Grails 2.0.1
| Configuring classpath.
| Environment set to test…..
| Compiling 1 source files…..
<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">

  <bean id="processEngineConfiguration" class="org.activiti.engine.impl.cfg.StandaloneInMemProcessEngineConfiguration">
 
    <property name="processEngineName" value="activiti-engine-test" />
    <property name="databaseType" value="h2" />
    <property name="jdbcUrl" value="jdbc:h2:mem:testDb;MVCC=TRUE" />
    <property name="jdbcDriver" value="org.h2.Driver" />
    <property name="jdbcUsername" value="sa" />
    <property name="jdbcPassword" value="" />
   
    <!– Database configurations –>
    <property name="databaseSchemaUpdate" value="true" />
   
    <!– job executor configurations –>
    <property name="jobExecutorActivate" value="false" />
   
    <!– mail server configurations –>
    <property name="mailServerPort" value="5025" />   
  </bean>

</beans>   

| Packaging Grails application.
| Compiling 1 source files…..
| Packaging Grails application.
| Compiling 1 source files…..
Activiti Process Engine Initialization…
| Tests FAILED  - view reports in target\test-reports
| Error Error executing script TestApp: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'processEngine': FactoryBean threw exception on object creation; nested exception is org.apache.ibatis.exceptions.PersistenceException:
### Error querying database.  Cause: org.h2.jdbc.JdbcSQLException: Table "ACT_RE_DEPLOYMENT" not found; SQL statement:
select * from ACT_RE_DEPLOYMENT D where NAME_=? order by D.DEPLOY_TIME_ asc [42102-147]
### The error may exist in org/activiti/db/mapping/entity/Deployment.xml
### The error may involve org.activiti.engine.impl.persistence.entity.DeploymentEntity.selectDeploymentsByName
### The error occurred while executing a query
### SQL: select * from ACT_RE_DEPLOYMENT D where NAME_=? order by D.DEPLOY_TIME_ asc
### Cause: org.h2.jdbc.JdbcSQLException: Table "ACT_RE_DEPLOYMENT" not found; SQL statement:
select * from ACT_RE_DEPLOYMENT D where NAME_=? order by D.DEPLOY_TIME_ asc [42102-147] (Use –stacktrace to see the full trace)

Outcomes