Skip to content
Snippets Groups Projects
Commit ee291c06 authored by srosse's avatar srosse
Browse files

OO-797: use the right class for the unit tests

parent 927693b3
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
......@@ -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);
}
......
......@@ -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);
}
}
......@@ -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...");
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment