KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > hivemind > service > impl > ConstructorAccessImpl


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

15 package org.apache.hivemind.service.impl;
16
17
18 import java.util.Map JavaDoc;
19
20 import junit.framework.Assert;
21 import junit.framework.AssertionFailedError;
22
23 import org.apache.commons.logging.Log;
24 import org.apache.hivemind.Messages;
25 import org.apache.hivemind.service.ConstructorAccess;
26
27 /**
28  * Used to test constructor parameter passing of
29  * {@link org.apache.hivemind.service.impl.BuilderFactory}.
30  */

31 public class ConstructorAccessImpl implements ConstructorAccess
32 {
33
34     private String JavaDoc actualMessage;
35
36     private String JavaDoc expectedMessage;
37
38     public ConstructorAccessImpl()
39     {
40         actualMessage = "()";
41     }
42
43     public ConstructorAccessImpl(long l)
44     {
45         actualMessage = "(long)";
46     }
47
48     public ConstructorAccessImpl(String JavaDoc string)
49     {
50         actualMessage = "(String)";
51     }
52
53     public ConstructorAccessImpl(ConstructorAccess service)
54     {
55         actualMessage = "(ConstructorAccess)";
56     }
57
58     public ConstructorAccessImpl(ConstructorAccess service, String JavaDoc s)
59     {
60         actualMessage = "(ConstructorAccess, String)";
61     }
62
63     public ConstructorAccessImpl(Map JavaDoc configurations)
64     {
65         actualMessage = "(Map)";
66     }
67
68     public ConstructorAccessImpl(Map JavaDoc configurations, long l)
69     {
70         actualMessage = "(Map, long)";
71     }
72
73     public ConstructorAccessImpl(Log log, Messages messages)
74     {
75         actualMessage = "(Log, Messages)";
76     }
77
78     public ConstructorAccessImpl(long l, ConstructorAccess nullObject)
79     {
80         actualMessage = "(long, " + nullObject + ")";
81     }
82     
83     public void setExpectedConstructorMessage(String JavaDoc expectedMessage)
84     {
85         this.expectedMessage = expectedMessage;
86     }
87
88     public void verify() throws AssertionFailedError
89     {
90         Assert.assertEquals(expectedMessage, actualMessage);
91     }
92
93 }
Popular Tags