Package org.apache.abdera.model

Examples of org.apache.abdera.model.Generator


     IRI uri = baseURI.resolve("4.2.4/generator-escaped-html.xml");
     Document<Feed> doc = get(uri);
     assertNotNull(doc);
     Feed feed = doc.getRoot();
     assertNotNull(feed);
     Generator generator = feed.getGenerator();
     assertEquals(generator.getText(),"<b>The</b> generator");
   }
View Full Code Here


     IRI uri = baseURI.resolve("4.2.4/generator-invalid-iri.xml");
     Document<Feed> doc = get(uri);
     assertNotNull(doc);
     Feed feed = doc.getRoot();
     assertNotNull(feed);
     Generator generator = feed.getGenerator();
     assertNotNull(generator);
     try {
       generator.getUri();
     } catch (Exception e) {
       assertTrue(e instanceof IRISyntaxException);
     }
   }
View Full Code Here

     IRI uri = baseURI.resolve("4.2.4/generator-no-text.xml");
     Document<Feed> doc = get(uri);
     assertNotNull(doc);
     Feed feed = doc.getRoot();
     assertNotNull(feed);
     Generator generator = feed.getGenerator();
     assertEquals(generator.getText(),"");
   }
View Full Code Here

     IRI uri = baseURI.resolve("4.2.4/generator-with-child.xml");
     Document<Feed> doc = get(uri);
     assertNotNull(doc);
     Feed feed = doc.getRoot();
     assertNotNull(feed);
     Generator generator = feed.getGenerator();
     assertEquals(generator.getText(),"");
   }
View Full Code Here

     IRI uri = baseURI.resolve("4.2.4/generator_relative_ref.xml");
     Document<Feed> doc = get(uri);
     assertNotNull(doc);
     Feed feed = doc.getRoot();
     assertNotNull(feed);
     Generator generator = feed.getGenerator();
     assertNotNull(generator);
     assertEquals(generator.getResolvedUri(), uri.resolve("misc/Colophon"));
   }
View Full Code Here

     //http://feedvalidator.org/testcases/atom/4.2.11/multiple-generators.xml
     IRI uri = baseURI.resolve("4.2.11/multiple-generators.xml");
     Document<Feed> doc = get(uri);
     assertNotNull(doc);
     Entry entry = doc.getRoot().getEntries().get(0);
     Generator g = entry.getSource().getGenerator();
     assertEquals(g.getResolvedUri(), new IRI("http://www.example.com/"));
   }
View Full Code Here

    assertEquals(dateTime.getTime(), now.getTime());
    dateTime = factory.newDateTime(Constants.UPDATED, null);
    dateTime.setString(AtomDate.format(now));
    assertEquals(dateTime.getString(), AtomDate.format(now));
    assertEquals(dateTime.getDate(), now);
    Generator generator = factory.newDefaultGenerator();
    assertNotNull(generator);
    assertEquals(generator.getText(), Version.APP_NAME);
    assertEquals(generator.getVersion(), Version.VERSION);
    assertEquals(generator.getUri().toString(), Version.URI);
    Div div = factory.newDiv();
    assertNotNull(div);
    Document<?> doc = factory.newDocument();
    assertNotNull(doc);
    Element el = factory.newEmail();
    assertNotNull(el);
    el = factory.newEmail();
    el.setText("a");
    assertEquals(el.getText(), "a");
    Entry entry = factory.newEntry();
    assertNotNull(entry);
    entry = factory.newEntry();
    assertNotNull(entry);
    Element ee = factory.newExtensionElement(new QName("urn:foo", "bar", "b"));
    assertNotNull(ee);
    assertEquals(ee.getQName(), new QName("urn:foo", "bar", "b"));
    Feed feed = factory.newFeed();
    assertNotNull(feed);
    generator = factory.newGenerator();
    assertNotNull(generator);
    generator = factory.newGenerator();
    generator.setUri(Version.URI);
    generator.setVersion(Version.VERSION);
    generator.setText(Version.APP_NAME);
    assertNotNull(generator);
    assertEquals(generator.getText(), Version.APP_NAME);
    assertEquals(generator.getVersion(), Version.VERSION);
    assertEquals(generator.getUri().toString(), Version.URI);
    content = factory.newContent(Content.Type.HTML);
    content.setValue("a");
    assertNotNull(content);
    assertEquals(content.getValue(), "a");
    assertEquals(content.getContentType(), Content.Type.HTML);
View Full Code Here

    } else if (element instanceof Generator) {
      jstream.startObject();
      writeLanguageFields(element, jstream);
      if (!isSameAsParentBase(element))
        jstream.writeField("xml:base", element.getResolvedBaseUri());
      Generator generator = (Generator)element;
      jstream.writeField("version", generator.getVersion());
      jstream.writeField("uri", generator.getResolvedUri());
      jstream.writeField("value", generator.getText());
      jstream.endObject();
    } else if (element instanceof Link) {
      jstream.startObject();
      writeLanguageFields(element, jstream);
      if (!isSameAsParentBase(element))
View Full Code Here

    assertEquals(dateTime.getTime(), now.getTime());
    dateTime = factory.newDateTime(Constants.UPDATED, null);
    dateTime.setString(AtomDate.format(now));
    assertEquals(dateTime.getString(), AtomDate.format(now));
    assertEquals(dateTime.getDate(), now);
    Generator generator = factory.newDefaultGenerator();
    assertNotNull(generator);
    assertEquals(generator.getText(), Version.APP_NAME);
    assertEquals(generator.getVersion(), Version.VERSION);
    assertEquals(generator.getUri().toString(), Version.URI);
    Div div = factory.newDiv();
    assertNotNull(div);
    Document doc = factory.newDocument();
    assertNotNull(doc);
    Element el = factory.newEmail();
    assertNotNull(el);
    el = factory.newEmail();
    el.setText("a");
    assertEquals(el.getText(), "a");
    Entry entry = factory.newEntry();
    assertNotNull(entry);
    entry = factory.newEntry();
    assertNotNull(entry);
    Element ee = factory.newExtensionElement(new QName("urn:foo", "bar", "b"));
    assertNotNull(ee);
    assertEquals(ee.getQName(), new QName("urn:foo", "bar", "b"));
    Feed feed = factory.newFeed();
    assertNotNull(feed);
    generator = factory.newGenerator();
    assertNotNull(generator);
    generator = factory.newGenerator();
    generator.setUri(Version.URI);
    generator.setVersion(Version.VERSION);
    generator.setText(Version.APP_NAME);
    assertNotNull(generator);
    assertEquals(generator.getText(), Version.APP_NAME);
    assertEquals(generator.getVersion(), Version.VERSION);
    assertEquals(generator.getUri().toString(), Version.URI);
    content = factory.newContent(Content.Type.HTML);
    content.setValue("a");
    assertNotNull(content);
    assertEquals(content.getValue(), "a");
    assertEquals(content.getContentType(), Content.Type.HTML);
View Full Code Here

    return newDefaultGenerator(null);
  }
 
  public Generator newDefaultGenerator(
    Element parent) {
      Generator generator = newGenerator(parent);
      generator.setVersion(Version.VERSION);
      generator.setText(Version.APP_NAME);
      generator.setUri(Version.URI);
      return generator;
  }
View Full Code Here

TOP

Related Classes of org.apache.abdera.model.Generator

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.