首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在Jspresso中实现Tmar测试?

如何在Jspresso中实现Tmar测试?
EN

Stack Overflow用户
提问于 2015-08-03 09:06:33
回答 1查看 106关注 0票数 0

按照www.tmar-test.com安装过程,我在我的Jspresso应用程序中编写了一个非常基本的测试(算术和),一切正常。

在第二步中,我想编写一个更真实的测试,并调用一个方法,它是我的Jspresso应用程序的一部分。

为了调用该方法,我需要启动测试描述上下文,但我缺乏信息。

你有什么能帮我的吗?

例如,基于Hrsample,您能提供一个调用computeAge方法的Tmar方法吗?

在computeAge方法下面:

代码语言:javascript
复制
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;
}
}
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-08-19 14:55:20

看看这个职位在Jspresso.org,这应该对你有帮助。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/31783415

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档