use of com.amazon.ion.IonSystem in project ion-java by amzn.
the class IonSystemBuilderTest method testFluidStyle.
// -------------------------------------------------------------------------
@Test
public void testFluidStyle() {
IonCatalog catalog = new SimpleCatalog();
IonSystem ion = IonSystemBuilder.standard().withCatalog(catalog).withStreamCopyOptimized(true).build();
assertSame(catalog, ion.getCatalog());
}
use of com.amazon.ion.IonSystem in project ion-java by amzn.
the class IonSystemBuilderTest method testCustomCatalog.
@Test
public void testCustomCatalog() {
IonCatalog catalog = new SimpleCatalog();
IonSystemBuilder b = IonSystemBuilder.standard().copy();
b.setCatalog(catalog);
assertSame(catalog, b.getCatalog());
IonSystem ion = b.build();
assertSame(catalog, ion.getCatalog());
}
use of com.amazon.ion.IonSystem in project ion-java by amzn.
the class IonSystemBuilderTest method testStreamCopyOptimized.
// -------------------------------------------------------------------------
@Test
public void testStreamCopyOptimized() {
IonSystemBuilder b = IonSystemBuilder.standard().copy();
b.setStreamCopyOptimized(true);
IonSystem ion = b.build();
assertTrue(isLiteSystem(ion));
ByteArrayOutputStream out = new ByteArrayOutputStream();
IonWriter w = ion.newBinaryWriter(out);
assertTrue(((_Private_IonWriter) w).isStreamCopyOptimized());
}
use of com.amazon.ion.IonSystem in project ion-java by amzn.
the class IonSystemBuilderTest method testNullCatalog.
@Test
public void testNullCatalog() {
IonSystemBuilder b = IonSystemBuilder.standard().copy();
b.setCatalog(null);
IonSystem ion = b.build();
assertSame(SimpleCatalog.class, ion.getCatalog().getClass());
}
Aggregations