Examples of SwitchYardModel


Examples of org.switchyard.config.model.switchyard.SwitchYardModel

    }

    @Test
    public void testWrite() throws Exception {
        String old_xml = new StringPuller().pull(XML, getClass());
        SwitchYardModel switchyard = _puller.pull(new StringReader(old_xml));
        String new_xml = switchyard.toString();
        XMLUnit.setIgnoreWhitespace(true);
        Diff diff = XMLUnit.compareXML(old_xml, new_xml);
        Assert.assertTrue(diff.toString(), diff.identical());
    }
View Full Code Here

Examples of org.switchyard.config.model.switchyard.SwitchYardModel

        Assert.assertEquals("A", marshalingTransformer.getTo().toString());
    }
   
    @Test
    public void test_configReadContextPath() throws IOException {
        SwitchYardModel config = new ModelPuller<SwitchYardModel>().pull("org/switchyard/transform/jaxb/internal/switchyard-config-03.xml", JAXBTransformerTest.class);
        for (TransformModel tm : config.getTransforms().getTransforms()) {
            Assert.assertTrue(tm instanceof JAXBTransformModel);
            Assert.assertEquals("org.switchyard.transform.jaxb.internal", ((JAXBTransformModel)tm).getContextPath());
        }
    }
View Full Code Here

Examples of org.switchyard.config.model.switchyard.SwitchYardModel

        Assert.assertTrue(diff.toString(), diff.identical());
    }

    @Test
    public void testParenthood() throws Exception {
        SwitchYardModel switchyard_1 = _puller.pull(XML, getClass());
        TransformsModel transforms_1 = switchyard_1.getTransforms();
        TransformModel transform = transforms_1.getTransforms().get(0);
        TransformsModel transforms_2 = transform.getTransforms();
        SwitchYardModel switchyard_2 = transforms_2.getSwitchYard();
        Assert.assertEquals(transforms_1, transforms_2);
        Assert.assertEquals(switchyard_1, switchyard_2);
    }
View Full Code Here

Examples of org.switchyard.config.model.switchyard.SwitchYardModel

        Assert.assertEquals(switchyard_1, switchyard_2);
    }

    @Test
    public void testValidation() throws Exception {
        SwitchYardModel switchyard = _puller.pull(XML, getClass());
        switchyard.assertModelValid();
    }
View Full Code Here

Examples of org.switchyard.config.model.switchyard.SwitchYardModel

    if (swConfigStream == null) {
      Assert.fail("null config stream.");
    }

    SwitchYardModel switchyardConfig = (SwitchYardModel) new ModelPuller()
        .pull(swConfigStream);
    TransformsModel transforms = switchyardConfig.getTransforms();

    List<TransformModel> trans = transforms.getTransforms();
    JSONTransformModel jsonTransformModel = (JSONTransformModel) trans
        .get(0);
View Full Code Here

Examples of org.switchyard.config.model.switchyard.SwitchYardModel

   
    @Test
    public void test_validation() throws Exception {
        InputStream swConfigStream = Classes.getResourceAsStream("xslt-config-01.xml", getClass());
        try {
            SwitchYardModel switchyardConfig = new ModelPuller<SwitchYardModel>().pull(swConfigStream);
            switchyardConfig.assertModelValid();
        } finally {
            swConfigStream.close();
        }
    }
View Full Code Here

Examples of org.switchyard.config.model.switchyard.SwitchYardModel

    }
   
    @Test
    public void testPoolSizeConfiguration() throws Exception {
        XsltTransformFactory factory = new XsltTransformFactory();
        SwitchYardModel switchyard = new ModelPuller<SwitchYardModel>().pull(
                "xslt-config-06.xml", getClass());
        XsltTransformModel model = (XsltTransformModel)
                switchyard.getTransforms().getTransforms().get(0);
        int maxSize = factory.getTransformPoolSize(model);
        Assert.assertEquals(123, maxSize);
    }
View Full Code Here

Examples of org.switchyard.config.model.switchyard.SwitchYardModel

        // If running this test inside your IDE... you need to set the cwd to be the
        // root of the transform module !!
        urls.add(new File("./target/test-classes").toURI().toURL());

        ScannerInput<SwitchYardModel> input = new ScannerInput<SwitchYardModel>().setURLs(urls);
        SwitchYardModel switchyard = scanner.scan(input).getModel();
        List<TransformModel> models = switchyard.getTransforms().getTransforms();

        Assert.assertEquals(11, models.size());
        assertModelInstanceOK((JavaTransformModel) models.get(0));
        assertModelInstanceOK((JavaTransformModel) models.get(1));
        assertModelInstanceOK((JavaTransformModel) models.get(2));
View Full Code Here

Examples of org.switchyard.config.model.switchyard.SwitchYardModel

        Assert.assertEquals(new QName(namespace, name), model.getModelConfiguration().getQName());
    }

    @Test
    public void testCreate() throws Exception {
        SwitchYardModel switchyard = new V1SwitchYardModel(SwitchYardNamespace.V_1_0.uri());
        ValidatesModel validates = new V1ValidatesModel(SwitchYardNamespace.V_1_0.uri());
        JavaValidateModel javaValidate = new V1JavaValidateModel(ValidateNamespace.V_1_0.uri());
        javaValidate.setName(new QName("msgA"));
        javaValidate.setClazz("org.examples.validate.AValidate");
        validates.addValidate(javaValidate);
        XmlValidateModel xmlValidate = new V1XmlValidateModel(ValidateNamespace.V_1_0.uri());
        xmlValidate.setName(new QName("msgB"));
        xmlValidate.setSchemaType(XmlSchemaType.XML_SCHEMA);
        FileEntryModel entry = new V1FileEntryModel(ValidateNamespace.V_1_0.uri()).setFile("/validates/xxx.xml");
        SchemaFilesModel schemaFiles = new V1SchemaFilesModel(ValidateNamespace.V_1_0.uri());
        schemaFiles.addEntry(entry);
        xmlValidate.setSchemaFiles(schemaFiles);
        xmlValidate.setFailOnWarning(true);
        validates.addValidate(xmlValidate);
        switchyard.setValidates(validates);
        String new_xml = switchyard.toString();
        String old_xml = new ModelPuller<SwitchYardModel>().pull(XML, getClass()).toString();
        XMLUnit.setIgnoreWhitespace(true);
        Diff diff = XMLUnit.compareXML(old_xml, new_xml);
        Assert.assertTrue(diff.toString(), diff.identical());
    }
View Full Code Here

Examples of org.switchyard.config.model.switchyard.SwitchYardModel

        Assert.assertTrue(diff.toString(), diff.identical());
    }

    @Test
    public void testRead() throws Exception {
        SwitchYardModel switchyard = _puller.pull(XML, getClass());
        ValidatesModel validates = switchyard.getValidates();
        JavaValidateModel java_validate = (JavaValidateModel)validates.getValidates().get(0);
        Assert.assertEquals("msgA", java_validate.getName().getLocalPart());
        Assert.assertEquals("org.examples.validate.AValidate", java_validate.getClazz());
        XmlValidateModel xml_validate = (XmlValidateModel)validates.getValidates().get(1);
        Assert.assertEquals("msgB", xml_validate.getName().getLocalPart());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.