Repository navigation
Commit 72e7f29
committed
Add comprehensive unit tests for Component methods
This commit adds extensive unit test coverage for previously untested
Component methods. Tests are designed to trigger methods through their
natural execution paths and public APIs rather than attempting to invoke
private methods directly.
Coverage includes:
- Shadow rendering (paintShadows with elevation, shadow calculations)
- Drag and drop operations (dragFinished, drop events, listeners)
- Pull-to-refresh functionality (triggered through paint cycle)
- Scroll and motion (scrollable components, tensile drag, listeners)
- Style processing (inline styles trigger internal string methods)
- Focus and events (focus loss, action events, state changes)
- Input handling (keyboard and pointer events, pinch gestures)
- Property binding (BindTarget implementation, property access)
- Utility methods (toString, paramString, hierarchy checks, editing)
- Component rendering and lifecycle methods
Tests follow existing patterns:
- Extend UITestBase for proper test environment
- Override protected methods (dragFinished, paramString, paintBorderBackground)
- Trigger private methods through public API calls and lifecycle
- No reflection or direct access to package-private methods
- No Mockito - uses TestCodenameOneImplementation where needed
- Java 8 syntax only
Total: 70+ test methods covering the previously untested methods.1 parent dad8862 commit 72e7f29
1 file changed
Lines changed: 921 additions & 0 deletions
0 commit comments