01: // Copyright 2004, 2005 The Apache Software Foundation
02: //
03: // Licensed under the Apache License, Version 2.0 (the "License");
04: // you may not use this file except in compliance with the License.
05: // You may obtain a copy of the License at
06: //
07: // http://www.apache.org/licenses/LICENSE-2.0
08: //
09: // 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 hivemind.test.services;
16:
17: import hivemind.test.FrameworkTestCase;
18: import hivemind.test.services.impl.StartupRunnableFixtureImpl;
19:
20: import java.util.ArrayList;
21: import java.util.List;
22:
23: import org.apache.hivemind.Registry;
24: import org.apache.hivemind.impl.StartupImpl;
25:
26: /**
27: * Tests Registry startup.
28: *
29: * @author Howard Lewis Ship
30: */
31: public class TestStartup extends FrameworkTestCase {
32:
33: public void testStartupImpl() {
34: StartupRunnableFixture fixture = new StartupRunnableFixtureImpl();
35:
36: List l = new ArrayList();
37: l.add(fixture);
38:
39: StartupImpl s = new StartupImpl();
40:
41: s.setRunnables(l);
42: s.run();
43:
44: assertEquals(true, fixture.getDidRun());
45: }
46:
47: public void testStartupContribution() throws Exception {
48: Registry r = buildFrameworkRegistry("StartupContribution.xml");
49:
50: StartupRunnableFixture fixture = (StartupRunnableFixture) r
51: .getService(
52: "hivemind.test.services.StartupRunnableFixture",
53: StartupRunnableFixture.class);
54:
55: assertEquals(true, fixture.getDidRun());
56: }
57: }
|