假设我有一个扩展 CommonDomain 类的 Transformation 类。
我创建了一个 DaoUtil 只是为了插入一个默认参数来插入。
public static void populateValuesForInsert(CommonDomain domain, Long userId)
{
java.util.Date today = new java.util.Date();
domain.setCreatedBy(userId);
domain.setCreatedDate(today);
domain.setUpdatedBy(userId);
domain.setUpdatedDate(today);
}
public class Transformation extends CommonDomain
{
//private static final long serialVersionUID = -2800564185309854734L;
private Long id;
private Long scenarioType;
private String description;
//.... get set here ...
}
public class CommonDomain implements Serializable
{
private static final long serialVersionUID = 1L;
public static final Integer DEFAULT_BASELINE_ID = 0;
public static final String DATE_FORMAT_DEFAULT = "MM/dd/yyyy";
public static final String DATE_FORMAT_WITH_TIME = "MM/dd/yyyy HH:mm:ss";
public long maxRowCount;
private String roleName;
private Date createdDate;
private Date updatedDate;
private Long createdBy;
private Long updatedBy;
//..get set here
}
当我运行 JUnit 测试时,它在本地运行得很好。 但是在 Hudson 中运行测试会导致此错误:
populateValuesForInsert(com.domain.CommonDomain,java.lang.Long) in
com.utils.DaoUtil
cannot be applied to (com.domain.Transformation,java.lang.Long)
我在本地使用 JDK 1.5.0_14,在 Hudson 中使用 JDK 1.5.0_21。
知道为什么会发生这个错误吗?
我不知道 Hudson 的内部结构,但也许有某种缓存保存着一些类文件的旧版本。