Search in sources :

Example 1 with TimeSpan

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);
}
Also used : TimeSpan(org.sosy_lab.common.time.TimeSpan) Test(org.junit.Test)

Example 2 with TimeSpan

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);
}
Also used : TimeSpan(org.sosy_lab.common.time.TimeSpan) Test(org.junit.Test)

Example 3 with TimeSpan

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);
}
Also used : TimeSpan(org.sosy_lab.common.time.TimeSpan) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)3 TimeSpan (org.sosy_lab.common.time.TimeSpan)3