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
$                              set d64
$if %system.buildcode% == SIG $set d64 -d64
$if %system.buildcode% == DIG $set d64 -d32
$if %system.buildcode% == SOL $set d64 -d32
$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 cp xp_example1.class com%system.dirsep%gams%system.dirsep%xp_examples
$call cp api%system.dirsep%gdx.class api%system.dirsep%gamsglobals.class com%system.dirsep%gams%system.dirsep%api
$call java %d64% -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 %d64% -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'