KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > snipsnap > test > mock > MockSnipSpace


1 package org.snipsnap.test.mock;
2
3 import org.apache.lucene.search.Hits;
4 import org.snipsnap.snip.Blog;
5 import org.snipsnap.snip.Snip;
6 import org.snipsnap.snip.SnipSpace;
7
8 import java.sql.Timestamp JavaDoc;
9 import java.util.List JavaDoc;
10 import java.util.Map JavaDoc;
11 import java.util.HashMap JavaDoc;
12
13 public class MockSnipSpace extends MockObject implements SnipSpace {
14   private Map JavaDoc snips;
15
16   public MockSnipSpace() {
17     super();
18     snips = new HashMap JavaDoc();
19   }
20
21   public Snip[] match(String JavaDoc start, String JavaDoc end) {
22     return new Snip[0];
23   }
24
25   // A snip is changed by the user (created, stored)
26
public Snip[] match(String JavaDoc pattern) {
27     return new Snip[0];
28   }
29
30   public void changed(Snip snip) {
31   }
32
33   public void init() {
34   }
35
36   public void setETag() {
37   }
38
39   public int getSnipCount() {
40     return 0;
41   }
42
43   public List JavaDoc getChanged() {
44     return null;
45   }
46
47   public List JavaDoc getChanged(int count) {
48     return null;
49   }
50
51   public List JavaDoc getAll() {
52     return null;
53   }
54
55   public List JavaDoc getSince(Timestamp JavaDoc date) {
56     return null;
57   }
58
59   public List JavaDoc getByDate(String JavaDoc nameSpace, String JavaDoc start, String JavaDoc end) {
60     return null;
61   }
62
63   public List JavaDoc getHot(int count) {
64     return null;
65   }
66
67   public List JavaDoc getComments(Snip snip) {
68     return null;
69   }
70
71   public List JavaDoc getByUser(String JavaDoc login) {
72     return null;
73   }
74
75   public List JavaDoc getChildren(Snip snip) {
76     return null;
77   }
78
79   public List JavaDoc getChildrenDateOrder(Snip snip, int count) {
80     return null;
81   }
82
83   public List JavaDoc getChildrenModifiedOrder(Snip snip, int count) {
84     return null;
85   }
86
87   public void reIndex() {
88   }
89
90   public Hits search(String JavaDoc queryString) {
91     return null;
92   }
93
94   public Blog getBlog(String JavaDoc name) {
95     return null;
96   }
97
98   public boolean exists(String JavaDoc name) {
99     //System.out.println("exists=>"+name+"<");
100
inc("exists");
101     return snips.containsKey(name);
102   }
103
104   public Snip load(String JavaDoc name) {
105     return null;
106   }
107
108   public void store(Snip snip) {
109   }
110
111   public Blog getBlog() {
112     return null;
113   }
114
115   public void systemStore(Snip snip) {
116   }
117
118   public void delayedStore(Snip snip) {
119   }
120
121   public Snip create(String JavaDoc name, String JavaDoc content) {
122     inc("create");
123     return null;
124   }
125
126   public void remove(Snip snip) {
127   }
128
129   public String JavaDoc getETag() {
130     return null;
131   }
132
133   public void addSnip(String JavaDoc name) {
134     snips.put(name, name);
135   }
136
137   public Snip copy(Snip snip, String JavaDoc newName) {
138     return null;
139   }
140 }
141
Popular Tags