Skip to content

Commit ecd0313

Browse files
committed
#470: cleanup: introduce static imports, remove redundant throws-clauses
1 parent 1943e2e commit ecd0313

5 files changed

+13
-13
lines changed

oshdb-api-ignite/src/test/java/org/heigit/ohsome/oshdb/api/tests/MapReduceOSHDBIgniteAffinityCallTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package org.heigit.ohsome.oshdb.api.tests;
22

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

56
import java.util.Set;
67
import java.util.stream.Collectors;
7-
import org.heigit.ohsome.oshdb.api.db.OSHDBIgnite;
88
import org.heigit.ohsome.oshdb.util.time.OSHDBTimestamps;
99
import org.junit.jupiter.api.Test;
1010

@@ -20,7 +20,7 @@ class MapReduceOSHDBIgniteAffinityCallTest extends MapReduceOSHDBIgniteTest {
2020
* @throws Exception if something goes wrong
2121
*/
2222
MapReduceOSHDBIgniteAffinityCallTest() throws Exception {
23-
super(oshdb -> oshdb.computeMode(OSHDBIgnite.ComputeMode.AFFINITY_CALL));
23+
super(oshdb -> oshdb.computeMode(AFFINITY_CALL));
2424
}
2525

2626
@Test

oshdb-api-ignite/src/test/java/org/heigit/ohsome/oshdb/api/tests/MapReduceOSHDBIgniteLocalPeekTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package org.heigit.ohsome.oshdb.api.tests;
22

3-
import org.heigit.ohsome.oshdb.api.db.OSHDBIgnite;
3+
import static org.heigit.ohsome.oshdb.api.db.OSHDBIgnite.ComputeMode.LOCAL_PEEK;
44

55
/**
66
* {@inheritDoc}
@@ -14,6 +14,6 @@ class MapReduceOSHDBIgniteLocalPeekTest extends MapReduceOSHDBIgniteTest {
1414
* @throws Exception if something goes wrong
1515
*/
1616
MapReduceOSHDBIgniteLocalPeekTest() throws Exception {
17-
super(oshdb -> oshdb.computeMode(OSHDBIgnite.ComputeMode.LOCAL_PEEK));
17+
super(oshdb -> oshdb.computeMode(LOCAL_PEEK));
1818
}
1919
}

oshdb-api-ignite/src/test/java/org/heigit/ohsome/oshdb/api/tests/MapReduceOSHDBIgniteMissingCacheTest.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -21,31 +21,31 @@ class MapReduceOSHDBIgniteMissingCacheTest extends MapReduceOSHDBIgniteTest {
2121

2222
@Override
2323
@Test()
24-
void testOSMContributionView() throws Exception {
24+
void testOSMContributionView() {
2525
assertThrows(OSHDBTableNotFoundException.class, super::testOSMContributionView);
2626
}
2727

2828
@Override
2929
@Test()
30-
void testOSMEntitySnapshotView() throws Exception {
30+
void testOSMEntitySnapshotView() {
3131
assertThrows(OSHDBTableNotFoundException.class, super::testOSMEntitySnapshotView);
3232
}
3333

3434
@Override
3535
@Test()
36-
void testOSMContributionViewStream() throws Exception {
36+
void testOSMContributionViewStream() {
3737
assertThrows(OSHDBTableNotFoundException.class, super::testOSMContributionViewStream);
3838
}
3939

4040
@Override
4141
@Test()
42-
void testOSMEntitySnapshotViewStream() throws Exception {
42+
void testOSMEntitySnapshotViewStream() {
4343
assertThrows(OSHDBTableNotFoundException.class, super::testOSMEntitySnapshotViewStream);
4444
}
4545

4646
@Override
4747
@Test()
48-
void testTimeoutMapReduce() throws Exception {
48+
void testTimeoutMapReduce() {
4949
assertThrows(OSHDBTableNotFoundException.class, this::timeoutMapReduce);
5050
}
5151

oshdb-api-ignite/src/test/java/org/heigit/ohsome/oshdb/api/tests/MapReduceOSHDBIgniteScanQueryTest.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package org.heigit.ohsome.oshdb.api.tests;
22

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

5-
import org.heigit.ohsome.oshdb.api.db.OSHDBIgnite;
66
import org.junit.jupiter.api.Test;
77

88
/**
@@ -17,12 +17,12 @@ class MapReduceOSHDBIgniteScanQueryTest extends MapReduceOSHDBIgniteTest {
1717
* @throws Exception if something goes wrong
1818
*/
1919
MapReduceOSHDBIgniteScanQueryTest() throws Exception {
20-
super(oshdb -> oshdb.computeMode(OSHDBIgnite.ComputeMode.SCAN_QUERY));
20+
super(oshdb -> oshdb.computeMode(SCAN_QUERY));
2121
}
2222

2323
@Override
2424
@Test
25-
void testTimeoutStream() throws Exception {
25+
void testTimeoutStream() {
2626
// ignore this test -> scanquery backend currently doesn't support timeouts for stream()
2727
assertTrue(true);
2828
}

oshdb-api-ignite/src/test/java/org/heigit/ohsome/oshdb/api/tests/MapReduceOSHDBIgniteTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ private static OSHDBDatabase initOshdb(Consumer<OSHDBIgnite> computeMode) {
7272
streamer.allowOverwrite(true);
7373

7474
try (final ResultSet rst =
75-
h2Stmt.executeQuery("select level, id, data from " + TableNames.T_NODES.toString())) {
75+
h2Stmt.executeQuery("select level, id, data from " + TableNames.T_NODES)) {
7676
while (rst.next()) {
7777
final int level = rst.getInt(1);
7878
final long id = rst.getLong(2);

0 commit comments

Comments
 (0)