directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From szoer...@apache.org
Subject svn commit: r714064 - /directory/sandbox/szoerner/syspropPartition/src/test/java/org/apache/directory/samples/partition/sysprops/backend/SystemPropertyGeneratorTest.java
Date Fri, 14 Nov 2008 16:39:28 GMT
Author: szoerner
Date: Fri Nov 14 08:39:28 2008
New Revision: 714064

URL: http://svn.apache.org/viewvc?rev=714064&view=rev
Log:
Several improvements

Modified:
    directory/sandbox/szoerner/syspropPartition/src/test/java/org/apache/directory/samples/partition/sysprops/backend/SystemPropertyGeneratorTest.java

Modified: directory/sandbox/szoerner/syspropPartition/src/test/java/org/apache/directory/samples/partition/sysprops/backend/SystemPropertyGeneratorTest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/szoerner/syspropPartition/src/test/java/org/apache/directory/samples/partition/sysprops/backend/SystemPropertyGeneratorTest.java?rev=714064&r1=714063&r2=714064&view=diff
==============================================================================
--- directory/sandbox/szoerner/syspropPartition/src/test/java/org/apache/directory/samples/partition/sysprops/backend/SystemPropertyGeneratorTest.java
(original)
+++ directory/sandbox/szoerner/syspropPartition/src/test/java/org/apache/directory/samples/partition/sysprops/backend/SystemPropertyGeneratorTest.java
Fri Nov 14 08:39:28 2008
@@ -1,12 +1,32 @@
 package org.apache.directory.samples.partition.sysprops.backend;
 
+import java.util.Properties;
+import java.util.Set;
+
 import junit.framework.TestCase;
 
+/**
+ * Tests filling a property storage with the system property.
+ */
 public class SystemPropertyGeneratorTest extends TestCase {
     
     public void testFilling() {
+        
+        // Fill storage
         PropertyStorage storage = new PropertyStorage();
         SystemPropertyGenerator.fill(storage);
+        
+        // Check, whether the system properties are stored within 
+        Properties props = System.getProperties();
+        Set<Object> keys = props.keySet();
+        for (Object key : keys) {
+            
+            PropertyNode node = storage.findByKey(key.toString());
+            assertNotNull(node);
+            assertEquals(node.getKey(), key);
+            
+            String value = System.getProperty(key.toString());
+            assertEquals(value, node.getValue());
+        }
     }
-
 }



Mime
View raw message