按照www.tmar-test.com安装过程,我在我的Jspresso应用程序中编写了一个非常基本的测试(算术和),一切正常。
在第二步中,我想编写一个更真实的测试,并调用一个方法,它是我的Jspresso应用程序的一部分。
为了调用该方法,我需要启动测试描述上下文,但我缺乏信息。
你有什么能帮我的吗?
例如,基于Hrsample,您能提供一个调用computeAge方法的Tmar方法吗?
在computeAge方法下面:
package org.jspresso.hrsample.model.service;
import java.util.Date;
import org.jspresso.hrsample.model.Employee;
import org.jspresso.framework.model.component.service.IComponentService;
/**
* The services delegate of the Employee entity
*/
public class EmployeeServiceDelegate implements IComponentService {
/**
* Computes the employee age.
*
* @param employee
* the employee this service execution has been triggered on.
* @param birthDate
* a birth date (might be different than the actual employee birth
* date).
* @return the age computed from the birth date passed as parameter.
*/
public Integer computeAge(Employee employee, Date birthDate) {
if (birthDate != null) {
return new Integer(
(int) ((new Date().getTime() - birthDate.getTime()) / (1000L * 60 * 60 * 24 * 365)));
}
return null;
}
}发布于 2015-08-19 14:55:20
看看这个职位在Jspresso.org,这应该对你有帮助。
https://stackoverflow.com/questions/31783415
复制相似问题