Android JUnit With Varying Network Conditions
inna last edited by user
I have written a suite of tests for our company's Android app using Android JUnit and Robotium.
I have written a Utility that can enable and disable networking for a device.
My Question is: "Is there an easy way to run a JUnit Test with parameters?".
I would like to be able to run these test under normal network conditions, and then again when the network cuts out mid test, but I do not want to be copying and pasting tests
I recommend that you create a custom wrapper for your tests. Put this as a call for your test initialization so that it will fire on all your tests, but the code for managing it will all be in a single place. Read from a property or config file the parameter to indicate "normal" and "cut out".
I'm assuming that your "mid test" has a timer or something to manage this? There could be some trickiness and possible threading that is necessary depending on what is managing this...please provide more info on this part if this doesn't answer the full question.