Package fi.luomus.commons.containers

Examples of fi.luomus.commons.containers.DateValue


      String actual = DateUtils.humanize(new DateValue("1", "", "0"), DateUtils.EN);
      assertEquals("1 day", actual);
    }

    public void test___humanize_5_en() {
      String actual = DateUtils.humanize(new DateValue(1, 1, 0), DateUtils.EN);
      assertEquals("1 month 1 day", actual);
    }
View Full Code Here


      String actual = DateUtils.humanize(new DateValue(1, 1, 0), DateUtils.EN);
      assertEquals("1 month 1 day", actual);
    }

    public void test___humanize_6_en() {
      String actual = DateUtils.humanize(new DateValue(0, 1, 3), DateUtils.EN);
      assertEquals("3 years 1 month", actual);
    }
View Full Code Here

      String actual = DateUtils.humanize(new DateValue(0, 1, 3), DateUtils.EN);
      assertEquals("3 years 1 month", actual);
    }

    public void test___humanize_sv() {
      String actual = DateUtils.humanize(new DateValue(19, 9, 1), DateUtils.SV);
      assertEquals("1 år 9 månader 19 dagar", actual);
    }
View Full Code Here

      String actual = DateUtils.humanize(new DateValue(19, 9, 1), DateUtils.SV);
      assertEquals("1 år 9 månader 19 dagar", actual);
    }

    public void test___humanize_2_sv() {
      String actual = DateUtils.humanize(new DateValue(2, 1, 2), DateUtils.SV);
      assertEquals("2 år 1 månad 2 dagar", actual);
    }
View Full Code Here

      String actual = DateUtils.humanize(new DateValue(2, 1, 2), DateUtils.SV);
      assertEquals("2 år 1 månad 2 dagar", actual);
    }

    public void test___humanize_3_sv() {
      String actual = DateUtils.humanize(new DateValue(1, null, null), DateUtils.SV);
      assertEquals("1 dagen", actual);
    }
View Full Code Here

      String actual = DateUtils.humanize(new DateValue(1, null, null), DateUtils.SV);
      assertEquals("1 dagen", actual);
    }

    public void test___humanize_4_sv() {
      String actual = DateUtils.humanize(new DateValue("1", "", "0"), DateUtils.SV);
      assertEquals("1 dagen", actual);
    }
View Full Code Here

      String actual = DateUtils.humanize(new DateValue("1", "", "0"), DateUtils.SV);
      assertEquals("1 dagen", actual);
    }

    public void test___humanize_5_sv() {
      String actual = DateUtils.humanize(new DateValue(1, 1, 0), DateUtils.SV);
      assertEquals("1 månad 1 dagen", actual);
    }
View Full Code Here

      String actual = DateUtils.humanize(new DateValue(1, 1, 0), DateUtils.SV);
      assertEquals("1 månad 1 dagen", actual);
    }

    public void test___humanize_6_sv() {
      String actual = DateUtils.humanize(new DateValue(0, 1, 3), DateUtils.SV);
      assertEquals("3 år 1 månad", actual);
    }
View Full Code Here

      assertEquals(1293832800L, epoch);
    }

    @SuppressWarnings("deprecation")
    public void test_date() {
      DateValue date = DateUtils.convertToDateValue("5.10.2009");
      assertEquals("05", date.get(DAY));
      assertEquals("10", date.get(MONTH));
      assertEquals("2009", date.get(YEAR));

      //      date = DateUtils.toDate(null);
      //      assertEquals("", date.get(DAY));
      //      assertEquals("", date.get(MONTH));
      //      assertEquals("", date.get(YEAR));

      date = DateUtils.convertToDateValue("");
      assertEquals("", date.get(DAY));
      assertEquals("", date.get(MONTH));
      assertEquals("", date.get(YEAR));

      date = DateUtils.convertToDateValue(".");
      assertEquals("", date.get(DAY));
      assertEquals("", date.get(MONTH));
      assertEquals("", date.get(YEAR));

      date = DateUtils.convertToDateValue("..");
      assertEquals("", date.get(DAY));
      assertEquals("", date.get(MONTH));
      assertEquals("", date.get(YEAR));

      date = DateUtils.convertToDateValue("...");
      assertEquals("", date.get(DAY));
      assertEquals("", date.get(MONTH));
      assertEquals("", date.get(YEAR));

      date = DateUtils.convertToDateValue("5..2009");
      assertEquals("05", date.get(DAY));
      assertEquals("", date.get(MONTH));
      assertEquals("2009", date.get(YEAR));

      date = DateUtils.convertToDateValue("asdada");
      assertEquals("asdada", date.get(DAY));
      assertEquals("", date.get(MONTH));
      assertEquals("", date.get(YEAR));

      date = DateUtils.convertToDateValue("1.2.3.4.5.6.7.8");
      assertEquals("01", date.get(DAY));
      assertEquals("02", date.get(MONTH));
      assertEquals("3", date.get(YEAR));
    }
View Full Code Here

    public void test_dateString() {
      assertEquals("05.02.2042", DateUtils.catenateDateString("5", "2", "2042"));
    }

    public void test_format_datevalue() {
      assertEquals("2013-01-15", DateUtils.format(new DateValue("15", "1", "2013"), "yyyy-MM-dd"));
    }
View Full Code Here

TOP

Related Classes of fi.luomus.commons.containers.DateValue

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.