Skip to content

Commit c04ce71

Browse files
committed
Resolve conflicts
1 parent 4263155 commit c04ce71

18 files changed

+1967
-1602
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package com.scalar.db.storage.cassandra;
2+
3+
import com.scalar.db.api.DistributedStorageAdminCaseSensitivityIntegrationTestBase;
4+
import com.scalar.db.config.DatabaseConfig;
5+
import java.util.Properties;
6+
7+
public class CassandraAdminCaseSensitivityIntegrationTest
8+
extends DistributedStorageAdminCaseSensitivityIntegrationTestBase {
9+
@Override
10+
protected Properties getProperties(String testName) {
11+
return CassandraEnv.getProperties(testName);
12+
}
13+
14+
@Override
15+
protected String getSystemNamespaceName(Properties properties) {
16+
return new CassandraConfig(new DatabaseConfig(properties))
17+
.getSystemNamespaceName()
18+
.orElse(DatabaseConfig.DEFAULT_SYSTEM_NAMESPACE_NAME);
19+
}
20+
21+
@Override
22+
protected boolean isTimestampTypeSupported() {
23+
return false;
24+
}
25+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package com.scalar.db.storage.cassandra;
2+
3+
import com.scalar.db.api.DistributedStorageCaseSensitivityIntegrationTestBase;
4+
import java.util.Collections;
5+
import java.util.Map;
6+
import java.util.Properties;
7+
import org.junit.jupiter.api.Disabled;
8+
import org.junit.jupiter.api.Test;
9+
10+
public class CassandraCaseSensitivityIntegrationTest
11+
extends DistributedStorageCaseSensitivityIntegrationTestBase {
12+
@Override
13+
protected Properties getProperties(String testName) {
14+
return CassandraEnv.getProperties(testName);
15+
}
16+
17+
@Override
18+
protected Map<String, String> getCreationOptions() {
19+
return Collections.singletonMap(CassandraAdmin.REPLICATION_FACTOR, "1");
20+
}
21+
22+
@Disabled(
23+
"In Cassandra, if an IS NULL condition is specified for a column in a non-existing record, "
24+
+ "the condition is considered satisfied. This behavior differs from that of other adapters")
25+
@Override
26+
@Test
27+
public void put_withPutIfIsNullWhenRecordDoesNotExist_shouldThrowNoMutationException() {}
28+
}

core/src/integration-test/java/com/scalar/db/storage/cassandra/CassandraWithReservedKeywordIntegrationTest.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
import com.scalar.db.api.DistributedStorageWithReservedKeywordIntegrationTestBase;
44
import java.util.Properties;
5+
import org.junit.jupiter.api.Disabled;
6+
import org.junit.jupiter.api.Test;
57

68
public class CassandraWithReservedKeywordIntegrationTest
79
extends DistributedStorageWithReservedKeywordIntegrationTestBase {
@@ -52,4 +54,11 @@ protected String getColumnName5() {
5254
protected Properties getProperties(String testName) {
5355
return CassandraEnv.getProperties(testName);
5456
}
57+
58+
@Disabled(
59+
"In Cassandra, if an IS NULL condition is specified for a column in a non-existing record, "
60+
+ "the condition is considered satisfied. This behavior differs from that of other adapters")
61+
@Override
62+
@Test
63+
public void put_withPutIfIsNullWhenRecordDoesNotExist_shouldThrowNoMutationException() {}
5564
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package com.scalar.db.storage.cosmos;
2+
3+
import com.scalar.db.api.DistributedStorageAdminCaseSensitivityIntegrationTestBase;
4+
import com.scalar.db.config.DatabaseConfig;
5+
import java.util.Map;
6+
import java.util.Properties;
7+
8+
public class CosmosAdminCaseSensitivityIntegrationTest
9+
extends DistributedStorageAdminCaseSensitivityIntegrationTestBase {
10+
11+
@Override
12+
protected Properties getProperties(String testName) {
13+
return CosmosEnv.getProperties(testName);
14+
}
15+
16+
@Override
17+
protected Map<String, String> getCreationOptions() {
18+
return CosmosEnv.getCreationOptions();
19+
}
20+
21+
@Override
22+
protected String getSystemNamespaceName(Properties properties) {
23+
return new CosmosConfig(new DatabaseConfig(properties))
24+
.getTableMetadataDatabase()
25+
.orElse(DatabaseConfig.DEFAULT_SYSTEM_NAMESPACE_NAME);
26+
}
27+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package com.scalar.db.storage.cosmos;
2+
3+
import com.scalar.db.api.DistributedStorageCaseSensitivityIntegrationTestBase;
4+
import java.util.Map;
5+
import java.util.Properties;
6+
7+
public class CosmosCaseSensitivityIntegrationTest
8+
extends DistributedStorageCaseSensitivityIntegrationTestBase {
9+
10+
@Override
11+
protected Properties getProperties(String testName) {
12+
return CosmosEnv.getProperties(testName);
13+
}
14+
15+
@Override
16+
protected Map<String, String> getCreationOptions() {
17+
return CosmosEnv.getCreationOptions();
18+
}
19+
}
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
package com.scalar.db.storage.dynamo;
2+
3+
import com.scalar.db.api.DistributedStorageAdminCaseSensitivityIntegrationTestBase;
4+
import com.scalar.db.config.DatabaseConfig;
5+
import java.util.Map;
6+
import java.util.Properties;
7+
import org.junit.jupiter.api.Disabled;
8+
import org.junit.jupiter.api.Test;
9+
10+
public class DynamoAdminCaseSensitivityIntegrationTest
11+
extends DistributedStorageAdminCaseSensitivityIntegrationTestBase {
12+
13+
@Override
14+
protected Properties getProperties(String testName) {
15+
return DynamoEnv.getProperties(testName);
16+
}
17+
18+
@Override
19+
protected Map<String, String> getCreationOptions() {
20+
return DynamoEnv.getCreationOptions();
21+
}
22+
23+
@Override
24+
protected boolean isIndexOnBooleanColumnSupported() {
25+
return false;
26+
}
27+
28+
@Override
29+
protected String getSystemNamespaceName(Properties properties) {
30+
return new DynamoConfig(new DatabaseConfig(properties))
31+
.getTableMetadataNamespace()
32+
.orElse(DatabaseConfig.DEFAULT_SYSTEM_NAMESPACE_NAME);
33+
}
34+
35+
// Since DynamoDB doesn't have the namespace concept, some behaviors around the namespace are
36+
// different from the other adapters. So disable several tests that check such behaviors
37+
38+
@Disabled
39+
@Test
40+
@Override
41+
public void createNamespace_ForNonExistingNamespace_ShouldCreateNamespaceProperly() {}
42+
43+
@Disabled
44+
@Test
45+
@Override
46+
public void createNamespace_ForExistingNamespace_ShouldThrowIllegalArgumentException() {}
47+
48+
@Disabled
49+
@Test
50+
@Override
51+
public void createNamespace_IfNotExists_ForExistingNamespace_ShouldNotThrowAnyException() {}
52+
53+
@Disabled
54+
@Test
55+
@Override
56+
public void dropNamespace_ForNonExistingNamespace_ShouldDropNamespaceProperly() {}
57+
58+
@Disabled
59+
@Test
60+
@Override
61+
public void dropNamespace_ForNonExistingNamespace_ShouldThrowIllegalArgumentException() {}
62+
63+
@Disabled
64+
@Test
65+
@Override
66+
public void dropNamespace_ForNonEmptyNamespace_ShouldThrowIllegalArgumentException() {}
67+
68+
@Disabled
69+
@Test
70+
@Override
71+
public void dropNamespace_IfExists_ForNonExistingNamespace_ShouldNotThrowAnyException() {}
72+
73+
@Disabled
74+
@Test
75+
@Override
76+
public void namespaceExists_ShouldReturnCorrectResults() {}
77+
78+
@Disabled
79+
@Test
80+
@Override
81+
public void createTable_ForNonExistingNamespace_ShouldThrowIllegalArgumentException() {}
82+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package com.scalar.db.storage.dynamo;
2+
3+
import com.scalar.db.api.DistributedStorageCaseSensitivityIntegrationTestBase;
4+
import java.util.Map;
5+
import java.util.Properties;
6+
import org.junit.jupiter.api.Disabled;
7+
8+
public class DynamoCaseSensitivityIntegrationTest
9+
extends DistributedStorageCaseSensitivityIntegrationTestBase {
10+
11+
@Override
12+
protected Properties getProperties(String testName) {
13+
return DynamoEnv.getProperties(testName);
14+
}
15+
16+
@Override
17+
protected Map<String, String> getCreationOptions() {
18+
return DynamoEnv.getCreationOptions();
19+
}
20+
21+
@Disabled("DynamoDB doesn't support putting a null value for a secondary index column")
22+
@Override
23+
public void put_PutGivenForIndexedColumnWithNullValue_ShouldPut() {}
24+
}

core/src/integration-test/java/com/scalar/db/storage/dynamo/DynamoIntegrationTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ protected Map<String, String> getCreationOptions() {
1717
return DynamoEnv.getCreationOptions();
1818
}
1919

20-
// DynamoDB doesn't support putting a null value for a secondary index column
21-
@Disabled
20+
@Disabled("DynamoDB doesn't support putting a null value for a secondary index column")
2221
@Override
2322
public void put_PutGivenForIndexedColumnWithNullValue_ShouldPut() {}
2423
}

core/src/integration-test/java/com/scalar/db/storage/dynamo/DynamoWithReservedKeywordIntegrationTest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import com.scalar.db.api.DistributedStorageWithReservedKeywordIntegrationTestBase;
44
import java.util.Map;
55
import java.util.Properties;
6+
import org.junit.jupiter.api.Disabled;
67

78
public class DynamoWithReservedKeywordIntegrationTest
89
extends DistributedStorageWithReservedKeywordIntegrationTestBase {
@@ -58,4 +59,8 @@ protected Properties getProperties(String testName) {
5859
protected Map<String, String> getCreationOptions() {
5960
return DynamoEnv.getCreationOptions();
6061
}
62+
63+
@Disabled("DynamoDB doesn't support putting a null value for a secondary index column")
64+
@Override
65+
public void put_PutGivenForIndexedColumnWithNullValue_ShouldPut() {}
6166
}
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
package com.scalar.db.storage.jdbc;
2+
3+
import com.scalar.db.api.DistributedStorageAdminCaseSensitivityIntegrationTestBase;
4+
import com.scalar.db.config.DatabaseConfig;
5+
import com.scalar.db.exception.storage.ExecutionException;
6+
import java.util.Properties;
7+
import org.junit.jupiter.api.Test;
8+
import org.junit.jupiter.api.condition.DisabledIf;
9+
10+
public class JdbcAdminCaseSensitivityIntegrationTest
11+
extends DistributedStorageAdminCaseSensitivityIntegrationTestBase {
12+
private RdbEngineStrategy rdbEngine;
13+
14+
@Override
15+
protected Properties getProperties(String testName) {
16+
Properties properties = JdbcEnv.getProperties(testName);
17+
rdbEngine = RdbEngineFactory.create(new JdbcConfig(new DatabaseConfig(properties)));
18+
return properties;
19+
}
20+
21+
@Override
22+
protected String getSystemNamespaceName(Properties properties) {
23+
return new JdbcConfig(new DatabaseConfig(properties))
24+
.getTableMetadataSchema()
25+
.orElse(DatabaseConfig.DEFAULT_SYSTEM_NAMESPACE_NAME);
26+
}
27+
28+
// Since SQLite doesn't have persistent namespaces, some behaviors around the namespace are
29+
// different from the other adapters. So disable several tests that check such behaviors.
30+
31+
@SuppressWarnings("unused")
32+
private boolean isSqlite() {
33+
return JdbcEnv.isSqlite();
34+
}
35+
36+
@Test
37+
@Override
38+
@DisabledIf("isSqlite")
39+
public void createNamespace_ForNonExistingNamespace_ShouldCreateNamespaceProperly()
40+
throws ExecutionException {
41+
super.createNamespace_ForNonExistingNamespace_ShouldCreateNamespaceProperly();
42+
}
43+
44+
@Test
45+
@Override
46+
@DisabledIf("isSqlite")
47+
public void createNamespace_ForExistingNamespace_ShouldThrowIllegalArgumentException() {
48+
super.createNamespace_ForExistingNamespace_ShouldThrowIllegalArgumentException();
49+
}
50+
51+
@Test
52+
@Override
53+
@DisabledIf("isSqlite")
54+
public void createNamespace_IfNotExists_ForExistingNamespace_ShouldNotThrowAnyException() {
55+
super.createNamespace_IfNotExists_ForExistingNamespace_ShouldNotThrowAnyException();
56+
}
57+
58+
@Test
59+
@Override
60+
@DisabledIf("isSqlite")
61+
public void dropNamespace_ForNonExistingNamespace_ShouldDropNamespaceProperly()
62+
throws ExecutionException {
63+
super.dropNamespace_ForNonExistingNamespace_ShouldDropNamespaceProperly();
64+
}
65+
66+
@Test
67+
@Override
68+
@DisabledIf("isSqlite")
69+
public void dropNamespace_ForNonExistingNamespace_ShouldThrowIllegalArgumentException() {
70+
super.dropNamespace_ForNonExistingNamespace_ShouldThrowIllegalArgumentException();
71+
}
72+
73+
@Test
74+
@Override
75+
@DisabledIf("isSqlite")
76+
public void dropNamespace_ForNonEmptyNamespace_ShouldThrowIllegalArgumentException()
77+
throws ExecutionException {
78+
super.dropNamespace_ForNonEmptyNamespace_ShouldThrowIllegalArgumentException();
79+
}
80+
81+
@Test
82+
@Override
83+
@DisabledIf("isSqlite")
84+
public void dropNamespace_IfExists_ForNonExistingNamespace_ShouldNotThrowAnyException() {
85+
super.dropNamespace_IfExists_ForNonExistingNamespace_ShouldNotThrowAnyException();
86+
}
87+
88+
@Test
89+
@Override
90+
@DisabledIf("isSqlite")
91+
public void namespaceExists_ShouldReturnCorrectResults() throws ExecutionException {
92+
super.namespaceExists_ShouldReturnCorrectResults();
93+
}
94+
95+
@Test
96+
@Override
97+
@DisabledIf("isSqlite")
98+
public void createTable_ForNonExistingNamespace_ShouldThrowIllegalArgumentException() {
99+
super.createTable_ForNonExistingNamespace_ShouldThrowIllegalArgumentException();
100+
}
101+
102+
@Override
103+
protected boolean isCreateIndexOnTextAndBlobColumnsEnabled() {
104+
// "admin.createIndex()" for TEXT and BLOB columns fails (the "create index" query runs
105+
// indefinitely) on Db2 community edition version but works on Db2 hosted on IBM Cloud.
106+
// So we disable these tests until the issue is resolved.
107+
return !JdbcTestUtils.isDb2(rdbEngine);
108+
}
109+
}

0 commit comments

Comments
 (0)