@Test public void test_compareTo() { RuleKey aa = RuleKey.of("A", "A"); RuleKey ab = RuleKey.of("A", "B"); assertThat(ab).isGreaterThan(aa); assertThat(aa).isLessThan(ab); assertThat(aa).isNotEqualTo(ab); assertThat(ab).isNotEqualTo(aa); assertThat(aa).isEqualTo(aa); assertThat(ab).isEqualTo(ab); } }
@Test void defaults() { final Job j = new MyJob(); assertSoftly(softly -> { softly.assertThat(j.startIn()).isGreaterThanOrEqualTo(Duration.ZERO); softly.assertThat(j.repeatEvery()).isEqualTo(Duration.ZERO); softly.assertThat(j.killIn()).isGreaterThan(Duration.ZERO); }); }
@Test void compareWithNull() { assertThat(parse("1.2.0.RC2")).isGreaterThan(null); }
@Test void compareMajorOnly() { assertThat(parse("2.2.0")).isGreaterThan(parse("1.8.0")); }
@Test void comparePatchOnly() { assertThat(parse("2.2.4")).isGreaterThan(parse("2.2.3")); }
@Test void compareHigherVersion() { assertThat(parse("1.2.0.RELEASE")).isGreaterThan(parse("1.1.9.RELEASE")); }
@Test void compareMinorOnly() { assertThat(parse("2.2.0")).isGreaterThan(parse("2.1.9")); }
@Test void compareHigherQualifierVersion() { assertThat(parse("1.2.0.RC2")).isGreaterThan(parse("1.2.0.RC1")); }
@Test void snapshotGreaterThanRC() { assertThat(parse("1.2.0.BUILD-SNAPSHOT")).isGreaterThan(parse("1.2.0.RC1")); }
@Test void compareHigherQualifier() { assertThat(parse("1.2.0.RC1")).isGreaterThan(parse("1.2.0.M1")); }
@Test @Category( { SlowTest.class, Writable.class, Attributes.class, LastAccessTime.class } ) public void testCreateDirSetsLastAccessTimeOfParent() throws IOException, InterruptedException { Path dir = dirTA(); FileTime before = Files.readAttributes( dir, BasicFileAttributes.class ).lastAccessTime(); waitForAttribute(); Files.createDirectory( dir.resolve( nameB() ) ); assertThat( Files.readAttributes( dir, BasicFileAttributes.class ).lastAccessTime() ).isGreaterThan( before ); }
@Test @Category( { SlowTest.class, Writable.class, Attributes.class, LastModifiedTime.class } ) public void testCreateFileSetModifiedTime() throws Exception { Path file = absTA(); FileTime parentCreated = Files.getLastModifiedTime( childGetParent( file ) ); waitForAttribute(); fileTA(); // creates file assertThat( Files.getLastModifiedTime( file ) ).isGreaterThan( parentCreated ); }
@Test @Category( { SlowTest.class, Writable.class, Delete.class, Attributes.class, LastModifiedTime.class } ) public void testDeleteDirChangesParentsModificationTime() throws IOException, InterruptedException { FileTime modified = Files.getLastModifiedTime( childGetParent( dirTAB() )); waitForAttribute(); Files.delete( absTAB() ); assertThat( Files.getLastModifiedTime( absTA() ) ).isGreaterThan( modified ); }
@Test @Category( { SlowTest.class, HardLink.class, Writable.class } ) public void testHardLinkModifyOneModifiedDateOfOtherChanged() throws IOException, InterruptedException { Files.createLink( link(), orig() ); FileTime before = Files.getLastModifiedTime( orig() ); waitForAttribute(); Files.write( link(), CONTENT_OTHER ); assertThat( Files.getLastModifiedTime( orig() ) ).isGreaterThan( before ); }
@Test @Category( { SlowTest.class, Writable.class, Move.class, Attributes.class, LastModifiedTime.class } ) public void testMoveChangesModifiedTimeOfParent() throws IOException, InterruptedException { FileTime modi = Files.getLastModifiedTime( childGetParent( srcFile()) ); waitForAttribute(); Files.move( src(), tgt() ); assertThat( Files.getLastModifiedTime( childGetParent( src()) ) ).isGreaterThan( modi ); }
public void test_comparisonByScheme() { StandardId id1 = StandardId.of(SCHEME, "123"); StandardId id2 = StandardId.of(OTHER_SCHEME, "234"); // as schemes are different, will compare by scheme assertThat(id1).isGreaterThan(id2); }
@Test(timeout = 10000) public void loadDefaultMigrations() throws Exception { Duration duration = longTimeInitializingBean.getInitializationDuration(); assertThat(duration).isGreaterThan(Duration.ofSeconds(1)); List<Map<String, Object>> persons = jdbcTemplate.queryForList(SQL_SELECT_PERSONS); assertThat(persons).isNotNull().hasSize(1); }
@Test void compareToShouldReturnNegativeWhenComparedToPrevious() { assertThat(EventId.first().next()) .isGreaterThan(EventId.first()); }
@Test void compareToShouldReturnNegativeWhenComparedToPrevious() { assertThat(EventId.first().next()) .isGreaterThan(EventId.first()); }
@Test void compareToShouldReturnNegativeWhenComparedToPreviousWithPreviousCall() { assertThat(EventId.first().next()) .isGreaterThan(EventId.first().next().previous().get()); }