Stendhal Quest Testing: Difference between revisions

Jump to navigation Jump to search
Content deleted Content added
imported>Kymara
imported>Kymara
Line 312: Line 312:
== Trouble shooting ==
== Trouble shooting ==
===ChatTestCreator===
===ChatTestCreator===

;Problem: ArrayIndexOutOfBoundsException
Problem: ArrayIndexOutOfBoundsException
java games.stendhal.tools.test.ChatTestCreator chatlog.txt [chatlogtest.java]
java games.stendhal.tools.test.ChatTestCreator chatlog.txt [chatlogtest.java]
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
at games.stendhal.tools.test.ChatTestCreator.main(ChatTestCreator.java:75)
at games.stendhal.tools.test.ChatTestCreator.main(ChatTestCreator.java:75)


:Solution: Put gamechat.log into the Program arguments.
Solution: Put gamechat.log into the Program arguments.


; Problem: FileNotFoundException
Problem: FileNotFoundException
Exception in thread "main" java.io.FileNotFoundException: gamechat.log (No such file or directory)
Exception in thread "main" java.io.FileNotFoundException: gamechat.log (No such file or directory)


:Solution: copy gamechat.log into the project folder for your eclipse workspace.
Solution: copy gamechat.log into the project folder for your eclipse workspace.

Problem: Test doesn't look anything like example, there's no <code>en.step(player</code> lines and only <code>assertEquals</code>


Solution: add the character name for the player who made the test to the LineAnalyser file
;Problem: Test doesn't look anything like example, there's no <code>en.step(player</code> lines and only <code>assertEquals</code>
:Solution: add the character name for the player who made the test to the LineAnalyser file


===Running Tests===
===Running Tests===
;Problem:NullPointerException
Problem:NullPointerException
java.lang.NullPointerException
java.lang.NullPointerException
at utilities.PlayerTestHelper.equipWithStackableItem(PlayerTestHelper.java:217)
at utilities.PlayerTestHelper.equipWithStackableItem(PlayerTestHelper.java:217)
at utilities.PlayerTestHelper.equipWithMoney(PlayerTestHelper.java:190)
at utilities.PlayerTestHelper.equipWithMoney(PlayerTestHelper.java:190)


:Solution: put the stendhal project folder on your classpath for running tests
Solution: put the stendhal project folder on your classpath for running tests