Search in sources :

Example 6 with ParserOptions

use of uk.co.real_logic.sbe.xml.ParserOptions in project simple-binary-encoding by real-logic.

the class RustGeneratorTest method generateIrForResource.

public static Ir generateIrForResource(final String localResourceName) {
    final ParserOptions options = ParserOptions.builder().stopOnError(true).build();
    final String xmlLocalResourceName = localResourceName.endsWith(".xml") ? localResourceName : localResourceName + ".xml";
    final MessageSchema schema;
    try {
        schema = parse(TestUtil.getLocalResource(xmlLocalResourceName), options);
    } catch (final Exception e) {
        throw new IllegalStateException(e);
    }
    final IrGenerator irg = new IrGenerator();
    return irg.generate(schema);
}
Also used : IrGenerator(uk.co.real_logic.sbe.xml.IrGenerator) ParserOptions(uk.co.real_logic.sbe.xml.ParserOptions) MessageSchema(uk.co.real_logic.sbe.xml.MessageSchema) CoreMatchers.containsString(org.hamcrest.CoreMatchers.containsString)

Aggregations

IrGenerator (uk.co.real_logic.sbe.xml.IrGenerator)6 MessageSchema (uk.co.real_logic.sbe.xml.MessageSchema)6 ParserOptions (uk.co.real_logic.sbe.xml.ParserOptions)6 Test (org.junit.Test)3 Ir (uk.co.real_logic.sbe.ir.Ir)3 Before (org.junit.Before)2 ByteBuffer (java.nio.ByteBuffer)1 StringWriterOutputManager (org.agrona.generation.StringWriterOutputManager)1 CoreMatchers.containsString (org.hamcrest.CoreMatchers.containsString)1 StringContains.containsString (org.hamcrest.core.StringContains.containsString)1 IrDecoder (uk.co.real_logic.sbe.ir.IrDecoder)1 IrEncoder (uk.co.real_logic.sbe.ir.IrEncoder)1