Search in sources :

Example 11 with SymbolTable

use of com.amazon.ion.SymbolTable in project ion-java by amzn.

the class OutputStreamWriterTestCase method testFlushingLockedSymtabWithImports.

@Test
public void testFlushingLockedSymtabWithImports() throws Exception {
    SymbolTable fred1 = Symtabs.register("fred", 1, catalog());
    iw = makeWriter(fred1);
    testFlushing();
}
Also used : SymbolTable(com.amazon.ion.SymbolTable) Test(org.junit.Test)

Example 12 with SymbolTable

use of com.amazon.ion.SymbolTable in project ion-java by amzn.

the class SharedSymbolTableTest method testMalformedSymbolEntry.

public void testMalformedSymbolEntry(String symbolValue) {
    IonStruct s = sharedSymtabStruct(system(), "ST", 5);
    IonValue entry = system().singleValue(symbolValue);
    s.put(SystemSymbols.SYMBOLS).newList(entry);
    SymbolTable st = myMaker.newSharedSymtab(system(), s);
    checkSharedTable("ST", 5, new String[] { null }, st);
    assertEquals(1, st.getMaxId());
    checkUnknownSymbol(1, st);
}
Also used : IonValue(com.amazon.ion.IonValue) IonStruct(com.amazon.ion.IonStruct) SymbolTable(com.amazon.ion.SymbolTable)

Example 13 with SymbolTable

use of com.amazon.ion.SymbolTable in project ion-java by amzn.

the class SharedSymbolTableTest method testMalformedSymbols.

public void testMalformedSymbols(String symbolValue) {
    IonStruct s = sharedSymtabStruct(system(), "ST", 5);
    putParsedValue(s, SystemSymbols.SYMBOLS, symbolValue);
    SymbolTable st = myMaker.newSharedSymtab(system(), s);
    checkSharedTable("ST", 5, EMPTY_STRING_ARRAY, st);
}
Also used : IonStruct(com.amazon.ion.IonStruct) SymbolTable(com.amazon.ion.SymbolTable)

Example 14 with SymbolTable

use of com.amazon.ion.SymbolTable in project ion-java by amzn.

the class SharedSymbolTableTest method testBasicSharedSymtabCreation.

// -------------------------------------------------------------------------
@Test
public void testBasicSharedSymtabCreation() {
    String[] syms = { "a", "b", "c" };
    SymbolTable st = myMaker.newSharedSymtab(system(), "ST", 1, syms);
    checkSharedTable("ST", 1, syms, st);
}
Also used : SymbolTable(com.amazon.ion.SymbolTable) Test(org.junit.Test)

Example 15 with SymbolTable

use of com.amazon.ion.SymbolTable in project ion-java by amzn.

the class SharedSymbolTableTest method testInternNull.

@Test(expected = NullPointerException.class)
public void testInternNull() {
    SymbolTable st = makeAbcTable();
    st.intern(null);
}
Also used : SymbolTable(com.amazon.ion.SymbolTable) Test(org.junit.Test)

Aggregations

SymbolTable (com.amazon.ion.SymbolTable)177 Test (org.junit.Test)105 IonValue (com.amazon.ion.IonValue)21 IonDatagram (com.amazon.ion.IonDatagram)18 com.amazon.ion.impl._Private_Utils.copyLocalSymbolTable (com.amazon.ion.impl._Private_Utils.copyLocalSymbolTable)17 SymbolToken (com.amazon.ion.SymbolToken)14 IonStruct (com.amazon.ion.IonStruct)13 ByteArrayOutputStream (java.io.ByteArrayOutputStream)13 IonWriter (com.amazon.ion.IonWriter)12 SimpleCatalog (com.amazon.ion.system.SimpleCatalog)12 IonReader (com.amazon.ion.IonReader)11 IonSystem (com.amazon.ion.IonSystem)10 IOException (java.io.IOException)9 IonType (com.amazon.ion.IonType)8 ArrayList (java.util.ArrayList)7 IonException (com.amazon.ion.IonException)6 com.amazon.ion.impl._Private_IonBinaryWriterBuilder (com.amazon.ion.impl._Private_IonBinaryWriterBuilder)6 com.amazon.ion.impl.bin._Private_IonRawWriter (com.amazon.ion.impl.bin._Private_IonRawWriter)6 IonCatalog (com.amazon.ion.IonCatalog)5 IonList (com.amazon.ion.IonList)5