KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > hivemind > TestToString


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;
16
17 import hivemind.test.FrameworkTestCase;
18
19 import java.util.Locale JavaDoc;
20
21 import org.apache.hivemind.definition.ModuleDefinition;
22 import org.apache.hivemind.definition.ImplementationDefinition;
23 import org.apache.hivemind.definition.Visibility;
24 import org.apache.hivemind.definition.impl.ModuleDefinitionImpl;
25 import org.apache.hivemind.definition.impl.ImplementationDefinitionImpl;
26 import org.apache.hivemind.definition.impl.ServicePointDefinitionImpl;
27 import org.apache.hivemind.impl.InterceptorStackImpl;
28 import org.apache.hivemind.impl.ModuleImpl;
29 import org.apache.hivemind.impl.RegistryInfrastructureImpl;
30 import org.apache.hivemind.impl.ServicePointImpl;
31 import org.apache.hivemind.internal.ServiceModel;
32 import org.apache.hivemind.internal.ServicePoint;
33 import org.easymock.MockControl;
34
35 /**
36  * A cheat, for code-coverage reasons. We check that all the classes have a toString()
37  * method.
38  *
39  * @author Howard Lewis Ship
40  */

41
42 public class TestToString extends FrameworkTestCase
43 {
44
45     public void testToString()
46     {
47         MockControl control = MockControl.createControl(ServicePoint.class);
48         ServicePoint mockServicePoint = (ServicePoint) control.getMock();
49
50         ModuleImpl module = new ModuleImpl();
51         module.setModuleId("module");
52         module.toString();
53         new RegistryInfrastructureImpl(null, Locale.ENGLISH).toString();
54         new InterceptorStackImpl(null, mockServicePoint, null).toString();
55
56         ModuleDefinition md = new ModuleDefinitionImpl("module", null, null, null);
57         ServicePointDefinitionImpl spd = new ServicePointDefinitionImpl(md, "service", null,
58                 Visibility.PUBLIC, Runnable JavaDoc.class.getName());
59         ImplementationDefinition sid = new ImplementationDefinitionImpl(md,
60                 null, null, ServiceModel.PRIMITIVE, true);
61         spd.addImplementation(sid);
62         new ServicePointImpl(module, spd).toString();
63     }
64 }
65
Popular Tags