Stendhal Quest Testing: Difference between revisions
imported>Kymara No edit summary |
imported>Kymara No edit summary |
(No difference)
| |
Revision as of 19:42, 26 November 2010
Stendhal Quests
Generate a chat log
We need chat logs of players doing each Stendhal Quest so that we can create tests for them. So, it's easy to help us because all you need to do, is do the quest and then save the chat log for us. There are some ways you can help us make the best possible test:
- don't say yes to everything immediately. try saying no and then come back and say yes
- try to fool the npc. if he asked you for an item, say you had it when you didn't really! or if you were supposed to kill something, say yes you did, before you really did.
- if it's repeatable, try to come back and do it too early, and then again later
- if it's not repeatable, try to come back and ask for a quest again anyway!
Some quests have already got a test written for them because chat logs have been provided. Please take a look at the report from hudson - quests which are all or mostly green are done, and quests which are all or mostly red need a chatlog provided.
Run ChatTestCreator
Once you have the chatlog you can use games.stendhal.tools.test.ChatTestCreator to make a test. We assume you are using eclipse. First, copy the chat log into the project folder of your Stendhal project. For this tutorial we are using File:Test Gamechat.log - rename it if you want to follow the tutorial.
Open src/games/stendhal/tools.test/ChatTestCreator.java in the editor in Eclipse then go to the green arrow button for running an application.
Run Configurations ... Arguments tab Program arguments: gamechat.log Click Run
If all is well you should get some text output into your Console starting with
package games.stendhal.server.maps.quests; import static org.junit.Assert.assertEquals; import games.stendhal.server.core.engine.SingletonRepository;
and it will be plain with no coloured highlighting.
Trouble shooting
java games.stendhal.tools.test.ChatTestCreator chatlog.txt [chatlogtest.java] Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0 at games.stendhal.tools.test.ChatTestCreator.main(ChatTestCreator.java:75)
- You didn't put gamechat.log into the Program arguments.
Exception in thread "main" java.io.FileNotFoundException: gamechat.log (No such file or directory)
- You didn't copy gamechat.log into the project folder for your eclipse workspace.