Jex1.gms : Test expert level Java API to read and write GDX

Description

Contributor: Lutz Westermann, October 2012


Small Model of Type : Java


Category : GAMS API library


Main file : Jex1.gms

$title 'Test expert level Java API to read and write GDX' (JEX1,SEQ=10)

$onText
Contributor: Lutz Westermann, October 2012
$offText


$set srcRoot %gams.sysdir%apifiles%system.dirsep%Java%system.dirsep%

$                              set P
$if %system.filesys% == UNIX  $set P -p
$if not set jcomp $set jcomp javac

$call rm -rf demanddata.gdx com

$call mkdir %P% com%system.dirsep%gams%system.dirsep%api
$call mkdir %P% com%system.dirsep%gams%system.dirsep%xp_examples
$call %jcomp% "%srcRoot%xp_example1.java" "%srcRoot%api%system.dirsep%gdx.java" "%srcRoot%api%system.dirsep%gamsglobals.java" -d .
$if errorlevel 1 $abort 'Problem compiling xp_example1.java'
$call java -cp . -Djava.library.path="%srcRoot%api" com.gams.xp_examples.xp_example1 "%gams.sysdir%."
$if errorlevel 1 $abort 'Problem executing xp_example1 writing GDX file'
$call gdxdiff demanddata.gdx demandwant.gdx
$if errorlevel 1 $abort 'Demanddata not as expected'
$call java -cp . -Djava.library.path="%srcRoot%api" com.gams.xp_examples.xp_example1 "%gams.sysdir%." trnsport.gdx
$if errorlevel 1 $abort 'Problem executing xp_example1 reading GDX file'