/**
 * Copyright 2015 Palantir Technologies
 * <p>
 * Licensed under the BSD-3 License (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * <p>
 * http://opensource.org/licenses/BSD-3-Clause
 * <p>
 * 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.palantir.atlasdb.keyvalue.dbkvs;

import org.junit.Ignore;

import com.palantir.atlasdb.keyvalue.api.KeyValueService;
import com.palantir.atlasdb.keyvalue.api.TableReference;
import com.palantir.atlasdb.keyvalue.dbkvs.impl.ConnectionManagerAwareDbKvs;
import com.palantir.atlasdb.keyvalue.impl.AbstractAtlasDbKeyValueServiceTest;

public class DbkvsKeyValueServiceTest extends AbstractAtlasDbKeyValueServiceTest {
    @Override
    protected KeyValueService getKeyValueService() {
        KeyValueService kvs = ConnectionManagerAwareDbKvs.create(DbkvsTestSuite.POSTGRES_KVS_CONFIG);
        for (TableReference table : kvs.getAllTableNames()) {
            if (!table.getQualifiedName().equals("_metadata")) {
                kvs.dropTable(table);
            }
        }
        return kvs;
    }

    @Override
    @Ignore
    public void testGetRangeWithHistory() {
        /* Have to ignore this test as it is an unsupported operation for this KVS */
    }
}

@@ -665,16 +665,150 @@
 Ignore;%0A
+import org.junit.Rule;%0Aimport org.junit.Test;%0Aimport org.junit.rules.ExpectedException;%0A%0Aimport com.palantir.atlasdb.AtlasDbConstants;
 %0Aimport 
@@ -854,24 +854,76 @@
 lueService;%0A
+import com.palantir.atlasdb.keyvalue.api.Namespace;%0A
 import com.p
@@ -1121,16 +1121,68 @@
 iceTest;
+%0Aimport com.palantir.exception.PalantirSqlException;
 %0A%0Apublic
@@ -1643,16 +1643,91 @@
 %0A    %7D%0A%0A
+    @Rule%0A    public ExpectedException thrown = ExpectedException.none();%0A%0A
     @Ove
@@ -1879,11 +1879,425 @@
 */%0A    %7D
+%0A%0A    @Test%0A    public void testRejectCaseInsensitiveDuplicateTableName() %7B%0A        keyValueService.createTable(TableReference.create(Namespace.EMPTY_NAMESPACE, %22Duplicate%22), AtlasDbConstants.GENERIC_TABLE_METADATA);%0A        thrown.expect(PalantirSqlException.class);%0A        keyValueService.createTable(TableReference.create(Namespace.EMPTY_NAMESPACE, %22duplicate%22), AtlasDbConstants.GENERIC_TABLE_METADATA);%0A    %7D
 %0A%7D%0A

Add a test cases specifically for dbkvs