📄 testdateutil.java
字号:
package com.wiley.compBooks.EJwithUML.Base;
import java.util.*;
import javax.naming.NamingException;
import java.sql.SQLException;
import junit.framework.*;
import java.util.logging.*;
public class TestDateUtil extends TestCase
{
private Date testDate = new Date();
public static void main(String[] args)
{
junit.textui.TestRunner.run(TestDateUtil.class);
}
public TestDateUtil(String name)
{
super(name);
System.out.println("SUNDAY=" + Calendar.SUNDAY);
System.out.println("MONDAY=" + Calendar.MONDAY);
System.out.println("SATURDAY=" + Calendar.SATURDAY);
}
public void testGetNextWeekMonday()
{
System.out.println("current date=" + testDate);
System.out.println("next monday= " + DateUtil.getNextWeekMonday(testDate));
}
public void testGetCurrentWeekMonday()
{
System.out.println("current date=" + testDate);
System.out.println("current monday= " + DateUtil.getCurrentWeekMonday(testDate));
}
public void testGetCurrentWeekSunday()
{
System.out.println("current date=" + testDate);
System.out.println("current sunday= " + DateUtil.getCurrentWeekSunday(testDate));
}
public void testGetCurrentWeekSundayUsingCurrentMonday()
{
Date date = DateUtil.getCurrentWeekMonday(testDate);
System.out.println("current date=" + date);
System.out.println("current sunday= " + DateUtil.getCurrentWeekSunday(date));
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -