Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Odkxfileuriutils test #314

Open
wants to merge 2 commits into
base: upgrade-jdk11
Choose a base branch
from

Conversation

sonalgaud12
Copy link

@sonalgaud12 sonalgaud12 commented Mar 16, 2025

This PR addresses issue odk-x/tool-suite-X#507
by adding tests for the ODKXFileUriUtils class which comes under utilities

Added Tests

  • testODKXRemainingPath_ExactMatch: Tests that when a URI exactly matches the app path
  • testPathSegmentCounting: Verifies that each level of the URI hierarchy (base, app, config, assets, csv) adds exactly one path segment.
  • testUriRelationships: Confirms that each level of URI is properly built on top of the previous level by checking that each path starts with its parent path.
  • testAppNameConsistency: Ensures that the app name is consistently used in the second path segment across all generated URIs.
  • testODKXRemainingPath_WithSpaces: Tests the handling of paths that contain spaces
  • testODKXRemainingPath_WithSpecialCharacters: Verifies that paths containing special characters like @, :, [, ], !, $, and & are handled correctly by the ODKXRemainingPath() method, confirming proper URI encoding/decoding behavior.

Result
image

@sonalgaud12 sonalgaud12 changed the title Added Odkxfileuriutils unit test Added Odkxfileuriutils test Mar 18, 2025
Copy link
Member

@wbrunette wbrunette left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

most strings such as "config" or other strings should be made a constant at top of file to make easy for later updates

@sonalgaud12 sonalgaud12 requested a review from wbrunette March 26, 2025 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants