View Javadoc

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