Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: com/sample/addressbook/dumbdb/FakeData.java


1   /*
2    * FakeData.java
3    *
4    * Copyright (c) 2001, 2002 Aendvari, Ltd. All Rights Reserved.
5    *
6    * See the file LICENSE for terms of use.
7    *
8    */
9   
10  package com.sample.addressbook.dumbdb;
11  
12  import java.util.ArrayList;
13  import java.util.TreeSet;
14  
15  import com.sample.addressbook.model.contact.data.Contact;
16  
17  
18  /**
19   * <p>This class is used for creating a fake Contact.</p>
20   *
21   * @author  Scott Milne
22   *
23   */
24  
25  public class FakeData
26  {
27    //
28    // TESTING ONLY
29    //
30  
31    public static Contact createFakeContact()
32    {
33      // load the address data into the XML DOM
34      Contact.Address address = new Contact.Address(
35        "street", "city",
36        "state", "zipcode", "country",
37        "phone", "fax", "mobile",
38        "webpage"
39      );
40  
41      TreeSet emails = new TreeSet();
42      emails.add("smilne@pictorius.com");
43      emails.add("smilne@aendvari.com");
44      emails.add("smilne@netprogs.com");
45  
46      Contact.Basic basic = new Contact.Basic(
47        "firstname", "middlename",
48        "lastname", "title", "nickname",
49        emails
50      );
51  
52      Contact contactBean = new Contact(basic, address);
53  
54      return contactBean;
55    }
56  
57    public static Contact createFakeContact2()
58    {
59      // load the address data into the XML DOM
60      Contact.Address address = new Contact.Address(
61        "street2", "city2",
62        "state2", "zipcode2", "country2",
63        "phone2", "fax2", "mobile2",
64        "webpage2"
65      );
66  
67      TreeSet emails = new TreeSet();
68      emails.add("smilne2@pictorius.com");
69      emails.add("smilne2@aendvari.com");
70      emails.add("smilne2@netprogs.com");
71  
72      Contact.Basic basic = new Contact.Basic(
73        "firstname2", "middlename2",
74        "lastname2", "title2", "nickname2",
75        emails
76      );
77  
78      Contact contactBean = new Contact(basic, address);
79  
80      return contactBean;
81    }
82  
83    public static Contact createFakeContact3()
84    {
85      // load the address data into the XML DOM
86      Contact.Address address = new Contact.Address(
87        "street3", "city3",
88        "state3", "zipcode3", "country3",
89        "phone3", "fax3", "mobile3",
90        "webpage3"
91      );
92  
93      TreeSet emails = new TreeSet();
94      emails.add("smilne3@pictorius.com");
95      emails.add("smilne3@aendvari.com");
96      emails.add("smilne3@netprogs.com");
97  
98      Contact.Basic basic = new Contact.Basic(
99        "firstname3", "middlename3",
100       "lastname3", "title3", "nickname3",
101       emails
102     );
103 
104     Contact contactBean = new Contact(basic, address);
105 
106     return contactBean;
107   }
108 }
109