Package org.joda.time

Examples of org.joda.time.DateMidnight


    if (applyTimeZoneDifference)
    {
      TimeZone zone = getClientTimeZone();
      // instantiate now/ current time
      MutableDateTime dt = new MutableDateTime(new DateMidnight());
      if (zone != null)
      {
        // set time zone for client
        format = format.withZone(DateTimeZone.forTimeZone(zone));
        dt.setZone(DateTimeZone.forTimeZone(zone));
View Full Code Here


  @Resource
  private BookDao dao;

  @Test
  public void testDao() {
    final Book book = new Book("ArbitraryResultTypeTest", new DateMidnight());
    dao.create(book);
    final List<String> titles = dao.findTitles();
    Assert.assertEquals(titles, Arrays.asList(book.getTitle()));
  }
View Full Code Here

    Assert.assertEquals(titles, Arrays.asList(book.getTitle()));
  }

  @Test
  public void testSqlQuery() {
    final DateMidnight date = new DateMidnight();
    final Book book = new Book("sql query", date);
    dao.create(book);
    final List<Object[]> list = dao.getBookByTitle("sql query");
    Assert.assertTrue(list.size() == 1);
    Assert.assertEquals(list.get(0), new Object[] { BigInteger.valueOf(book.getPrimaryKey()), new Timestamp(date.getMillis()), book.getTitle() });
  }
View Full Code Here

    Assert.assertEquals(list.get(0), new Object[] { BigInteger.valueOf(book.getPrimaryKey()), new Timestamp(date.getMillis()), book.getTitle() });
  }

  @Test
  public void testSqlNamedQuery() {
    final DateMidnight date = new DateMidnight();
    final Book book = new Book("sql named query", date);
    dao.create(book);
    final BigInteger count = dao.countBooks();
    Assert.assertEquals(count, BigInteger.valueOf(1));
  }
View Full Code Here

    return title;
  }

  @NotNull
  public DateMidnight getPublishDate() {
    return new DateMidnight(publishDate);
  }
View Full Code Here

  @Resource
  private BookDao dao;

  @Test
  public void testDao() {
    final Book book = new Book("ArbitraryResultTypeTest", new DateMidnight());
    dao.create(book);
    final List<String> titles = dao.findTitles();
    Assert.assertEquals(titles, Arrays.asList(book.getTitle()));
  }
View Full Code Here

    Assert.assertEquals(titles, Arrays.asList(book.getTitle()));
  }

  @Test
  public void testSqlQuery() {
    final DateMidnight date = new DateMidnight();
    final Book book = new Book("sql query", date);
    dao.create(book);
    final List<Object[]> list = dao.getBookByTitle("sql query");
    Assert.assertTrue(list.size() == 1);
    Assert.assertEquals(list.get(0), new Object[] { BigInteger.valueOf(book.getPrimaryKey()), new Timestamp(date.getMillis()), book.getTitle() });
  }
View Full Code Here

    Assert.assertEquals(list.get(0), new Object[] { BigInteger.valueOf(book.getPrimaryKey()), new Timestamp(date.getMillis()), book.getTitle() });
  }

  @Test
  public void testSqlNamedQuery() {
    final DateMidnight date = new DateMidnight();
    final Book book = new Book("sql named query", date);
    dao.create(book);
    final BigInteger count = dao.countBooks();
    Assert.assertEquals(count, BigInteger.valueOf(1));
  }
View Full Code Here

public class ExplicitEntityTest extends AbstractTransactionalTestNGSpringContextTests {

  @SuppressWarnings({ "unchecked" })
  @Test
  public void testDao() {
    final Book book = new Book("ExplicitEntityTest", new DateMidnight());
    final NoEntityDao dao = applicationContext.getBean("dao", NoEntityDao.class);
    dao.create(book);
  }
View Full Code Here

@ContextConfiguration(locations = "classpath:namedParamContext.xml")
public class NamedParamTest extends AbstractTransactionalTestNGSpringContextTests {

  @Test
  public void test() {
    final Book book = new Book("NamedParamTest", new DateMidnight());
    final NamedParamDao dao = applicationContext.getBean("dao", NamedParamDao.class);
    dao.create(book);
    final Book fromDb = dao.findNamedByTitle("NamedParamTest");
    Assert.assertEquals(book, fromDb);
  }
View Full Code Here

TOP

Related Classes of org.joda.time.DateMidnight

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.