Changes between Version 46 and Version 47 of InstallNotes


Ignore:
Timestamp:
2011-09-04T16:52:07+02:00 (15 years ago)
Author:
bastiK
Comment:

added comments on testing

Legend:

Unmodified
Added
Removed
Modified
  • InstallNotes

    v46 v47  
    120120You can also build josm without ant or eclipse. To do so, call `javac` on the file `org/openstreetmap/josm/gui/MainApplication.java` with all libs from `../lib/*.jar` in your classpath (you have to specify all subsequent). If running Linux, this would look like that:
    121121
    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.)
    139122 * Check out the sources
    140123
     
    147130 * Compile and run
    148131{{{
    149 $ javac -cp .:src:lib/metadata-extractor-2.3.1-nosun.jar:lib/signpost-core-1.1.jar -d build src/org/openstreetmap/josm/gui/MainApplication.java
    150 $ java -cp .:build:lib/metadata-extractor-2.3.1-nosun.jar:lib/signpost-core-1.1.jar org.openstreetmap.josm.gui.MainApplication
     132$ javac -cp .:src -d build src/org/openstreetmap/josm/gui/MainApplication.java
     133$ java -cp .:build org.openstreetmap.josm.gui.MainApplication
    151134}}}
     135
     136== Unit Tests ==
     137
     138It 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
     142You can run tests from the command line, as well. Include all libraries in the class path like this:
     143{{{
     144export 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}}}
     146Then run for example
     147{{{
     148javac -cp $TESTCP test/unit/org/openstreetmap/josm/data/projection/ProjectionRefTest.java
     149java -cp $TESTCP org.junit.runner.JUnitCore org.openstreetmap.josm.data.projection.ProjectionRefTest
     150}}}