Tests-wise, there's currently no way to debug outgoing GenericRequests.
Any method that ends with / has logic that centers around a call to RequestThread.postRequest is therefore pretty much un-testable.
So, I was wondering if there would be any demand for something which would try to help with exactly that.
Basically, I'm thinking of adding conditionals at various points, like at the start of GenericRequest.run(), at the start of GenericRequest.execute() and before entering GenericRequest.externalExecute().
If a RequestInterrupter was enabled, these conditionals could allow things like stopping the request in order to simply examine it (enabling tests like "this method should make a request to fight.php"), or to bypass GenericRequest.externalExecute(), while injecting it with a responseText manually.
Of course, even though this is only meant for tests, the nature of GenericRequest means that it would require applying modifications to src/ ...
Ideas/thoughts?
Any method that ends with / has logic that centers around a call to RequestThread.postRequest is therefore pretty much un-testable.
So, I was wondering if there would be any demand for something which would try to help with exactly that.
Basically, I'm thinking of adding conditionals at various points, like at the start of GenericRequest.run(), at the start of GenericRequest.execute() and before entering GenericRequest.externalExecute().
If a RequestInterrupter was enabled, these conditionals could allow things like stopping the request in order to simply examine it (enabling tests like "this method should make a request to fight.php"), or to bypass GenericRequest.externalExecute(), while injecting it with a responseText manually.
Of course, even though this is only meant for tests, the nature of GenericRequest means that it would require applying modifications to src/ ...
Ideas/thoughts?