1 package org.exoplatform.services.wsrp.test; 2 3 7 8 9 import java.rmi.RemoteException ; 10 import org.exoplatform.services.wsrp.type.*; 11 12 19 public class TestSomeScenarios extends BaseTest { 20 21 private static final String PORTLET_HANDLE = "hello/HelloWorld2"; 22 23 public TestSomeScenarios(String s) { 24 super(s); 25 } 26 27 public void testFirstConsumerScenario() throws Throwable , RemoteException { 28 ServiceDescriptionRequest request = new ServiceDescriptionRequest(); 30 request.setDesiredLocales(new String []{"en"}); 31 ServiceDescription serviceDescription = null; 32 serviceDescription = serviceDescriptionInterface.getServiceDescription(request); 33 34 RegistrationContext rC = null; 36 if (serviceDescription.isRequiresRegistration()) { 37 System.out.println("[test] Registration required"); 38 rC = registrationOperationsInterface.register(registrationData); 39 resolveRegistrationContext(rC); 40 } else { 41 System.out.println("[test] Registration non required"); 42 } 43 44 boolean go_on = false; 46 PortletDescription[] array = serviceDescription.getOfferedPortlets(); 47 for (int i = 0; i < array.length; i++) { 48 PortletDescription portletDescription = array[i]; 49 if(PORTLET_HANDLE.equals(portletDescription.getPortletHandle())){ 50 go_on = true; 51 break; 52 } 53 } 54 if(!go_on) 55 fail("The portlet " + PORTLET_HANDLE + " is not deployed"); 56 57 PortletContext portletContext = new PortletContext(); 59 portletContext.setPortletHandle(PORTLET_HANDLE); 60 MarkupRequest getMarkup = getMarkup(rC, portletContext); 61 62 MarkupResponse response = markupOperationsInterface.getMarkup(getMarkup); 64 response.getSessionContext(); 65 response.getMarkupContext(); 66 } 67 } 68 | Popular Tags |