Commit fb93d50
Add more test cases on DataNodeUtilsTest (#36943)
* Try to use mvnd for SQL E2E GitHub action
* Try to use mvnd for SQL E2E GitHub action
* Add comprehensive test cases for DataNodeUtils.getFormattedDataNodes method
- Add 10 new test cases to achieve 100% code coverage
- Test normal cases, cycling behavior, edge cases, and exception scenarios
- Cover all code branches including iterator reset logic
- Ensure clean test code with no duplication
- Verify exact string formatting and ordering behavior
Test cases added:
- assertGetFormattedDataNodes: Basic functionality with amount < dataSources
- assertGetFormatSingleDataNode: Single data source cycling behavior
- assertGetFormattedDataNodesWithCycling: Iterator reset when amount > dataSources
- assertGetFormattedDataNodesWithZeroAmount: Edge case with zero amount
- assertGetFormattedDataNodesWithAmountEqualToDataSourcesSize: Exact match scenario
- assertGetFormattedDataNodesWithSpecialCharactersInLogicTable: Special character handling
- assertGetFormattedDataNodesWithLargeAmount: Performance testing with large datasets
- assertGetFormattedDataNodesWithEmptyDataSources: Exception handling for empty collections
- assertGetFormattedDataNodesWithSingleAmountAndMultipleDataSources: Minimal amount scenario
- assertGetFormattedDataNodesIteratorResetBehavior: Complex iterator reset verification
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
* Add more test cases on DataNodeUtilsTest
* Add more test cases on DataNodeUtilsTest
---------
Co-authored-by: Claude <[email protected]>1 parent 38c1d7f commit fb93d50
File tree
5 files changed
+93
-10
lines changed- features/sharding
- core/src/main/java/org/apache/shardingsphere/sharding/rule
- distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/converter
- infra/common/src
- main/java/org/apache/shardingsphere/infra/datanode
- test/java/org/apache/shardingsphere/infra/datanode
5 files changed
+93
-10
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
158 | | - | |
| 158 | + | |
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
251 | 251 | | |
252 | 252 | | |
253 | 253 | | |
254 | | - | |
| 254 | + | |
255 | 255 | | |
256 | 256 | | |
257 | 257 | | |
| |||
Lines changed: 0 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
62 | 61 | | |
63 | | - | |
64 | | - | |
65 | 62 | | |
66 | | - | |
67 | | - | |
68 | 63 | | |
69 | 64 | | |
70 | 65 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
| 70 | + | |
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
| 75 | + | |
76 | 76 | | |
77 | | - | |
| 77 | + | |
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| |||
Lines changed: 88 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
64 | 152 | | |
0 commit comments