You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ab...@apache.org on 2020/05/14 08:54:33 UTC
[lucene-solr] 03/03: SOLR-14470: Remove left-over from merge.
This is an automated email from the ASF dual-hosted git repository.
ab pushed a commit to branch jira/solr-14470
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git
commit 2b90568e61a3d206dc66d60ce4912097e6f208f5
Author: Andrzej Bialecki <ab...@apache.org>
AuthorDate: Thu May 14 10:53:54 2020 +0200
SOLR-14470: Remove left-over from merge.
---
.../handler/sql/TestFilterCalciteConnection.java | 93 ----------------------
1 file changed, 93 deletions(-)
diff --git a/solr/core/src/test/org/apache/solr/handler/sql/TestFilterCalciteConnection.java b/solr/core/src/test/org/apache/solr/handler/sql/TestFilterCalciteConnection.java
deleted file mode 100644
index 180817f..0000000
--- a/solr/core/src/test/org/apache/solr/handler/sql/TestFilterCalciteConnection.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * 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.solr.handler.sql;
-
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.sql.Connection;
-import java.sql.DriverManager;
-import java.util.Properties;
-
-import org.apache.calcite.jdbc.CalciteConnection;
-import org.apache.calcite.schema.SchemaPlus;
-import org.apache.solr.cloud.SolrCloudTestCase;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- *
- */
-public class TestFilterCalciteConnection extends SolrCloudTestCase {
-
- @BeforeClass
- public static void setupCluster() throws Exception {
- configureCluster(1)
- .addConfig("conf", configset("cloud-minimal"))
- .configure();
- }
-
- @Test
- public void testConnectionClosesSchema() throws Exception {
- String zkHost = cluster.getSolrClient().getZkHost();
- Properties props = new Properties();
- props.setProperty("zk", zkHost);
- Connection conn = null;
- try {
- // load the driver
- Class.forName(CalciteSolrDriver.class.getName());
- conn = DriverManager.getConnection("jdbc:calcitesolr:test", props);
- assertTrue("unexpected connection impl: " + conn.getClass().getName(),
- conn instanceof FilterCalciteConnection);
- SchemaPlus rootSchema = ((FilterCalciteConnection)conn).getRootSchema();
- SchemaPlus subSchema = rootSchema.getSubSchema(zkHost);
- assertNotNull("missing SolrSchema", subSchema);
- SolrSchema solrSchema = subSchema.unwrap(SolrSchema.class);
- // test that conn.close() propagates to the schema
- conn.close();
- assertTrue("SolrSchema not closed after connection close!", solrSchema.isClosed());
- } finally {
- if (conn != null && !conn.isClosed()) {
- conn.close();
- }
- }
- }
-
- @Test
- public void testMethodsOverriden() throws Exception {
- implTestDeclaredMethodsOverridden(CalciteConnection.class, FilterCalciteConnection.class);
- }
-
- private void implTestDeclaredMethodsOverridden(Class<?> superClass, Class<?> subClass) throws Exception {
- for (final Method superClassMethod : superClass.getDeclaredMethods()) {
- final int modifiers = superClassMethod.getModifiers();
- if (Modifier.isPrivate(modifiers)) continue;
- if (Modifier.isFinal(modifiers)) continue;
- if (Modifier.isStatic(modifiers)) continue;
- try {
- final Method subClassMethod = subClass.getDeclaredMethod(
- superClassMethod.getName(),
- superClassMethod.getParameterTypes());
- assertEquals("getReturnType() difference",
- superClassMethod.getReturnType(),
- subClassMethod.getReturnType());
- } catch (NoSuchMethodException e) {
- fail(subClass + " needs to override '" + superClassMethod + "'");
- }
- }
- }
-}