Commit 4f31e13c authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

test, app-emu: Add HelloWorld java test

Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 4debf589
/*
* Trivial program which requires no
* additional imports
*/
public class HelloWorld {
public static void main(String[] args) {
int nr_sleeps = 5;
for (;;) {
System.out.println("Hello World");
if (nr_sleeps == 0)
System.exit(0);
try {
Thread.sleep(1000);
nr_sleeps--;
} catch(InterruptedException ex) {
Thread.currentThread().interrupt();
}
}
}
}
#!/bin/bash
crtools="../../../../crtools"
cleanup_class() {
rm -f ./*.class
}
javac HelloWorld.java || exit 1
set -x
rm -rf dump
mkdir dump
setsid java HelloWorld &
pid=${!}
echo Lanuched java application with pid $pid in background
${crtools} dump -D dump -o dump.log -v 4 -t ${pid} || {
echo "Dump failed"
exit 1
}
echo "Dumped, restoring and waiting for completion"
${crtools} restore -D dump -o restore.log -v 4 -t ${pid} || {
echo "Restore failed"
exit 1
}
echo PASS
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment