From: Astrid S. <ast...@us...> - 2008-07-03 22:01:32
|
Update of /cvsroot/arianne/stendhal/tests/games/stendhal/server/entity/item In directory sc8-pr-cvs11.sourceforge.net:/tmp/cvs-serv23597/tests/games/stendhal/server/entity/item Added Files: SeedTest.java Log Message: seed and Flowergrower initial commit. a seed when used on ground creates a plantaction a PlantAction which is successfully executed produces a Flowergrower. a full grown flowergrower when picked gives a rose and vanishes --- NEW FILE: SeedTest.java --- package games.stendhal.server.entity.item; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import games.stendhal.server.core.engine.SingletonRepository; import games.stendhal.server.core.engine.StendhalRPZone; import games.stendhal.server.entity.player.Player; import games.stendhal.server.maps.MockStendlRPWorld; import org.junit.BeforeClass; import org.junit.Test; import utilities.PlayerTestHelper; import utilities.RPClass.GrowingPassiveEntityRespawnPointTestHelper; public class SeedTest { @BeforeClass public static void setUpBeforeClass() throws Exception { MockStendlRPWorld.get(); GrowingPassiveEntityRespawnPointTestHelper.generateRPClasses(); } @Test public void testOnUsed() { Seed seed = (Seed) SingletonRepository.getEntityManager().getItem("seed"); assertNotNull(seed); assertFalse(seed.onUsed(null)); Player player = PlayerTestHelper.createPlayer("bob"); StendhalRPZone zone = new StendhalRPZone("zone"); zone.add(player); zone.add(seed); assertTrue(seed.onUsed(player)); } } |