[CRIU] [RFC] zdtm: Add HelloWorld java source code

Cyrill Gorcunov gorcunov at openvz.org
Tue Apr 24 11:58:33 EDT 2012


Guys, here is java trivial HelloWorld example which checkpoints/
restores perfectly well on my testing machine.

So we need to invent the way to use zdtm with java (or
maybe someone familiar with java can say us if JUnit
is to be used here as well).

So just for info.

	Cyrill
-------------- next part --------------
>From f3e040c4e67f7b14c8de8e8b0b7ed3bfa30ea2fb Mon Sep 17 00:00:00 2001
From: Cyrill Gorcunov <gorcunov at openvz.org>
Date: Tue, 24 Apr 2012 19:55:22 +0400
Subject: [PATCH] zdtm: Add HelloWorld java source code

Need to invent the scheme how to test java
applications with zdtm suite.

At moment this class should be compiled as

# javac HelloWorld.java

so HelloWorld.class will be generated and then
it should be started as

# java HelloWorld

Finally the crtools should dump and restore it.
One needs to do all stages manually at moment :(

Tested with OpenJDK-1.6.0.

Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 test/zdtm/java/HelloWorld/HelloWorld.java |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)
 create mode 100644 test/zdtm/java/HelloWorld/HelloWorld.java

diff --git a/test/zdtm/java/HelloWorld/HelloWorld.java b/test/zdtm/java/HelloWorld/HelloWorld.java
new file mode 100644
index 0000000..c73b7bc
--- /dev/null
+++ b/test/zdtm/java/HelloWorld/HelloWorld.java
@@ -0,0 +1,16 @@
+/*
+ * Trivial program which requires no
+ * additional imports
+ */
+public class HelloWorld {
+	public static void main(String[] args) {
+		for (;;) {
+			System.out.println("Hello there");
+			try {
+				Thread.sleep(1000);
+			} catch(InterruptedException ex) {
+				Thread.currentThread().interrupt();
+			}
+		}
+	}
+}
-- 
1.7.7.6



More information about the CRIU mailing list