import org.apache.felix.ipojo.everest.services.IllegalActionOnResourceException;
import org.apache.felix.ipojo.everest.services.Resource;
import org.apache.felix.ipojo.everest.services.ResourceMetadata;
import org.apache.felix.ipojo.everest.services.ResourceNotFoundException;
import org.junit.Test;

import static org.fest.assertions.Assertions.assertThat;

/**
 * Created with IntelliJ IDEA.
 * User: root
 * Date: 16/07/13
 * Time: 17:36
 * To change this template use File | Settings | File Templates.
 */
public class TestEnvironment extends CommonTest {


    @Test
    public void testCommonMetadataPresent() throws ResourceNotFoundException, IllegalActionOnResourceException {
        Resource r = read("/system/environment");
        // Resource should not be observable
        assertThat(r.isObservable()).isFalse();
        ResourceMetadata m = r.getMetadata();
        assertThat(m.get("TERM")).isNotEqualTo(null);
        assertThat(m.get("SHLVL")).isNotEqualTo(null);
        assertThat(m.get("LESSCLOSE")).isNotEqualTo(null);
        assertThat(m.get("XFILESEARCHPATH")).isNotEqualTo(null);
        assertThat(m.get("SUDO_UID")).isNotEqualTo(null);
        assertThat(m.get("COLORTERM")).isNotEqualTo(null);
        assertThat(m.get("MAIL")).isNotEqualTo(null);
        assertThat(m.get("XDG_SESSION_COOKIE")).isNotEqualTo(null);
        assertThat(m.get("PWD")).isNotEqualTo(null);
        assertThat(m.get("LOGNAME")).isNotEqualTo(null);
        assertThat(m.get("SUDO_USER")).isNotEqualTo(null);
        assertThat(m.get("_")).isNotEqualTo(null);
        assertThat(m.get("NLSPATH")).isNotEqualTo(null);
        assertThat(m.get("OLDPWD")).isNotEqualTo(null);
        assertThat(m.get("SHELL")).isNotEqualTo(null);
        assertThat(m.get("SUDO_GID")).isNotEqualTo(null);
        assertThat(m.get("PATH")).isNotEqualTo(null);
        assertThat(m.get("DISPLAY")).isNotEqualTo(null);
        assertThat(m.get("USER")).isNotEqualTo(null);
        assertThat(m.get("HOME")).isNotEqualTo(null);
        assertThat(m.get("LESSOPEN")).isNotEqualTo(null);
        assertThat(m.get("XAUTHORITY")).isNotEqualTo(null);
        assertThat(m.get("SUDO_COMMAND")).isNotEqualTo(null);
        assertThat(m.get("LS_COLORS")).isNotEqualTo(null);
        assertThat(m.get("USERNAME")).isNotEqualTo(null);
        assertThat(m.get("XDG_RUNTIME_DIR")).isNotEqualTo(null);
        assertThat(m.get("LANG")).isNotEqualTo(null);
    }
}

@@ -863,24 +863,71 @@
 Metadata();%0A
+        assertThat(m.keySet()).isNotEmpty();%0A//
         asse
@@ -960,32 +960,34 @@
 tEqualTo(null);%0A
+//
         assertTh
@@ -1017,32 +1017,34 @@
 tEqualTo(null);%0A
+//
         assertTh
@@ -1078,32 +1078,34 @@
 tEqualTo(null);%0A
+//
         assertTh
@@ -1145,32 +1145,34 @@
 tEqualTo(null);%0A
+//
         assertTh
@@ -1205,32 +1205,34 @@
 tEqualTo(null);%0A
+//
         assertTh
@@ -1266,32 +1266,34 @@
 tEqualTo(null);%0A
+//
         assertTh
@@ -1322,32 +1322,34 @@
 tEqualTo(null);%0A
+//
         assertTh
@@ -1392,32 +1392,34 @@
 tEqualTo(null);%0A
+//
         assertTh
@@ -1447,32 +1447,34 @@
 tEqualTo(null);%0A
+//
         assertTh
@@ -1506,32 +1506,34 @@
 tEqualTo(null);%0A
+//
         assertTh
@@ -1567,32 +1567,34 @@
 tEqualTo(null);%0A
+//
         assertTh
@@ -1620,32 +1620,34 @@
 tEqualTo(null);%0A
+//
         assertTh
@@ -1679,32 +1679,34 @@
 tEqualTo(null);%0A
+//
         assertTh
@@ -1737,32 +1737,34 @@
 tEqualTo(null);%0A
+//
         assertTh
@@ -1794,32 +1794,34 @@
 tEqualTo(null);%0A
+//
         assertTh
@@ -1854,32 +1854,34 @@
 tEqualTo(null);%0A
+//
         assertTh
@@ -1910,32 +1910,34 @@
 tEqualTo(null);%0A
+//
         assertTh
@@ -1969,32 +1969,34 @@
 tEqualTo(null);%0A
+//
         assertTh
@@ -2025,32 +2025,34 @@
 tEqualTo(null);%0A
+//
         assertTh
@@ -2081,32 +2081,34 @@
 tEqualTo(null);%0A
+//
         assertTh
@@ -2141,32 +2141,34 @@
 tEqualTo(null);%0A
+//
         assertTh
@@ -2203,32 +2203,34 @@
 tEqualTo(null);%0A
+//
         assertTh
@@ -2267,32 +2267,34 @@
 tEqualTo(null);%0A
+//
         assertTh
@@ -2328,32 +2328,34 @@
 tEqualTo(null);%0A
+//
         assertTh
@@ -2388,32 +2388,34 @@
 tEqualTo(null);%0A
+//
         assertTh
@@ -2459,24 +2459,26 @@
 alTo(null);%0A
+//
         asse

fix for latest merge, environment variables are different in each machine