Examples of GOMStaxWriter


Examples of org.apache.lucene.gdata.gom.writer.GOMStaxWriter

  }

  public void testWriteAtomOutput() throws XMLStreamException {
    {
      StringWriter stW = new StringWriter();
      GOMOutputWriter writer = new GOMStaxWriter(stW);
      this.iconImpl.writeAtomOutput(writer);
      assertEquals("<icon/>", stW.toString());
    }
    {
      StringWriter stW = new StringWriter();
      GOMOutputWriter writer = new GOMStaxWriter(stW);
      this.iconImpl.setTextValue("test");
      this.iconImpl.writeAtomOutput(writer);
      assertEquals("<icon>test</icon>", stW.toString());
    }

    {
      StringWriter stW = new StringWriter();
      GOMOutputWriter writer = new GOMStaxWriter(stW);
      this.logoImpl.writeAtomOutput(writer);
      assertEquals("<logo/>", stW.toString());
    }
    {
      StringWriter stW = new StringWriter();
      GOMOutputWriter writer = new GOMStaxWriter(stW);
      this.logoImpl.setTextValue("test");
      this.logoImpl.writeAtomOutput(writer);
      assertEquals("<logo>test</logo>", stW.toString());
    }
  }
View Full Code Here

Examples of org.apache.lucene.gdata.gom.writer.GOMStaxWriter

    this.impl.setTitle(new GOMTitleImpl());
    this.impl.setUpdated(new GOMUpdatedImpl());
    this.impl.extensions.add(new TestExtension());
    this.impl.addNamespace(GOMNamespace.OPENSEARCH_NAMESPACE);
    StringWriter stW = new StringWriter();
    GOMOutputWriter writer = new GOMStaxWriter(stW);
    this.impl.writeAtomOutput(writer);
    String string = stW.toString();
    assertTrue(string.contains("xmlns:openSearch"));
    assertTrue(string.contains("xmlns=\"http://www.w3.org/2005/Atom\""));
    assertTrue(string.contains("<" + GOMAuthor.LOCALNAME));
View Full Code Here

Examples of org.apache.lucene.gdata.gom.writer.GOMStaxWriter

    this.impl.setUpdated(new GOMUpdatedImpl());
    this.impl.addNamespace(GOMNamespace.ATOM_NAMESPACE);
    this.impl.addNamespace(GOMNamespace.OPENSEARCH_NAMESPACE);
    this.impl.extensions.add(new TestExtension());
    StringWriter stW = new StringWriter();
    GOMOutputWriter writer = new GOMStaxWriter(stW);
    this.impl.writeRssOutput(writer);

    String string = stW.toString();
    assertTrue(string.contains("xmlns:openSearch"));
    assertTrue(string.contains("xmlns:atom"));
View Full Code Here

Examples of org.apache.lucene.gdata.gom.writer.GOMStaxWriter

    this.impl.setRights(new GOMRightsImpl());
    this.impl.setSubtitle(new GOMSubtitleImpl());
    this.impl.setTitle(new GOMTitleImpl());
    this.impl.setUpdated(new GOMUpdatedImpl());
    StringWriter stW = new StringWriter();
    GOMOutputWriter writer = new GOMStaxWriter(stW);
    this.impl.writeAtomOutput(writer);
    String string = stW.toString();
    assertTrue(string.startsWith("<" + GOMSource.LOCALNAME));
    assertTrue(string.contains("<" + GOMAuthor.LOCALNAME));
    assertTrue(string.contains("<" + GOMCategory.LOCALNAME));
View Full Code Here

Examples of org.apache.lucene.gdata.gom.writer.GOMStaxWriter

   */
  public void testWriteRssOutput() throws XMLStreamException,
      FactoryConfigurationError {

    StringWriter stW = new StringWriter();
    GOMOutputWriter writer = new GOMStaxWriter(stW);
    this.impl.writeRssOutput(writer);
    assertEquals("", stW.toString());
  }
View Full Code Here

Examples of org.apache.lucene.gdata.gom.writer.GOMStaxWriter

   * 'org.apache.lucene.gdata.gom.core.GOMGeneratorImpl.writeAtomOutput(GOMWriter)'
   */
  public void testWriteAtomOutput() throws XMLStreamException {
    {
      StringWriter stW = new StringWriter();
      GOMOutputWriter writer = new GOMStaxWriter(stW);
      this.impl.writeAtomOutput(writer);
      assertEquals("<" + this.impl.getLocalName() + "/>", stW.toString());
    }

    {
      StringWriter stW = new StringWriter();
      GOMOutputWriter writer = new GOMStaxWriter(stW);
      this.impl.setTextValue("Lucene");
      this.impl.writeAtomOutput(writer);
      assertEquals("<" + this.impl.getLocalName() + ">Lucene</"
          + this.impl.getLocalName() + ">", stW.toString());
    }
    {
      StringWriter stW = new StringWriter();
      GOMOutputWriter writer = new GOMStaxWriter(stW);
      this.impl.setUri("http://apache.org");
      this.impl.writeAtomOutput(writer);
      assertEquals("<" + this.impl.getLocalName()
          + " uri=\"http://apache.org\">Lucene</"
          + this.impl.getLocalName() + ">", stW.toString());
    }

    {
      StringWriter stW = new StringWriter();
      GOMOutputWriter writer = new GOMStaxWriter(stW);
      this.impl.setGeneratorVersion("1");
      this.impl.writeAtomOutput(writer);
      assertEquals("<" + this.impl.getLocalName()
          + " uri=\"http://apache.org\" version=\"1\">Lucene</"
          + this.impl.getLocalName() + ">", stW.toString());
View Full Code Here

Examples of org.apache.lucene.gdata.gom.writer.GOMStaxWriter

   */
  public void testWriteRssOutput() throws XMLStreamException,
      FactoryConfigurationError {
    {
      StringWriter stW = new StringWriter();
      GOMOutputWriter writer = new GOMStaxWriter(stW);
      this.impl.setTextValue("Lucene");
      this.impl.writeRssOutput(writer);
      assertEquals("<" + this.impl.getLocalName() + ">Lucene</"
          + this.impl.getLocalName() + ">", stW.toString());
    }

    {
      StringWriter stW = new StringWriter();
      GOMOutputWriter writer = new GOMStaxWriter(stW);
      this.impl.setUri("http://apache.org");
      this.impl.setGeneratorVersion("1");
      this.impl.writeRssOutput(writer);
      assertEquals("<" + this.impl.getLocalName() + ">Lucene</"
          + this.impl.getLocalName() + ">", stW.toString());
View Full Code Here

Examples of org.apache.lucene.gdata.gom.writer.GOMStaxWriter

    this.impl.setUpdated(new GOMUpdatedImpl());
    this.impl.setSource(new GOMSourceImpl());
    this.impl.setPublished(new GOMPublishedImpl());
    this.impl.extensions.add(new GOMFeedImplTest.TestExtension());
    StringWriter stW = new StringWriter();
    GOMOutputWriter writer = new GOMStaxWriter(stW);
    this.impl.writeAtomOutput(writer);
    String string = stW.toString();
    assertTrue(string.contains("xmlns=\"http://www.w3.org/2005/Atom\""));
    assertTrue(string.startsWith("<" + GOMEntry.LOCALNAME));
    assertTrue(string.contains("<" + GOMAuthor.LOCALNAME));
View Full Code Here

Examples of org.apache.lucene.gdata.gom.writer.GOMStaxWriter

    this.impl.setUpdated(new GOMUpdatedImpl());
    this.impl.setSource(new GOMSourceImpl());
    this.impl.setPublished(new GOMPublishedImpl());
    this.impl.extensions.add(new GOMFeedImplTest.TestExtension());
    StringWriter stW = new StringWriter();
    GOMOutputWriter writer = new GOMStaxWriter(stW);
    this.impl.writeRssOutput(writer);
    String string = stW.toString();
    assertTrue(string
        .contains("xmlns:atom=\"http://www.w3.org/2005/Atom\""));
    assertTrue(string.startsWith("<" + GOMEntry.LOCALNAME_RSS));
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.