// =========================================================================
// H E L P E R M E T H O D S
// =========================================================================
public void helpTestParsable(final String str, final String expectedProtocol, boolean shouldSucceed ) {
ParsedObjectID p = null;
try {
if ( expectedProtocol == null ) {
p = ParsedObjectID.parsedStringifiedObjectID(str);
} else {
p = ParsedObjectID.parsedStringifiedObjectID(str,expectedProtocol);
}
if ( !shouldSucceed ) {
fail("Unexpectedly succeeded in parsing string " + str); //$NON-NLS-1$
}
} catch (InvalidIDException e) {
if ( shouldSucceed ) {
throw new RuntimeException(e);
}
}
// If shouldSucceed, then test for expected protocol ...
if ( shouldSucceed && expectedProtocol != null ) {
if ( !p.getProtocol().equals(expectedProtocol)) {
fail("Result of getProtocol() on parsed string didn't match expected protocol " + expectedProtocol); //$NON-NLS-1$
}
}
}