use of com.amazon.ion.SymbolTable in project ion-java by amzn.
the class SharedSymbolTableTest method testDomSharedSymbolTable.
@Test
public void testDomSharedSymbolTable() {
String[] symbols = { "hello" };
IonStruct struct = sharedSymtabStruct(system(), "foobar", 1, symbols);
final SymbolTable table = myMaker.newSharedSymtab(system(), struct);
checkSharedTable("foobar", 1, new String[] { "hello" }, table);
}
use of com.amazon.ion.SymbolTable in project ion-java by amzn.
the class SharedSymbolTableTest method testMalformedVersion.
public void testMalformedVersion(String versionValue) {
IonStruct s = sharedSymtabStruct(system(), "ST", 1, "x", "y");
putParsedValue(s, SystemSymbols.VERSION, versionValue);
SymbolTable st = myMaker.newSharedSymtab(system(), s);
checkSharedTable("ST", 1, new String[] { "x", "y" }, st);
}
use of com.amazon.ion.SymbolTable in project ion-java by amzn.
the class SharedSymbolTableTest method testFindSymbolToken.
// -------------------------------------------------------------------------
// find()
@Test
public void testFindSymbolToken() {
SymbolTable st = makeAbcTable();
SymbolToken tok = st.find(OTHER_A);
assertSame(A, tok.getText());
assertEquals(st.getImportedMaxId() + 1, tok.getSid());
tok = st.find("not there");
assertNull(tok);
}
use of com.amazon.ion.SymbolTable in project ion-java by amzn.
the class SymbolTableTest method testExtendingSharedSymbolTableWithHoles.
@Test
public void testExtendingSharedSymbolTableWithHoles() {
String serializedSymtab = "$ion_shared_symbol_table::{" + " name:\"Test\", version:3," + " symbols:[ \"one\", 2, \"three\", null, \"\" ]" + "}";
registerSharedSymtab(serializedSymtab);
Iterator<String> newSymbols = Arrays.asList("four", null, "five").iterator();
SymbolTable v4 = system().newSharedSymbolTable("Test", 4, newSymbols);
checkSharedTable("Test", 4, new String[] { "one", null, "three", null, null, "four", "five" }, v4);
}
use of com.amazon.ion.SymbolTable in project ion-java by amzn.
the class SymbolTableTest method testSystemSymtabAddSymbol.
@Test(expected = ReadOnlyValueException.class)
public void testSystemSymtabAddSymbol() {
SymbolTable st = system().getSystemSymbolTable();
st.intern("hello");
}
Aggregations