use of org.sosy_lab.common.time.TimeSpan in project java-common-lib by sosy-lab.
the class TimeSpanTypeConverterTest method test_returnsTimeSpan.
@Test
public void test_returnsTimeSpan() throws InvalidConfigurationException {
TimeSpan result = convertToTimeSpan("10", SECONDS);
assertThat(result).isEqualTo(TimeSpan.ofSeconds(10));
assertThat(result.getUnit()).isEqualTo(SECONDS);
}
use of org.sosy_lab.common.time.TimeSpan in project java-common-lib by sosy-lab.
the class TimeSpanTypeConverterTest method test_returnsTimeSpan_otherUnit.
@Test
public void test_returnsTimeSpan_otherUnit() throws InvalidConfigurationException {
TimeSpan result = convertToTimeSpan("10min", SECONDS);
assertThat(result).isEqualTo(TimeSpan.of(10, MINUTES));
assertThat(result.getUnit()).isEqualTo(MINUTES);
}
use of org.sosy_lab.common.time.TimeSpan in project java-common-lib by sosy-lab.
the class TimeSpanTypeConverterTest method test_returnsTimeSpan_differentDefaultUnit.
@Test
public void test_returnsTimeSpan_differentDefaultUnit() throws InvalidConfigurationException {
TimeSpan result = convertToTimeSpan("10", MINUTES);
assertThat(result).isEqualTo(TimeSpan.of(10, MINUTES));
assertThat(result.getUnit()).isEqualTo(MINUTES);
}