Stendhal on Eclipse: Difference between revisions

Jump to navigation Jump to search
Content deleted Content added
imported>Kiheru
To make the client run: Removed note about utf-8 for OS X. It's now in the general instructions for all systems
imported>AntumDeluge
Line 99: Line 99:


==Running JUnit Tests in Eclipse==
==Running JUnit Tests in Eclipse==
# If you are runing JUnit tests in Eclipse, there are some additional things to be taken into account:
If you are runing JUnit tests in Eclipse, there are some additional things to be taken into account:
# Eclipse always automatically sets up a new run configuration for you if you invoke the "Run As" -> "JUnitTest" context command on a class or folder. It creates a default classpath configuration derived from the project settings in this run configurations. So there is missing the 'Stendhal' root folder in the classpath, which results in failures running some test cases. To fix this, open the run configurations and add the 'Stendhal' root folder like described above for the client configuration:
# Eclipse always automatically sets up a new run configuration for you if you invoke the "Run As" -> "JUnitTest" context command on a class or folder. It creates a default classpath configuration derived from the project settings in this run configurations. So there is missing the 'Stendhal' root folder in the classpath, which results in failures running some test cases. To fix this, open the run configurations and add the 'Stendhal' root folder like described above for the client configuration:
# On the [Classpath] tab - button "Advanced" - (*) add folder | OK - and select the project root folder. | OK
# On the [Classpath] tab - button "Advanced" - (*) add folder | OK - and select the project root folder. | OK
# After adding project-root to your classpath, Eclipse should automatically exclude the folders "src/" and "tests/". If not, exclude them together with "tools/" and "tiled/src/".
# After adding project-root to your classpath, Eclipse should automatically exclude the folders "src/" and "tests/". If not, exclude them together with "tools/" and "tiled/src/".

Setting up JUnit tests in Eclipse:
# Click the arrow next to either the green "Run" or "Debug" button.
# Select "Run/Debug Configurations...".
# Select "JUnit" in the left column and press the "New launch configuration" at the top of left column.
# Give it a unique name, like "Stendhal Tests".
# Select "Run all tests in the selected project, package or source folder".
# OPTIONAL:
## Press "Search".
## Select "tests" folder under Stendhal root directory and press "OK".
# Under "Test runner" select "JUnit 4".
# Under "Classpath" tab select "User Entries" and press "Advanced" on the right panel.
# Select "Add Folders" and press "OK".
# Select the Stendhal root folder and press "OK".


==Switching from pserver to extssh==
==Switching from pserver to extssh==