Package org.apache.vysper.xml.decoder

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


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

        particles.add(new XMLParticle("<balanced>"));
        particles.add(new XMLParticle("</balanced>"));
        particles.add(new XMLParticle("<unbalanced>"));
       
        assertFalse(new XMLRawToFragmentConverter().isBalanced(particles));
    }
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("</balanced>"));
       
        assertTrue(new XMLRawToFragmentConverter().isBalanced(particles));
    }
View Full Code Here

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

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

        assertTrue(new XMLRawToFragmentConverter().isBalanced(particles));
    }
    public void testNested3() 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>"));
       
        assertTrue(new XMLRawToFragmentConverter().isBalanced(particles));
    }
View Full Code Here

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

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

    public void testMoreWrongOpeningElementName() {
        assertFailureOpeningElementName("<wrong#separator>");
    }

    private void assertOpeningElementName(String input, String expected) throws DecodingException {
        XMLParticle particle = new XMLParticle(input);
        assertEquals(expected, particle.getElementName());
    }
View Full Code Here

        XMLParticle particle = new XMLParticle(input);
        assertEquals(expected, particle.getElementName());
    }

    private void assertFailureOpeningElementName(String input) {
        XMLParticle particle = new XMLParticle(input);
        try {
            particle.getElementName();
            fail("failure expected");
        } catch (DecodingException e) {
            // expected
        }
    }
View Full Code Here

    }

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

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

        XMLElement xmlElement = (XMLElement) xmlRawToFragmentConverter.convert(particles);
        assertNotNull(xmlElement);
        assertEquals("balanced", xmlElement.getName());
    }
View Full Code Here

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

        particles.add(new XMLParticle("<balanced attr1=\"1\" attr2='2' ns:at_tr3=\"\" />"));

        XMLElement xmlElement = (XMLElement) xmlRawToFragmentConverter.convert(particles);
        assertNotNull(xmlElement);
        assertEquals("balanced", xmlElement.getName());
        List<Attribute> attributes = xmlElement.getAttributes();
View Full Code Here

        assertEquals("", attributes.get(2).getValue());
    }
    public void testElementSimpleAttributesMoreWhitespace() throws DecodingException {
        List<XMLParticle> particles = new ArrayList<XMLParticle>();

        particles.add(new XMLParticle("<balanced attr1 = \"1\"   attr2=' 2 ' ns:at_tr3= \" \" />"));

        XMLElement xmlElement = (XMLElement) xmlRawToFragmentConverter.convert(particles);
        assertNotNull(xmlElement);
        assertEquals("balanced", xmlElement.getName());
        List<Attribute> attributes = xmlElement.getAttributes();
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.