Package org.apache.vysper.xml.decoder

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


    }

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

        particles.add(new XMLParticle("<name attr='val' / >"));
        try {
            xmlRawToFragmentConverter.convert(particles);
            fail("opening+closing xml element must end with '/>'");
        } catch (DecodingException e) {
            // test succeded
View Full Code Here


    }

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

        particles.add(new XMLParticle("<name attr 'val' />"));
        try {
            xmlRawToFragmentConverter.convert(particles);
            fail("attribute and value must be separated by '='");
        } catch (DecodingException e) {
            // test succeded
View Full Code Here

    }
   
    public void testUnsupportedXMLComment() {
        List<XMLParticle> particles = new ArrayList<XMLParticle>();

        particles.add(new XMLParticle("<!-- unsupported comment -->"));
        try {
            xmlRawToFragmentConverter.convert(particles);
            fail("comments are unsupported");
        } catch (UnsupportedXMLException e) {
            // test succeded
View Full Code Here

    }
   
    public void testUnsupportedXMLCommentNested() {
        List<XMLParticle> particles = new ArrayList<XMLParticle>();

        particles.add(new XMLParticle("<name attr='val'>"));
        particles.add(new XMLParticle("<!-- unsupported comment -->"));
        particles.add(new XMLParticle("</name >"));
        try {
            xmlRawToFragmentConverter.convert(particles);
            fail("comments are unsupported");
        } catch (UnsupportedXMLException e) {
            // test succeded
View Full Code Here

public class XMLRawToFragmentConverterBalancedTestCase extends TestCase {

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

        particles.add(new XMLParticle("<balanced>"));
        particles.add(new XMLParticle("</balanced>"));
       
        assertTrue(new XMLRawToFragmentConverter().isBalanced(particles));
    }
View Full Code Here

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

        particles.add(new XMLParticle("<balanced>"));
        particles.add(new XMLParticle("plain"));
        particles.add(new XMLParticle("</balanced>"));
       
        assertTrue(new XMLRawToFragmentConverter().isBalanced(particles));
    }
View Full Code Here

        assertTrue(new XMLRawToFragmentConverter().isBalanced(particles));
    }
    public void testSimple3() throws DecodingException {
        List<XMLParticle> particles = new ArrayList<XMLParticle>();

        particles.add(new XMLParticle("<balanced/>"));
       
        assertTrue(new XMLRawToFragmentConverter().isBalanced(particles));
    }
View Full Code Here

        assertTrue(new XMLRawToFragmentConverter().isBalanced(particles));
    }
    public void testSimple4() throws DecodingException {
        List<XMLParticle> particles = new ArrayList<XMLParticle>();

        particles.add(new XMLParticle("balanced"));
       
        assertTrue(new XMLRawToFragmentConverter().isBalanced(particles));
    }
View Full Code Here

        assertTrue(new XMLRawToFragmentConverter().isBalanced(particles));
    }
    public void testSimple5() throws DecodingException {
        List<XMLParticle> particles = new ArrayList<XMLParticle>();

        particles.add(new XMLParticle("<unbalanced>"));
       
        assertFalse(new XMLRawToFragmentConverter().isBalanced(particles));
    }
View Full Code Here

        assertFalse(new XMLRawToFragmentConverter().isBalanced(particles));
    }
    public void testSimple6() throws DecodingException {
        List<XMLParticle> particles = new ArrayList<XMLParticle>();

        particles.add(new XMLParticle("<unbalanced>"));
        particles.add(new XMLParticle("<unbalanced2>"));
       
        assertFalse(new XMLRawToFragmentConverter().isBalanced(particles));
    }
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.