Skip to content

Commit 05c831b

Browse files
committed
Fix integration tests
1 parent c8e1cf0 commit 05c831b

File tree

3 files changed

+46
-3
lines changed

3 files changed

+46
-3
lines changed

core/src/integration-test/java/com/scalar/db/storage/objectstorage/ObjectStorageWithReservedKeywordIntegrationTest.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,29 @@
11
package com.scalar.db.storage.objectstorage;
22

33
import com.scalar.db.api.DistributedStorageWithReservedKeywordIntegrationTestBase;
4+
import com.scalar.db.api.TableMetadata;
5+
import com.scalar.db.io.DataType;
46
import java.util.Map;
57
import java.util.Properties;
68
import org.junit.jupiter.api.Disabled;
79

810
public class ObjectStorageWithReservedKeywordIntegrationTest
911
extends DistributedStorageWithReservedKeywordIntegrationTestBase {
1012

13+
@Override
14+
protected TableMetadata getTableMetadata() {
15+
return TableMetadata.newBuilder()
16+
.addColumn(getColumnName1(), DataType.INT)
17+
.addColumn(getColumnName2(), DataType.TEXT)
18+
.addColumn(getColumnName3(), DataType.INT)
19+
.addColumn(getColumnName4(), DataType.INT)
20+
.addColumn(getColumnName5(), DataType.BOOLEAN)
21+
.addColumn(getColumnName6(), DataType.BLOB)
22+
.addPartitionKey(getColumnName1())
23+
.addClusteringKey(getColumnName4())
24+
.build();
25+
}
26+
1127
@Override
1228
protected Properties getProperties(String testName) {
1329
return ObjectStorageEnv.getProperties(testName);

core/src/integration-test/java/com/scalar/db/storage/objectstorage/TwoPhaseConsensusCommitIntegrationTestWithObjectStorage.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,36 @@
11
package com.scalar.db.storage.objectstorage;
22

3+
import com.scalar.db.api.TableMetadata;
4+
import com.scalar.db.io.DataType;
35
import com.scalar.db.transaction.consensuscommit.TwoPhaseConsensusCommitIntegrationTestBase;
46
import java.util.Properties;
57
import org.junit.jupiter.api.Disabled;
68

79
public class TwoPhaseConsensusCommitIntegrationTestWithObjectStorage
810
extends TwoPhaseConsensusCommitIntegrationTestBase {
911

12+
@Override
13+
protected TableMetadata getTableMetadata() {
14+
return TableMetadata.newBuilder()
15+
.addColumn(ACCOUNT_ID, DataType.INT)
16+
.addColumn(ACCOUNT_TYPE, DataType.INT)
17+
.addColumn(BALANCE, DataType.INT)
18+
.addColumn(SOME_COLUMN, DataType.INT)
19+
.addColumn(BOOLEAN_COL, DataType.BOOLEAN)
20+
.addColumn(BIGINT_COL, DataType.BIGINT)
21+
.addColumn(FLOAT_COL, DataType.FLOAT)
22+
.addColumn(DOUBLE_COL, DataType.DOUBLE)
23+
.addColumn(TEXT_COL, DataType.TEXT)
24+
.addColumn(BLOB_COL, DataType.BLOB)
25+
.addColumn(DATE_COL, DataType.DATE)
26+
.addColumn(TIME_COL, DataType.TIME)
27+
.addColumn(TIMESTAMP_COL, DataType.TIMESTAMP)
28+
.addColumn(TIMESTAMPTZ_COL, DataType.TIMESTAMPTZ)
29+
.addPartitionKey(ACCOUNT_ID)
30+
.addClusteringKey(ACCOUNT_TYPE)
31+
.build();
32+
}
33+
1034
@Override
1135
protected Properties getProps1(String testName) {
1236
return ConsensusCommitObjectStorageEnv.getProperties(testName);

integration-test/src/main/java/com/scalar/db/api/TwoPhaseCommitTransactionIntegrationTestBase.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ protected String getNamespaceBaseName() {
122122
return NAMESPACE_BASE_NAME;
123123
}
124124

125-
private void createTables() throws ExecutionException {
125+
protected TableMetadata getTableMetadata() {
126126
TableMetadata.Builder tableMetadata =
127127
TableMetadata.newBuilder()
128128
.addColumn(ACCOUNT_ID, DataType.INT)
@@ -144,13 +144,16 @@ private void createTables() throws ExecutionException {
144144
if (isTimestampTypeSupported()) {
145145
tableMetadata.addColumn(TIMESTAMP_COL, DataType.TIMESTAMP);
146146
}
147+
return tableMetadata.build();
148+
}
147149

150+
private void createTables() throws ExecutionException {
148151
Map<String, String> options = getCreationOptions();
149152
admin1.createCoordinatorTables(true, options);
150153
admin1.createNamespace(namespace1, true, options);
151-
admin1.createTable(namespace1, TABLE_1, tableMetadata.build(), true, options);
154+
admin1.createTable(namespace1, TABLE_1, getTableMetadata(), true, options);
152155
admin2.createNamespace(namespace2, true, options);
153-
admin2.createTable(namespace2, TABLE_2, tableMetadata.build(), true, options);
156+
admin2.createTable(namespace2, TABLE_2, getTableMetadata(), true, options);
154157
}
155158

156159
protected Map<String, String> getCreationOptions() {

0 commit comments

Comments
 (0)