Skip to content

Commit

Permalink
Rename DataSetColumn.assertion to ignoreAssertData (#32153)
Browse files Browse the repository at this point in the history
  • Loading branch information
terrymanu authored Jul 17, 2024
1 parent c460c4f commit 7c5ca85
Show file tree
Hide file tree
Showing 13 changed files with 31 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ public final class DataSetColumn {
@XmlAttribute(required = true)
private String name;

@XmlAttribute
private boolean assertion = true;

@XmlAttribute
private String type;

@XmlAttribute(name = "ignore-assert-data")
private boolean ignoreAssertData;
}
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ private void assertResultSet(final SingleE2EContainerComposer containerComposer,

private void assertResultSet(final SingleE2EContainerComposer containerComposer, final ResultSet resultSet) throws SQLException {
assertMetaData(resultSet.getMetaData(), getExpectedColumns(containerComposer));
assertRows(resultSet, getNotAssertionColumns(containerComposer), containerComposer.getDataSet().getRows());
assertRows(resultSet, getIgnoreAssertColumns(containerComposer), containerComposer.getDataSet().getRows());
}

private Collection<DataSetColumn> getExpectedColumns(final SingleE2EContainerComposer containerComposer) {
Expand All @@ -143,10 +143,10 @@ private Collection<DataSetColumn> getExpectedColumns(final SingleE2EContainerCom
return result;
}

private Collection<String> getNotAssertionColumns(final SingleE2EContainerComposer containerComposer) {
private Collection<String> getIgnoreAssertColumns(final SingleE2EContainerComposer containerComposer) {
Collection<String> result = new LinkedList<>();
for (DataSetMetaData each : containerComposer.getDataSet().getMetaDataList()) {
result.addAll(each.getColumns().stream().filter(column -> !column.isAssertion()).map(DataSetColumn::getName).collect(Collectors.toList()));
result.addAll(each.getColumns().stream().filter(DataSetColumn::isIgnoreAssertData).map(DataSetColumn::getName).collect(Collectors.toList()));
}
return result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ protected final void assertResultSet(final ResultSet actualResultSet, final Resu

protected final void assertResultSet(final SingleE2EContainerComposer containerComposer, final ResultSet resultSet) throws SQLException {
assertMetaData(resultSet.getMetaData(), getExpectedColumns(containerComposer));
assertRows(resultSet, getNotAssertionColumns(containerComposer), containerComposer.getDataSet().getRows());
assertRows(resultSet, getIgnoreAssertColumns(containerComposer), containerComposer.getDataSet().getRows());
}

private Collection<DataSetColumn> getExpectedColumns(final SingleE2EContainerComposer containerComposer) {
Expand All @@ -111,10 +111,10 @@ private Collection<DataSetColumn> getExpectedColumns(final SingleE2EContainerCom
return result;
}

private Collection<String> getNotAssertionColumns(final SingleE2EContainerComposer containerComposer) {
private Collection<String> getIgnoreAssertColumns(final SingleE2EContainerComposer containerComposer) {
Collection<String> result = new LinkedList<>();
for (DataSetMetaData each : containerComposer.getDataSet().getMetaDataList()) {
result.addAll(each.getColumns().stream().filter(column -> !column.isAssertion()).map(DataSetColumn::getName).collect(Collectors.toList()));
result.addAll(each.getColumns().stream().filter(DataSetColumn::isIgnoreAssertData).map(DataSetColumn::getName).collect(Collectors.toList()));
}
return result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

<dataset>
<metadata>
<column name="version" assertion="false" />
<column name="version" ignore-assert-data="true" />
</metadata>
<row values="" />
</dataset>
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@

<dataset>
<metadata>
<column name="id" assertion="false" />
<column name="id" ignore-assert-data="true" />
<column name="logic_database_name" />
<column name="logic_table_name" />
<column name="actual_database_name" />
<column name="actual_table_name" />
<column name="row_count" assertion="false" />
<column name="size" assertion="false" />
<column name="row_count" ignore-assert-data="true" />
<column name="size" ignore-assert-data="true" />
</metadata>
<row values=" | db | t_order | ds_0 | t_order | | " />
<row values=" | db | t_order | ds_1 | t_order | | " />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<column name="Name" />
<column name="Type" />
<column name="Owner" />
<column name="Storage" assertion="false" />
<column name="Storage" ignore-assert-data="true" />
</metadata>
<row values="public | t_country | table | mock user |" />
<row values="public | t_merchant | table | mock user |" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<column name="Name" />
<column name="Type" />
<column name="Owner" />
<column name="Storage" assertion="false" />
<column name="Storage" ignore-assert-data="true" />
</metadata>
<row values="public | t_order | table | mock user" />
<row values="public | t_order_item | table | mock user" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@

<dataset>
<metadata>
<column name="instance_id" assertion="false" />
<column name="host" assertion="false" />
<column name="instance_id" ignore-assert-data="true" />
<column name="host" ignore-assert-data="true" />
<column name="port" />
<column name="status" />
<column name="mode_type" />
<column name="worker_id" />
<column name="labels" />
<column name="version" assertion="false"/>
<column name="version" ignore-assert-data="true" />
</metadata>
<row values=" | | 3307| OK| Cluster| 0| |" />
</dataset>
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
<dataset>
<metadata>
<column name="type" />
<column name="repository" assertion="false" />
<column name="props" assertion="false"/>
<column name="repository" ignore-assert-data="true" />
<column name="props" ignore-assert-data="true" />
</metadata>
<row values="Cluster| | " />
</dataset>
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@

<dataset>
<metadata>
<column name="instance_id" assertion="false" />
<column name="instance_id" ignore-assert-data="true" />
<column name="instance_type" />
<column name="host" assertion="false" />
<column name="host" ignore-assert-data="true" />
<column name="port" />
<column name="status" />
<column name="mode_type" />
<column name="worker_id" />
<column name="labels" />
<column name="version" assertion="false"/>
<column name="version" ignore-assert-data="true" />
</metadata>
<row values=" | PROXY| | 3307| OK| Cluster| 0| |" />
</dataset>
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@

<dataset>
<metadata>
<column name="instance_id" assertion="false" />
<column name="host" assertion="false" />
<column name="instance_id" ignore-assert-data="true" />
<column name="host" ignore-assert-data="true" />
<column name="port" />
<column name="status" />
<column name="mode_type" />
<column name="worker_id" />
<column name="labels" />
<column name="version" assertion="false"/>
<column name="version" ignore-assert-data="true" />
</metadata>
<row values=" | | 3307| OK| Standalone| 1| |" />
</dataset>
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
<dataset>
<metadata>
<column name="type" />
<column name="repository" assertion="false" />
<column name="props" assertion="false"/>
<column name="repository" ignore-assert-data="true" />
<column name="props" ignore-assert-data="true" />
</metadata>
<row values="Standalone| | " />
</dataset>
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@

<dataset>
<metadata>
<column name="instance_id" assertion="false" />
<column name="instance_id" ignore-assert-data="true" />
<column name="instance_type" />
<column name="host" assertion="false" />
<column name="host" ignore-assert-data="true" />
<column name="port" />
<column name="status" />
<column name="mode_type" />
<column name="worker_id" />
<column name="labels" />
<column name="version" assertion="false"/>
<column name="version" ignore-assert-data="true" />
</metadata>
<row values=" | PROXY| | 3307| OK| Standalone| 1| |" />
</dataset>

0 comments on commit 7c5ca85

Please sign in to comment.