@@ -0,0 +1,2124 @@
+package org.geoserver.shell;%0A%0Aimport com.google.common.base.Charsets;%0Aimport com.google.common.io.Resources;%0Aimport it.geosolutions.geoserver.rest.decoder.utils.JDOMBuilder;%0Aimport org.jdom.Element;%0Aimport org.junit.Test;%0Aimport org.springframework.shell.support.util.OsUtils;%0A%0Aimport java.io.IOException;%0A%0Aimport static junit.framework.Assert.assertEquals;%0Aimport static junit.framework.Assert.assertNotNull;%0A%0Apublic class JDOMUtilTest %7B%0A%0A    @Test%0A    public void getOrAdd() throws Exception %7B%0A        Element element = JDOMBuilder.buildElement(getResourceString(%22workspaces.xml%22));%0A%0A        Element workspaceElement = JDOMUtil.getOrAdd(element, %22workspace%22);%0A        assertNotNull(workspaceElement);%0A%0A        Element testElement = JDOMUtil.getOrAdd(element, %22test%22);%0A        assertNotNull(testElement);%0A    %7D%0A%0A    @Test%0A    public void toPrettyString() throws Exception %7B%0A        Element element = JDOMBuilder.buildElement(getResourceString(%22workspaces.xml%22));%0A        String actual = JDOMUtil.toPrettyString(element);%0A        String expected = %22%3Cworkspaces%3E%5Cr%5Cn%22 +%0A                %22  %3Cworkspace%3E%5Cr%5Cn%22 +%0A                %22    %3Cname%3Eit.geosolutions%3C/name%3E%5Cr%5Cn%22 +%0A                %22  %3C/workspace%3E%5Cr%5Cn%22 +%0A                %22  %3Cworkspace%3E%5Cr%5Cn%22 +%0A                %22    %3Cname%3Ecite%3C/name%3E%5Cr%5Cn%22 +%0A                %22  %3C/workspace%3E%5Cr%5Cn%22 +%0A                %22  %3Cworkspace%3E%5Cr%5Cn%22 +%0A                %22    %3Cname%3Etopp%3C/name%3E%5Cr%5Cn%22 +%0A                %22  %3C/workspace%3E%5Cr%5Cn%22 +%0A                %22%3C/workspaces%3E%22;%0A        assertEquals(expected, actual);%0A    %7D%0A%0A    @Test%0A    public void toStringTest() throws Exception %7B%0A        Element element = JDOMBuilder.buildElement(getResourceString(%22workspaces.xml%22));%0A        String actual = JDOMUtil.toString(element);%0A        String expected = %22%3Cworkspaces%3E%3Cworkspace%3E%3Cname%3Eit.geosolutions%3C/name%3E%3C/workspace%3E%3Cworkspace%3E%3Cname%3Ecite%3C/name%3E%3C/workspace%3E%3Cworkspace%3E%3Cname%3Etopp%3C/name%3E%3C/workspace%3E%3C/workspaces%3E%22;%0A        assertEquals(expected, actual);%0A    %7D%0A%0A    protected String getResourceString(String path) throws IOException %7B%0A        return Resources.toString(Resources.getResource(path), Charsets.UTF_8);%0A    %7D%0A%7D%0A

Add JDOMUtil tests