Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.scalar.db.storage.cassandra;

import com.scalar.db.api.DistributedStorageAdminCaseSensitivityIntegrationTestBase;
import com.scalar.db.config.DatabaseConfig;
import java.util.Properties;

public class CassandraAdminCaseSensitivityIntegrationTest
extends DistributedStorageAdminCaseSensitivityIntegrationTestBase {
@Override
protected Properties getProperties(String testName) {
return CassandraEnv.getProperties(testName);
}

@Override
protected String getSystemNamespaceName(Properties properties) {
return new CassandraConfig(new DatabaseConfig(properties))
.getSystemNamespaceName()
.orElse(DatabaseConfig.DEFAULT_SYSTEM_NAMESPACE_NAME);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.scalar.db.storage.cassandra;

import com.scalar.db.api.DistributedStorageCaseSensitivityIntegrationTestBase;
import java.util.Properties;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

public class CassandraCaseSensitivityIntegrationTest
extends DistributedStorageCaseSensitivityIntegrationTestBase {
@Override
protected Properties getProperties(String testName) {
return CassandraEnv.getProperties(testName);
}

@Disabled(
"In Cassandra, if an IS NULL condition is specified for a column in a non-existing record, "
+ "the condition is considered satisfied. This behavior differs from that of other adapters")
@Override
@Test
public void put_withPutIfIsNullWhenRecordDoesNotExist_shouldThrowNoMutationException() {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import com.scalar.db.api.DistributedStorageWithReservedKeywordIntegrationTestBase;
import java.util.Properties;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

public class CassandraWithReservedKeywordIntegrationTest
extends DistributedStorageWithReservedKeywordIntegrationTestBase {
Expand Down Expand Up @@ -52,4 +54,11 @@ protected String getColumnName5() {
protected Properties getProperties(String testName) {
return CassandraEnv.getProperties(testName);
}

@Disabled(
"In Cassandra, if an IS NULL condition is specified for a column in a non-existing record, "
+ "the condition is considered satisfied. This behavior differs from that of other adapters")
@Override
@Test
public void put_withPutIfIsNullWhenRecordDoesNotExist_shouldThrowNoMutationException() {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package com.scalar.db.storage.cosmos;

import com.scalar.db.api.DistributedStorageAdminCaseSensitivityIntegrationTestBase;
import com.scalar.db.config.DatabaseConfig;
import java.util.Map;
import java.util.Properties;

public class CosmosAdminCaseSensitivityIntegrationTest
extends DistributedStorageAdminCaseSensitivityIntegrationTestBase {

@Override
protected Properties getProperties(String testName) {
return CosmosEnv.getProperties(testName);
}

@Override
protected Map<String, String> getCreationOptions() {
return CosmosEnv.getCreationOptions();
}

@Override
protected String getSystemNamespaceName(Properties properties) {
return new CosmosConfig(new DatabaseConfig(properties))
.getTableMetadataDatabase()
.orElse(DatabaseConfig.DEFAULT_SYSTEM_NAMESPACE_NAME);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.scalar.db.storage.cosmos;

import com.scalar.db.api.DistributedStorageCaseSensitivityIntegrationTestBase;
import java.util.Map;
import java.util.Properties;

public class CosmosCaseSensitivityIntegrationTest
extends DistributedStorageCaseSensitivityIntegrationTestBase {

@Override
protected Properties getProperties(String testName) {
return CosmosEnv.getProperties(testName);
}

@Override
protected Map<String, String> getCreationOptions() {
return CosmosEnv.getCreationOptions();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
package com.scalar.db.storage.dynamo;

import com.scalar.db.api.DistributedStorageAdminCaseSensitivityIntegrationTestBase;
import com.scalar.db.config.DatabaseConfig;
import java.util.Map;
import java.util.Properties;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

public class DynamoAdminCaseSensitivityIntegrationTest
extends DistributedStorageAdminCaseSensitivityIntegrationTestBase {

@Override
protected Properties getProperties(String testName) {
return DynamoEnv.getProperties(testName);
}

@Override
protected Map<String, String> getCreationOptions() {
return DynamoEnv.getCreationOptions();
}

@Override
protected boolean isIndexOnBooleanColumnSupported() {
return false;
}

@Override
protected String getSystemNamespaceName(Properties properties) {
return new DynamoConfig(new DatabaseConfig(properties))
.getTableMetadataNamespace()
.orElse(DatabaseConfig.DEFAULT_SYSTEM_NAMESPACE_NAME);
}

// Since DynamoDB doesn't have the namespace concept, some behaviors around the namespace are
// different from the other adapters. So disable several tests that check such behaviors

@Disabled
@Test
@Override
public void createNamespace_ForNonExistingNamespace_ShouldCreateNamespaceProperly() {}

@Disabled
@Test
@Override
public void createNamespace_ForExistingNamespace_ShouldThrowIllegalArgumentException() {}

@Disabled
@Test
@Override
public void createNamespace_IfNotExists_ForExistingNamespace_ShouldNotThrowAnyException() {}

@Disabled
@Test
@Override
public void dropNamespace_ForNonExistingNamespace_ShouldDropNamespaceProperly() {}

@Disabled
@Test
@Override
public void dropNamespace_ForNonExistingNamespace_ShouldThrowIllegalArgumentException() {}

@Disabled
@Test
@Override
public void dropNamespace_ForNonEmptyNamespace_ShouldThrowIllegalArgumentException() {}

@Disabled
@Test
@Override
public void dropNamespace_IfExists_ForNonExistingNamespace_ShouldNotThrowAnyException() {}

@Disabled
@Test
@Override
public void namespaceExists_ShouldReturnCorrectResults() {}

@Disabled
@Test
@Override
public void createTable_ForNonExistingNamespace_ShouldThrowIllegalArgumentException() {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.scalar.db.storage.dynamo;

import com.scalar.db.api.DistributedStorageCaseSensitivityIntegrationTestBase;
import java.util.Map;
import java.util.Properties;
import org.junit.jupiter.api.Disabled;

public class DynamoCaseSensitivityIntegrationTest
extends DistributedStorageCaseSensitivityIntegrationTestBase {

@Override
protected Properties getProperties(String testName) {
return DynamoEnv.getProperties(testName);
}

@Override
protected Map<String, String> getCreationOptions() {
return DynamoEnv.getCreationOptions();
}

@Disabled("DynamoDB doesn't support putting a null value for a secondary index column")
@Override
public void put_PutGivenForIndexedColumnWithNullValue_ShouldPut() {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ protected Map<String, String> getCreationOptions() {
return DynamoEnv.getCreationOptions();
}

// DynamoDB doesn't support putting a null value for a secondary index column
@Disabled
@Disabled("DynamoDB doesn't support putting a null value for a secondary index column")
@Override
public void put_PutGivenForIndexedColumnWithNullValue_ShouldPut() {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.scalar.db.api.DistributedStorageWithReservedKeywordIntegrationTestBase;
import java.util.Map;
import java.util.Properties;
import org.junit.jupiter.api.Disabled;

public class DynamoWithReservedKeywordIntegrationTest
extends DistributedStorageWithReservedKeywordIntegrationTestBase {
Expand Down Expand Up @@ -58,4 +59,8 @@ protected Properties getProperties(String testName) {
protected Map<String, String> getCreationOptions() {
return DynamoEnv.getCreationOptions();
}

@Disabled("DynamoDB doesn't support putting a null value for a secondary index column")
@Override
public void put_PutGivenForIndexedColumnWithNullValue_ShouldPut() {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
package com.scalar.db.storage.jdbc;

import com.scalar.db.api.DistributedStorageAdminCaseSensitivityIntegrationTestBase;
import com.scalar.db.config.DatabaseConfig;
import com.scalar.db.exception.storage.ExecutionException;
import java.util.Properties;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledIf;

public class JdbcAdminCaseSensitivityIntegrationTest
extends DistributedStorageAdminCaseSensitivityIntegrationTestBase {

@Override
protected Properties getProperties(String testName) {
return JdbcEnv.getProperties(testName);
}

@Override
protected String getSystemNamespaceName(Properties properties) {
return new JdbcConfig(new DatabaseConfig(properties))
.getTableMetadataSchema()
.orElse(DatabaseConfig.DEFAULT_SYSTEM_NAMESPACE_NAME);
}

// Since SQLite doesn't have persistent namespaces, some behaviors around the namespace are
// different from the other adapters. So disable several tests that check such behaviors.

@SuppressWarnings("unused")
private boolean isSqlite() {
return JdbcEnv.isSqlite();
}

@Test
@Override
@DisabledIf("isSqlite")
public void createNamespace_ForNonExistingNamespace_ShouldCreateNamespaceProperly()
throws ExecutionException {
super.createNamespace_ForNonExistingNamespace_ShouldCreateNamespaceProperly();
}

@Test
@Override
@DisabledIf("isSqlite")
public void createNamespace_ForExistingNamespace_ShouldThrowIllegalArgumentException() {
super.createNamespace_ForExistingNamespace_ShouldThrowIllegalArgumentException();
}

@Test
@Override
@DisabledIf("isSqlite")
public void createNamespace_IfNotExists_ForExistingNamespace_ShouldNotThrowAnyException() {
super.createNamespace_IfNotExists_ForExistingNamespace_ShouldNotThrowAnyException();
}

@Test
@Override
@DisabledIf("isSqlite")
public void dropNamespace_ForNonExistingNamespace_ShouldDropNamespaceProperly()
throws ExecutionException {
super.dropNamespace_ForNonExistingNamespace_ShouldDropNamespaceProperly();
}

@Test
@Override
@DisabledIf("isSqlite")
public void dropNamespace_ForNonExistingNamespace_ShouldThrowIllegalArgumentException() {
super.dropNamespace_ForNonExistingNamespace_ShouldThrowIllegalArgumentException();
}

@Test
@Override
@DisabledIf("isSqlite")
public void dropNamespace_ForNonEmptyNamespace_ShouldThrowIllegalArgumentException()
throws ExecutionException {
super.dropNamespace_ForNonEmptyNamespace_ShouldThrowIllegalArgumentException();
}

@Test
@Override
@DisabledIf("isSqlite")
public void dropNamespace_IfExists_ForNonExistingNamespace_ShouldNotThrowAnyException() {
super.dropNamespace_IfExists_ForNonExistingNamespace_ShouldNotThrowAnyException();
}

@Test
@Override
@DisabledIf("isSqlite")
public void namespaceExists_ShouldReturnCorrectResults() throws ExecutionException {
super.namespaceExists_ShouldReturnCorrectResults();
}

@Test
@Override
@DisabledIf("isSqlite")
public void createTable_ForNonExistingNamespace_ShouldThrowIllegalArgumentException() {
super.createTable_ForNonExistingNamespace_ShouldThrowIllegalArgumentException();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package com.scalar.db.storage.jdbc;

import com.scalar.db.api.DistributedStorageCaseSensitivityIntegrationTestBase;
import com.scalar.db.config.DatabaseConfig;
import java.util.Properties;

public class JdbcDatabaseCaseSensitivityIntegrationTest
extends DistributedStorageCaseSensitivityIntegrationTestBase {

private RdbEngineStrategy rdbEngine;

@Override
protected Properties getProperties(String testName) {
Properties properties = JdbcEnv.getProperties(testName);
JdbcConfig config = new JdbcConfig(new DatabaseConfig(properties));
rdbEngine = RdbEngineFactory.create(config);
return JdbcEnv.getProperties(testName);
}

@Override
protected int getLargeDataSizeInBytes() {
if (JdbcTestUtils.isOracle(rdbEngine)) {
// For Oracle, the max data size for BLOB is 2000 bytes
return 2000;
} else {
return super.getLargeDataSizeInBytes();
}
}
}
Loading