Search in sources :

Example 1 with MessageSchema

use of com.ociweb.pronghorn.pipe.MessageSchema in project PronghornPipes by oci-pronghorn.

the class TemplateProcessGeneratorTest method testGenerateLowLevelReaderCleanCompile.

@Test
public void testGenerateLowLevelReaderCleanCompile() {
    if ("arm".equals(System.getProperty("os.arch"))) {
        assertTrue(true);
    } else {
        try {
            FieldReferenceOffsetManager from = TemplateHandler.loadFrom("/template/smallExample.xml");
            MessageSchema schema = new MessageSchemaDynamic(from);
            String className = "LowLevelReader";
            StringBuilder target = new StringBuilder();
            TemplateProcessGeneratorLowLevelReader simple = new TemplateProcessGeneratorLowLevelReader(schema, target);
            simple.processSchema();
            // System.out.println(target);
            validateCleanCompile(className, target);
        } catch (ParserConfigurationException e) {
            e.printStackTrace();
            fail();
        } catch (SAXException e) {
            e.printStackTrace();
            fail();
        } catch (IOException e) {
            e.printStackTrace();
            fail();
        }
    }
}
Also used : MessageSchema(com.ociweb.pronghorn.pipe.MessageSchema) TemplateProcessGeneratorLowLevelReader(com.ociweb.pronghorn.pipe.util.build.TemplateProcessGeneratorLowLevelReader) MessageSchemaDynamic(com.ociweb.pronghorn.pipe.MessageSchemaDynamic) ParserConfigurationException(javax.xml.parsers.ParserConfigurationException) IOException(java.io.IOException) FieldReferenceOffsetManager(com.ociweb.pronghorn.pipe.FieldReferenceOffsetManager) SAXException(org.xml.sax.SAXException) Test(org.junit.Test)

Example 2 with MessageSchema

use of com.ociweb.pronghorn.pipe.MessageSchema in project PronghornPipes by oci-pronghorn.

the class TemplateProcessGeneratorTest method testGenerateLowLevelWriterCleanCompile.

@Test
public void testGenerateLowLevelWriterCleanCompile() {
    if ("arm".equals(System.getProperty("os.arch"))) {
        assertTrue(true);
    } else {
        try {
            FieldReferenceOffsetManager from = TemplateHandler.loadFrom("/template/smallExample.xml");
            MessageSchema schema = new MessageSchemaDynamic(from);
            String className = "LowLevelWriter";
            StringBuilder target = new StringBuilder();
            TemplateProcessGeneratorLowLevelWriter simple = new TemplateProcessGeneratorLowLevelWriter(schema, target, true, "com.ociweb.pronghorn.pipe.build");
            simple.processSchema();
            // System.out.println(target);
            validateCleanCompile(className, target);
        } catch (ParserConfigurationException e) {
            e.printStackTrace();
            fail();
        } catch (SAXException e) {
            e.printStackTrace();
            fail();
        } catch (IOException e) {
            e.printStackTrace();
            fail();
        }
    }
}
Also used : MessageSchema(com.ociweb.pronghorn.pipe.MessageSchema) TemplateProcessGeneratorLowLevelWriter(com.ociweb.pronghorn.pipe.util.build.TemplateProcessGeneratorLowLevelWriter) MessageSchemaDynamic(com.ociweb.pronghorn.pipe.MessageSchemaDynamic) ParserConfigurationException(javax.xml.parsers.ParserConfigurationException) IOException(java.io.IOException) FieldReferenceOffsetManager(com.ociweb.pronghorn.pipe.FieldReferenceOffsetManager) SAXException(org.xml.sax.SAXException) Test(org.junit.Test)

Aggregations

FieldReferenceOffsetManager (com.ociweb.pronghorn.pipe.FieldReferenceOffsetManager)2 MessageSchema (com.ociweb.pronghorn.pipe.MessageSchema)2 MessageSchemaDynamic (com.ociweb.pronghorn.pipe.MessageSchemaDynamic)2 IOException (java.io.IOException)2 ParserConfigurationException (javax.xml.parsers.ParserConfigurationException)2 Test (org.junit.Test)2 SAXException (org.xml.sax.SAXException)2 TemplateProcessGeneratorLowLevelReader (com.ociweb.pronghorn.pipe.util.build.TemplateProcessGeneratorLowLevelReader)1 TemplateProcessGeneratorLowLevelWriter (com.ociweb.pronghorn.pipe.util.build.TemplateProcessGeneratorLowLevelWriter)1