| 122 | | * Choose the right version of the java compiler (1.6) |
| 123 | | |
| 124 | | {{{ |
| 125 | | $ sudo update-alternatives --config javac |
| 126 | | There are 2 choices for the alternative javac (providing /usr/bin/javac). |
| 127 | | |
| 128 | | Selection Path Priority Status |
| 129 | | ------------------------------------------------------------ |
| 130 | | * 0 /usr/lib/jvm/java-6-sun/bin/javac 63 auto mode |
| 131 | | 1 /usr/lib/jvm/java-1.5.0-sun/bin/javac 53 manual mode |
| 132 | | 2 /usr/lib/jvm/java-6-sun/bin/javac 63 manual mode |
| 133 | | |
| 134 | | Press enter to keep the current choice[*], or type selection number: 1 |
| 135 | | update-alternatives: using /usr/lib/jvm/java-1.5.0-sun/bin/javac to provide /usr/bin/javac (javac) in manual mode. |
| 136 | | $ export JAVA_HOME=/usr/lib/jvm/java-6-sun |
| 137 | | }}} |
| 138 | | (Alternatively you can provide the full path when running javac.) |
| | 135 | |
| | 136 | == Unit Tests == |
| | 137 | |
| | 138 | It is most convenient, to run tests from an IDE like Eclipse or Netbeans. There is also an ant task to run all tests (but you cannot rerun individual tests). |
| | 139 | |
| | 140 | === Running Test from Command line === |
| | 141 | |
| | 142 | You can run tests from the command line, as well. Include all libraries in the class path like this: |
| | 143 | {{{ |
| | 144 | export TESTCP=".:test/unit:test/functional:dist/josm-custom.jar:test/lib/fest/fest-assert-1.0.jar:test/lib/fest/MRJToolkitStubs-1.0.jar:test/lib/fest/jcip-annotations-1.0.jar:test/lib/fest/fest-swing-1.1.jar:test/lib/fest/fest-reflect-1.1.jar:test/lib/fest/fest-util-1.0.jar:test/lib/fest/debug-1.0.jar:test/lib/junit/junit-4.6.jar:test/lib/jfcunit.jar:test/lib/unitils-core/ognl-2.6.9.jar:test/lib/unitils-core/commons-lang-2.3.jar:test/lib/unitils-core/unitils-core-3.1.jar:test/lib/unitils-core/junit-4.4.jar:test/lib/unitils-core/commons-logging-1.1.jar:test/lib/unitils-core/commons-collections-3.2.jar" |
| | 145 | }}} |
| | 146 | Then run for example |
| | 147 | {{{ |
| | 148 | javac -cp $TESTCP test/unit/org/openstreetmap/josm/data/projection/ProjectionRefTest.java |
| | 149 | java -cp $TESTCP org.junit.runner.JUnitCore org.openstreetmap.josm.data.projection.ProjectionRefTest |
| | 150 | }}} |