Package com.colorfulsoftware.atom

Examples of com.colorfulsoftware.atom.FeedReader


   *             if there is an error creating the test data.
   */
  @SuppressWarnings("unchecked")
  @Before
  public void setUp() throws Exception {
    feedReader = new FeedReader(new FeedDoc());
    XMLDecoder decode = new XMLDecoder(new BufferedInputStream(
        new FileInputStream("src/test/resources/atomConfig.xml")));
    configFile = (Map<String, String>) decode.readObject();
    decode.close();
    for (String feedName : configFile.values()) {
View Full Code Here


      fout.close();

      XMLStreamReader reader = XMLInputFactory.newInstance()
          .createXMLStreamReader(
              new FileInputStream("target/xhtmlRegular.xml"));
      Content content = (new FeedReader(feedDoc)).readContent(reader);
      BufferedWriter out = new BufferedWriter(new FileWriter(
          "target/content.xml"));
      out.write(content.toString());
      out.flush();
      out.close();
View Full Code Here

   */
  @Test
  public void testWriteEntries() {
    try {

      List<Entry> entries = new FeedReader(feedDoc).readEntry(
          XMLInputFactory.newInstance().createXMLStreamReader(
              new StringReader(entry1)), null);
      assertTrue(entries != null);
      assertTrue(entries.size() == 1);

      StringWriter theXMLString = new StringWriter();
      XMLStreamWriter writer = XMLOutputFactory.newInstance()
          .createXMLStreamWriter(theXMLString);
      new FeedWriter().writeEntries(writer, entries);
      writer.flush();
      writer.close();
      assertEquals(theXMLString.toString(), entry1Result);

      entries = new FeedReader(feedDoc).readEntry(XMLInputFactory
          .newInstance().createXMLStreamReader(
              new StringReader(entry2)), null);
      assertTrue(entries != null);
      assertTrue(entries.size() == 1);

      theXMLString = new StringWriter();
      writer = XMLOutputFactory.newInstance().createXMLStreamWriter(
          theXMLString);
      new FeedWriter().writeEntries(writer, entries);
      writer.flush();
      writer.close();
      assertEquals(theXMLString.toString(), entry2Result);

      entries = new FeedReader(feedDoc).readEntry(XMLInputFactory
          .newInstance().createXMLStreamReader(
              new StringReader(entry3)), null);
      assertTrue(entries != null);
      assertTrue(entries.size() == 1);

      theXMLString = new StringWriter();
      writer = XMLOutputFactory.newInstance().createXMLStreamWriter(
          theXMLString);
      new FeedWriter().writeEntries(writer, entries);
      writer.flush();
      writer.close();
      assertEquals(theXMLString.toString(), entry3Result);

      entries = new FeedReader(feedDoc).readEntry(XMLInputFactory
          .newInstance().createXMLStreamReader(
              new StringReader(entry3Result)), null);
      assertTrue(entries != null);
      assertTrue(entries.size() == 1);

      entries = new FeedReader(feedDoc).readEntry(XMLInputFactory
          .newInstance().createXMLStreamReader(
              new StringReader(entry4)), null);
      assertTrue(entries != null);
      assertTrue(entries.size() == 1);

View Full Code Here

      fout.close();

      XMLStreamReader reader = XMLInputFactory.newInstance()
          .createXMLStreamReader(
              new FileInputStream("target/xhtmlRegular.xml"));
      Content content = (new FeedReader(feedDoc)).readContent(reader);
      BufferedWriter out = new BufferedWriter(new FileWriter(
          "target/content.xml"));
      out.write(content.toString());
      out.flush();
      out.close();
View Full Code Here

   */
  @Test
  public void testWriteEntries() {
    try {

      List<Entry> entries = new FeedReader(feedDoc).readEntry(
          XMLInputFactory.newInstance().createXMLStreamReader(
              new StringReader(entry1)), null);
      assertTrue(entries != null);
      assertTrue(entries.size() == 1);

      StringWriter theXMLString = new StringWriter();
      XMLStreamWriter writer = XMLOutputFactory.newInstance()
          .createXMLStreamWriter(theXMLString);
      new FeedWriter().writeEntries(writer, entries);
      writer.flush();
      writer.close();
      assertEquals(theXMLString.toString(), entry1Result);

      entries = new FeedReader(feedDoc).readEntry(XMLInputFactory
          .newInstance().createXMLStreamReader(
              new StringReader(entry2)), null);
      assertTrue(entries != null);
      assertTrue(entries.size() == 1);

      theXMLString = new StringWriter();
      writer = XMLOutputFactory.newInstance().createXMLStreamWriter(
          theXMLString);
      new FeedWriter().writeEntries(writer, entries);
      writer.flush();
      writer.close();
      assertEquals(theXMLString.toString(), entry2Result);

      entries = new FeedReader(feedDoc).readEntry(XMLInputFactory
          .newInstance().createXMLStreamReader(
              new StringReader(entry3)), null);
      assertTrue(entries != null);
      assertTrue(entries.size() == 1);

      theXMLString = new StringWriter();
      writer = XMLOutputFactory.newInstance().createXMLStreamWriter(
          theXMLString);
      new FeedWriter().writeEntries(writer, entries);
      writer.flush();
      writer.close();
      assertEquals(theXMLString.toString(), entry3Result);

      entries = new FeedReader(feedDoc).readEntry(XMLInputFactory
          .newInstance().createXMLStreamReader(
              new StringReader(entry3Result)), null);
      assertTrue(entries != null);
      assertTrue(entries.size() == 1);

      entries = new FeedReader(feedDoc).readEntry(XMLInputFactory
          .newInstance().createXMLStreamReader(
              new StringReader(entry4)), null);
      assertTrue(entries != null);
      assertTrue(entries.size() == 1);

View Full Code Here

   *             if there is an error creating the test data.
   */
  @SuppressWarnings("unchecked")
  @Before
  public void setUp() throws Exception {
    feedReader = new FeedReader(new FeedDoc());
    XMLDecoder decode = new XMLDecoder(new BufferedInputStream(
        new FileInputStream("src/test/resources/atomConfig.xml")));
    configFile = (Map<String, String>) decode.readObject();
    decode.close();
    for (String feedName : configFile.values()) {
View Full Code Here

      fout.close();

      XMLStreamReader reader = XMLInputFactory.newInstance()
          .createXMLStreamReader(
              new FileInputStream("target/xhtmlRegular.xml"));
      Content content = (new FeedReader(feedDoc)).readContent(reader);
      BufferedWriter out = new BufferedWriter(new FileWriter(
          "target/content.xml"));
      out.write(content.toString());
      out.flush();
      out.close();
View Full Code Here

   */
  @Test
  public void testWriteEntries() {
    try {

      List<Entry> entries = new FeedReader(feedDoc).readEntry(
          XMLInputFactory.newInstance().createXMLStreamReader(
              new StringReader(entry1)), null);
      assertTrue(entries != null);
      assertTrue(entries.size() == 1);

      StringWriter theXMLString = new StringWriter();
      XMLStreamWriter writer = XMLOutputFactory.newInstance()
          .createXMLStreamWriter(theXMLString);
      new FeedWriter().writeEntries(writer, entries);
      writer.flush();
      writer.close();
      assertEquals(theXMLString.toString(), entry1Result);

      entries = new FeedReader(feedDoc).readEntry(XMLInputFactory
          .newInstance().createXMLStreamReader(
              new StringReader(entry2)), null);
      assertTrue(entries != null);
      assertTrue(entries.size() == 1);

      theXMLString = new StringWriter();
      writer = XMLOutputFactory.newInstance().createXMLStreamWriter(
          theXMLString);
      new FeedWriter().writeEntries(writer, entries);
      writer.flush();
      writer.close();
      assertEquals(theXMLString.toString(), entry2Result);

      entries = new FeedReader(feedDoc).readEntry(XMLInputFactory
          .newInstance().createXMLStreamReader(
              new StringReader(entry3)), null);
      assertTrue(entries != null);
      assertTrue(entries.size() == 1);

      theXMLString = new StringWriter();
      writer = XMLOutputFactory.newInstance().createXMLStreamWriter(
          theXMLString);
      new FeedWriter().writeEntries(writer, entries);
      writer.flush();
      writer.close();
      assertEquals(theXMLString.toString(), entry3Result);

      entries = new FeedReader(feedDoc).readEntry(XMLInputFactory
          .newInstance().createXMLStreamReader(
              new StringReader(entry3Result)), null);
      assertTrue(entries != null);
      assertTrue(entries.size() == 1);

      entries = new FeedReader(feedDoc).readEntry(XMLInputFactory
          .newInstance().createXMLStreamReader(
              new StringReader(entry4)), null);
      assertTrue(entries != null);
      assertTrue(entries.size() == 1);

View Full Code Here

   *             if there is an error creating the test data.
   */
  @SuppressWarnings("unchecked")
  @Before
  public void setUp() throws Exception {
    feedReader = new FeedReader(new FeedDoc());
    XMLDecoder decode = new XMLDecoder(new BufferedInputStream(
        new FileInputStream("src/test/resources/atomConfig.xml")));
    configFile = (Map<String, String>) decode.readObject();
    decode.close();
    for (String feedName : configFile.values()) {
View Full Code Here

      fout.close();

      XMLStreamReader reader = XMLInputFactory.newInstance()
          .createXMLStreamReader(
              new FileInputStream("target/xhtmlRegular.xml"));
      Content content = (new FeedReader(feedDoc)).readContent(reader);
      BufferedWriter out = new BufferedWriter(new FileWriter(
          "target/content.xml"));
      out.write(content.toString());
      out.flush();
      out.close();
View Full Code Here

TOP

Related Classes of com.colorfulsoftware.atom.FeedReader

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.