1 5 package org.exoplatform.services.wsrp.test; 6 7 import org.exoplatform.container.PortalContainer; 8 import org.exoplatform.services.wsrp.producer.*; 9 import org.exoplatform.services.wsrp.producer.impl.PersistentStateManagerImpl; 10 import org.exoplatform.services.wsrp.producer.impl.StateData; 11 import org.exoplatform.services.wsrp.type.*; 12 18 19 public class TestPersistentStateManager extends BaseTest{ 20 private PersistentStateManagerImpl psmanager_ ; 21 22 public TestPersistentStateManager(String s) { 23 super(s); 24 } 25 26 public void setUp() throws Exception { 27 super.setUp() ; 28 PortalContainer manager = PortalContainer.getInstance(); 29 psmanager_ = (PersistentStateManagerImpl) manager. 30 getComponentInstanceOfType(PersistentStateManager.class); 31 } 32 33 public void testPersistentStateData() throws Exception { 34 RegistrationData registrationData = new RegistrationData(); 35 registrationData.setConsumerName("www.exoplatform.com"); 36 registrationData.setConsumerAgent("exoplatform.1.0"); 37 registrationData.setMethodGetSupported(false); 38 registrationData.setConsumerModes(CONSUMER_MODES); 39 registrationData.setConsumerWindowStates(CONSUMER_STATES); 40 registrationData.setConsumerUserScopes(CONSUMER_SCOPES); 41 registrationData.setCustomUserProfileData(CONSUMER_CUSTOM_PROFILES); 42 registrationData.setRegistrationProperties(null); registrationData.setExtensions(null); 45 psmanager_.save("test" , "RegistrationData" , registrationData) ; 46 47 StateData data = psmanager_.load("test"); 48 assertTrue("Expect data is not null", data != null ) ; 49 50 psmanager_.remove("test"); 51 data = psmanager_.load("test"); 52 assertTrue("Expect data is null", data == null ) ; 53 } 54 } 55 | Popular Tags |