Package org.apache.wookie.w3c.impl

Examples of org.apache.wookie.w3c.impl.AccessEntity.fromXML()


 
  @Test
  public void noOrigin(){
    Element element = new Element("access");
    AccessEntity accessEntity = new AccessEntity();
    accessEntity.fromXML(element);
    assertEquals(null,accessEntity.getOrigin());
  }

  @Test
  public void okOrigin(){
View Full Code Here


  @Test
  public void okOrigin(){
    Element element = new Element("access");
    element.setAttribute("origin","http://www.apache.org");
    AccessEntity accessEntity = new AccessEntity();
    accessEntity.fromXML(element);
    assertEquals("http://www.apache.org:80",accessEntity.getOrigin());
  }
 
  @Test
  public void okOriginHttps(){
View Full Code Here

  @Test
  public void okOriginHttps(){
    Element element = new Element("access");
    element.setAttribute("origin","https://www.apache.org");
    AccessEntity accessEntity = new AccessEntity();
    accessEntity.fromXML(element);
    assertEquals("https://www.apache.org:443",accessEntity.getOrigin());
  }
 
  @Test
  public void wildcardOrigin(){
View Full Code Here

  @Test
  public void wildcardOrigin(){
    Element element = new Element("access");
    element.setAttribute("origin","*");
    AccessEntity accessEntity = new AccessEntity();
    accessEntity.fromXML(element);
    assertEquals("*",accessEntity.getOrigin());
  }
 
  @Test
  public void badOriginNoScheme(){
View Full Code Here

  @Test
  public void badOriginNoScheme(){
    Element element = new Element("access");
    element.setAttribute("origin","www.apache.org");
    AccessEntity accessEntity = new AccessEntity();
    accessEntity.fromXML(element);
    assertEquals(null,accessEntity.getOrigin());
  }
 
  @Test
  public void okOriginWithSubdomains(){
View Full Code Here

  public void okOriginWithSubdomains(){
    Element element = new Element("access");
    element.setAttribute("origin","http://apache.org");
    element.setAttribute("subdomains","true");
    AccessEntity accessEntity = new AccessEntity();
    accessEntity.fromXML(element);
    assertEquals("http://apache.org:80",accessEntity.getOrigin());
    assertEquals(true,accessEntity.hasSubDomains());
  }
 
  @Test
View Full Code Here

  public void okOriginWithBadSubdomains(){
    Element element = new Element("access");
    element.setAttribute("origin","http://apache.org");
    element.setAttribute("subdomains","blah");
    AccessEntity accessEntity = new AccessEntity();
    accessEntity.fromXML(element);
    assertEquals(null,accessEntity.getOrigin());
    assertEquals(false,accessEntity.hasSubDomains());
  }
 
  @Test
View Full Code Here

  @Test
  public void badOriginNoHost(){
    Element element = new Element("access");
    element.setAttribute("origin","http://");
    AccessEntity accessEntity = new AccessEntity();
    accessEntity.fromXML(element);
    assertEquals(null,accessEntity.getOrigin());
  }
 
  @Test
  public void badOriginHasUserinfo(){
View Full Code Here

  @Test
  public void badOriginHasUserinfo(){
    Element element = new Element("access");
    element.setAttribute("origin","http://test:test@www.apache.org");
    AccessEntity accessEntity = new AccessEntity();
    accessEntity.fromXML(element);
    assertEquals(null,accessEntity.getOrigin());
  }
 
  @Test
  public void badOriginHasPath(){
View Full Code Here

  @Test
  public void badOriginHasPath(){
    Element element = new Element("access");
    element.setAttribute("origin","http://www.apache.org/incubator");
    AccessEntity accessEntity = new AccessEntity();
    accessEntity.fromXML(element);
    assertEquals(null,accessEntity.getOrigin());
  }
 
  @Test
  public void badOriginHasFragment(){
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.