I wrote an instance of the OCUnit unit test, which relies on an external web service to complete. I know this is inconsistent in itself, but I definitely want the web service to be included in the tests (it still works on the internal server).
NSURLConnection does not seem to start at startup as part of SenTestCase. The connection is not started by the line:
NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:urlRequest delegate:self startImmediately:YES];
None of the delegate methods are called. Almost identical code works fine outside of OCUnit.
What is the OCUnit runtime that prevents it from starting?
It is not that the test completes before the request returns: I have NSCondition locks to handle the asynchronous nature of the request. I also tried removing them and just unscrewing the execution loop. The test continues, but NSURLConnection never starts.
I would prefer not to transfer my testing to another unit testing system, if possible.
source share