Package org.joda.time

Examples of org.joda.time.DateMidnight


        .newCode(new DateMidnight(2010, 3, 30).toDate()));
  }

  public void testNewEnsemblePuces() throws Exception
  {
    Date date = new DateMidnight(2010, 3, 30).toDate();
    EnsemblePuces ens = ensemblePucesService.newEnsemblePuces(date);
    assertEquals(date, ens.getDateDebut());
    assertEquals("20100330-02", ens.getCode());
  }
View Full Code Here


  }

  public void testFindActif() throws Exception
  {
    assertEquals(4, ensemblePucesService.findActif(
        new DateMidnight(2007, 4, 1).toDate()).size());
    assertEquals(3, ensemblePucesService.findActif(
        new DateMidnight(2007, 4, 2).toDate()).size());
    assertEquals(1, ensemblePucesService.findActif(
        new DateMidnight(2006, 4, 1).toDate()).size());
  }
View Full Code Here

  }

  public void testSave() throws Exception
  {
    EnsemblePuces puces = ensemblePucesService
        .newEnsemblePuces(new DateMidnight(2010, 3, 30).toDate());
    puces.setNom("Les puces à Jacques");
    puces.setDescription("Le nom dit tout");
    puces.setDateFin(new DateMidnight(2010, 3, 30).toDate());

    ensemblePucesService.save(puces);

    assertNotNull(puces.getId());
  }
View Full Code Here

  }

  public void testSaveChampsNull() throws Exception
  {
    EnsemblePuces puces = ensemblePucesService
        .newEnsemblePuces(new DateMidnight(2010, 3, 30).toDate());
    puces.setDescription("Le nom est null !");

    try
    {
      ensemblePucesService.save(puces);
View Full Code Here

  }

  public void testSaveUnique() throws Exception
  {
    EnsemblePuces puces = ensemblePucesService
        .newEnsemblePuces(new DateMidnight(2010, 3, 30).toDate());
    puces.setCode("20100330-01");
    puces.setNom("Les puces à Jacques");
    puces.setDescription("Le nom est null !");

    try
View Full Code Here

  }

  public void testSaveRangeDates() throws Exception
  {
    EnsemblePuces puces = ensemblePucesService
        .newEnsemblePuces(new DateMidnight(2010, 3, 30).toDate());
    puces.setNom("Les puces à Jacques");
    puces.setDescription("Le nom dit tout");
    puces.setDateFin(new DateMidnight(2010, 3, 29).toDate());

    try
    {
      ensemblePucesService.save(puces);
      fail();
View Full Code Here

  }

  public void testDelete() throws Exception
  {
    EnsemblePuces puces = ensemblePucesService
        .newEnsemblePuces(new DateMidnight(2010, 3, 30).toDate());
    puces.setNom("Les puces à Jacques");
    puces.setDescription("Le nom dit tout");
    puces.setDateFin(new DateMidnight(2010, 3, 30).toDate());

    ensemblePucesService.save(puces);

    ensemblePucesService.delete(puces);
    assertNull(ensemblePucesService.find(puces.getId()));
View Full Code Here

    super(EnsemblePuces.class);
  }

  public String newCode(Date date)
  {
    DateMidnight dm = new DateMidnight(date);
    String debutCode = dm.toString("yyyyMMdd") + "-";
    int cpt = 1;
    String code;

    while (true)
    {
View Full Code Here

                jp.nextToken(); // VALUE_NUMBER_INT
                int day = jp.getIntValue();
                if (jp.nextToken() != JsonToken.END_ARRAY) {
                    throw ctxt.wrongTokenException(jp, JsonToken.END_ARRAY, "after DateMidnight ints");
                }
                return new DateMidnight(year, month, day);
            }
            switch (jp.getCurrentToken()) {
            case VALUE_NUMBER_INT:
                return new DateMidnight(jp.getLongValue());           
            case VALUE_STRING:
                DateTime local = parseLocal(jp);
                if (local == null) {
                    return null;
                }
View Full Code Here

    /**
     * test issue 109
     */
    public void test109() {
        Date someDate = new DateMidnight(9, 2, 21, DateTimeZone.forID("Europe/Amsterdam")).toDate();
        Yaml yaml = new Yaml();
        String timestamp = yaml.dump(someDate);
        assertEquals("0009-02-22T23:40:28Z\n", timestamp);
        // System.out.println(timestamp);
        Object o = yaml.load(timestamp);
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.