Demos and unit tests that illustrate the use of JSDL.

See:
          Description

Packages
sdl.test Demos and unit tests that illustrate the use of JSDL.
sdl.test.ext.sfont  
sdl.test.gui Demo to exercise various API in a minimal awt-like gui system.
sdl.test.gui.unit  
sdl.test.junit  

 

Demos and unit tests that illustrate the use of JSDL.

copy of local README file in $JSDL_BASE/sdl/test


Unit Tests
-----------

This directory contains a set of unit tests that verify the functionality
of the existing api.  These tests also serve as simple demos illustrating
the use of the JSDL api.

There is a quick and dirty script to run these at the bottom of this file.


Compilation
-----------

make sure all the necessary JSDL libraries/classes have been built.
(cd $JSDL_BASE; ant)

Then you can modify /test each example in place. 

JSDL_BASE=/home/sstraw/build/jsdl
javac  -classpath .:$JSDL_BASE TestAnim.java


Testing
--------
Each example needs to be run relative to the package root "sdl.test"
The JSDL shared library must be in the "java.library.path".

cd ../..
java  -Djava.library.path=$JSDL_BASE:/usr/lib -classpath .:$JSDL_BASE/build sdl.test.${1}

SEE the bottom of this document for a quick and dirty test script.


Dependencies - sounds and images
-------------

Some of these examples load image or sound files.  Assuming $JSDL_BASE
is set to the directory where the jsdl sources were extracted,


$JSDL_BASE/sdl/test  - These java examples (TestXXX.java)
$JSDL_BASE/C 	     - The sound and image files used by the java examples

Since some of the sound and image paths have been  hardcoded,  it will be 
necessary to update some of these examples to your current directory
structure. This will be obvious when you get "FileNotFoundException"






-------------------------------------------
Assuming you are too lazy to install ant on your system, 
here's a basic shell script to  compile and run each example from this 
directory.  To run, simply 
1. copy this to test.sh 
2. chmod +x test.sh
3. do "./test.sh TestXXX" where TestXXX is one of the examples
(do not add ".java", ./test.sh TestXXX.java wont work)

### cut here ####
#!/bin/sh

JSDL_BASE=/home/sstraw/build/jsdl
javac  -classpath .:$JSDL_BASE ${1}.java
cd ../..
java  -Djava.library.path=$JSDL_BASE:/usr/lib -classpath .:$JSDL_BASE/build sdl.test.${1}