Java Code Examples for javax.portlet.PortletMode#VIEW

The following examples show how to use javax.portlet.PortletMode#VIEW . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: InvokeRenderTest.java    From portals-pluto with Apache License 2.0 6 votes vote down vote up
@Test
public void invoke1() throws Exception {
   meths.reset();
   PortletInvoker i = new PortletInvoker(ams, "portlet1", cfg);
   PortletMode mode = PortletMode.VIEW;
   req.setMode(mode);
   i.render(req, resp);
   List<String> names = meths.getMethods();
   assertNotNull(names);
   assertEquals(3, names.size());
   List<String> soll = Arrays.asList(new String[] {
         Render1.class.getSimpleName() + "#render1a",
         Render1.class.getSimpleName() + "#render1b",
         Render1.class.getSimpleName() + "#render1c"
         });
   for (String name : names) {
      assertTrue(soll.contains(name));
   }
}
 
Example 2
Source File: InvokeHeaderTest.java    From portals-pluto with Apache License 2.0 6 votes vote down vote up
@Test
public void invoke3b() throws Exception {
   meths.reset();
   PortletInvoker i = new PortletInvoker(ams, "portlet3");
   PortletMode mode = PortletMode.VIEW;
   req.setMode(mode);
   i.renderHeaders(req, resp);
   List<String> names = meths.getMethods();
   assertNotNull(names);
   assertEquals(3, names.size());
   List<String> soll = Arrays.asList(new String[] {
         Header1.class.getSimpleName() + "#header3c",
         Header1.class.getSimpleName() + "#header3a",
         Header1.class.getSimpleName() + "#header3b",
         });
   assertArrayEquals(soll.toArray(), names.toArray());
}
 
Example 3
Source File: PortletAnnotationControllerTests.java    From spring4-understanding with Apache License 2.0 6 votes vote down vote up
@Test
public void standardHandleMethod() throws Exception {
	DispatcherPortlet portlet = new DispatcherPortlet() {
		@Override
		protected ApplicationContext createPortletApplicationContext(ApplicationContext parent) throws BeansException {
			GenericWebApplicationContext wac = new GenericWebApplicationContext();
			wac.registerBeanDefinition("controller", new RootBeanDefinition(MyController.class));
			wac.refresh();
			return wac;
		}
	};
	portlet.init(new MockPortletConfig());

	MockRenderRequest request = new MockRenderRequest(PortletMode.VIEW);
	MockRenderResponse response = new MockRenderResponse();
	portlet.render(request, response);
	assertEquals("test", response.getContentAsString());
}
 
Example 4
Source File: InvokeHeaderTest.java    From portals-pluto with Apache License 2.0 6 votes vote down vote up
@Test
public void invoke1() throws Exception {
   meths.reset();
   PortletInvoker i = new PortletInvoker(ams, "portlet1");
   PortletMode mode = PortletMode.VIEW;
   req.setMode(mode);
   i.renderHeaders(req, resp);
   List<String> names = meths.getMethods();
   assertNotNull(names);
   assertEquals(3, names.size());
   List<String> soll = Arrays.asList(new String[] {
         Header1.class.getSimpleName() + "#header1a",
         Header1.class.getSimpleName() + "#header1b",
         Header1.class.getSimpleName() + "#header1c"
         });
   for (String name : names) {
      assertTrue(soll.contains(name));
   }
}
 
Example 5
Source File: Portlet20AnnotationControllerTests.java    From spring4-understanding with Apache License 2.0 6 votes vote down vote up
@Test
public void standardHandleMethod() throws Exception {
	DispatcherPortlet portlet = new DispatcherPortlet() {
		@Override
		protected ApplicationContext createPortletApplicationContext(ApplicationContext parent) throws BeansException {
			GenericWebApplicationContext wac = new GenericWebApplicationContext();
			wac.registerBeanDefinition("controller", new RootBeanDefinition(MyController.class));
			wac.refresh();
			return wac;
		}
	};
	portlet.init(new MockPortletConfig());

	MockRenderRequest request = new MockRenderRequest(PortletMode.VIEW);
	MockRenderResponse response = new MockRenderResponse();
	portlet.render(request, response);
	assertEquals("test", response.getContentAsString());
}
 
Example 6
Source File: PortletAnnotationControllerTests.java    From spring4-understanding with Apache License 2.0 6 votes vote down vote up
@Test
public void mavResolver() throws Exception {
	DispatcherPortlet portlet = new DispatcherPortlet() {
		@Override
		protected ApplicationContext createPortletApplicationContext(ApplicationContext parent) throws BeansException {
			GenericWebApplicationContext wac = new GenericWebApplicationContext();
			wac.registerBeanDefinition("controller",
					new RootBeanDefinition(ModelAndViewResolverController.class));
			RootBeanDefinition adapterDef = new RootBeanDefinition(AnnotationMethodHandlerAdapter.class);
			adapterDef.getPropertyValues()
					.add("customModelAndViewResolver", new MyModelAndViewResolver());
			wac.registerBeanDefinition("handlerAdapter", adapterDef);
			wac.refresh();
			return wac;
		}
	};
	portlet.init(new MockPortletConfig());

	MockRenderRequest request = new MockRenderRequest(PortletMode.VIEW);
	MockRenderResponse response = new MockRenderResponse();
	portlet.render(request, response);
}
 
Example 7
Source File: InvokeRenderTest.java    From portals-pluto with Apache License 2.0 6 votes vote down vote up
@Test
public void invoke3b() throws Exception {
   meths.reset();
   PortletInvoker i = new PortletInvoker(ams, "portlet3", cfg);
   PortletMode mode = PortletMode.VIEW;
   req.setMode(mode);
   i.render(req, resp);
   List<String> names = meths.getMethods();
   assertNotNull(names);
   assertEquals(3, names.size());
   List<String> soll = Arrays.asList(new String[] {
         Render1.class.getSimpleName() + "#render3c",
         Render1.class.getSimpleName() + "#render3a",
         Render1.class.getSimpleName() + "#render3b",
         });
   assertArrayEquals(soll.toArray(), names.toArray());
}
 
Example 8
Source File: GenericPortletFeaturesInvokeTest.java    From portals-pluto with Apache License 2.0 5 votes vote down vote up
@Test
public void test6doView() throws Exception {
   List<String> methNames = Arrays.asList(new String[] {
         TestPortlet6.class.getSimpleName() + "#doHeaders",
         TestPortlet6.class.getSimpleName() + "#doView",
   });
   PortletMode pm = PortletMode.VIEW;
   helper.renderWithHeaders("Portlet6", pm, methNames);
   assertTrue(meths.isConfigExists());
}
 
Example 9
Source File: AnnotatedGenericPortletInvokeTest.java    From portals-pluto with Apache License 2.0 5 votes vote down vote up
@Test
public void test1render() throws Exception {
   String expectedMeth = TestPortlet5.class.getSimpleName() + "#render";
   PortletMode pm = PortletMode.VIEW;
   helper.render("Portlet5", pm, expectedMeth);
   assertTrue(meths.isConfigExists());
}
 
Example 10
Source File: PortletState.java    From sakai with Educational Community License v2.0 5 votes vote down vote up
public PortletState(String id)
{
	this.id = id;
	portletMode = PortletMode.VIEW;
	windowState = WindowState.NORMAL;
	parameters = new HashMap();
}
 
Example 11
Source File: InvokeHeaderTest.java    From portals-pluto with Apache License 2.0 5 votes vote down vote up
@Test
public void invoke2() throws Exception {
   meths.reset();
   PortletInvoker i = new PortletInvoker(ams, "portlet2");
   PortletMode mode = PortletMode.VIEW;
   req.setMode(mode);
   i.renderHeaders(req, resp);
   List<String> names = meths.getMethods();
   assertNotNull(names);
   assertEquals(0, names.size());
}
 
Example 12
Source File: PortletInvokeTest.java    From portals-pluto with Apache License 2.0 5 votes vote down vote up
@Test
public void test3render() throws Exception {
   String expectedMeth = TestPortlet3.class.getSimpleName() + "#render";
   PortletMode pm = PortletMode.VIEW;
   helper.render("Portlet3", pm, expectedMeth);
   assertTrue(meths.isConfigExists());
}
 
Example 13
Source File: InvokeRenderTest.java    From portals-pluto with Apache License 2.0 5 votes vote down vote up
@Test
public void invoke6() throws Exception {
   meths.reset();
   PortletInvoker i = new PortletInvoker(ams, "portlet6", cfg);
   PortletMode mode = PortletMode.VIEW;
   req.setMode(mode);
   i.render(req, resp);
   List<String> names = meths.getMethods();
   assertEquals(2, names.size());
   List<String> soll = Arrays.asList(new String[] {
         Render2.class.getSimpleName() + "#render6and7", 
         Render2.class.getSimpleName() + "#render6andStar",
         });
   assertArrayEquals(soll.toArray(), names.toArray());
}
 
Example 14
Source File: PortletInvokeTest.java    From portals-pluto with Apache License 2.0 5 votes vote down vote up
@Test
public void test1render() throws Exception {
   String expectedMeth = TestPortlet1.class.getSimpleName() + "#render";
   PortletMode pm = PortletMode.VIEW;
   helper.render("Portlet1", pm, expectedMeth);
   assertTrue(meths.isConfigExists());
}
 
Example 15
Source File: InvokeRenderTest.java    From portals-pluto with Apache License 2.0 5 votes vote down vote up
@Test
public void invoke2() throws Exception {
   meths.reset();
   PortletInvoker i = new PortletInvoker(ams, "portlet2", cfg);
   PortletMode mode = PortletMode.VIEW;
   req.setMode(mode);
   i.render(req, resp);
   List<String> names = meths.getMethods();
   assertNotNull(names);
   assertEquals(0, names.size());
}
 
Example 16
Source File: PortletAnnotationControllerTests.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@Test
public void typeLevelParameterDispatchingController() throws Exception {
	DispatcherPortlet portlet = new DispatcherPortlet() {
		@Override
		protected ApplicationContext createPortletApplicationContext(ApplicationContext parent) throws BeansException {
			StaticPortletApplicationContext wac = new StaticPortletApplicationContext();
			wac.setPortletContext(new MockPortletContext());
			RootBeanDefinition bd = new RootBeanDefinition(MyTypeLevelParameterDispatchingController.class);
			bd.setScope(WebApplicationContext.SCOPE_REQUEST);
			wac.registerBeanDefinition("controller", bd);
			RootBeanDefinition bd2 = new RootBeanDefinition(MySpecialParameterDispatchingController.class);
			bd2.setScope(WebApplicationContext.SCOPE_REQUEST);
			wac.registerBeanDefinition("controller2", bd2);
			RootBeanDefinition bd3 = new RootBeanDefinition(MyOtherSpecialParameterDispatchingController.class);
			bd3.setScope(WebApplicationContext.SCOPE_REQUEST);
			wac.registerBeanDefinition("controller3", bd3);
			RootBeanDefinition bd4 = new RootBeanDefinition(MyParameterDispatchingController.class);
			bd4.setScope(WebApplicationContext.SCOPE_REQUEST);
			wac.registerBeanDefinition("controller4", bd4);
			AnnotationConfigUtils.registerAnnotationConfigProcessors(wac);
			wac.refresh();
			return wac;
		}
	};
	portlet.init(new MockPortletConfig());

	MockRenderRequest request = new MockRenderRequest(PortletMode.HELP);
	MockRenderResponse response = new MockRenderResponse();
	try {
		portlet.render(request, response);
		fail("Should have thrown NoHandlerFoundException");
	}
	catch (NoHandlerFoundException ex) {
		// expected
	}

	request = new MockRenderRequest(PortletMode.EDIT);
	response = new MockRenderResponse();
	portlet.render(request, response);
	assertEquals("myDefaultView", response.getContentAsString());

	request = new MockRenderRequest(PortletMode.EDIT);
	request.addParameter("myParam", "myValue");
	response = new MockRenderResponse();
	portlet.render(request, response);
	assertEquals("myView", response.getContentAsString());

	request = new MockRenderRequest(PortletMode.EDIT);
	request.addParameter("myParam", "mySpecialValue");
	response = new MockRenderResponse();
	portlet.render(request, response);
	assertEquals("mySpecialView", response.getContentAsString());

	request = new MockRenderRequest(PortletMode.EDIT);
	request.addParameter("myParam", "myOtherSpecialValue");
	response = new MockRenderResponse();
	portlet.render(request, response);
	assertEquals("myOtherSpecialView", response.getContentAsString());

	request = new MockRenderRequest(PortletMode.VIEW);
	response = new MockRenderResponse();
	portlet.render(request, response);
	assertEquals("myView", response.getContentAsString());

	request = new MockRenderRequest(PortletMode.EDIT);
	request.addParameter("myParam", "myValue");
	request.addParameter("view", "other");
	response = new MockRenderResponse();
	portlet.render(request, response);
	assertEquals("myOtherView", response.getContentAsString());

	request = new MockRenderRequest(PortletMode.EDIT);
	request.addParameter("myParam", "myValue");
	request.addParameter("view", "my");
	request.addParameter("lang", "de");
	response = new MockRenderResponse();
	portlet.render(request, response);
	assertEquals("myLangView", response.getContentAsString());

	request = new MockRenderRequest(PortletMode.EDIT);
	request.addParameter("myParam", "myValue");
	request.addParameter("surprise", "!");
	response = new MockRenderResponse();
	portlet.render(request, response);
	assertEquals("mySurpriseView", response.getContentAsString());
}
 
Example 17
Source File: PortletAnnotationControllerTests.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@Test
public void parameterDispatchingController() throws Exception {
	DispatcherPortlet portlet = new DispatcherPortlet() {
		@Override
		protected ApplicationContext createPortletApplicationContext(ApplicationContext parent) throws BeansException {
			StaticPortletApplicationContext wac = new StaticPortletApplicationContext();
			wac.setPortletContext(new MockPortletContext());
			RootBeanDefinition bd = new RootBeanDefinition(MyParameterDispatchingController.class);
			bd.setScope(WebApplicationContext.SCOPE_REQUEST);
			wac.registerBeanDefinition("controller", bd);
			AnnotationConfigUtils.registerAnnotationConfigProcessors(wac);
			wac.refresh();
			return wac;
		}
	};
	portlet.init(new MockPortletConfig());

	MockRenderRequest request = new MockRenderRequest(PortletMode.VIEW);
	MockRenderResponse response = new MockRenderResponse();
	portlet.render(request, response);
	assertEquals("myView", response.getContentAsString());

	request = new MockRenderRequest(PortletMode.VIEW);
	request.addParameter("view", "other");
	response = new MockRenderResponse();
	portlet.render(request, response);
	assertEquals("myOtherView", response.getContentAsString());

	request = new MockRenderRequest(PortletMode.VIEW);
	request.addParameter("view", "my");
	request.addParameter("lang", "de");
	response = new MockRenderResponse();
	portlet.render(request, response);
	assertEquals("myLangView", response.getContentAsString());

	request = new MockRenderRequest(PortletMode.VIEW);
	request.addParameter("surprise", "!");
	response = new MockRenderResponse();
	portlet.render(request, response);
	assertEquals("mySurpriseView", response.getContentAsString());
}
 
Example 18
Source File: Portlet20AnnotationControllerTests.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@Test
public void portlet20DispatchingController() throws Exception {
	DispatcherPortlet portlet = new DispatcherPortlet() {
		@Override
		protected ApplicationContext createPortletApplicationContext(ApplicationContext parent) throws BeansException {
			StaticPortletApplicationContext wac = new StaticPortletApplicationContext();
			wac.setPortletContext(new MockPortletContext());
			RootBeanDefinition bd = new RootBeanDefinition(MyPortlet20DispatchingController.class);
			bd.setScope(WebApplicationContext.SCOPE_REQUEST);
			wac.registerBeanDefinition("controller", bd);
			wac.registerBeanDefinition("controller2", new RootBeanDefinition(DetailsController.class));
			AnnotationConfigUtils.registerAnnotationConfigProcessors(wac);
			wac.refresh();
			return wac;
		}
	};
	portlet.init(new MockPortletConfig());

	MockRenderRequest request = new MockRenderRequest(PortletMode.VIEW);
	MockRenderResponse response = new MockRenderResponse();
	portlet.render(request, response);
	assertEquals("myView", response.getContentAsString());

	MockActionRequest actionRequest = new MockActionRequest("this");
	MockActionResponse actionResponse = new MockActionResponse();
	portlet.processAction(actionRequest, actionResponse);

	request = new MockRenderRequest(PortletMode.VIEW, WindowState.MAXIMIZED);
	request.setParameters(actionResponse.getRenderParameterMap());
	response = new MockRenderResponse();
	portlet.render(request, response);
	assertEquals("myLargeView-value", response.getContentAsString());

	actionRequest = new MockActionRequest("that");
	actionResponse = new MockActionResponse();
	portlet.processAction(actionRequest, actionResponse);

	request = new MockRenderRequest(PortletMode.VIEW, WindowState.MAXIMIZED);
	request.setParameters(actionResponse.getRenderParameterMap());
	response = new MockRenderResponse();
	portlet.render(request, response);
	assertEquals("myLargeView-value2", response.getContentAsString());

	actionRequest = new MockActionRequest("else");
	actionResponse = new MockActionResponse();
	portlet.processAction(actionRequest, actionResponse);

	request = new MockRenderRequest(PortletMode.VIEW, WindowState.MAXIMIZED);
	request.setParameters(actionResponse.getRenderParameterMap());
	response = new MockRenderResponse();
	portlet.render(request, response);
	assertEquals("myLargeView-value3", response.getContentAsString());

	actionRequest = new MockActionRequest("error");
	actionResponse = new MockActionResponse();
	portlet.processAction(actionRequest, actionResponse);

	request = new MockRenderRequest(PortletMode.VIEW, WindowState.MAXIMIZED);
	request.setParameters(actionResponse.getRenderParameterMap());
	request.setSession(actionRequest.getPortletSession());
	response = new MockRenderResponse();
	portlet.render(request, response);
	assertEquals("XXX", response.getContentAsString());

	MockEventRequest eventRequest = new MockEventRequest(new MockEvent("event1"));
	MockEventResponse eventResponse = new MockEventResponse();
	portlet.processEvent(eventRequest, eventResponse);

	request = new MockRenderRequest(PortletMode.VIEW, WindowState.MAXIMIZED);
	request.setParameters(eventResponse.getRenderParameterMap());
	response = new MockRenderResponse();
	portlet.render(request, response);
	assertEquals("myLargeView-value3", response.getContentAsString());

	eventRequest = new MockEventRequest(new MockEvent("event2"));
	eventResponse = new MockEventResponse();
	portlet.processEvent(eventRequest, eventResponse);

	request = new MockRenderRequest(PortletMode.VIEW, WindowState.MAXIMIZED);
	request.setParameters(eventResponse.getRenderParameterMap());
	response = new MockRenderResponse();
	portlet.render(request, response);
	assertEquals("myLargeView-value4", response.getContentAsString());

	request = new MockRenderRequest(PortletMode.VIEW, WindowState.NORMAL);
	request.setParameters(actionResponse.getRenderParameterMap());
	response = new MockRenderResponse();
	portlet.render(request, response);
	assertEquals("myView", response.getContentAsString());

	MockResourceRequest resourceRequest = new MockResourceRequest("resource1");
	MockResourceResponse resourceResponse = new MockResourceResponse();
	portlet.serveResource(resourceRequest, resourceResponse);
	assertEquals("myResource", resourceResponse.getContentAsString());

	resourceRequest = new MockResourceRequest("resource2");
	resourceResponse = new MockResourceResponse();
	portlet.serveResource(resourceRequest, resourceResponse);
	assertEquals("myDefaultResource", resourceResponse.getContentAsString());
}
 
Example 19
Source File: Portlet20AnnotationControllerTests.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@Test
public void typeLevelParameterDispatchingController() throws Exception {
	DispatcherPortlet portlet = new DispatcherPortlet() {
		@Override
		protected ApplicationContext createPortletApplicationContext(ApplicationContext parent) throws BeansException {
			StaticPortletApplicationContext wac = new StaticPortletApplicationContext();
			wac.setPortletContext(new MockPortletContext());
			RootBeanDefinition bd = new RootBeanDefinition(MyTypeLevelParameterDispatchingController.class);
			bd.setScope(WebApplicationContext.SCOPE_REQUEST);
			wac.registerBeanDefinition("controller", bd);
			RootBeanDefinition bd2 = new RootBeanDefinition(MySpecialParameterDispatchingController.class);
			bd2.setScope(WebApplicationContext.SCOPE_REQUEST);
			wac.registerBeanDefinition("controller2", bd2);
			RootBeanDefinition bd3 = new RootBeanDefinition(MyOtherSpecialParameterDispatchingController.class);
			bd3.setScope(WebApplicationContext.SCOPE_REQUEST);
			wac.registerBeanDefinition("controller3", bd3);
			RootBeanDefinition bd4 = new RootBeanDefinition(MyParameterDispatchingController.class);
			bd4.setScope(WebApplicationContext.SCOPE_REQUEST);
			wac.registerBeanDefinition("controller4", bd4);
			AnnotationConfigUtils.registerAnnotationConfigProcessors(wac);
			wac.refresh();
			return wac;
		}
	};
	portlet.init(new MockPortletConfig());

	MockRenderRequest request = new MockRenderRequest(PortletMode.HELP);
	MockRenderResponse response = new MockRenderResponse();
	try {
		portlet.render(request, response);
		fail("Should have thrown NoHandlerFoundException");
	}
	catch (NoHandlerFoundException ex) {
		// expected
	}

	request = new MockRenderRequest(PortletMode.EDIT);
	response = new MockRenderResponse();
	portlet.render(request, response);
	assertEquals("myDefaultView", response.getContentAsString());

	request = new MockRenderRequest(PortletMode.EDIT);
	request.addParameter("myParam", "myValue");
	response = new MockRenderResponse();
	portlet.render(request, response);
	assertEquals("myView", response.getContentAsString());

	request = new MockRenderRequest(PortletMode.EDIT);
	request.addParameter("myParam", "mySpecialValue");
	response = new MockRenderResponse();
	portlet.render(request, response);
	assertEquals("mySpecialView", response.getContentAsString());

	request = new MockRenderRequest(PortletMode.EDIT);
	request.addParameter("myParam", "myOtherSpecialValue");
	response = new MockRenderResponse();
	portlet.render(request, response);
	assertEquals("myOtherSpecialView", response.getContentAsString());

	request = new MockRenderRequest(PortletMode.VIEW);
	response = new MockRenderResponse();
	portlet.render(request, response);
	assertEquals("myView", response.getContentAsString());

	request = new MockRenderRequest(PortletMode.EDIT);
	request.addParameter("myParam", "myValue");
	request.addParameter("view", "other");
	response = new MockRenderResponse();
	portlet.render(request, response);
	assertEquals("myOtherView", response.getContentAsString());

	request = new MockRenderRequest(PortletMode.EDIT);
	request.addParameter("myParam", "myValue");
	request.addParameter("view", "my");
	request.addParameter("lang", "de");
	response = new MockRenderResponse();
	portlet.render(request, response);
	assertEquals("myLangView", response.getContentAsString());

	request = new MockRenderRequest(PortletMode.EDIT);
	request.addParameter("myParam", "myValue");
	request.addParameter("surprise", "!");
	response = new MockRenderResponse();
	portlet.render(request, response);
	assertEquals("mySurpriseView", response.getContentAsString());
}
 
Example 20
Source File: Portlet20AnnotationControllerTests.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
private void doTestAdaptedHandleMethods(final Class<?> controllerClass) throws Exception {
	DispatcherPortlet portlet = new DispatcherPortlet() {
		@Override
		protected ApplicationContext createPortletApplicationContext(ApplicationContext parent) throws BeansException {
			GenericWebApplicationContext wac = new GenericWebApplicationContext();
			wac.registerBeanDefinition("controller", new RootBeanDefinition(controllerClass));
			wac.refresh();
			return wac;
		}
	};
	portlet.init(new MockPortletConfig());

	MockActionRequest actionRequest = new MockActionRequest(PortletMode.VIEW);
	MockActionResponse actionResponse = new MockActionResponse();
	portlet.processAction(actionRequest, actionResponse);
	assertEquals("value", actionResponse.getRenderParameter("test"));

	MockRenderRequest request = new MockRenderRequest(PortletMode.VIEW);
	request.setSession(actionRequest.getPortletSession());
	request.setParameters(actionResponse.getRenderParameterMap());
	request.addParameter("name", "name1");
	request.addParameter("age", "value2");
	MockRenderResponse response = new MockRenderResponse();
	portlet.render(request, response);
	assertEquals("test-name1-typeMismatch", response.getContentAsString());
	assertNull(request.getPortletSession().getAttribute("testBean"));

	request = new MockRenderRequest(PortletMode.EDIT);
	request.addParameter("param1", "value1");
	request.addParameter("param2", "2");
	request.addProperty("header1", "10");
	request.setCookies(new Cookie("cookie1", "3"));
	response = new MockRenderResponse();
	portlet.render(request, response);
	assertEquals("test-value1-2-10-3", response.getContentAsString());

	request = new MockRenderRequest(PortletMode.HELP);
	request.addParameter("name", "name1");
	request.addParameter("age", "2");
	response = new MockRenderResponse();
	portlet.render(request, response);
	assertEquals("test-name1-2", response.getContentAsString());
}