コード例 #1
0
  @Test
  public void testGetAdminDeploymentPath_when_vhost_set() throws Exception {
    MockHttpServletRequest request = new MockHttpServletRequest();
    request.setRequestURI("/site/0/");
    request.setContextPath(null);

    VirtualHostHelper.setBasePath(request, "");
    assertEquals("", DeploymentPathResolver.getSiteDeploymentPath(request));

    VirtualHostHelper.setBasePath(request, "/");
    assertEquals("/", DeploymentPathResolver.getSiteDeploymentPath(request));
  }
コード例 #2
0
 @Test
 public void testGetAdminDeploymentPath_when_no_context_path_or_vhost_set() throws Exception {
   MockHttpServletRequest request = new MockHttpServletRequest();
   request.setRequestURI("/site/0/");
   request.setContextPath(null);
   assertEquals("/site/0", DeploymentPathResolver.getSiteDeploymentPath(request));
 }
コード例 #3
0
 @Test
 public void getAdminDeploymentPath_when_context_path_not_set_and_vhost_not_set()
     throws Exception {
   MockHttpServletRequest request = new MockHttpServletRequest();
   request.setContextPath(null);
   assertEquals("/admin", DeploymentPathResolver.getAdminDeploymentPath(request));
 }
コード例 #4
0
 @Test
 public void testGetAdminDeploymentPath_when_context_path_set() throws Exception {
   MockHttpServletRequest request = new MockHttpServletRequest();
   request.setContextPath("/cms");
   assertEquals("/cms/admin", DeploymentPathResolver.getAdminDeploymentPath(request));
 }