/*
 */
package org.datadryad.rest.storage;

import com.sun.istack.logging.Logger;
import java.util.Arrays;
import java.util.List;
import org.junit.Test;
import static org.junit.Assert.*;

/**
 *
 * @author Dan Leehr <dan.leehr@nescent.org>
 */
public class StoragePathTest {
    private static final Logger log = Logger.getLogger(StoragePathTest.class);

    /**
     * Test of addPathElement method, of class StoragePath.
     */
    @Test
    public void testAddPathElement() {
        log.info("addPathElement");
        String key = "key";
        String value = "value";
        StoragePath instance = new StoragePath();
        assertEquals(0, instance.size());
        instance.addPathElement(key, value);
        assertEquals(1, instance.size());
    }

    /**
     * Test of getKeyPath method, of class StoragePath.
     */
    @Test
    public void testGetKeyPath() {
        log.info("getKeyPath");
        StoragePath instance = new StoragePath();
        String key = "key";
        String value = "value";
        List expResult = Arrays.asList(key);
        instance.addPathElement(key, value);
        List result = instance.getKeyPath();
        assertEquals(expResult, result);
    }

    /**
     * Test of getValuePath method, of class StoragePath.
     */
    @Test
    public void testGetValuePath() {
        log.info("getValuePath");
        StoragePath instance = new StoragePath();
        String key = "key";
        String value = "value";
        List expResult = Arrays.asList(value);
        List result = instance.getValuePath();
        assertEquals(expResult, result);
    }

    /**
     * Test of validElements method, of class StoragePath.
     */
    @Test
    public void testInvalidElements() {
        System.out.println("invalidElements");
        StoragePath instance = new StoragePath();
        // Should be invalid if string length is 0
        String key = "key";
        String invalidValue = "";
        instance.addPathElement(key, invalidValue);
        Boolean expResult = false;
        Boolean result = instance.validElements();
        assertEquals(expResult, result);
    }

    /**
     * Test of validElements method, of class StoragePath.
     */
    @Test
    public void testValidElements() {
        System.out.println("validElements");
        StoragePath instance = new StoragePath();
        // Should be invalid if string length is 0
        String key = "key";
        String validValue = "f";
        instance.addPathElement(key, validValue);
        Boolean expResult = true;
        Boolean result = instance.validElements();
        assertEquals(expResult, result);
    }

}

@@ -727,16 +727,41 @@
 tEquals(
+%22Path size should be 1%22, 
 1, insta
@@ -769,24 +769,24 @@
 ce.size());%0A
-
     %7D%0A%0A    /
@@ -1187,32 +1187,90 @@
    assertEquals(
+%22key Path should be a list containing only the test key%22, 
 expResult, resul
@@ -1652,32 +1652,94 @@
    assertEquals(
+%22value path should be a list containing only the test value%22, 
 expResult, resul
@@ -2235,32 +2235,91 @@
    assertEquals(
+%22Storage Path with zero-length value should not be valid%22, 
 expResult, resul
@@ -2786,32 +2786,32 @@
 alidElements();%0A
-
         assertEq
@@ -2815,16 +2815,74 @@
 tEquals(
+%22Storage path with nonzero-length value should be valid%22, 
 expResul

Add messages for StoragePathTest assertions