Package org.milyn

Examples of org.milyn.Smooks.addConfigurations()


        protected SmooksResource createResource(final String resourceLocation)
            throws UnsupportedEncodingException, SAXException, IOException
        {
            final Smooks smooks = new Smooks();
            smooks.addConfigurations("smooks-resource", new ByteArrayInputStream(resourceLocation.getBytes("UTF-8")));
            return new SmooksResource(smooks) ;
        }
    }

    /**
 
View Full Code Here


    }

    public void test_profile_expansion() throws IOException, SAXException {
        Smooks smooks = new Smooks();

        smooks.addConfigurations("testconfig2.cdrl", getClass().getResourceAsStream("testconfig2.cdrl"));
        assertProfilesOK(smooks);
    }

    public void test_import_filesys() throws IOException, SAXException, URISyntaxException {
        Smooks smooks = new Smooks("src/test/java/org/milyn/cdr/testconfig3.cdrl");
View Full Code Here

public class ExpandableContentDeliveryUnitTest extends TestCase {

    public void test() throws IOException, SAXException {
        Smooks smooks = new Smooks();

        smooks.addConfigurations("expansion-config.xml", getClass().getResourceAsStream("expansion-config.xml"));
        ExecutionContext context = smooks.createExecutionContext();

        DOMContentDeliveryConfig config = (DOMContentDeliveryConfig) context.getDeliveryConfig();
        ContentHandlerConfigMapTable<DOMVisitBefore> assemblyVisitBefores = config.getAssemblyVisitBefores();
        ContentHandlerConfigMapTable<DOMVisitAfter> assemblyVisitAfters = config.getAssemblyVisitAfters();
View Full Code Here

    public void test_phase_selection() throws IOException, SAXException {
        Smooks smooks = new Smooks();
        ExecutionContext execContext;
        DOMContentDeliveryConfig config;

        smooks.addConfigurations("config1.xml", getClass().getResourceAsStream("config1.xml"));
        execContext = smooks.createExecutionContext();
        config = (DOMContentDeliveryConfig) execContext.getDeliveryConfig();

        // Check the assembly units...
        List<ContentHandlerConfigMap<DOMVisitBefore>> assemblyVBs = config.getAssemblyVisitBefores().getMappings("a");
View Full Code Here

    public void test_filtering() throws IOException, SAXException {
        Smooks smooks = new Smooks();
        BasicExecutionEventListener eventListener = new BasicExecutionEventListener();

        smooks.addConfigurations("config2.xml", getClass().getResourceAsStream("config2.xml"));
        // Create an exec context - no profiles....
        ExecutionContext executionContext = smooks.createExecutionContext();
        CharArrayWriter outputWriter = new CharArrayWriter();

        // Filter the input message to the outputWriter, using the execution context...
View Full Code Here

        Smooks smooks = new Smooks();

        // Configure Smooks
        SmooksUtil.registerProfileSet(new DefaultProfileSet("shipping-request"), smooks);
        SmooksUtil.registerProfileSet(new DefaultProfileSet("shipping-response"), smooks);
        smooks.addConfigurations("trans-request.cdrl", getClass().getResourceAsStream("trans-request.cdrl"));
        smooks.addConfigurations("trans-response.cdrl", getClass().getResourceAsStream("trans-response.cdrl"));
               
        InputStream requestStream = getClass().getResourceAsStream("../request.xml");
        ExecutionContext context = smooks.createExecutionContext("shipping-request");
        String requestResult = SmooksUtil.filterAndSerialize(context, requestStream, smooks);
View Full Code Here

        // Configure Smooks
        SmooksUtil.registerProfileSet(new DefaultProfileSet("shipping-request"), smooks);
        SmooksUtil.registerProfileSet(new DefaultProfileSet("shipping-response"), smooks);
        smooks.addConfigurations("trans-request.cdrl", getClass().getResourceAsStream("trans-request.cdrl"));
        smooks.addConfigurations("trans-response.cdrl", getClass().getResourceAsStream("trans-response.cdrl"));
               
        InputStream requestStream = getClass().getResourceAsStream("../request.xml");
        ExecutionContext context = smooks.createExecutionContext("shipping-request");
        String requestResult = SmooksUtil.filterAndSerialize(context, requestStream, smooks);
    CharUtils.assertEquals("Template test failed.", "/org/milyn/templating/soapshipping/request.xml.tran.expected", requestResult);
View Full Code Here

    }

    private Smooks initialiseSmooksTransformer(String smooksConfig) throws IOException, SAXException {
        Smooks smooksTransformer = new Smooks();

        smooksTransformer.addConfigurations("order-transforms", getClass().getResourceAsStream(smooksConfig + "/smooks-transforms.xml"));

        return smooksTransformer;
    }

    private static class PerformanceThread extends Thread {
View Full Code Here

    public void testTransform() throws SAXException, IOException {
        Smooks smooks = new Smooks();

        // Configure Smooks...
        SmooksUtil.registerProfileSet(DefaultProfileSet.create("acme-findAddresses-request", new String[] {"acme-request"}), smooks);
        smooks.addConfigurations("acme-creds.cdrl", getClass().getResourceAsStream("acme-creds.cdrl"));

        // Perform the transformation...
        InputStream requestStream = getClass().getResourceAsStream("AcmeFindaddressRequest.xml");
        ExecutionContext context = smooks.createExecutionContext("acme-findAddresses-request");
        String requestResult = SmooksUtil.filterAndSerialize(context, requestStream, smooks);
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.