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