Skip to content

Commit

Permalink
#470: cleanup: introduce static imports, remove redundant throws-clauses
Browse files Browse the repository at this point in the history
  • Loading branch information
mmerdes committed Nov 4, 2022
1 parent 1943e2e commit ecd0313
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package org.heigit.ohsome.oshdb.api.tests;

import static org.heigit.ohsome.oshdb.api.db.OSHDBIgnite.ComputeMode.AFFINITY_CALL;
import static org.junit.jupiter.api.Assertions.assertEquals;

import java.util.Set;
import java.util.stream.Collectors;
import org.heigit.ohsome.oshdb.api.db.OSHDBIgnite;
import org.heigit.ohsome.oshdb.util.time.OSHDBTimestamps;
import org.junit.jupiter.api.Test;

Expand All @@ -20,7 +20,7 @@ class MapReduceOSHDBIgniteAffinityCallTest extends MapReduceOSHDBIgniteTest {
* @throws Exception if something goes wrong
*/
MapReduceOSHDBIgniteAffinityCallTest() throws Exception {
super(oshdb -> oshdb.computeMode(OSHDBIgnite.ComputeMode.AFFINITY_CALL));
super(oshdb -> oshdb.computeMode(AFFINITY_CALL));
}

@Test
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.heigit.ohsome.oshdb.api.tests;

import org.heigit.ohsome.oshdb.api.db.OSHDBIgnite;
import static org.heigit.ohsome.oshdb.api.db.OSHDBIgnite.ComputeMode.LOCAL_PEEK;

/**
* {@inheritDoc}
Expand All @@ -14,6 +14,6 @@ class MapReduceOSHDBIgniteLocalPeekTest extends MapReduceOSHDBIgniteTest {
* @throws Exception if something goes wrong
*/
MapReduceOSHDBIgniteLocalPeekTest() throws Exception {
super(oshdb -> oshdb.computeMode(OSHDBIgnite.ComputeMode.LOCAL_PEEK));
super(oshdb -> oshdb.computeMode(LOCAL_PEEK));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,31 +21,31 @@ class MapReduceOSHDBIgniteMissingCacheTest extends MapReduceOSHDBIgniteTest {

@Override
@Test()
void testOSMContributionView() throws Exception {
void testOSMContributionView() {
assertThrows(OSHDBTableNotFoundException.class, super::testOSMContributionView);
}

@Override
@Test()
void testOSMEntitySnapshotView() throws Exception {
void testOSMEntitySnapshotView() {
assertThrows(OSHDBTableNotFoundException.class, super::testOSMEntitySnapshotView);
}

@Override
@Test()
void testOSMContributionViewStream() throws Exception {
void testOSMContributionViewStream() {
assertThrows(OSHDBTableNotFoundException.class, super::testOSMContributionViewStream);
}

@Override
@Test()
void testOSMEntitySnapshotViewStream() throws Exception {
void testOSMEntitySnapshotViewStream() {
assertThrows(OSHDBTableNotFoundException.class, super::testOSMEntitySnapshotViewStream);
}

@Override
@Test()
void testTimeoutMapReduce() throws Exception {
void testTimeoutMapReduce() {
assertThrows(OSHDBTableNotFoundException.class, this::timeoutMapReduce);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.heigit.ohsome.oshdb.api.tests;

import static org.heigit.ohsome.oshdb.api.db.OSHDBIgnite.ComputeMode.SCAN_QUERY;
import static org.junit.jupiter.api.Assertions.assertTrue;

import org.heigit.ohsome.oshdb.api.db.OSHDBIgnite;
import org.junit.jupiter.api.Test;

/**
Expand All @@ -17,12 +17,12 @@ class MapReduceOSHDBIgniteScanQueryTest extends MapReduceOSHDBIgniteTest {
* @throws Exception if something goes wrong
*/
MapReduceOSHDBIgniteScanQueryTest() throws Exception {
super(oshdb -> oshdb.computeMode(OSHDBIgnite.ComputeMode.SCAN_QUERY));
super(oshdb -> oshdb.computeMode(SCAN_QUERY));
}

@Override
@Test
void testTimeoutStream() throws Exception {
void testTimeoutStream() {
// ignore this test -> scanquery backend currently doesn't support timeouts for stream()
assertTrue(true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ private static OSHDBDatabase initOshdb(Consumer<OSHDBIgnite> computeMode) {
streamer.allowOverwrite(true);

try (final ResultSet rst =
h2Stmt.executeQuery("select level, id, data from " + TableNames.T_NODES.toString())) {
h2Stmt.executeQuery("select level, id, data from " + TableNames.T_NODES)) {
while (rst.next()) {
final int level = rst.getInt(1);
final long id = rst.getLong(2);
Expand Down

0 comments on commit ecd0313

Please sign in to comment.