diff options
author | Sven Gothel <[email protected]> | 2012-03-28 17:40:49 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2012-03-28 17:40:49 +0200 |
commit | 133db9f855b351e25c1b9ebf752fdb05e03ae36c (patch) | |
tree | 5ab142086a6093e162d16fd36bdc3958e48fc1a4 /src | |
parent | 469a4987bd6be2fe49c2e6e0fb97a42f26eabfbe (diff) |
Test: Add dump of environment vars
Diffstat (limited to 'src')
-rw-r--r-- | src/junit/com/jogamp/common/util/TestSystemPropsAndEnvs.java (renamed from src/junit/com/jogamp/common/util/TestSystemProperties.java) | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/src/junit/com/jogamp/common/util/TestSystemProperties.java b/src/junit/com/jogamp/common/util/TestSystemPropsAndEnvs.java index 8ede038..d9afe1d 100644 --- a/src/junit/com/jogamp/common/util/TestSystemProperties.java +++ b/src/junit/com/jogamp/common/util/TestSystemPropsAndEnvs.java @@ -37,7 +37,7 @@ import org.junit.Test; import com.jogamp.junit.util.JunitTracer; -public class TestSystemProperties extends JunitTracer { +public class TestSystemPropsAndEnvs extends JunitTracer { @Test public void dumpProperties() { @@ -47,13 +47,26 @@ public class TestSystemProperties extends JunitTracer { while (iter.hasNext()) { i++; Map.Entry<Object, Object> entry = iter.next(); - System.out.println(i+": "+entry.getKey() + " = " + entry.getValue()); + System.out.format("%4d: %s = %s%n", i, entry.getKey(), entry.getValue()); } - System.out.println("Property count: "+i); + System.out.println("Property count: "+i); + } + + @Test + public void dumpEnvironment() { + int i=0; + Map<String, String> env = System.getenv(); + for (String envName : env.keySet()) { + i++; + System.out.format("%4d: %s = %s%n", + i, envName, + env.get(envName)); + } + System.out.println("Environment count: "+i); } public static void main(String args[]) throws IOException { - String tstname = TestSystemProperties.class.getName(); + String tstname = TestSystemPropsAndEnvs.class.getName(); org.junit.runner.JUnitCore.main(tstname); } |