Demos and unit tests that illustrate the use of JSDL.


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


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.


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

Then you can modify /test each example in place. 

javac  -classpath .:$JSDL_BASE

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 (
$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 
2. chmod +x
3. do "./ TestXXX" where TestXXX is one of the examples
(do not add ".java", ./ wont work)

### cut here ####

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