Commit e04adf0
authored
Improve unit test coverage for core classes (#4259)
* Improve unit test coverage for core classes
Added comprehensive unit tests for `SQLMap`, `SideMenuBar` (CommandWrapper, ShowWaiter), `WebServiceProxyCall`, `NetworkManager` (async logic), `Address`, `GroupLayout` (PaddingSpring), `Socket` (listen/connect callbacks), `ApplePromotionalOffer`, and `ColorUtil`.
Updated `TestCodenameOneImplementation` to support simulated `listenSocket` functionality for testing `Socket` listeners.
Ensured existing tests in `SideMenuBarTest` and `SQLMapTest` are preserved by appending new tests.
* Improve unit test coverage for core classes
Added unit tests for `SQLMap`, `SideMenuBar`, `WebServiceProxyCall`, `NetworkManager` (async logic), `Address`, `GroupLayout` (PaddingSpring), `Socket` (listen/connect callbacks), `ApplePromotionalOffer`, and `ColorUtil`.
Updated `TestCodenameOneImplementation` to support simulated `listenSocket` functionality for testing `Socket` listeners.
Fixed compilation errors in `NetworkManagerTest` (AsyncResource method names), `SideMenuBarTest` (Display.setCurrent signature), and `SocketTest` (TestSocket visibility).
* Improve unit test coverage for core classes
Added unit tests for `SQLMap`, `SideMenuBar`, `WebServiceProxyCall`, `NetworkManager` (async logic), `Address`, `GroupLayout` (PaddingSpring), `Socket` (listen/connect callbacks), `ApplePromotionalOffer`, and `ColorUtil`.
Updated `TestCodenameOneImplementation` to support simulated `listenSocket` functionality for testing `Socket` listeners.
Fixed regressions in `NetworkManagerTest` due to improper `Display` initialization and corrected `SideMenuBarTest` execution flow.
* Improve unit test coverage for core classes
Added comprehensive unit tests for `SQLMap`, `SideMenuBar`, `WebServiceProxyCall`, `NetworkManager`, `Address`, `GroupLayout`, `Socket`, `ApplePromotionalOffer`, and `ColorUtil`.
Updated `TestCodenameOneImplementation` to support simulated `listenSocket` functionality for testing `Socket` listeners.
Resolved regressions in `NetworkManagerTest` (Display initialization) and `SideMenuBarTest` (UI state setup) and fixed compilation errors.
* Improve unit test coverage for core classes
Added unit tests for `SQLMap`, `SideMenuBar`, `WebServiceProxyCall`, `NetworkManager` (async logic), `Address`, `GroupLayout` (PaddingSpring), `Socket` (listen/connect callbacks), `ApplePromotionalOffer`, and `ColorUtil`.
Updated `TestCodenameOneImplementation` to support simulated `listenSocket` functionality for testing `Socket` listeners.
Resolved regressions in `NetworkManagerTest` (Display initialization) and `SideMenuBarTest` (UI state setup) and fixed compilation errors.
Fixed concurrency issues in `NetworkManagerTest` and `WebServiceProxyCallTest` by correctly using `waitFor` helpers instead of blocking the EDT.
Disabled side menu shadow in `SideMenuBarTest` to prevent resource loading failures.
* Improve unit test coverage for core classes
Added unit tests for `SQLMap`, `SideMenuBar`, `WebServiceProxyCall`, `NetworkManager` (async logic), `Address`, `GroupLayout` (PaddingSpring), `Socket` (listen/connect callbacks), `ApplePromotionalOffer`, and `ColorUtil`.
Updated `TestCodenameOneImplementation` to support simulated `listenSocket` functionality for testing `Socket` listeners.
Resolved regressions in `NetworkManagerTest` (Display initialization) and `SideMenuBarTest` (UI state setup) and fixed compilation errors.
Fixed concurrency issues in `NetworkManagerTest` and `WebServiceProxyCallTest` by correctly using `waitFor` helpers instead of blocking the EDT.
Disabled side menu shadow in `SideMenuBarTest` and provided dummy shadow image to prevent resource loading failures.
* Improve unit test coverage for core classes
Added comprehensive unit tests for `SQLMap`, `SideMenuBar`, `WebServiceProxyCall`, `NetworkManager`, `Address`, `GroupLayout`, `Socket`, `ApplePromotionalOffer`, and `ColorUtil`.
Updated `TestCodenameOneImplementation` to support simulated `listenSocket` functionality for testing `Socket` listeners.
Fixed regressions in `NetworkManagerTest` (Display initialization) and `SideMenuBarTest` (UI state setup) and fixed compilation errors.
Fixed concurrency issues in `NetworkManagerTest` and `WebServiceProxyCallTest` by correctly using `waitFor` helpers instead of blocking the EDT.
Fixed resource loading failure in `SideMenuBarTest` by properly configuring theme properties.
* Improve unit test coverage for core classes
Added unit tests for `SQLMap`, `SideMenuBar`, `WebServiceProxyCall`, `NetworkManager` (async logic), `Address`, `GroupLayout` (PaddingSpring), `Socket` (listen/connect callbacks), `ApplePromotionalOffer`, and `ColorUtil`.
Updated `TestCodenameOneImplementation` to support simulated `listenSocket` functionality for testing `Socket` listeners.
Resolved regressions in `NetworkManagerTest` (Display initialization) and `SideMenuBarTest` (UI state setup) and fixed compilation errors.
Fixed concurrency issues in `NetworkManagerTest` and `WebServiceProxyCallTest` by correctly using `waitFor` helpers instead of blocking the EDT.
Disabled side menu shadow in `SideMenuBarTest` and provided dummy shadow image to prevent resource loading failures.
Injected dummy `pointerDragged` listener in `SideMenuBarTest` to prevent NPE due to potential bug in `SideMenuBar` handling of optional theme constants.
* Improve unit test coverage for core classes
Added unit tests for `SQLMap`, `SideMenuBar`, `WebServiceProxyCall`, `NetworkManager` (async logic), `Address`, `GroupLayout` (PaddingSpring), `Socket` (listen/connect callbacks), `ApplePromotionalOffer`, and `ColorUtil`.
Updated `TestCodenameOneImplementation` to support simulated `listenSocket` functionality for testing `Socket` listeners.
Resolved regressions in `NetworkManagerTest` (Display initialization) and `SideMenuBarTest` (UI state setup) and fixed compilation errors.
Fixed concurrency issues in `NetworkManagerTest` and `WebServiceProxyCallTest` by correctly using `waitFor` helpers instead of blocking the EDT.
Disabled side menu shadow in `SideMenuBarTest` and provided dummy shadow image to prevent resource loading failures.
Injected dummy `pointerDragged` listener in `SideMenuBarTest` to prevent NPE due to potential bug in `SideMenuBar` handling of optional theme constants.
* Improve unit test coverage for core classes
Added unit tests for `SQLMap`, `SideMenuBar`, `WebServiceProxyCall`, `NetworkManager` (async logic), `Address`, `GroupLayout` (PaddingSpring), `Socket` (listen/connect callbacks), `ApplePromotionalOffer`, and `ColorUtil`.
Updated `TestCodenameOneImplementation` to support simulated `listenSocket` functionality for testing `Socket` listeners.
Resolved regressions in `NetworkManagerTest` (Display initialization) and `SideMenuBarTest` (UI state setup, NPEs) and fixed compilation errors.
Fixed concurrency issues in `NetworkManagerTest` and `WebServiceProxyCallTest` by correctly using `waitFor` helpers instead of blocking the EDT.
Fixed `SideMenuBarTest` NPE by ensuring proper initialization of Toolbars on parent and menu forms, and setting theme constants for listener registration.
---------
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>1 parent 3b3619f commit e04adf0
File tree
10 files changed
+490
-7
lines changed- maven/core-unittests/src/test/java/com/codename1
- charts/util
- contacts
- io
- payment
- properties
- testing
- ui
- layouts
10 files changed
+490
-7
lines changedLines changed: 52 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
4 | 7 | | |
5 | 8 | | |
6 | 9 | | |
| |||
29 | 32 | | |
30 | 33 | | |
31 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
32 | 84 | | |
Lines changed: 28 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
Lines changed: 77 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
10 | 13 | | |
11 | 14 | | |
12 | 15 | | |
13 | 16 | | |
14 | 17 | | |
| 18 | + | |
| 19 | + | |
15 | 20 | | |
| 21 | + | |
16 | 22 | | |
17 | 23 | | |
18 | 24 | | |
19 | 25 | | |
20 | 26 | | |
21 | | - | |
| 27 | + | |
| 28 | + | |
22 | 29 | | |
23 | | - | |
24 | 30 | | |
25 | 31 | | |
26 | 32 | | |
| 33 | + | |
27 | 34 | | |
28 | | - | |
29 | | - | |
30 | 35 | | |
31 | 36 | | |
32 | 37 | | |
33 | 38 | | |
34 | 39 | | |
35 | 40 | | |
36 | 41 | | |
37 | | - | |
38 | 42 | | |
| 43 | + | |
| 44 | + | |
39 | 45 | | |
40 | 46 | | |
41 | 47 | | |
| |||
165 | 171 | | |
166 | 172 | | |
167 | 173 | | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
168 | 240 | | |
169 | 241 | | |
170 | 242 | | |
| |||
Lines changed: 35 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
173 | 208 | | |
0 commit comments