Package org.apache.xml.security.stax.impl.transformer.canonicalizer

Examples of org.apache.xml.security.stax.impl.transformer.canonicalizer.Canonicalizer20010315_ExclOmitCommentsTransformer


        {
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            List<String> inclusiveNamespaces = new ArrayList<String>();
            inclusiveNamespaces.add("#default");
            inclusiveNamespaces.add("xsi");
            Canonicalizer20010315_ExclOmitCommentsTransformer c = new Canonicalizer20010315_ExclOmitCommentsTransformer();
            c.setList(inclusiveNamespaces);
            c.setOutputStream(baos);
            canonicalize(c, new StringReader(XML), new QName("http://schemas.xmlsoap.org/soap/envelope/", "Body"));

            assertEquals(new String(baos.toByteArray(), "UTF-8"), c14nXML);
        }

        {
            //exactly the same outcome is expected if #default is not set:
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            List<String> inclusiveNamespaces = new ArrayList<String>();
            inclusiveNamespaces.add("xsi");
            Canonicalizer20010315_ExclOmitCommentsTransformer c = new Canonicalizer20010315_ExclOmitCommentsTransformer();
            c.setList(inclusiveNamespaces);
            c.setOutputStream(baos);
            canonicalize(c, new StringReader(XML), new QName("http://schemas.xmlsoap.org/soap/envelope/", "Body"));

            assertEquals(new String(baos.toByteArray(), "UTF-8"), c14nXML);
        }
    }
View Full Code Here


        {
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            List<String> inclusiveNamespaces = new ArrayList<String>();
            inclusiveNamespaces.add("#default");
            inclusiveNamespaces.add("xsi");
            Canonicalizer20010315_ExclOmitCommentsTransformer c = new Canonicalizer20010315_ExclOmitCommentsTransformer();
            c.setList(inclusiveNamespaces);
            c.setOutputStream(baos);
            canonicalize(c, new StringReader(XML), new QName("http://schemas.xmlsoap.org/soap/envelope/", "Body"));

            assertEquals(new String(baos.toByteArray(), "UTF-8"), c14nXML1);
        }
        {
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            List<String> inclusiveNamespaces = new ArrayList<String>();
            inclusiveNamespaces.add("xsi");
            Canonicalizer20010315_ExclOmitCommentsTransformer c = new Canonicalizer20010315_ExclOmitCommentsTransformer();
            c.setList(inclusiveNamespaces);
            c.setOutputStream(baos);
            canonicalize(c, new StringReader(XML), new QName("http://schemas.xmlsoap.org/soap/envelope/", "Body"));

            assertEquals(new String(baos.toByteArray(), "UTF-8"), c14nXML2);
        }
    }
View Full Code Here

        {
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            List<String> inclusiveNamespaces = new ArrayList<String>();
            inclusiveNamespaces.add("#default");
            inclusiveNamespaces.add("xsi");
            Canonicalizer20010315_ExclOmitCommentsTransformer c = new Canonicalizer20010315_ExclOmitCommentsTransformer();
            c.setList(inclusiveNamespaces);
            c.setOutputStream(baos);
            canonicalize(c, new StringReader(XML), new QName("http://schemas.xmlsoap.org/soap/envelope/", "Body"));

            assertEquals(new String(baos.toByteArray(), "UTF-8"), c14nXML);
        }
        {
            //exactly the same outcome is expected if #default is not set:
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            List<String> inclusiveNamespaces = new ArrayList<String>();
            inclusiveNamespaces.add("xsi");
            Canonicalizer20010315_ExclOmitCommentsTransformer c = new Canonicalizer20010315_ExclOmitCommentsTransformer();
            c.setList(inclusiveNamespaces);
            c.setOutputStream(baos);
            canonicalize(c, new StringReader(XML), new QName("http://schemas.xmlsoap.org/soap/envelope/", "Body"));

            assertEquals(new String(baos.toByteArray(), "UTF-8"), c14nXML);
        }
    }
View Full Code Here

        {
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            List<String> inclusiveNamespaces = new ArrayList<String>();
            inclusiveNamespaces.add("#default");
            inclusiveNamespaces.add("xsi");
            Canonicalizer20010315_ExclOmitCommentsTransformer c = new Canonicalizer20010315_ExclOmitCommentsTransformer();
            c.setList(inclusiveNamespaces);
            c.setOutputStream(baos);
            canonicalize(c, new StringReader(XML), new QName("http://schemas.xmlsoap.org/soap/envelope/", "Body"));

            assertEquals(new String(baos.toByteArray(), "UTF-8"), c14nXML);
        }
        {
            //exactly the same outcome is expected if #default is not set:
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            List<String> inclusiveNamespaces = new ArrayList<String>();
            inclusiveNamespaces.add("xsi");
            Canonicalizer20010315_ExclOmitCommentsTransformer c = new Canonicalizer20010315_ExclOmitCommentsTransformer();
            c.setList(inclusiveNamespaces);
            c.setOutputStream(baos);
            canonicalize(c, new StringReader(XML), new QName("http://schemas.xmlsoap.org/soap/envelope/", "Body"));

            assertEquals(new String(baos.toByteArray(), "UTF-8"), c14nXML);
        }
    }
View Full Code Here

                        + "</env:Body>";

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        List<String> inclusiveNamespaces = new ArrayList<String>();
        inclusiveNamespaces.add("#default");
        Canonicalizer20010315_ExclOmitCommentsTransformer c = new Canonicalizer20010315_ExclOmitCommentsTransformer();
        c.setList(inclusiveNamespaces);
        c.setPropagateDefaultNamespace(true);
        c.setOutputStream(baos);
        canonicalize(c, new StringReader(XML), new QName("http://schemas.xmlsoap.org/soap/envelope/", "Body"));

        assertEquals(new String(baos.toByteArray(), "UTF-8"), c14nXML);
    }
View Full Code Here

                        + "</env:Body>";

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        List<String> inclusiveNamespaces = new ArrayList<String>();
        inclusiveNamespaces.add("#default");
        Canonicalizer20010315_ExclOmitCommentsTransformer c = new Canonicalizer20010315_ExclOmitCommentsTransformer();
        c.setList(inclusiveNamespaces);
        c.setPropagateDefaultNamespace(true);
        c.setOutputStream(baos);
        canonicalize(c, new StringReader(XML), new QName("http://schemas.xmlsoap.org/soap/envelope/", "Body"));

        assertEquals(new String(baos.toByteArray(), "UTF-8"), c14nXML);
    }
View Full Code Here

                        + "</env:Body>";

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        List<String> inclusiveNamespaces = new ArrayList<String>();
        inclusiveNamespaces.add("#default");
        Canonicalizer20010315_ExclOmitCommentsTransformer c = new Canonicalizer20010315_ExclOmitCommentsTransformer();
        c.setList(inclusiveNamespaces);
        c.setPropagateDefaultNamespace(true);
        c.setOutputStream(baos);
        canonicalize(c, new StringReader(XML), new QName("http://schemas.xmlsoap.org/soap/envelope/", "Body"));

        assertEquals(new String(baos.toByteArray(), "UTF-8"), c14nXML);
    }
View Full Code Here

                        + "</env:Body>";

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        List<String> inclusiveNamespaces = new ArrayList<String>();
        inclusiveNamespaces.add("#default");
        Canonicalizer20010315_ExclOmitCommentsTransformer c = new Canonicalizer20010315_ExclOmitCommentsTransformer();
        c.setList(inclusiveNamespaces);
        c.setPropagateDefaultNamespace(true);
        c.setOutputStream(baos);
        canonicalize(c, new StringReader(XML), new QName("http://schemas.xmlsoap.org/soap/envelope/", "Body"));

        assertEquals(new String(baos.toByteArray(), "UTF-8"), c14nXML);
    }
View Full Code Here

                        + "</ns0:Ping>";

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        List<String> inclusiveNamespaces = new ArrayList<String>();
        inclusiveNamespaces.add("#default");
        Canonicalizer20010315_ExclOmitCommentsTransformer c = new Canonicalizer20010315_ExclOmitCommentsTransformer();
        c.setList(inclusiveNamespaces);
        c.setPropagateDefaultNamespace(true);
        c.setOutputStream(baos);
        canonicalize(c, new StringReader(XML), new QName("http://xmlsoap.org/Ping", "Ping"));

        assertEquals(new String(baos.toByteArray(), "UTF-8"), c14nXML);
    }
View Full Code Here

                        + "</env:Body>";

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        List<String> inclusiveNamespaces = new ArrayList<String>();
        inclusiveNamespaces.add("#default");
        Canonicalizer20010315_ExclOmitCommentsTransformer c = new Canonicalizer20010315_ExclOmitCommentsTransformer();
        Map<String, Object> transformerProperties = new HashMap<String, Object>();
        transformerProperties.put(Canonicalizer20010315_Excl.INCLUSIVE_NAMESPACES_PREFIX_LIST, inclusiveNamespaces);
        transformerProperties.put(Canonicalizer20010315_Excl.PROPAGATE_DEFAULT_NAMESPACE, Boolean.TRUE);
        c.setProperties(transformerProperties);
        c.setOutputStream(baos);
        canonicalize(c, new StringReader(XML), new QName("http://schemas.xmlsoap.org/soap/envelope/", "Body"));

        assertEquals(new String(baos.toByteArray(), "UTF-8"), c14nXML);
    }
View Full Code Here

TOP

Related Classes of org.apache.xml.security.stax.impl.transformer.canonicalizer.Canonicalizer20010315_ExclOmitCommentsTransformer

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.