Fixed test

This commit is contained in:
Christian Basler 2015-06-16 07:08:33 +02:00
parent c0a7acc609
commit 49a9e0c5f7
2 changed files with 4 additions and 3 deletions

View File

@ -76,7 +76,7 @@ public class JdbcNodeRegistry extends JdbcHelper implements NodeRegistry {
ResultSet lastConnectionTime = exists.executeQuery();
if (lastConnectionTime.next()) {
long time = lastConnectionTime.getLong("time");
if (time < node.getTime() && node.getTime() < UnixTime.now()) {
if (time < node.getTime() && node.getTime() <= UnixTime.now()) {
time = node.getTime();
update.setLong(1, node.getServices());
update.setLong(2, time);
@ -86,7 +86,7 @@ public class JdbcNodeRegistry extends JdbcHelper implements NodeRegistry {
update.setLong(5, node.getStream());
update.executeUpdate();
}
} else if (node.getTime() < UnixTime.now()) {
} else if (node.getTime() <= UnixTime.now()) {
insert.setBytes(1, node.getIPv6());
insert.setInt(2, node.getPort());
insert.setLong(3, node.getServices());

View File

@ -40,7 +40,8 @@ public class JdbcNodeRegistryTest {
registry.offerAddresses(Arrays.asList(
createAddress(1, 8444, 1, now()),
createAddress(2, 8444, 1, now()),
createAddress(3, 8444, 1, now())
createAddress(3, 8444, 1, now()),
createAddress(4, 8444, 2, now())
));
}