@@ -0,0 +1,2201 @@
+package org.gnode.nix;%0A%0Aimport org.junit.After;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0A%0Aimport static org.junit.Assert.*;%0A%0Apublic class TestValue %7B%0A%0A    @Before%0A    public void setUp() %7B%0A%0A    %7D%0A%0A    @After%0A    public void tearDown() %7B%0A%0A    %7D%0A%0A    @Test%0A    public void testObject() %7B%0A%0A        Value boolVal = new Value(true);%0A        assertEquals(boolVal.getBoolean(), true);%0A        try %7B%0A            boolVal.getInt();%0A            fail();%0A        %7D catch (RuntimeException re) %7B%0A        %7D%0A%0A        Value intVal = new Value(42);%0A        assertEquals(intVal.getInt(), 42);%0A        try %7B%0A            intVal.getBoolean();%0A            fail();%0A        %7D catch (RuntimeException re) %7B%0A        %7D%0A%0A        Value longVal = new Value(42L);%0A        assertEquals(longVal.getLong(), 42L);%0A        try %7B%0A            longVal.getBoolean();%0A            fail();%0A        %7D catch (RuntimeException re) %7B%0A        %7D%0A%0A        Value doubleVal = new Value(2.71828);%0A        assertTrue(doubleVal.getDouble() == 2.71828);%0A        try %7B%0A            doubleVal.getBoolean();%0A            fail();%0A        %7D catch (RuntimeException re) %7B%0A        %7D%0A%0A        Value stringVal = new Value(%22When shall we three meet again%22);%0A        assertEquals(stringVal.getString(), %22When shall we three meet again%22);%0A        try %7B%0A            stringVal.getBoolean();%0A            fail();%0A        %7D catch (RuntimeException re) %7B%0A        %7D%0A%0A        Value v1 = new Value();%0A        assertEquals(v1.getType(), DataType.Nothing);%0A%0A        assertFalse(Value.supportsType(DataType.DateTime));%0A    %7D%0A%0A    @Test%0A    public void testSwap() %7B%0A%0A        Value v1 = new Value(%22Hallo%22);%0A        Value v2 = new Value(%22Welt%22);%0A%0A        v1.swap(v2);%0A%0A        assertEquals(v1.getString(), %22Welt%22);%0A        assertEquals(v2.getString(), %22Hallo%22);%0A%0A        //lets swap a int with a Nothing%0A        Value v3 = new Value(42);%0A        Value v4 = new Value();%0A%0A        v4.swap(v3);%0A%0A        assertEquals(v4.getInt(), 42);%0A        assertEquals(v3.getType(), DataType.Nothing);%0A%0A        // and now with the string%0A        String checkStr = v2.getString();%0A        v4.swap(v2);%0A        assertEquals(v2.getInt(), 42);%0A        assertEquals(v4.getString(), checkStr);%0A    %7D%0A%7D%0A

write tests for Value