You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "ygerzhedovich (via GitHub)" <gi...@apache.org> on 2023/09/22 10:21:15 UTC
[GitHub] [ignite-3] ygerzhedovich opened a new pull request, #2616: IGNITE-20476: improve checking SQL exceptions in tests
ygerzhedovich opened a new pull request, #2616:
URL: https://github.com/apache/ignite-3/pull/2616
Thank you for submitting the pull request.
To streamline the review process of the patch and ensure better code quality
we ask both an author and a reviewer to verify the following:
### The Review Checklist
- [ ] **Formal criteria:** TC status, codestyle, mandatory documentation. Also make sure to complete the following:
\- There is a single JIRA ticket related to the pull request.
\- The web-link to the pull request is attached to the JIRA ticket.
\- The JIRA ticket has the Patch Available state.
\- The description of the JIRA ticket explains WHAT was made, WHY and HOW.
\- The pull request title is treated as the final commit message. The following pattern must be used: IGNITE-XXXX Change summary where XXXX - number of JIRA issue.
- [ ] **Design:** new code conforms with the design principles of the components it is added to.
- [ ] **Patch quality:** patch cannot be split into smaller pieces, its size must be reasonable.
- [ ] **Code quality:** code is clean and readable, necessary developer documentation is added if needed.
- [ ] **Tests code quality:** test set covers positive/negative scenarios, happy/edge cases. Tests are effective in terms of execution time and resources.
### Notes
- [Apache Ignite Coding Guidelines](https://cwiki.apache.org/confluence/display/IGNITE/Java+Code+Style+Guide)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ignite-3] xtern commented on a diff in pull request #2616: IGNITE-20476: improve checking SQL exceptions in tests
Posted by "xtern (via GitHub)" <gi...@apache.org>.
xtern commented on code in PR #2616:
URL: https://github.com/apache/ignite-3/pull/2616#discussion_r1337169678
##########
modules/jdbc/src/integrationTest/java/org/apache/ignite/jdbc/ItJdbcComplexQuerySelfTest.java:
##########
@@ -209,21 +208,25 @@ public void testWrongArgumentType() throws Exception {
}
// Check non-indexed field.
- assertThrows(SQLException.class, () -> {
- try (ResultSet rs = stmt.executeQuery("select * from PUBLIC.Org where name = 2")) {
- assertFalse(rs.next());
- }
- });
+ JdbcTestUtils.assertThrowsSqlException(
+ "For input string: \"B\"",
+ () -> {
+ try (ResultSet rs = stmt.executeQuery("select * from PUBLIC.Org where name = 2")) {
+ assertFalse(rs.next());
+ }
+ });
// Check indexed field.
try (ResultSet rs = stmt.executeQuery("select * from PUBLIC.Person where name = '2'")) {
assertFalse(rs.next());
}
- assertThrows(SQLException.class, () -> {
- try (ResultSet rs = stmt.executeQuery("select * from PUBLIC.Person where name = 2")) {
- assertFalse(rs.next());
- }
- });
+ JdbcTestUtils.assertThrowsSqlException(
+ "For input string: \"Mike Green\"",
+ () -> {
+ try (ResultSet rs = stmt.executeQuery("select * from PUBLIC.Person where name = 2")) {
+ assertFalse(rs.next());
+ }
+ });
Review Comment:
You need to close `ResultSet` only if `executeQuery` does not throw exception (when this check fails), and I don't see any value from doing it here.
Currently this code looks a bit confusing because because it’s not immediately clear which expression should throw an exception :thinking: .
##########
modules/jdbc/src/integrationTest/java/org/apache/ignite/jdbc/ItJdbcComplexQuerySelfTest.java:
##########
@@ -209,21 +208,25 @@ public void testWrongArgumentType() throws Exception {
}
// Check non-indexed field.
- assertThrows(SQLException.class, () -> {
- try (ResultSet rs = stmt.executeQuery("select * from PUBLIC.Org where name = 2")) {
- assertFalse(rs.next());
- }
- });
+ JdbcTestUtils.assertThrowsSqlException(
+ "For input string: \"B\"",
+ () -> {
+ try (ResultSet rs = stmt.executeQuery("select * from PUBLIC.Org where name = 2")) {
+ assertFalse(rs.next());
+ }
+ });
// Check indexed field.
try (ResultSet rs = stmt.executeQuery("select * from PUBLIC.Person where name = '2'")) {
assertFalse(rs.next());
}
- assertThrows(SQLException.class, () -> {
- try (ResultSet rs = stmt.executeQuery("select * from PUBLIC.Person where name = 2")) {
- assertFalse(rs.next());
- }
- });
+ JdbcTestUtils.assertThrowsSqlException(
+ "For input string: \"Mike Green\"",
+ () -> {
+ try (ResultSet rs = stmt.executeQuery("select * from PUBLIC.Person where name = 2")) {
+ assertFalse(rs.next());
+ }
+ });
Review Comment:
You need to close `ResultSet` only if `executeQuery` does not throw exception (when this check fails), and I don't see any value from doing it here.
Currently this code looks a bit confusing because because it’s not immediately clear which expression should throw an exception :thinking: .
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ignite-3] lowka commented on a diff in pull request #2616: IGNITE-20476: improve checking SQL exceptions in tests
Posted by "lowka (via GitHub)" <gi...@apache.org>.
lowka commented on code in PR #2616:
URL: https://github.com/apache/ignite-3/pull/2616#discussion_r1335849265
##########
modules/jdbc/src/integrationTest/java/org/apache/ignite/jdbc/ItJdbcComplexQuerySelfTest.java:
##########
@@ -209,21 +208,25 @@ public void testWrongArgumentType() throws Exception {
}
// Check non-indexed field.
- assertThrows(SQLException.class, () -> {
- try (ResultSet rs = stmt.executeQuery("select * from PUBLIC.Org where name = 2")) {
- assertFalse(rs.next());
- }
- });
+ JdbcTestUtils.assertThrowsSqlException(
Review Comment:
Maybe we can use `import static` instead of `JdbcTestUtils.assertThrowsSqlException`, because most of the code uses `import static JdbcTestUtils.assertThrowsSqlException`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ignite-3] ygerzhedovich commented on a diff in pull request #2616: IGNITE-20476: improve checking SQL exceptions in tests
Posted by "ygerzhedovich (via GitHub)" <gi...@apache.org>.
ygerzhedovich commented on code in PR #2616:
URL: https://github.com/apache/ignite-3/pull/2616#discussion_r1337103025
##########
modules/runner/src/integrationTest/java/org/apache/ignite/internal/sql/api/ItSqlAsynchronousApiTest.java:
##########
@@ -345,14 +344,17 @@ public void checkTransactionsWithDml() {
outerTx.commit();
// Outdated tx.
- Transaction outerTx0 = outerTx;
- IgniteException e = assertThrows(IgniteException.class,
Review Comment:
ok
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ignite-3] xtern merged pull request #2616: IGNITE-20476: improve checking SQL exceptions in tests
Posted by "xtern (via GitHub)" <gi...@apache.org>.
xtern merged PR #2616:
URL: https://github.com/apache/ignite-3/pull/2616
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ignite-3] xtern commented on a diff in pull request #2616: IGNITE-20476: improve checking SQL exceptions in tests
Posted by "xtern (via GitHub)" <gi...@apache.org>.
xtern commented on code in PR #2616:
URL: https://github.com/apache/ignite-3/pull/2616#discussion_r1336225897
##########
modules/jdbc/src/integrationTest/java/org/apache/ignite/jdbc/ItJdbcComplexQuerySelfTest.java:
##########
@@ -209,21 +208,25 @@ public void testWrongArgumentType() throws Exception {
}
// Check non-indexed field.
- assertThrows(SQLException.class, () -> {
- try (ResultSet rs = stmt.executeQuery("select * from PUBLIC.Org where name = 2")) {
- assertFalse(rs.next());
- }
- });
+ JdbcTestUtils.assertThrowsSqlException(
+ "For input string: \"B\"",
+ () -> {
+ try (ResultSet rs = stmt.executeQuery("select * from PUBLIC.Org where name = 2")) {
+ assertFalse(rs.next());
+ }
+ });
Review Comment:
```suggestion
() -> stmt.executeQuery("select * from PUBLIC.Org where name = 2")
);
```
##########
modules/jdbc/src/integrationTest/java/org/apache/ignite/jdbc/ItJdbcComplexQuerySelfTest.java:
##########
@@ -209,21 +208,25 @@ public void testWrongArgumentType() throws Exception {
}
// Check non-indexed field.
- assertThrows(SQLException.class, () -> {
- try (ResultSet rs = stmt.executeQuery("select * from PUBLIC.Org where name = 2")) {
- assertFalse(rs.next());
- }
- });
+ JdbcTestUtils.assertThrowsSqlException(
+ "For input string: \"B\"",
+ () -> {
+ try (ResultSet rs = stmt.executeQuery("select * from PUBLIC.Org where name = 2")) {
+ assertFalse(rs.next());
+ }
+ });
// Check indexed field.
try (ResultSet rs = stmt.executeQuery("select * from PUBLIC.Person where name = '2'")) {
assertFalse(rs.next());
}
- assertThrows(SQLException.class, () -> {
- try (ResultSet rs = stmt.executeQuery("select * from PUBLIC.Person where name = 2")) {
- assertFalse(rs.next());
- }
- });
+ JdbcTestUtils.assertThrowsSqlException(
+ "For input string: \"Mike Green\"",
+ () -> {
+ try (ResultSet rs = stmt.executeQuery("select * from PUBLIC.Person where name = 2")) {
+ assertFalse(rs.next());
+ }
+ });
Review Comment:
```suggestion
() -> stmt.executeQuery("select * from PUBLIC.Person where name = 2")
);
```
##########
modules/runner/src/integrationTest/java/org/apache/ignite/internal/jdbc/ItJdbcTest.java:
##########
@@ -98,7 +97,7 @@ void tearDown() {
@DisplayName("Jdbc client can not connect without basic authentication configured")
void jdbcCanNotConnectWithoutBasicAuthentication() {
var url = "jdbc:ignite:thin://127.0.0.1:10800";
- assertThrows(SQLException.class, () -> DriverManager.getConnection(url));
+ JdbcTestUtils.assertThrowsSqlException(SQLException.class, () -> DriverManager.getConnection(url));
Review Comment:
assertThrows**SqlException**(**SQLException**.class sounds strange
##########
modules/core/src/main/java/org/apache/ignite/lang/IgniteExceptionMapperUtil.java:
##########
@@ -137,4 +140,22 @@ public static <T> CompletableFuture<T> convertToPublicFuture(CompletableFuture<T
private static <T extends Exception, R extends Exception> Exception map(IgniteExceptionMapper<T, R> mapper, Throwable t) {
return mapper.map(mapper.mappingFrom().cast(t));
}
+
+ /**
+ * Assert that passed exception is not related to internal exceptions.
+ *
+ * @param ex Exception to be checked.
+ * @return {@code true} if canonical name of passed Exception doesn't contains word 'internal'.
+ * @throws AssertionError in case assertions is enabled and passed exception is fail check.
+ */
+ public static boolean assertInternal(Throwable ex) {
Review Comment:
I suggest keep this change for IGNITE-20348 and not adding it in this PR.
* Method name is confusing - may be it should be something like `assertPublic` or at least the return value should be inverted.
* Assertion inside another assertion also seems strange to me.
* This check looks more like a part of the static analysis :thinking:
##########
modules/runner/src/integrationTest/java/org/apache/ignite/internal/sql/api/ItSqlAsynchronousApiTest.java:
##########
@@ -345,14 +344,17 @@ public void checkTransactionsWithDml() {
outerTx.commit();
// Outdated tx.
- Transaction outerTx0 = outerTx;
- IgniteException e = assertThrows(IgniteException.class,
Review Comment:
The test check seems to be working, why do we need to disable it right now? Maybe just add a TODO to rework it?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ignite-3] AMashenkov commented on a diff in pull request #2616: IGNITE-20476: improve checking SQL exceptions in tests
Posted by "AMashenkov (via GitHub)" <gi...@apache.org>.
AMashenkov commented on code in PR #2616:
URL: https://github.com/apache/ignite-3/pull/2616#discussion_r1337411086
##########
modules/core/src/main/java/org/apache/ignite/internal/lang/IgniteExceptionMapperUtil.java:
##########
@@ -140,4 +142,22 @@ public static <T> CompletableFuture<T> convertToPublicFuture(CompletableFuture<T
private static <T extends Exception, R extends Exception> Exception map(IgniteExceptionMapper<T, R> mapper, Throwable t) {
return mapper.map(mapper.mappingFrom().cast(t));
}
+
+ /**
+ * Assert that passed exception is not related to internal exceptions.
+ *
+ * @param ex Exception to be checked.
+ * @return {@code true} if canonical name of passed Exception doesn't contains word 'internal'.
+ * @throws AssertionError in case assertions is enabled and passed exception is fail check.
+ */
+ public static boolean assertInternal(Throwable ex) {
+ //IGNITE-20348: uncomment during implement the ticket.
+ // boolean isPublic = !ex.getClass().getCanonicalName().toLowerCase().contains("internal");
+ //
+ // assert isPublic : "public Exception can't be in internal package " + ex.getClass().getCanonicalName();
+ //
+ // return isPublic;
Review Comment:
I think such validation must be done in ArchUnitTest, where we could check internal exception never leak to public package and vice versa, instead of doing that at runtime.
Here, we should only check if the given exception doesn't inherits public IgniteException class via `instance of` operator... or smth like that.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ignite-3] ygerzhedovich commented on a diff in pull request #2616: IGNITE-20476: improve checking SQL exceptions in tests
Posted by "ygerzhedovich (via GitHub)" <gi...@apache.org>.
ygerzhedovich commented on code in PR #2616:
URL: https://github.com/apache/ignite-3/pull/2616#discussion_r1337080011
##########
modules/jdbc/src/integrationTest/java/org/apache/ignite/jdbc/ItJdbcComplexQuerySelfTest.java:
##########
@@ -209,21 +208,25 @@ public void testWrongArgumentType() throws Exception {
}
// Check non-indexed field.
- assertThrows(SQLException.class, () -> {
- try (ResultSet rs = stmt.executeQuery("select * from PUBLIC.Org where name = 2")) {
- assertFalse(rs.next());
- }
- });
+ JdbcTestUtils.assertThrowsSqlException(
+ "For input string: \"B\"",
+ () -> {
+ try (ResultSet rs = stmt.executeQuery("select * from PUBLIC.Org where name = 2")) {
+ assertFalse(rs.next());
+ }
+ });
// Check indexed field.
try (ResultSet rs = stmt.executeQuery("select * from PUBLIC.Person where name = '2'")) {
assertFalse(rs.next());
}
- assertThrows(SQLException.class, () -> {
- try (ResultSet rs = stmt.executeQuery("select * from PUBLIC.Person where name = 2")) {
- assertFalse(rs.next());
- }
- });
+ JdbcTestUtils.assertThrowsSqlException(
+ "For input string: \"Mike Green\"",
+ () -> {
+ try (ResultSet rs = stmt.executeQuery("select * from PUBLIC.Person where name = 2")) {
+ assertFalse(rs.next());
+ }
+ });
Review Comment:
don't agree, I want to close ResultSet. Unfortunately we don't follow the rules everywhere, but it's good to close RS
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ignite-3] ygerzhedovich commented on a diff in pull request #2616: IGNITE-20476: improve checking SQL exceptions in tests
Posted by "ygerzhedovich (via GitHub)" <gi...@apache.org>.
ygerzhedovich commented on code in PR #2616:
URL: https://github.com/apache/ignite-3/pull/2616#discussion_r1337093175
##########
modules/runner/src/integrationTest/java/org/apache/ignite/internal/jdbc/ItJdbcTest.java:
##########
@@ -98,7 +97,7 @@ void tearDown() {
@DisplayName("Jdbc client can not connect without basic authentication configured")
void jdbcCanNotConnectWithoutBasicAuthentication() {
var url = "jdbc:ignite:thin://127.0.0.1:10800";
- assertThrows(SQLException.class, () -> DriverManager.getConnection(url));
+ JdbcTestUtils.assertThrowsSqlException(SQLException.class, () -> DriverManager.getConnection(url));
Review Comment:
yes! good catch. Seems I've fixed it already for anoter PR, but will fix here too
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ignite-3] ygerzhedovich commented on a diff in pull request #2616: IGNITE-20476: improve checking SQL exceptions in tests
Posted by "ygerzhedovich (via GitHub)" <gi...@apache.org>.
ygerzhedovich commented on code in PR #2616:
URL: https://github.com/apache/ignite-3/pull/2616#discussion_r1337093175
##########
modules/runner/src/integrationTest/java/org/apache/ignite/internal/jdbc/ItJdbcTest.java:
##########
@@ -98,7 +97,7 @@ void tearDown() {
@DisplayName("Jdbc client can not connect without basic authentication configured")
void jdbcCanNotConnectWithoutBasicAuthentication() {
var url = "jdbc:ignite:thin://127.0.0.1:10800";
- assertThrows(SQLException.class, () -> DriverManager.getConnection(url));
+ JdbcTestUtils.assertThrowsSqlException(SQLException.class, () -> DriverManager.getConnection(url));
Review Comment:
yes! good catch. Seems I fix it already for anoter PR, but will fix here too
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ignite-3] AMashenkov commented on a diff in pull request #2616: IGNITE-20476: improve checking SQL exceptions in tests
Posted by "AMashenkov (via GitHub)" <gi...@apache.org>.
AMashenkov commented on code in PR #2616:
URL: https://github.com/apache/ignite-3/pull/2616#discussion_r1337411086
##########
modules/core/src/main/java/org/apache/ignite/internal/lang/IgniteExceptionMapperUtil.java:
##########
@@ -140,4 +142,22 @@ public static <T> CompletableFuture<T> convertToPublicFuture(CompletableFuture<T
private static <T extends Exception, R extends Exception> Exception map(IgniteExceptionMapper<T, R> mapper, Throwable t) {
return mapper.map(mapper.mappingFrom().cast(t));
}
+
+ /**
+ * Assert that passed exception is not related to internal exceptions.
+ *
+ * @param ex Exception to be checked.
+ * @return {@code true} if canonical name of passed Exception doesn't contains word 'internal'.
+ * @throws AssertionError in case assertions is enabled and passed exception is fail check.
+ */
+ public static boolean assertInternal(Throwable ex) {
+ //IGNITE-20348: uncomment during implement the ticket.
+ // boolean isPublic = !ex.getClass().getCanonicalName().toLowerCase().contains("internal");
+ //
+ // assert isPublic : "public Exception can't be in internal package " + ex.getClass().getCanonicalName();
+ //
+ // return isPublic;
Review Comment:
I think such validation must be done in ArchUnitTest.
Here, we should only check if the given exception doesn't inherits public IgniteException class via `instance of` operator... or smth like that.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ignite-3] ygerzhedovich commented on a diff in pull request #2616: IGNITE-20476: improve checking SQL exceptions in tests
Posted by "ygerzhedovich (via GitHub)" <gi...@apache.org>.
ygerzhedovich commented on code in PR #2616:
URL: https://github.com/apache/ignite-3/pull/2616#discussion_r1335851759
##########
modules/jdbc/src/integrationTest/java/org/apache/ignite/jdbc/ItJdbcComplexQuerySelfTest.java:
##########
@@ -209,21 +208,25 @@ public void testWrongArgumentType() throws Exception {
}
// Check non-indexed field.
- assertThrows(SQLException.class, () -> {
- try (ResultSet rs = stmt.executeQuery("select * from PUBLIC.Org where name = 2")) {
- assertFalse(rs.next());
- }
- });
+ JdbcTestUtils.assertThrowsSqlException(
Review Comment:
I don't consciously use it, due t have understanding that we expect JDBC exception.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ignite-3] ygerzhedovich commented on a diff in pull request #2616: IGNITE-20476: improve checking SQL exceptions in tests
Posted by "ygerzhedovich (via GitHub)" <gi...@apache.org>.
ygerzhedovich commented on code in PR #2616:
URL: https://github.com/apache/ignite-3/pull/2616#discussion_r1338504606
##########
modules/core/src/main/java/org/apache/ignite/internal/lang/IgniteExceptionMapperUtil.java:
##########
@@ -140,4 +142,22 @@ public static <T> CompletableFuture<T> convertToPublicFuture(CompletableFuture<T
private static <T extends Exception, R extends Exception> Exception map(IgniteExceptionMapper<T, R> mapper, Throwable t) {
return mapper.map(mapper.mappingFrom().cast(t));
}
+
+ /**
+ * Assert that passed exception is not related to internal exceptions.
+ *
+ * @param ex Exception to be checked.
+ * @return {@code true} if canonical name of passed Exception doesn't contains word 'internal'.
+ * @throws AssertionError in case assertions is enabled and passed exception is fail check.
+ */
+ public static boolean assertInternal(Throwable ex) {
+ //IGNITE-20348: uncomment during implement the ticket.
+ // boolean isPublic = !ex.getClass().getCanonicalName().toLowerCase().contains("internal");
+ //
+ // assert isPublic : "public Exception can't be in internal package " + ex.getClass().getCanonicalName();
+ //
+ // return isPublic;
Review Comment:
I've removed the code at all from the patch.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ignite-3] ygerzhedovich commented on a diff in pull request #2616: IGNITE-20476: improve checking SQL exceptions in tests
Posted by "ygerzhedovich (via GitHub)" <gi...@apache.org>.
ygerzhedovich commented on code in PR #2616:
URL: https://github.com/apache/ignite-3/pull/2616#discussion_r1337076620
##########
modules/core/src/main/java/org/apache/ignite/lang/IgniteExceptionMapperUtil.java:
##########
@@ -137,4 +140,22 @@ public static <T> CompletableFuture<T> convertToPublicFuture(CompletableFuture<T
private static <T extends Exception, R extends Exception> Exception map(IgniteExceptionMapper<T, R> mapper, Throwable t) {
return mapper.map(mapper.mappingFrom().cast(t));
}
+
+ /**
+ * Assert that passed exception is not related to internal exceptions.
+ *
+ * @param ex Exception to be checked.
+ * @return {@code true} if canonical name of passed Exception doesn't contains word 'internal'.
+ * @throws AssertionError in case assertions is enabled and passed exception is fail check.
+ */
+ public static boolean assertInternal(Throwable ex) {
Review Comment:
ok, remove it.
Unfortunately static analyze can't be used here due to complicated the problem.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org