Package java.time

Examples of java.time.Year


    constraint = new FutureValidatorForYear();
  }

  @Test
  public void testIsValid() {
    Year future = Year.now().plusYears( 1 );
    Year past = Year.now().minusYears( 1 );

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

TOP

Related Classes of java.time.Year

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.