1 5 6 package org.exoplatform.services.wsrp.test; 7 8 import java.rmi.RemoteException ; 9 import org.exoplatform.services.wsrp.WSRPConstants; 10 import org.exoplatform.services.wsrp.type.CacheControl; 11 import org.exoplatform.services.wsrp.type.MarkupResponse; 12 import org.exoplatform.services.wsrp.type.PortletContext; 13 import org.exoplatform.services.wsrp.type.RegistrationContext; 14 import org.exoplatform.services.wsrp.type.ServiceDescription; 15 16 17 23 24 public class TestCachingMechanism extends BaseTest{ 25 26 public TestCachingMechanism(String s) { 27 super(s); 28 } 29 30 public void testExistenceOfValidateTag() throws RemoteException { 31 ServiceDescription sd = getServiceDescription(new String []{"en"}); 32 RegistrationContext rc = null; 33 if(sd.isRequiresRegistration()) rc = new RegistrationContext(); 34 PortletContext portletContext = new PortletContext(); 35 portletContext.setPortletHandle("hello/HelloWorld2"); 36 MarkupResponse response = markupOperationsInterface.getMarkup(getMarkup(rc, portletContext)); 37 CacheControl cacheControl = response.getMarkupContext().getCacheControl(); 38 assertEquals(4, cacheControl.getExpires()); 39 assertEquals(WSRPConstants.WSRP_USER_SCOPE_CACHE, cacheControl.getUserScope()); 40 assertNotNull(cacheControl.getValidateTag()); 41 } 42 81 } 82 | Popular Tags |