WW-3681 - testWebFlow(org.apache.struts2.sitegraph.SiteGraphTest) test fails on paths with spaces

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1173210 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Maurizio Cucchiara
2011-09-20 15:58:37 +00:00
parent 75b31dc959
commit 6f3fa76e3f
2 changed files with 8 additions and 15 deletions
@@ -21,17 +21,12 @@
package org.apache.struts2.sitegraph;
import java.io.ByteArrayOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.Writer;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
import org.apache.struts2.StrutsException;
import org.apache.struts2.sitegraph.renderers.DOTRenderer;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
import java.io.*;
/**
* // START SNIPPET: javadocs-intro
@@ -122,7 +117,7 @@ public class SiteGraph {
}
}
StrutsConfigRetriever.setConfiguration(configDir, views.split("[, ]+"));
StrutsConfigRetriever.setConfiguration(configDir, views.split("[,]+"));
DOTRenderer renderer = new DOTRenderer(writer);
renderer.render(namespace);
}
@@ -21,16 +21,14 @@
package org.apache.struts2.sitegraph;
import com.opensymphony.xwork2.util.ClassLoaderUtil;
import org.apache.struts2.StrutsTestCase;
import java.io.File;
import java.io.InputStream;
import java.io.StringWriter;
import java.net.URL;
import org.apache.struts2.StrutsTestCase;
import org.apache.struts2.dispatcher.Dispatcher;
import com.opensymphony.xwork2.util.ClassLoaderUtil;
/**
*/
public class SiteGraphTest extends StrutsTestCase {
@@ -39,7 +37,7 @@ public class SiteGraphTest extends StrutsTestCase {
// working directory being an assumed value when
// running the test: so let's get this class's parent dir
URL url = ClassLoaderUtil.getResource("org/apache/struts2/sitegraph/struts.xml", SiteGraphTest.class);
File file = new File(url.toString().substring(5));
File file = new File(url.toURI());
String dir = file.getParent();
SiteGraph siteGraph = new SiteGraph(dir, dir, dir, "");