Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
Giorgio Trettenero committed Dec 4, 2024
1 parent 5e2824c commit 20d3853
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,11 @@ public void delete(final ConnectorRequestContext context, final QualifiedName na
throw new DatabaseNotFoundException(name);
}
try {
System.out.println("BEFORE deleting polaris database " + name.getDatabaseName());
this.polarisStoreService.deleteDatabase(name.getDatabaseName());
System.out.println("AFTER deleting polaris database " + name.getDatabaseName());
} catch (DataIntegrityViolationException exception) {
System.out.println("CAUGHT THE DB DELETE ERROR");
if (exception.getCause() instanceof org.hibernate.exception.ConstraintViolationException) {
throw new DatabasePreconditionFailedException(
name,
Expand All @@ -100,6 +103,7 @@ public void delete(final ConnectorRequestContext context, final QualifiedName na
throw new ConnectorException(
String.format("Failed deleting polaris database %s", name), exception);
}
System.out.println("DID NOT CATCH THE DB DELETE ERROR");
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@ public void testDeleteDbNoCascades() {
polarisTableService.create(requestContext, tableInfo);
Assert.assertTrue(polarisTableService.exists(requestContext, qualifiedName));

polarisDBService.delete(requestContext, DB1_QUALIFIED_NAME);
// Expect an DatabasePreconditionFailedException when trying to delete a non-empty database
Assertions.assertThrows(DatabasePreconditionFailedException.class, () ->
polarisDBService.delete(requestContext, DB1_QUALIFIED_NAME));
Expand Down

0 comments on commit 20d3853

Please sign in to comment.