public static FieldReferenceOffsetManager loadFrom(String source) throws ParserConfigurationException, SAXException, IOException { return loadFrom(source,(short)0); }
public static FieldReferenceOffsetManager loadFrom(String source) throws ParserConfigurationException, SAXException, IOException { return loadFrom(source,(short)0); }
public static FieldReferenceOffsetManager loadFrom(String source) throws ParserConfigurationException, SAXException, IOException { return loadFrom(source,(short)0); }
public static FieldReferenceOffsetManager buildFROM(String source) { try { return TemplateHandler.loadFrom(source); } catch (Exception e) { throw new RuntimeException(e); } }
private static boolean testForMatchingFROMs(String templateFile, FieldReferenceOffsetManager encodedFrom, Appendable target) throws ParserConfigurationException, SAXException, IOException { boolean result = true; FieldReferenceOffsetManager expectedFrom = TemplateHandler.loadFrom(templateFile); if (null==expectedFrom) { logger.error("Unable to find: "+templateFile); result = false; } else if (null==encodedFrom || !expectedFrom.equals(encodedFrom)) { logger.error("Encoded source:"+expectedFrom); if (null!=encodedFrom) { logger.error("Template file:"+encodedFrom); } logger.error("//replacement source"); String nameOfFROM = templateFile.substring(1+templateFile.lastIndexOf('/') ); FieldReferenceOffsetManager.buildFROMConstructionSource(target, expectedFrom, "FROM", nameOfFROM); result = false; } return result; }
private static boolean testForMatchingFROMs(String templateFile, FieldReferenceOffsetManager encodedFrom, Appendable target) throws ParserConfigurationException, SAXException, IOException { boolean result = true; FieldReferenceOffsetManager expectedFrom = TemplateHandler.loadFrom(templateFile); if (null==expectedFrom) { logger.error("Unable to find: "+templateFile); result = false; } else if (null==encodedFrom || !expectedFrom.equals(encodedFrom)) { logger.error("Encoded source:"+expectedFrom); if (null!=encodedFrom) { logger.error("Template file:"+encodedFrom); } logger.error("//replacement source"); String nameOfFROM = templateFile.substring(1+templateFile.lastIndexOf('/') ); FieldReferenceOffsetManager.buildFROMConstructionSource(target, expectedFrom, "FROM", nameOfFROM); result = false; } return result; }
private static boolean testForMatchingFROMs(String templateFile, FieldReferenceOffsetManager encodedFrom, Appendable target) throws ParserConfigurationException, SAXException, IOException { boolean result = true; FieldReferenceOffsetManager expectedFrom = TemplateHandler.loadFrom(templateFile); if (null==expectedFrom) { logger.error("Unable to find: "+templateFile); result = false; } else if (null==encodedFrom || !expectedFrom.equals(encodedFrom)) { logger.error("Encoded source:"+expectedFrom); if (null!=encodedFrom) { logger.error("Template file:"+encodedFrom); } logger.error("//replacement source"); String nameOfFROM = templateFile.substring(1+templateFile.lastIndexOf('/') ); FieldReferenceOffsetManager.buildFROMConstructionSource(target, expectedFrom, "FROM", nameOfFROM); result = false; } return result; }
public static FieldReferenceOffsetManager buildFROM() { try { return TemplateHandler.loadFrom("/template/smallExample.xml"); } catch (ParserConfigurationException e) { e.printStackTrace(); } catch (SAXException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } return null; }
expectedFrom = TemplateHandler.loadFrom(templateFile); } catch (Exception e2) { e2.printStackTrace();
expectedFrom = TemplateHandler.loadFrom(templateFile); } catch (Exception e2) { e2.printStackTrace();
expectedFrom = TemplateHandler.loadFrom(templateFile); } catch (Exception e2) { e2.printStackTrace();
private MessageSchemaDynamic sequenceExampleSchema() { try { MessageSchemaDynamic schema; schema = new MessageSchemaDynamic(TemplateHandler.loadFrom("/template/sequenceExample.xml")); return schema; } catch (ParserConfigurationException e) { e.printStackTrace(); fail(); } catch (SAXException e) { e.printStackTrace(); fail(); } catch (IOException e) { e.printStackTrace(); fail(); } return null; }
@Test public void compileTest() throws Exception { FieldReferenceOffsetManager from = TemplateHandler.loadFrom("src/test/resources/template/integrityTest.xml"); MessageSchemaDynamic messageSchema = new MessageSchemaDynamic(from); StringBuilder target = new StringBuilder(); PhastDecoderStageGenerator ew = new PhastDecoderStageGenerator(messageSchema, target, false); try { ew.processSchema(); } catch (IOException e) { System.out.println(target); e.printStackTrace(); fail(); } validateCleanCompile(ew.getPackageName(), ew.getClassName(), target, PhastDecoderStageGenerator.class); StringBuilder target2 = new StringBuilder(); PhastEncoderStageGenerator encoder = new PhastEncoderStageGenerator(messageSchema, target2); try { encoder.processSchema(); } catch (IOException e) { System.out.println(target); e.printStackTrace(); fail(); } validateCleanCompile(encoder.getPackageName(), encoder.getClassName(), target2, PhastEncoderStageGenerator.class); }
GraphManager gm = new GraphManager(); FieldReferenceOffsetManager from = TemplateHandler.loadFrom("src/test/resources/template/integrityTest.xml"); MessageSchemaDynamic messageSchema = new MessageSchemaDynamic(from); Pipe<MessageSchemaDynamic> inPipe = new Pipe<MessageSchemaDynamic>(new PipeConfig<MessageSchemaDynamic>(messageSchema));