01: // Modified or written by Object Mentor, Inc. for inclusion with FitNesse.
02: // Copyright (c) 2002 Cunningham & Cunningham, Inc.
03: // Released under the terms of the GNU General Public License version 2 or later.
04: // Copyright (C) 2003,2004 by Object Mentor, Inc. All rights reserved.
05: // Released under the terms of the GNU General Public License version 2 or
06: // later.
07: package fit;
08:
09: import junit.framework.TestCase;
10:
11: public class FixtureLoaderTest extends TestCase {
12: private FixtureLoader fixtureLoader;
13:
14: protected void setUp() throws Exception {
15: fixtureLoader = new FixtureLoader();
16: }
17:
18: public void testLoadFixturesFromPreviouslyRememberedPackages()
19: throws Throwable {
20: Fixture f1 = fixtureLoader.disgraceThenLoad("fit.FixtureOne");
21: assertEquals("fit.FixtureOne", f1.getClass().getName());
22: Fixture f2 = fixtureLoader.disgraceThenLoad("FixtureTwo");
23: assertEquals("fit.FixtureTwo", f2.getClass().getName());
24: }
25:
26: public void testLoadFixturesWithGracefulName() throws Throwable {
27: fixtureLoader.disgraceThenLoad("fit.FixtureOne");
28: Fixture f2 = fixtureLoader.disgraceThenLoad("fixture two");
29: assertEquals("fit.FixtureTwo", f2.getClass().getName());
30: }
31:
32: public void testLoadFixturesWithFixtureImplied() throws Throwable {
33: fixtureLoader.disgraceThenLoad("fit.TheThirdFixture");
34: Fixture fixture = fixtureLoader.disgraceThenLoad("the third");
35: assertEquals("fit.TheThirdFixture", fixture.getClass()
36: .getName());
37: }
38: }
|