View Javadoc
1   /*
2    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
3    * The software in this package is published under the terms of the CPAL v1.0
4    * license, a copy of which has been included with this distribution in the
5    * LICENSE.txt file.
6    */
7   package org.mule.module.rss;
8   
9   import org.mule.util.IOUtils;
10  
11  import java.io.IOException;
12  import java.io.InputStream;
13  
14  import static org.junit.Assert.assertNotNull;
15  
16  /**
17   * Helper class to deal with sample-feed.rss
18   */
19  public class SampleFeed
20  {
21      public static final int ENTRIES_IN_RSS_FEED = 25;
22      private static final String FEED_FILE = "sample-feed.rss";
23  
24      public static String feedAsString() throws IOException
25      {
26          return IOUtils.getResourceAsString(FEED_FILE, SampleFeed.class);
27      }
28  
29      public static InputStream feedAsStream() throws IOException
30      {
31          InputStream stream = IOUtils.getResourceAsStream(FEED_FILE, SampleFeed.class);
32          assertNotNull(stream);
33          return stream;
34      }
35  }