暗夜蝶梦 2016-03-27 10:58 采纳率: 76.9%
浏览 1386
已采纳

初学者搭建jbpm测试时报错

报错信息:
junit.framework.AssertionFailedError: No tests found in edu.qlu.bean.TestJbpm
at junit.framework.Assert.fail(Assert.java:47)
at junit.framework.TestSuite$1.runTest(TestSuite.java:90)
at junit.framework.TestCase.runBare(TestCase.java:130)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:120)
at junit.framework.TestSuite.runTest(TestSuite.java:230)
at junit.framework.TestSuite.run(TestSuite.java:225)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:131)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
源码
java代码

 package edu.qlu.bean;

import org.jbpm.api.Configuration;
import org.jbpm.api.ProcessEngine;

import org.jbpm.api.RepositoryService;
import junit.framework.TestCase;

public class TestJbpm extends TestCase{
    /**
     * 部署流程
     */

    public void deploy(){
        ProcessEngine processEngine = Configuration.getProcessEngine();//流程引擎       
        RepositoryService repositoryService = processEngine.getRepositoryService();//创建服务
        repositoryService.createDeployment().addResourceFromClasspath("test1.jpdl.xml").deploy();//部署流程


    }

}

数据库配置

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

<!DOCTYPE hibernate-configuration PUBLIC
          "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
          "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<hibernate-configuration>
  <session-factory>

     <property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
     <property name="hibernate.connection.driver_class">com.mysql.jbdc.Driver</property>
     <property name="hibernate.connection.url">jdbc:mysql://localhost:3306/jbpm?&amp;useUnicode=true&amp;characterEncoding=utf-8</property>
     <property name="hibernate.connection.username">root</property>
     <property name="hibernate.connection.password">root</property>
     <property name="hibernate.hbm2ddl.auto">create</property>
     <property name="hibernate.format_sql">true</property>

     <mapping resource="jbpm.repository.hbm.xml" />
     <mapping resource="jbpm.execution.hbm.xml" />
     <mapping resource="jbpm.history.hbm.xml" />
     <mapping resource="jbpm.task.hbm.xml" />
     <mapping resource="jbpm.identity.hbm.xml" />

  </session-factory>
</hibernate-configuration>

  • 写回答

1条回答

  • 暗夜蝶梦 2016-03-27 11:31
    关注

    把方法名deploy()改成testDeploy()以后,测试成功了!但是有点不明白,方法名为什么要以test开头

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 求daily translation(DT)偏差订正方法的代码
  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler
  • ¥15 关于#python#的问题:自动化测试