Package java.time.chrono

Examples of java.time.chrono.ChronoLocalDateTime


    constraint = new FutureValidatorForChronoLocalDateTime();
  }

  @Test
  public void testIsValid() {
    ChronoLocalDateTime future = LocalDateTime.now().plusDays( 1 );
    ChronoLocalDateTime past = LocalDateTime.now().minusDays( 1 );

    assertTrue( constraint.isValid( null, null ), "null fails validation." );
    assertTrue( constraint.isValid( future, null ), "Future LocalDateTime '" + future + "' fails validation.");
    assertFalse( constraint.isValid( past, null ), "Past LocalDateTime '" + past + "' validated as future.");
  }
View Full Code Here


    constraint = new PastValidatorForChronoLocalDateTime();
  }

  @Test
  public void testIsValid() {
    ChronoLocalDateTime future = LocalDateTime.now().plusDays( 1 );
    ChronoLocalDateTime past = LocalDateTime.now().minusDays( 1 );

    assertTrue( constraint.isValid( null, null ), "null fails validation." );
    assertTrue( constraint.isValid( past, null ), "Past LocalDateTime '" + past + "' fails validation.");
    assertFalse( constraint.isValid( future, null ), "Future LocalDateTime '" + future + "' validated as past.");
  }
View Full Code Here

TOP

Related Classes of java.time.chrono.ChronoLocalDateTime

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.