From 0d1a7ebf89380ae16e67c75aac113e38d5df976d Mon Sep 17 00:00:00 2001 From: zhoujh Date: Tue, 30 Sep 2014 10:02:48 +0800 Subject: [PATCH] =?UTF-8?q?JdbcUtils=E5=A2=9E=E5=8A=A0=E5=AF=B9cobar=20dri?= =?UTF-8?q?ver=20url=E7=9A=84=E6=94=AF=E6=8C=81=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/alibaba/druid/util/JdbcUtilsTest.java | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 src/test/java/com/alibaba/druid/util/JdbcUtilsTest.java diff --git a/src/test/java/com/alibaba/druid/util/JdbcUtilsTest.java b/src/test/java/com/alibaba/druid/util/JdbcUtilsTest.java new file mode 100644 index 0000000000..518f09ed9d --- /dev/null +++ b/src/test/java/com/alibaba/druid/util/JdbcUtilsTest.java @@ -0,0 +1,36 @@ +/* + * Copyright 1999-2011 Alibaba Group Holding Ltd. + * + * Licensed 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 com.alibaba.druid.util; + +import junit.framework.TestCase; + +/** + * test for support cobar driver + * + * @author zhoujh + */ +public class JdbcUtilsTest extends TestCase { + + /** + * Test method for {@link com.alibaba.druid.util.JdbcUtils#getDbType(java.lang.String, java.lang.String)}. + */ + public void testGetDbType() { + String jdbcUrl = "jdbc:cobar://localhost:8066/test"; + String dbType = JdbcUtils.getDbType(jdbcUrl, null); + assertEquals("not support cobar driver, url like jdbc:cobar:...", JdbcConstants.MYSQL, dbType); + } + +}