-
Notifications
You must be signed in to change notification settings - Fork 116
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
Add new file tests to OdkWebserverServiceTest #270
base: development
Are you sure you want to change the base?
Add new file tests to OdkWebserverServiceTest #270
Conversation
@Test | ||
public void testServingLargeFile() { | ||
// Setup | ||
File directoryLocation = createTestDirectory(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace the File with URI
Instead of using "File" class use the URI style |
@permission-error let's chat about this PR during your meeting |
While your refactor of code improves the code, you still need to switch to the URI format in your private helper functions because when we remove the use legacy flag we are likely to see issues. Once file is created using URI interface it is fine to covert to file in your code. |
Pull Request Description:
This pull request introduces several changes to the
OdkWebserverServiceTest
class in theorg.opendatakit.webkitserver.service
package. Here's a summary of the changes:1. Added Permission Rules:
WRITE_EXTERNAL_STORAGE
andREAD_EXTERNAL_STORAGE
permissions to the test class.2. Updated Test Methods:
Updated test methods to create and serve various types of files and handle different scenarios, including serving HTML files, empty files, large files, files with special characters in their names, files with spaces in their names, files with Unicode characters in their content, files with invalid extensions, files with uppercase extensions, binary files, files with multiple dots in their names, files with no extension, and files with different extensions.
Added assertions to verify the responses from the web server for each test scenario.
3. Refactored Code:
4. Miscellaneous Changes:
Tags @wbrunette @Lamouresparus