diff --git a/src/main/java/org/olat/dispatcher/CatalogExportModuleDispatcher.java b/src/main/java/org/olat/dispatcher/CatalogExportModuleDispatcher.java index ef017ee40aa285325b0f3cdb960e53c1c065afb0..10d02c88e3d912cbaf5c84ed334928b9ec4fc8a0 100644 --- a/src/main/java/org/olat/dispatcher/CatalogExportModuleDispatcher.java +++ b/src/main/java/org/olat/dispatcher/CatalogExportModuleDispatcher.java @@ -59,7 +59,6 @@ import org.olat.basesecurity.SecurityGroup; import org.olat.catalog.CatalogEntry; import org.olat.catalog.CatalogManager; import org.olat.core.dispatcher.Dispatcher; -import org.olat.core.dispatcher.DispatcherModule; import org.olat.core.gui.media.FileMediaResource; import org.olat.core.gui.media.NotFoundMediaResource; import org.olat.core.gui.media.ServletUtil; diff --git a/src/test/java/org/olat/core/commons/services/webdav/WebDAVCommandsTest.java b/src/test/java/org/olat/core/commons/services/webdav/WebDAVCommandsTest.java index 9a097ca9186b38d3400faced9f0fc9f5d51aaed8..c8c8e8e96fc4cbd74e8c751a6b90297ecedc5277 100644 --- a/src/test/java/org/olat/core/commons/services/webdav/WebDAVCommandsTest.java +++ b/src/test/java/org/olat/core/commons/services/webdav/WebDAVCommandsTest.java @@ -54,12 +54,14 @@ public class WebDAVCommandsTest extends WebDAVTestCase { //list root content of its webdav folder WebDAVConnection conn = new WebDAVConnection(); conn.setCredentials(user.getName(), "A6B7C8"); - URI uri = conn.getContextURI().build(); + URI uri = conn.getBaseURI().build(); HttpResponse response = conn.propfind(uri); assertEquals(207, response.getStatusLine().getStatusCode()); String xml = EntityUtils.toString(response.getEntity()); - Assert.assertTrue(xml.indexOf("/webdav/coursefolders/") > 0); + Assert.assertTrue(xml.indexOf("<D:multistatus") > 0);//Windows need the D namespace + Assert.assertTrue(xml.indexOf("<D:href>/</D:href>") > 0);//check the root + Assert.assertTrue(xml.indexOf("<D:href>/webdav/</D:href>") > 0);//check the webdav folder IOUtils.closeQuietly(conn); } diff --git a/src/test/java/org/olat/core/commons/services/webdav/WebDAVConnection.java b/src/test/java/org/olat/core/commons/services/webdav/WebDAVConnection.java index 1cb4f20fec4d7ea7492f1e1c3eec511c4fc72c3f..c15a1a8f7ce07376b423ddc9f2e4c10e71437abb 100644 --- a/src/test/java/org/olat/core/commons/services/webdav/WebDAVConnection.java +++ b/src/test/java/org/olat/core/commons/services/webdav/WebDAVConnection.java @@ -55,7 +55,6 @@ public class WebDAVConnection implements Closeable { private int port = WebDAVTestCase.PORT; private String host = WebDAVTestCase.HOST; private String protocol = WebDAVTestCase.PROTOCOL; - private String contextPath = WebDAVTestCase.CONTEXT_PATH; private final BasicCookieStore cookieStore = new BasicCookieStore(); private final CredentialsProvider provider = new BasicCredentialsProvider(); @@ -104,11 +103,4 @@ public class WebDAVConnection implements Closeable { URI uri = new URI(protocol, null, host, port, null, null, null); return UriBuilder.fromUri(uri); } - - /** - * @return http://localhost:9997/webdav - */ - public UriBuilder getContextURI() throws URISyntaxException { - return getBaseURI().path(contextPath); - } } diff --git a/src/test/java/org/olat/core/commons/services/webdav/WebDAVTestCase.java b/src/test/java/org/olat/core/commons/services/webdav/WebDAVTestCase.java index f5fada09399a0dd60b853b5583692ebc26176a99..a92b8025362d0a22cb85af79ef7788de3be1eb99 100644 --- a/src/test/java/org/olat/core/commons/services/webdav/WebDAVTestCase.java +++ b/src/test/java/org/olat/core/commons/services/webdav/WebDAVTestCase.java @@ -54,7 +54,6 @@ public abstract class WebDAVTestCase extends OlatTestCase { public final static int PORT = 9997; public final static String HOST = "localhost"; public final static String PROTOCOL = "http"; - public final static String CONTEXT_PATH = "webdav"; private static GrizzlyWebServer webServer; @@ -77,7 +76,6 @@ public abstract class WebDAVTestCase extends OlatTestCase { sa.addInitParameter("output", "32768"); sa.addInitParameter("listings", "true"); sa.addInitParameter("readonly", "false"); - sa.setContextPath("/" + CONTEXT_PATH); webServer.addGrizzlyAdapter(sa, new String[]{""}); log.info("Starting the Grizzly Web Container for WebDAV..."); diff --git a/src/test/java/org/olat/test/AllTestsJunit4.java b/src/test/java/org/olat/test/AllTestsJunit4.java index a2a1ed717dcba8fc39c7e409c3e38ae5a54fbfa2..584b1533647bb8cc249664357c5b60414ad020cc 100644 --- a/src/test/java/org/olat/test/AllTestsJunit4.java +++ b/src/test/java/org/olat/test/AllTestsJunit4.java @@ -77,7 +77,7 @@ import org.junit.runners.Suite; org.olat.commons.coordinate.cluster.jms.JMSTest.class,//ok org.olat.commons.coordinate.cluster.lock.LockTest.class,//ok org.olat.commons.coordinate.CoordinatorTest.class,//ok - org.olat.core.commons.services.webdav.WebDAVTestCase.class,//ok + org.olat.core.commons.services.webdav.WebDAVCommandsTest.class,//ok org.olat.core.commons.services.webdav.manager.WebDAVManagerTest.class,//ok org.olat.core.commons.taskExecutor.PersistentTaskDAOTest.class,//ok org.olat.core.commons.taskExecutor.TaskExecutorManagerTest.class,//ok