testdateutil.java

来自「考勤管理系统源码」· Java 代码 · 共 49 行

JAVA
49
字号
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 + =
减小字号Ctrl + -
显示快捷键?