Package org.apache.vysper.xml.fragment

Examples of org.apache.vysper.xml.fragment.Attribute


public class AttributeTestCase extends TestCase {

 
 
  public void testEquals() {
    Attribute att1 = new Attribute("foo", "bar");
    Attribute att2 = new Attribute("foo", "bar");
   
    assertTrue(att1.equals(att2));
    assertTrue(att2.equals(att1));
  }
View Full Code Here


    assertTrue(att1.equals(att2));
    assertTrue(att2.equals(att1));
  }

  public void testNotEquals() {
    Attribute att1 = new Attribute("foo", "bar");
    Attribute att2 = new Attribute("foo", "dummy");
   
    assertFalse(att1.equals(att2));
    assertFalse(att2.equals(att1));
  }
View Full Code Here

    assertFalse(att1.equals(att2));
    assertFalse(att2.equals(att1));
  }

  public void testEqualsNamespaceUri() {
    Attribute att1 = new Attribute("http://example.com", "foo", "bar");
    Attribute att2 = new Attribute("http://example.com", "foo", "bar");
   
    assertTrue(att1.equals(att2));
    assertTrue(att2.equals(att1));
  }
View Full Code Here

    assertTrue(att1.equals(att2));
    assertTrue(att2.equals(att1));
  }

  public void testEqualsDifferentNamespaceUri() {
    Attribute att1 = new Attribute("http://example.com", "foo", "bar");
    Attribute att2 = new Attribute("http://someother.com", "foo", "bar");
   
    assertFalse(att1.equals(att2));
    assertFalse(att2.equals(att1));
  }
View Full Code Here

    assertFalse(att1.equals(att2));
    assertFalse(att2.equals(att1));
  }

  public void testEqualsNullNamespaceUri() {
    Attribute att1 = new Attribute("http://example.com", "foo", "bar");
    Attribute att2 = new Attribute("foo", "bar");
   
    assertFalse(att1.equals(att2));
    assertFalse(att2.equals(att1));
  }
View Full Code Here

import junit.framework.TestCase;

public class RendererTestCase extends TestCase {

  public void testRenderAttribute() {
    XMLElement elm = new XMLElement(null, "foo", null, new Attribute[]{new Attribute("attr1", "value1")}, null);
    assertRendering("<foo attr1=\"value1\"></foo>", elm);
  }
View Full Code Here

    assertRendering("<foo attr1=\"value1\"></foo>", elm);
  }

  // & must be escaped
  public void testRenderAttributeWithAmpersand() {
    XMLElement elm = new XMLElement(null, "foo", null, new Attribute[]{new Attribute("attr1", "val&ue1")}, null);
    assertRendering("<foo attr1=\"val&amp;ue1\"></foo>", elm);
  }
View Full Code Here

    XMLElement elm = new XMLElement(null, "foo", null, new Attribute[]{new Attribute("attr1", "val&ue1")}, null);
    assertRendering("<foo attr1=\"val&amp;ue1\"></foo>", elm);
  }

  public void testRenderAttributeWithQuot() {
    XMLElement elm = new XMLElement(null, "foo", null, new Attribute[]{new Attribute("attr1", "val\"ue1")}, null);
    assertRendering("<foo attr1=\"val&quot;ue1\"></foo>", elm);
  }
View Full Code Here

    XMLElement elm = new XMLElement(null, "foo", null, new Attribute[]{new Attribute("attr1", "val\"ue1")}, null);
    assertRendering("<foo attr1=\"val&quot;ue1\"></foo>", elm);
  }

  public void testRenderAttributeWithApos() {
    XMLElement elm = new XMLElement(null, "foo", null, new Attribute[]{new Attribute("attr1", "val'ue1")}, null);
    assertRendering("<foo attr1=\"val'ue1\"></foo>", elm);
  }
View Full Code Here

    assertRendering("<foo attr1=\"val'ue1\"></foo>", elm);
  }

  // > is not required to be escaped, but we do so to make sure
  public void testRenderAttributeWithGt() {
    XMLElement elm = new XMLElement(null, "foo", null, new Attribute[]{new Attribute("attr1", "val>ue1")}, null);
    assertRendering("<foo attr1=\"val&gt;ue1\"></foo>", elm);
  }
View Full Code Here

TOP

Related Classes of org.apache.vysper.xml.fragment.Attribute

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.