KickJava   Java API By Example, From Geeks To Geeks.

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


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.apache.torque.om.NumberKey;
48 import org.tigris.scarab.om.Query;
49 import org.tigris.scarab.om.QueryManager;
50 import org.tigris.scarab.om.ScarabUser;
51 import org.tigris.scarab.om.ScarabUserManager;
52 import org.tigris.scarab.test.BaseScarabTestCase;
53
54 import com.sun.syndication.feed.synd.SyndFeed;
55 import com.sun.syndication.io.SyndFeedOutput;
56
57
58 /**
59  * @author Eric Pugh
60  *
61  */

62 public class QueryFeedTest extends BaseScarabTestCase {
63     
64     public void testCreatingFeed() throws Exception JavaDoc{
65         Query query = QueryManager.getInstance(new Long JavaDoc(280));
66         ScarabUser user1 = ScarabUserManager.getInstance(new NumberKey(1), false);
67         assertNotNull(query);
68         Feed feed = new QueryFeed(query,user1,null,null);
69         SyndFeed syndFeed = feed.getFeed();
70         syndFeed.setFeedType("rss_2.0");
71         SyndFeedOutput out = new SyndFeedOutput();
72         String JavaDoc stringOutput = out.outputString(syndFeed);
73         System.out.println(stringOutput);
74     }
75
76 }
77
Popular Tags