KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > avalon > excalibur > monitor > test > Mock


1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
14  * implied.
15  *
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */

19 package org.apache.avalon.excalibur.monitor.test;
20
21
22 /**
23  * Simple Mock object to test active notification.
24  *
25  * @author <a HREF="mailto:dev@avalon.apache.org">Avalon Development Team</a>
26  */

27 public class Mock
28 {
29     private long m_lastModified = System.currentTimeMillis();
30     private String JavaDoc m_content = "";
31     private final String JavaDoc m_name;
32     
33     public Mock(String JavaDoc name)
34     {
35         m_name = name;
36     }
37     
38     public String JavaDoc getName()
39     {
40         return m_name;
41     }
42     
43     public String JavaDoc getContent()
44     {
45         return m_content;
46     }
47     
48     public void setContent(String JavaDoc content)
49     {
50         m_content = (null == content) ? "" : content;
51         touch();
52     }
53     
54     public long lastModified()
55     {
56         return m_lastModified;
57     }
58     
59     public void touch()
60     {
61         m_lastModified = System.currentTimeMillis();
62     }
63 }
64
Popular Tags