1   /***
2    Copyright (C) 2005 The Java Community
3   
4    This program is free software; you can redistribute it and/or modify  it under
5    the terms of the GNU General Public License as published by  the Free Software
6    Foundation; either version 2 of the License, or  (at your option) any later
7    version.
8   
9    This program is distributed in the hope that it will be useful,  but WITHOUT
10   ANY WARRANTY; without even the implied warranty of  MERCHANTABILITY or FITNESS
11   FOR A PARTICULAR PURPOSE. See the  GNU General Public License for more details.
12  
13   You should have received a copy of the GNU General Public License  along with
14   this program; if not, write to the Free Software  Foundation, Inc., 59 Temple
15   Place, Suite 330, Boston, MA 02111-1307 USA.
16  
17   */
18  package org.bejug.javacareers.feeder.dao.hibernate;
19  
20  import org.apache.commons.logging.Log;
21  import org.apache.commons.logging.LogFactory;
22  import org.bejug.javacareers.feeder.common.AbstractSpringContextTests;
23  import org.bejug.javacareers.feeder.model.RssFeed;
24  import org.bejug.javacareers.jobs.service.RssFeedService;
25  import org.springframework.dao.DataAccessException;
26  
27  /***
28   * @author Stephan (last modified by $Author: schauwvliege $)
29   * @version $Revision: 1.3 $ - $Date: 2005/06/14 12:05:54 $
30   */
31  public class RssFeedDaoHibernateImplTests extends AbstractSpringContextTests {
32  
33      /***
34       * Set via Springs IoC.
35       */
36      private RssFeedService rssFeedService;
37  
38      private static final Log LOGGER = LogFactory.getLog(RssFeedDaoHibernateImplTests.class);
39  
40      /***
41       * Return the job entry dao.
42       *
43       * @return the job entry dao.
44       */
45      public RssFeedService getRssFeedDao() {
46          LOGGER.info("RSSDAO get");
47          return rssFeedService;
48      }
49  
50      /***
51       * Sets the profile dao via the IoC Spring framework.
52       *
53       * @param rssFeedService the job entry dao reference.
54       */
55      public void setRssFeedService(RssFeedService rssFeedService) {
56          LOGGER.info("RSSDAO set");
57          this.rssFeedService = rssFeedService;
58      }
59  
60      /***
61       * Test the create, read, update and deletion of a profile.
62       *
63       * @throws DataAccessException if an error.
64       */
65      public void testAddRssFeed() throws DataAccessException {
66          LOGGER.info("testing add");
67          RssFeed rssFeed = new RssFeed();
68          rssFeed.setSourceName("JCS");
69          rssFeed.setUri("http://www.jcs.be/rss.xml");
70          rssFeed.setKeywords("java,j2ee");
71          rssFeed.setSourceUrl("http://www.jcs.be");
72  
73          getRssFeedDao().addRssFeed(rssFeed);
74      }
75  }
76  
77  /***
78   * $Log: RssFeedDaoHibernateImplTests.java,v $
79   * Revision 1.3  2005/06/14 12:05:54  schauwvliege
80   * CheckStyle and fixing tests
81   *
82   * Revision 1.2  2005/06/09 08:19:03  bejug_cc
83   * Fix initial import
84   *
85   * Revision 1.5  2005/06/06 13:51:54  bbr
86   * extracted feeder from test
87   *
88   * Revision 1.4  2005/06/05 12:28:48  sja
89   * Introduced sourceUrl and sourceName in jobOffer.
90   *
91   * Revision 1.3  2005/06/01 15:07:11  bbr
92   * RssFeed page
93   *
94   * Revision 1.2  2005/05/24 11:52:39  bbr
95   * Using spring sheduling
96   *
97   * Revision 1.1  2005/05/23 17:38:13  sja
98   * Package move to org.bejug.javacareers.feeder
99   *
100  * Revision 1.1  2005/05/23 15:42:00  bbr
101  * added weight to lucene
102  *
103  * Revision 1.1  2005/05/11 11:53:25  bavo_jcs
104  * refactored
105  * - conform to conventions
106  * - some javadoc
107  * - Added FeederTask design
108  *
109  * Revision 1.2  2005/05/03 13:46:08  bavo_jcs
110  * Added mockups
111  *
112  * Revision 1.1.1.1  2005/04/26 14:13:51  stephan_janssen
113  * Initial import
114  *
115  * Revision 1.1.1.1  2005/04/26 12:58:37  sja
116  * Initial Release
117  *
118  * Revision 1.1.1.1  2005/04/26 12:51:32  sja
119  * Initial Release
120  *
121  */