Skip to content

Commit

Permalink
remove unnecessary exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
danthe1st committed Nov 17, 2024
1 parent 4e8f021 commit 6552fe4
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class Neo4JSetup {
public static Label ANSWER = Label.label("Answer");
public static Label COMMENT = Label.label("Comment");

public static synchronized GraphDatabaseService createDatabase(Path dbDirectory, URL dumpLocation) throws IOException, IncorrectFormat, InterruptedException {
public static synchronized GraphDatabaseService createDatabase(Path dbDirectory, URL dumpLocation) throws IOException, IncorrectFormat {
boolean databaseExists = Files.exists(dbDirectory);
DatabaseManagementService databaseManagementService = createManagementService(dbDirectory);
if(!databaseExists){
Expand All @@ -61,7 +61,7 @@ private static GraphDatabaseService createDB(DatabaseManagementService databaseM
return graphDb;
}

private static void loadDB(Path dbDirectory, URL dumpLocation) throws IOException, IncorrectFormat, InterruptedException {
private static void loadDB(Path dbDirectory, URL dumpLocation) throws IOException, IncorrectFormat {
DatabaseLayout layout = DatabaseLayout.of(Neo4jLayout.of(dbDirectory), DB_NAME);
deleteRecursively(layout.databaseDirectory());

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package io.github.danthe1st.arebac.neo4j.tests.airbnb;

import java.io.IOException;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -135,7 +134,7 @@ public AirbnbState() {
hostPatternInfo = new PatternInfo<>(List.of("131304391", "155715332", "404944621"), Scenario1Test::createAuthorizedCetAllReviewsFromHostGraphPattern);
reviewerPatternInfo = new PatternInfo<>(List.of("272671293", "227163707", "268281268", "31292360"), Scenario1Test::createAuthorizedGetAllReviewsFromReviewerGraphPattern);
scenario2PatternInfo = new PatternInfo<>(List.of(new Scenario2Id("278934759", "1310402"), new Scenario2Id("363134483", "1310402")), id -> Scenario2Test.editListingInNeighborhoodPattern(id.subjectId(), id.neighborhoodId()));
}catch(IOException | IncorrectFormat | InterruptedException | URISyntaxException e){
}catch(IOException | IncorrectFormat e){
throw new RuntimeException("cannot initialize benchmark state", e);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package io.github.danthe1st.arebac.neo4j.tests.airbnb;

import java.io.IOException;
import java.net.URISyntaxException;
import java.nio.file.Path;

import io.github.danthe1st.arebac.neo4j.tests.Neo4JSetup;
Expand All @@ -19,7 +18,7 @@ public class AirbnbSetup {

public static final String NEIGHBORHOOD = "Neighborhood";

public static synchronized GraphDatabaseService getDatabase() throws IOException, IncorrectFormat, InterruptedException, URISyntaxException {
public static synchronized GraphDatabaseService getDatabase() throws IOException, IncorrectFormat {
if(graphDb == null){
graphDb = Neo4JSetup.createDatabase(Path.of("testdb", "airbnb"), AirbnbSetup.class.getClassLoader().getResource("testdumps/airbnb/airbnb.dump"));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import static org.junit.jupiter.api.Assertions.assertEquals;

import java.io.IOException;
import java.net.URISyntaxException;
import java.util.List;
import java.util.Map;
import java.util.Set;
Expand Down Expand Up @@ -39,7 +38,7 @@ class Scenario1Test {
private GraphDatabaseService database;

@BeforeEach
void setUp() throws IOException, IncorrectFormat, InterruptedException, URISyntaxException {
void setUp() throws IOException, IncorrectFormat {
database = AirbnbSetup.getDatabase();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import static org.junit.jupiter.api.Assertions.assertEquals;

import java.io.IOException;
import java.net.URISyntaxException;
import java.util.List;
import java.util.Map;
import java.util.Set;
Expand Down Expand Up @@ -39,7 +38,7 @@ class Scenario2Test {
private GraphDatabaseService database;

@BeforeEach
void setUp() throws IOException, IncorrectFormat, InterruptedException, URISyntaxException {
void setUp() throws IOException, IncorrectFormat {
database = AirbnbSetup.getDatabase();
}

Expand Down

0 comments on commit 6552fe4

Please sign in to comment.