Package org.switchyard.config

Examples of org.switchyard.config.Configuration


        PropertyMixIn pmi = SwitchYardTestKit.newMixInInstance(PropertyMixIn.class, this);
        Assert.assertNotNull(pmi);
        pmi.set("test.name", "ThyName");
        pmi.set("test.value", Integer.valueOf(100));
        String xml = "<test name='${test.name}'>${test.value}</test>";
        Configuration config = new ConfigurationPuller().pull(new StringReader(xml));
        Assert.assertEquals("ThyName", config.getAttribute("name"));
        Assert.assertEquals("100", config.getValue());
    }
View Full Code Here


        String from_model_cn = fromModel.getClass().getName();
        String to_model_cn = toModel.getClass().getName();
        if (!from_model_cn.equals(to_model_cn)) {
            throw new IllegalArgumentException(from_model_cn + " != " + to_model_cn);
        }
        Configuration from_model_config = fromModel.getModelConfiguration();
        Configuration to_model_config = toModel.getModelConfiguration();
        Configuration merged_model_config = Configurations.merge(from_model_config, to_model_config, fromOverridesTo);
        @SuppressWarnings("unchecked")
        M merged_model = (M)Descriptor.getMarshaller(toModel).read(merged_model_config);
        merged_model.orderModelChildren();
        if (validate) {
            merged_model.assertModelValid();
View Full Code Here

        }
        return _port;
    }
   
    public Integer getPortNum() {
        Configuration config = getModelConfiguration().getFirstChild(PORT_NUM);
        return config != null ? Integer.valueOf(config.getValue()) : null;
    }
View Full Code Here

    public String getGroup() {
        return getConfig(GROUP);
    }

    protected String getConfig(String configName) {
        Configuration config = getModelConfiguration().getFirstChild(configName);
        if (config != null) {
            return config.getValue();
        }
        return null;
    }
View Full Code Here

    public void testReadCustomViaConfig() throws Exception {
        CompositeModel composite = _puller.pull(COMPLETE_XML, getClass());
        CompositeServiceModel compositeService = composite.getServices().get(0);
        BindingModel binding = compositeService.getBindings().get(0);
        assertEquals("soap", binding.getType());
        Configuration port_config = binding.getModelConfiguration().getFirstChild(PortModel.PORT);
        assertEquals("MyWebService/SOAPPort", port_config.getValue());
        assertEquals("true", port_config.getAttribute(PortModel.SECURE));
        Configuration wsdl_config = binding.getModelConfiguration().getFirstChild(WSDLModel.WSDL);
        assertEquals("service.wsdl", wsdl_config.getValue());
        assertEquals("foobar", wsdl_config.getAttribute(WSDLModel.DESCRIPTION));
    }
View Full Code Here

    }

    @SuppressWarnings("unchecked")
    private <T> T unwrapResponse(Class<T> declaredType, String envelope) throws Exception {
        // TODO: replace with generic DOM code vs. using config helper code
        Configuration body = new ConfigurationPuller().pull(new StringReader(envelope)).getFirstChild("Body").getChildren().iterator().next();
        String content = body.toString();
        if (body.getName().equals("Fault")) {
            throw new Exception("Fault returned: " + content);
        } else {
            JAXBContext ctx = JAXBContext.newInstance("org.switchyard.quickstarts.demos.library.types");
            Unmarshaller u = ctx.createUnmarshaller();
            Object o = u.unmarshal(new StringReader(content));
View Full Code Here

TOP

Related Classes of org.switchyard.config.Configuration

Copyright © 2018 www.massapicom. 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.