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  package org.bejug.javacareers.generator;
18  
19  import org.bejug.javacareers.jobs.model.AcademicEducationOffer;
20  import org.bejug.javacareers.jobs.model.Address;
21  import org.bejug.javacareers.jobs.model.CommercialEducationOffer;
22  import org.bejug.javacareers.jobs.model.ConsultingServiceOffer;
23  import org.bejug.javacareers.jobs.model.EducationServiceOffer;
24  import org.bejug.javacareers.jobs.model.JobOffer;
25  import org.bejug.javacareers.jobs.model.Organisation;
26  import org.bejug.javacareers.jobs.model.OrganisationType;
27  import org.bejug.javacareers.jobs.model.User;
28  
29  /***
30   * This class creates collaborator objects for the class under test.
31   *
32   * @author : Peter Symoens (Last modified by $Author: psong09 $)
33   * @version $Revision: 1.6 $ - $Date: 2005/08/30 14:08:28 $:
34   */
35  
36  public class StubGenerator {
37  
38      /***
39       * @return OrganisationType   The OrganisationType to return
40       */
41      public static final OrganisationType getStubOrganisationType() {
42          OrganisationType type = new OrganisationType();
43          type.setName("University");
44          type.setDescription("Een academische instelling");
45          return type;
46      }
47  
48      /***
49       * @return Address The Address to return
50       */
51      public static final Address getStubAddress() {
52          Address address = new Address();
53          address.setCity("Gent");
54          address.setName("test");
55          address.setZipCode("1234");
56          address.setStreet("straat");
57          address.setNumber("1");
58          return address;
59      }
60  
61      /***
62       * @return User  The User to return
63       */
64      public static final User getStubUser() {
65          User myUser = new User();
66          myUser.setFirstName("test");
67          myUser.setLastName("test");
68          myUser.getContact().setMobile("test");
69          myUser.getContact().setEmail("test");
70          myUser.setUserName("test");
71          myUser.setRole("admin");
72          myUser.setPassword("test");
73          myUser.setSalutation("test");
74          return myUser;
75      }
76  
77      /***
78       * @return JobOffer The JobOffer to return
79       */
80      public static final JobOffer getStubJobOffer() {
81          JobOffer jobOffer = new JobOffer();
82          jobOffer.setDescription("Test");
83          jobOffer.setLocation("Gent");
84          jobOffer.setSourceName("BeJUG");
85          jobOffer.setSourceUrl("http://www.bejug.org");
86          jobOffer.setTitle("Senior Developer");
87          jobOffer.setStatus(1);
88          return jobOffer;
89      }
90      
91      /***
92       * @return AcademicEducationOffer The AcademicEducationOffer to return
93       */
94      public static final AcademicEducationOffer getStubAcademicEducationOffer() {
95      	AcademicEducationOffer  educationOffer = new AcademicEducationOffer ();
96      	educationOffer.setDescription("Test");
97      	educationOffer.setLocation("Gent");
98      	educationOffer.setSourceName("BeJUG");
99      	educationOffer.setSourceUrl("http://www.bejug.org");
100     	educationOffer.setTitle("Struts");
101     	educationOffer.setStatus(1);
102     	educationOffer.setCost(new Double(1223));
103         return educationOffer;
104     }
105     
106     /***
107      * @return CommercialEducationOffer The CommercialEducationOffer to return
108      */
109     public static final CommercialEducationOffer getStubCommercialEducationOffer() {
110     	CommercialEducationOffer educationOffer = new CommercialEducationOffer();
111     	educationOffer.setDescription("Test");
112     	educationOffer.setLocation("Gent");
113     	educationOffer.setSourceName("BeJUG");
114     	educationOffer.setSourceUrl("http://www.bejug.org");
115     	educationOffer.setTitle("Struts");
116     	educationOffer.setStatus(1);
117     	educationOffer.setCost(new Double(1223));
118         return educationOffer;
119     }
120 
121     /***
122      * @return EducationServiceOffer The EducationServiceOffer to return
123      */
124     public static final EducationServiceOffer getStubEducationServiceOffer() {
125     	EducationServiceOffer serviceOffer = new EducationServiceOffer();
126     	serviceOffer.setDescription("Test");
127     	serviceOffer.setLocation("Gent");
128     	serviceOffer.setSourceName("BeJUG");
129     	serviceOffer.setSourceUrl("http://www.bejug.org");
130     	serviceOffer.setTitle("Struts");
131     	serviceOffer.setStatus(1);
132     	serviceOffer.setCostPerDay(1223);
133         return serviceOffer;
134     }
135     
136     /***
137      * @return EducationServiceOffer The EducationServiceOffer to return
138      */
139     public static final ConsultingServiceOffer getStubConsultingServiceOffer() {
140     	ConsultingServiceOffer serviceOffer = new ConsultingServiceOffer();
141     	serviceOffer.setDescription("Test");
142     	serviceOffer.setLocation("Gent");
143     	serviceOffer.setSourceName("BeJUG");
144     	serviceOffer.setSourceUrl("http://www.bejug.org");
145     	serviceOffer.setTitle("Struts");
146     	serviceOffer.setStatus(1);
147     	serviceOffer.setCostPerDay(1223);
148         return serviceOffer;
149     }
150     
151     /***
152      * @return Organisation the organisation to return
153      */
154     public static final Organisation getStubOrganisation() {
155         Organisation org = new Organisation();
156         org.setName("test");
157         org.setDescription("test");
158         return org;
159     }
160 
161 
162 }
163 
164 /***
165  * $Log: StubGenerator.java,v $
166  * Revision 1.6  2005/08/30 14:08:28  psong09
167  * added javadoc
168  *
169  * Revision 1.5  2005/08/30 13:07:48  psong09
170  * renamed author: psong09
171  *
172  * Revision 1.4  2005/08/17 09:12:02  schauwvliege
173  * Checkstyle
174  *
175  * Revision 1.3  2005/08/17 09:09:31  schauwvliege
176  * Fixed all unit tests
177  *
178  * Revision 1.2  2005/07/06 07:35:59  psong09
179  * added user.getContact() calls
180  *
181  * Revision 1.1  2005/07/05 10:48:13  psong09
182  * rename of MockObs to StubGenerator
183  *
184  * Revision 1.4  2005/07/04 07:56:10  psong09
185  * updated javadoc
186  *
187  */