Package org.jwall.log.io

Examples of org.jwall.log.io.TimeParser


 
  @Test
  public void testParseTime() throws Exception {
    String str = "1 hour";
    TimeParser p = new TimeParser();
    Long time = p.parse( str );
    Assert.assertEquals( TimeParser.HOUR, time );
  }
View Full Code Here


  }
 
  @Test
  public void testParseHourShortened() throws Exception {
    String str = "2 hours";
    TimeParser p = new TimeParser();
    Long time = p.parse( str );
    Assert.assertEquals( 2*TimeParser.HOUR, time.longValue() );
  }
View Full Code Here

  }
 
  @Test
  public void testParseMix() throws Exception {
    String str = "2 hours 34 minutes 1sec";
    TimeParser p = new TimeParser();
    Long time = p.parse( str );
    Assert.assertEquals( 2*TimeParser.HOUR + 34 * TimeParser.MINUTE + TimeParser.SECOND, time.longValue() );
  }
View Full Code Here

 
  @Test
  public void testParseMix2() throws Exception {
    String str = "2hours34minutes 1sec";
    TimeParser p = new TimeParser();
    Long time = p.parse( str );
    Assert.assertEquals( 2*TimeParser.HOUR + 34 * TimeParser.MINUTE + TimeParser.SECOND, time.longValue() );
  }
View Full Code Here

TOP

Related Classes of org.jwall.log.io.TimeParser

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.