use of com.amazon.ion.UnknownSymbolException in project ion-java by amzn.
the class IonAssert method checkSymbol.
/**
* @param expectedText null means absent
*/
public static void checkSymbol(IonReader in, String expectedText, int expectedSid) {
assertSame(IonType.SYMBOL, in.getType());
assertFalse(in.isNullValue());
if (expectedText == null) {
try {
in.stringValue();
fail("Expected " + UnknownSymbolException.class);
} catch (UnknownSymbolException e) {
assertEquals(expectedSid, e.getSid());
}
} else {
assertEquals("IonReader.stringValue()", expectedText, in.stringValue());
}
SymbolToken sym = in.symbolValue();
IonTestCase.checkSymbol(expectedText, expectedSid, sym);
}
Aggregations