/* * AbstractPrerequisiteTestTest.java * * Copyright 2004 (C) Chris Ward <frugal@purplewombat.co.uk> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Created on 13-Jan-2004 * * Current Ver: $Revision$ * * * */ package pcgen.core.prereq; import java.util.Locale; import junit.framework.Test; import junit.framework.TestSuite; import junit.textui.TestRunner; import pcgen.AbstractCharacterTestCase; import pcgen.EnUsLocaleDependentTestCase; import pcgen.LocaleDependentTestCase; import plugin.pretokens.test.PreWieldTester; /** * @author wardc * */ public class AbstractPrerequisiteTestTest extends AbstractCharacterTestCase { /** * main * @param args */ public static void main(final String[] args) { TestRunner.run(AbstractPrerequisiteTestTest.class); } /** * @return Test */ public static Test suite() { return new TestSuite(AbstractPrerequisiteTestTest.class); } /** * @throws Exception */ @SuppressWarnings("nls") public void testVisionNotHandledFail() throws Exception { final Prerequisite prereq = new Prerequisite(); prereq.setKind("wield"); LocaleDependentTestCase.before(Locale.US); try { final PreWieldTester test = new PreWieldTester(); test.passes(prereq, getCharacter(), null); fail("Should have thrown a PrerequisiteException here."); } catch (PrerequisiteException pe) { assertEquals(PreWieldTester.class.getName() + " does not support prerequisites for Characters.", pe .getMessage()); } EnUsLocaleDependentTestCase.after(); } }