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 a file parser for parsing from the local file system. #22

Merged
merged 2 commits into from
May 9, 2016

Conversation

jwir3
Copy link
Contributor

@jwir3 jwir3 commented May 6, 2016

When using Roboelectric (or other unit testing framework for Android that
does not set up a "real" Android environment), it's necessary to retrieve
files based on the local file system of the machine on which the tests are
run, rather than the virtual file system expected by the Android operating
system. This is due to the fact that, when running these types of tests,
most of the Android system is really just a set of mocks. As such, without
this file parser, the "assets", "res", and other system-level file system
paths are not set up and linked correctly, as the system calls that would
normally provide this information are mocked.

@jwir3
Copy link
Contributor Author

jwir3 commented May 6, 2016

@andrzejchm I now added a UTF-8 encoding specifier when parsing local files to eliminate the findbugs warning.

@jwir3 jwir3 force-pushed the local-file-parser branch 3 times, most recently from 395f852 to 55bb963 Compare May 6, 2016 18:45
@andrzejchm
Copy link
Owner

Tremendous bunch of work, I'll dig into that.

@@ -145,6 +144,23 @@ RESTMockServer.enableLogging(RESTMockLogger)
RESTMockServer.disableLogging()
```

## Unit Tests with Robolectric
If you want to write unit tests (no emulator or device necessary), you can use [http://robolectric.org](Robolectric)
Copy link
Owner

Choose a reason for hiding this comment

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

here it should be (Robolectric)[http://robolectric.org]

@jwir3
Copy link
Contributor Author

jwir3 commented May 8, 2016

@andrzejchm Sure, I'll make the requested documentation changes & rebase the PR.

jwir3 added 2 commits May 9, 2016 08:45
When using Roboelectric (or other unit testing framework for Android that
does not set up a "real" Android environment), it's necessary to retrieve
files based on the local file system of the machine on which the tests are
run, rather than the virtual file system expected by the Android operating
system. This is due to the fact that, when running these types of tests,
most of the Android system is really just a set of mocks. As such, without
this file parser, the "assets", "res", and other system-level file system
paths are not set up and linked correctly, as the system calls that would
normally provide this information are mocked.
@jwir3
Copy link
Contributor Author

jwir3 commented May 9, 2016

@andrzejchm I made the changes to the README you requested.

@andrzejchm andrzejchm merged commit 4a00607 into andrzejchm:develop May 9, 2016
@andrzejchm
Copy link
Owner

thanks! merged

@andrzejchm andrzejchm added this to the 0.0.6 milestone May 9, 2016
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.

None yet

2 participants