提交 ffd936a9 编写于 作者: A ainilife

bug fix in time of StateAnalyzerTest

上级 e6f70f70
package com.dianping.cat.consumer.state;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import junit.framework.Assert;
......@@ -27,9 +28,11 @@ public class StateAnalyzerTest extends ComponentTestCase {
super.setUp();
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd HH:mm:ss");
Date date = sdf.parse("20120101 00:00:00");
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(1325347200000L); //20120101 00:00:00
m_analyzer = (StateAnalyzer) lookup(MessageAnalyzer.class, StateAnalyzer.ID);
m_analyzer.initialize(date.getTime(), Constants.HOUR, Constants.MINUTE * 5);
m_analyzer.initialize(calendar.getTimeInMillis(), Constants.HOUR, Constants.MINUTE * 5);
}
@Test
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册