Skip to content

Commit 51957d4

Browse files
committed
Adjust some tests for that.
1 parent b43e884 commit 51957d4

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

fdb-relational-core/src/test/java/com/apple/foundationdb/relational/api/ddl/DdlTestUtil.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,11 @@ private void buildTypesAndTables() {
251251
if (extension != null && extension.hasUsage() && extension.getUsage() == RecordMetaDataOptionsProto.RecordTypeOptions.Usage.UNION) {
252252
//we found the Union Descriptor
253253
for (DescriptorProtos.FieldDescriptorProto tableDescs : typeDesc.getFieldList()) {
254-
tableNames.add(tableDescs.getTypeName());
254+
String name = tableDescs.getTypeName();
255+
if (name.startsWith(".")) {
256+
name = name.substring(1);
257+
}
258+
tableNames.add(name);
255259
}
256260
}
257261
}

fdb-relational-core/src/test/java/com/apple/foundationdb/relational/recordlayer/metadata/SchemaTemplateSerDeTests.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ public void testGoodSchemaTemplate() {
163163
final var unionDesc = maybeUnionDesc.get();
164164

165165
// Check if all tables are part of union descriptor.
166-
final var expectedTableNameSet = Set.of("T1", "T2");
166+
final var expectedTableNameSet = Set.of(".T1", ".T2");
167167
Assertions.assertTrue(unionDesc.getFieldList().stream().allMatch(e -> expectedTableNameSet.contains(e.getTypeName())));
168168

169169
// Check if the number of fields in union descriptor are equal to the tables in the template.
@@ -237,8 +237,10 @@ public void testGoodSchemaTemplateWithGenerations() {
237237
// Check if all generations are present in union descriptor
238238
for (final var unionField : unionDesc.getFieldList()) {
239239
final var typeName = unionField.getTypeName();
240-
Assertions.assertTrue(testcase.containsKey(typeName));
241-
final var expectedGenerations = testcase.get(typeName);
240+
Assertions.assertTrue(typeName.startsWith("."));
241+
final var caseName = typeName.substring(1);
242+
Assertions.assertTrue(testcase.containsKey(caseName));
243+
final var expectedGenerations = testcase.get(caseName);
242244
Assertions.assertTrue(expectedGenerations.contains(NonnullPair.of(unionField.getNumber(), unionField.getOptions())));
243245
}
244246
}

0 commit comments

Comments
 (0)