am 77d823cf: am 739152d2: am 8670b1c2: ListeningPortsTest: Make error message more useful.

* commit '77d823cf78174f7c9d373303b4aa821ba1d24b44':
  ListeningPortsTest: Make error message more useful.
This commit is contained in:
Nick Kralevich
2011-10-05 10:54:09 -07:00
committed by Android Git Automerger

View File

@@ -118,13 +118,18 @@ public class ListeningPortsTest extends TestCase {
String localAddress = fields[1];
String state = fields[3];
String uid = fields[7];
assertTrue(procFilePath + " should have an IP address in the second column",
isAddress(localAddress));
String localIp = localAddress.split(":")[0];
int localPort = Integer.parseInt(localAddress.split(":")[1], 16);
if (!isException(localAddress) && isPortListening(state, isTcp)) {
throw new ListeningPortsAssertionError(
"Found port listening on " + localAddress + " in " + procFilePath);
"Found port listening on addr=" + localIp + ", port="
+ localPort + ", UID=" + uid + " in " + procFilePath);
}
}
} catch (FileNotFoundException notFound) {