Package org.apache.vysper.xml.decoder

Examples of org.apache.vysper.xml.decoder.XMLParticle


    }
   
    public void testSimple2() throws DecodingException {
        List<XMLParticle> particles = new ArrayList<XMLParticle>();

        particles.add(new XMLParticle("<balanced>"));
        particles.add(new XMLParticle("</balanced>"));

        XMLElement xmlElement = (XMLElement) xmlRawToFragmentConverter.convert(particles);
        assertNotNull(xmlElement);
    }
View Full Code Here


    }
   
    public void testNested1() throws DecodingException {
        List<XMLParticle> particles = new ArrayList<XMLParticle>();

        particles.add(new XMLParticle("<balanced>"));
        particles.add(new XMLParticle("<inner>"));
        particles.add(new XMLParticle("</inner>"));
        particles.add(new XMLParticle("</balanced>"));
       
        XMLElement xmlElement = (XMLElement) xmlRawToFragmentConverter.convert(particles);
        assertEquals(1, ((XMLElement)xmlElement).getInnerElements().size());
    }
View Full Code Here

    }
   
    public void testElementNameColonAtStart() throws DecodingException {
        List<XMLParticle> particles = new ArrayList<XMLParticle>();

        XMLParticle particle = new XMLParticle("<:name />");
        particles.add(particle);
        try {
            xmlRawToFragmentConverter.convert(particles);
            fail("colon at start denotes legal element name (according to XML Spec) -- but we don't support it");
        } catch (DecodingException e) {
            // succeeded
        }
        assertEquals(":name", particle.getElementName());
    }
View Full Code Here

    }

    private XMLElement elementFromString(String... xmls) throws DecodingException {
        List<XMLParticle> particles = new ArrayList<XMLParticle>();
        for(String xml : xmls) {
            particles.add(new XMLParticle(xml));
        }
        return (XMLElement) xmlRawToFragmentConverter.convert(particles);
    }
View Full Code Here

    }

    public void testTwoToplevels() throws DecodingException {
        List<XMLParticle> particles = new ArrayList<XMLParticle>();

        particles.add(new XMLParticle("<balanced>"));
        particles.add(new XMLParticle("</balanced>"));
        particles.add(new XMLParticle("<illegal-top-level>"));
        particles.add(new XMLParticle("</illegal-top-level>"));

        try {
            xmlRawToFragmentConverter.convert(particles);
            fail("to consecutive elements are not allowed on top level");
        } catch (DecodingException e) {
View Full Code Here

    }
   
    public void testTwoToplevels2() throws DecodingException {
        List<XMLParticle> particles = new ArrayList<XMLParticle>();

        particles.add(new XMLParticle("<balanced>"));
        particles.add(new XMLParticle("<inner />"));
        particles.add(new XMLParticle("</balanced>"));
        particles.add(new XMLParticle("<illegal-top-level>"));
        particles.add(new XMLParticle("</illegal-top-level>"));

        try {
            xmlRawToFragmentConverter.convert(particles);
            fail("to consecutive elements are not allowed on top level");
        } catch (DecodingException e) {
View Full Code Here

TOP

Related Classes of org.apache.vysper.xml.decoder.XMLParticle

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.