[
https://issues.apache.org/jira/browse/CALCITE-2219?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16505421#comment-16505421
]
ASF GitHub Bot commented on CALCITE-2219:
-----------------------------------------
Github user risdenk commented on a diff in the pull request:
https://github.com/apache/calcite-avatica/pull/33#discussion_r193910541
--- Diff:
core/src/test/java/org/apache/calcite/avatica/AvaticaClosedConnectionTest.java
---
@@ -0,0 +1,145 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.calcite.avatica;
+
+import org.apache.calcite.avatica.AvaticaClosedCheckHelper.MethodVerifier;
+import org.apache.calcite.avatica.AvaticaClosedCheckHelper.TestDriver;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameters;
+
+import java.lang.reflect.Method;
+import java.sql.Connection;
+import java.util.Arrays;
+import java.util.Properties;
+import java.util.function.Function;
+import java.util.function.Predicate;
+
+import static
org.apache.calcite.avatica.AvaticaClosedCheckHelper.ASSERT_CLIENTINFO;
+import static
org.apache.calcite.avatica.AvaticaClosedCheckHelper.ASSERT_CLOSED;
+import static
org.apache.calcite.avatica.AvaticaClosedCheckHelper.ASSERT_UNSUPPORTED;
+import static
org.apache.calcite.avatica.AvaticaClosedCheckHelper.createFakeArguments;
+import static
org.apache.calcite.avatica.AvaticaClosedCheckHelper.getMethodsToTest;
+import static
org.apache.calcite.avatica.AvaticaClosedCheckHelper.newInvocation;
+
+import static org.junit.Assert.assertTrue;
+
+/**
+ * Tests for {@code AvaticaConnection} relative to close behavior
+ */
+@RunWith(Parameterized.class)
+public class AvaticaClosedConnectionTest {
+
+ private static final Predicate<? super Method> METHOD_FILTER = new
Predicate<Method>() {
+ public boolean test(Method m) {
+ // Skip methods not overriden by Avatica
--- End diff --
sp nit: overridden
> Avatica Connection/Statement/ResultSet don't throw if resource is closed
> ------------------------------------------------------------------------
>
> Key: CALCITE-2219
> URL: https://issues.apache.org/jira/browse/CALCITE-2219
> Project: Calcite
> Issue Type: Bug
> Components: avatica
> Reporter: Laurent Goujon
> Assignee: Laurent Goujon
> Priority: Major
>
> According to JDBC spec/Javadoc, almost all methods of
> {{Connection}}/{{Statement}}/{{PreparedStatement}}/{{ResultSet}} should throw
> an exception if resource is closed.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)