[
https://issues.apache.org/jira/browse/TAJO-1699?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14649148#comment-14649148
]
ASF GitHub Bot commented on TAJO-1699:
--------------------------------------
Github user jihoonson commented on a diff in the pull request:
https://github.com/apache/tajo/pull/662#discussion_r35968081
--- Diff:
tajo-core/src/test/java/org/apache/tajo/client/v2/TestTajoClientV2.java ---
@@ -0,0 +1,236 @@
+/**
+ * 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.tajo.client.v2;
+
+import com.facebook.presto.hive.shaded.com.google.common.collect.Lists;
+import org.apache.tajo.QueryTestCaseBase;
+import org.apache.tajo.catalog.exception.DuplicateDatabaseException;
+import org.apache.tajo.catalog.exception.UndefinedDatabaseException;
+import org.apache.tajo.catalog.exception.UndefinedTableException;
+import org.apache.tajo.exception.TajoException;
+import org.apache.tajo.service.ServiceTracker;
+import org.apache.tajo.service.ServiceTrackerFactory;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import java.io.IOException;
+import java.net.InetSocketAddress;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.List;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+import static org.junit.Assert.*;
+
+public class TestTajoClientV2 extends QueryTestCaseBase {
+ private static TajoClient clientv2;
+
+ @BeforeClass
+ public static void setUp() throws Exception {
+ conf = testingCluster.getConfiguration();
+
+ clientv2 = new TajoClient(new ServiceDiscovery() {
+ ServiceTracker tracker = ServiceTrackerFactory.get(conf);
+ @Override
+ public InetSocketAddress clientAddress() {
+ return tracker.getClientServiceAddress();
+ }
+ });
+ }
+
+ @AfterClass
+ public static void tearDown() throws Exception {
+ clientv2.close();
+ }
+
+ @Test
+ public void testExecuteUpdate() throws TajoException {
+ clientv2.executeUpdate("create database tajoclientv2");
+ clientv2.selectDB("tajoclientv2");
+ clientv2.selectDB("default");
+ clientv2.executeUpdate("drop database tajoclientv2");
+
+ try {
+ clientv2.selectDB("tajoclientv2");
+ fail();
+ } catch (UndefinedDatabaseException e) {
--- End diff --
Don't we have to check other types of exceptions?
It seems that any exceptions except ```UndefinedDatabaseException``` are
not allowed here.
> Tajo Java Client version 2
> --------------------------
>
> Key: TAJO-1699
> URL: https://issues.apache.org/jira/browse/TAJO-1699
> Project: Tajo
> Issue Type: Improvement
> Components: Java Client
> Reporter: Hyunsik Choi
> Assignee: Hyunsik Choi
> Fix For: 0.11.0
>
>
> I propose Tajo Java Client version 2. Its motivations are as follows:
> * After TAJO-1625, the error propagation has been changed significantly.
> Java Client should make use the new error propagation system. Java Client
> should throw the proper exceptions.
> * Many Java API exposes internal data structure and protocol buffer data
> structure. It requires users to understand its internal behavior and
> architecture. We should hide them from users.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)