public void testResolveLongSitePath1() { httpServletRequest.setRequestURI("/site/1/About/Jobs/"); SitePath sitePath = sitePathResolver.resolveSitePath(httpServletRequest); assertEquals(siteKey_1, sitePath.getSiteKey()); assertEquals("/About/Jobs/", sitePath.getLocalPath().toString()); }
public void testResolveSimpleSitePath1() { httpServletRequest.setRequestURI("/site/1/Frontpage"); SitePath sitePath = sitePathResolver.resolveSitePath(httpServletRequest); assertEquals(siteKey_1, sitePath.getSiteKey()); assertEquals("/Frontpage", sitePath.getLocalPath().toString()); }
public void testResolveSimpleSitePath123() { httpServletRequest.setCharacterEncoding("ISO-8859-1"); httpServletRequest.setRequestURI("/site/123/Frontpage/"); SitePath sitePath = sitePathResolver.resolveSitePath(httpServletRequest); assertEquals(siteKey_123, sitePath.getSiteKey()); assertEquals("/Frontpage/", sitePath.getLocalPath().toString()); }
public void testResolveSimpleSitePathWithNoLocalPathAndNoEndSlash() { httpServletRequest.setCharacterEncoding("ISO-8859-1"); httpServletRequest.setRequestURI("/site/123"); SitePath sitePath = sitePathResolver.resolveSitePath(httpServletRequest); assertEquals(siteKey_123, sitePath.getSiteKey()); assertEquals("", sitePath.getLocalPath().toString()); }
public void testResolveIncludePath() { httpServletRequest.setAttribute("javax.servlet.include.request_uri", "/site/1/About/Jobs/"); httpServletRequest.setRequestURI("/About/Jobs/"); SitePath sitePath = sitePathResolver.resolveSitePath(httpServletRequest); assertEquals(siteKey_1, sitePath.getSiteKey()); assertEquals("/About/Jobs/", sitePath.getLocalPath().toString()); }
public void testResolveSitePathWithNoPrefix() { sitePathResolver.setSitePathPrefix(""); httpServletRequest.setRequestURI("/1/"); SitePath sitePath = sitePathResolver.resolveSitePath(httpServletRequest); assertEquals(siteKey_1, sitePath.getSiteKey()); assertEquals("/", sitePath.getLocalPath().toString()); }
public void testGetParamWithMultipleValues() { httpServletRequest.setRequestURI("/site/1/Frontpage"); httpServletRequest.setParameter("param1", new String[] {"value0", "value1"}); SitePath sitePath = sitePathResolver.resolveSitePath(httpServletRequest); assertEquals(siteKey_1, sitePath.getSiteKey()); assertEquals("/Frontpage", sitePath.getLocalPath().toString()); assertEquals("value0", sitePath.getParam("param1")); }
public void xtestRussianSitePath_WithDefaultCharacterEncoding_UTF_8() { sitePropertiesService.setProperty( siteKey_1, SitePropertyNames.URL_DEFAULT_CHARACTER_ENCODING, "UTF-8"); httpServletRequest.setRequestURI("/site/1/Services%D0%BB/"); SitePath sitePath = sitePathResolver.resolveSitePath(httpServletRequest); assertEquals(siteKey_1, sitePath.getSiteKey()); assertEquals("/Servicesл/", sitePath.getLocalPath().toString()); }
public void xtestSweedishSitePath_With_ISO_8859_1() { sitePropertiesService.setProperty( siteKey_1, SitePropertyNames.URL_DEFAULT_CHARACTER_ENCODING, "ISO-8859-1"); httpServletRequest.setRequestURI("/site/1/B%F6t/"); SitePath sitePath = sitePathResolver.resolveSitePath(httpServletRequest); assertEquals(siteKey_1, sitePath.getSiteKey()); assertEquals("/Böt/", sitePath.getLocalPath().toString()); }