Package org.apache.wookie.w3c.updates

Examples of org.apache.wookie.w3c.updates.UpdateDescription


        fAuthor.fromXML(child);
     
     
      // UDPATE DESCRIPTION IS OPTONAL - can only be one, ignore subsequent repetitions
      if(tag.equals(IW3CXMLConfiguration.UPDATE_ELEMENT) && fUpdate == null && child.getNamespace().getURI().equals(IW3CXMLConfiguration.MANIFEST_NAMESPACE)) {
        UpdateDescription update = new UpdateDescription();
        update.fromXML(child);
        // It must have a valid HREF attribute, or it is ignored
        if (update.getHref() != null) fUpdate = update.getHref();
     
   
      // LICENSE IS OPTIONAL - can be many
      if(tag.equals(IW3CXMLConfiguration.LICENSE_ELEMENT)) {       
        ILicenseEntity aLicense = new LicenseEntity();
View Full Code Here


    // Author
    if (getAuthor() != null) widgetElem.addContent(getAuthor().toXml());
   
    // Update
    if (getUpdate()!= null){
      widgetElem.addContent(new UpdateDescription(getUpdate()).toXML());
    }
   
   
    // Licenses
    for (ILicenseEntity license: getLicensesList()){
View Full Code Here

*/
public class UpdateDescriptionTest {
 
  @Test
  public void create(){
    UpdateDescription desc = new UpdateDescription();
    Element update = new Element("update-description", Namespace.getNamespace(IW3CXMLConfiguration.MANIFEST_NAMESPACE));
    update.setAttribute("href", "http://localhost");
    try {
      desc.fromXML(update);
    } catch (BadManifestException e) {
      fail();
    }
    assertEquals("http://localhost", desc.getHref());
  }
View Full Code Here

    assertEquals("http://localhost", desc.getHref());
  }
 
  @Test
  public void createInvalidURL(){
    UpdateDescription desc = new UpdateDescription();
    Element update = new Element("update-description", Namespace.getNamespace(IW3CXMLConfiguration.MANIFEST_NAMESPACE));
    update.setAttribute("href", "notavalidurl!");
    try {
      desc.fromXML(update);
    } catch (BadManifestException e) {
      fail();
    }
    assertNull(desc.getHref());
  }
View Full Code Here

        ((IElement) fAuthor).fromXML(child);
     
     
      // UDPATE DESCRIPTION IS OPTONAL - can only be one, ignore subsequent repetitions
      if(tag.equals(IW3CXMLConfiguration.UPDATE_ELEMENT) && fUpdate == null && child.getNamespace().getURI().equals(IW3CXMLConfiguration.MANIFEST_NAMESPACE)) {
        UpdateDescription update = new UpdateDescription();
        update.fromXML(child);
        // It must have a valid HREF attribute, or it is ignored
        if (update.getHref() != null) fUpdate = update.getHref();
     
   
      // LICENSE IS OPTIONAL - can be many
      if(tag.equals(IW3CXMLConfiguration.LICENSE_ELEMENT)) {       
        LicenseEntity aLicense = new LicenseEntity();
View Full Code Here

    // Author
    if (getAuthor() != null) widgetElem.addContent(((IElement) getAuthor()).toXml());
   
    // Update
    if (getUpdateLocation()!= null){
      widgetElem.addContent(new UpdateDescription(getUpdateLocation()).toXML());
    }
   
   
    // Licenses
    for (ILicense license: getLicenses()){
View Full Code Here

*/
public class UpdateDescriptionTest {
 
  @Test
  public void create(){
    UpdateDescription desc = new UpdateDescription();
    Element update = new Element(IW3CXMLConfiguration.UPDATE_ELEMENT, Namespace.getNamespace(IW3CXMLConfiguration.MANIFEST_NAMESPACE));
    update.setAttribute(IW3CXMLConfiguration.HREF_ATTRIBUTE, "http://localhost");
    try {
      desc.fromXML(update);
    } catch (BadManifestException e) {
      fail();
    }
    assertEquals("http://localhost", desc.getHref());
  }
View Full Code Here

    assertEquals("http://localhost", desc.getHref());
  }
 
  @Test
  public void createInvalidURL(){
    UpdateDescription desc = new UpdateDescription();
    Element update = new Element(IW3CXMLConfiguration.UPDATE_ELEMENT, Namespace.getNamespace(IW3CXMLConfiguration.MANIFEST_NAMESPACE));
    update.setAttribute(IW3CXMLConfiguration.HREF_ATTRIBUTE, "notavalidurl!");
    try {
      desc.fromXML(update);
    } catch (BadManifestException e) {
      fail();
    }
    assertNull(desc.getHref());
  }
View Full Code Here

    assertNull(desc.getHref());
  }

  @Test
  public void export(){
     UpdateDescription desc = new UpdateDescription("http://localhost");
     Element el = desc.toXML();
     assertEquals("http://localhost", el.getAttributeValue(IW3CXMLConfiguration.HREF_ATTRIBUTE));
    
  }
View Full Code Here

        fAuthor.fromXML(child);
     
     
      // UDPATE DESCRIPTION IS OPTONAL - can only be one, ignore subsequent repetitions
      if(tag.equals(IW3CXMLConfiguration.UPDATE_ELEMENT) && fUpdate == null) {
        UpdateDescription update = new UpdateDescription();
        update.fromXML(child);
        // It must have a valid HREF attribute, or it is ignored
        if (update.getHref() != null) fUpdate = update.getHref();
     
   
      // LICENSE IS OPTIONAL - can be many
      if(tag.equals(IW3CXMLConfiguration.LICENSE_ELEMENT)) {       
        ILicenseEntity aLicense = new LicenseEntity();
View Full Code Here

TOP

Related Classes of org.apache.wookie.w3c.updates.UpdateDescription

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.