KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > tigris > scarab > feeds > IssueFeedTest


1 package org.tigris.scarab.feeds;
2 /* ================================================================
3  * Copyright (c) 2000-2003 CollabNet. All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are
7  * met:
8  *
9  * 1. Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * 2. Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the distribution.
15  *
16  * 3. The end-user documentation included with the redistribution, if
17  * any, must include the following acknowlegement: "This product includes
18  * software developed by CollabNet <http://www.collab.net/>."
19  * Alternately, this acknowlegement may appear in the software itself, if
20  * and wherever such third-party acknowlegements normally appear.
21  *
22  * 4. The hosted project names must not be used to endorse or promote
23  * products derived from this software without prior written
24  * permission. For written permission, please contact info@collab.net.
25  *
26  * 5. Products derived from this software may not use the "Tigris" or
27  * "Scarab" names nor may "Tigris" or "Scarab" appear in their names without
28  * prior written permission of CollabNet.
29  *
30  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
31  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
32  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
33  * IN NO EVENT SHALL COLLAB.NET OR ITS CONTRIBUTORS BE LIABLE FOR ANY
34  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
35  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
36  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
37  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
38  * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
39  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
40  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
41  *
42  * ====================================================================
43  *
44  * This software consists of voluntary contributions made by many
45  * individuals on behalf of CollabNet.
46  */

47 import org.tigris.scarab.om.Issue;
48 import org.tigris.scarab.test.BaseScarabTestCase;
49 import org.tigris.scarab.test.mocks.MockScarabLink;
50 import org.tigris.scarab.test.mocks.MockScarabLocalizationTool;
51 import org.tigris.scarab.tools.ScarabToolManager;
52
53 import com.sun.syndication.feed.synd.SyndFeed;
54 import com.sun.syndication.io.SyndFeedOutput;
55
56 /**
57  * @author Eric Pugh
58  *
59  */

60 public class IssueFeedTest extends BaseScarabTestCase {
61
62     public void testCreatingFeed() throws Exception JavaDoc {
63         ScarabToolManager stm = new ScarabToolManager(
64                 new MockScarabLocalizationTool());
65         Issue issue = getIssue0();
66         Feed feed = new IssueFeed(issue, new MockScarabLink(), stm);
67         SyndFeed syndFeed = feed.getFeed();
68         syndFeed.setFeedType("rss_2.0");
69         SyndFeedOutput out = new SyndFeedOutput();
70         String JavaDoc stringOutput = out.outputString(syndFeed);
71         assertNotNull(stringOutput);
72         System.out.println(stringOutput);
73     }
74
75 }
Popular Tags