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

Add new file tests to OdkWebserverServiceTest #270

Open
wants to merge 6 commits into
base: development
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,8 @@ private void assertResponseForDifferentExtension(File fileLocation) {
}

private File createTestFile(File directoryLocation, String fileName, String content) {
permission-error marked this conversation as resolved.
Show resolved Hide resolved
File fileLocation = new File(directoryLocation, fileName);
Uri fileUri = Uri.withAppendedPath(Uri.fromFile(directoryLocation), fileName);
File fileLocation = new File(fileUri.getPath());
permission-error marked this conversation as resolved.
Show resolved Hide resolved

try (PrintWriter writer = new PrintWriter(fileLocation, "UTF-8")) {
writer.println(content);
Expand All @@ -732,7 +733,8 @@ private static String generateLargeFileContent() {
}

private File createBinaryFile(File directoryLocation, String fileName) {
File binaryFileLocation = new File(directoryLocation, fileName);
Uri fileUri = Uri.parse(directoryLocation.toURI() + fileName);
File binaryFileLocation = new File(fileUri.getPath());

try {
// Create a binary file with random content
Expand Down