本文整理汇总了Java中javax.portlet.PortletMode.VIEW属性的典型用法代码示例。如果您正苦于以下问题:Java PortletMode.VIEW属性的具体用法?Java PortletMode.VIEW怎么用?Java PortletMode.VIEW使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类javax.portlet.PortletMode
的用法示例。
在下文中一共展示了PortletMode.VIEW属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: standardHandleMethod
@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());
}
示例2: mavResolver
@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);
}
示例3: testStandardHandleMethod
public void testStandardHandleMethod() 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());
}
示例4: testMavResolver
public void testMavResolver() 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);
}
示例5: invoke1
@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));
}
}
示例6: invoke3b
@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());
}
示例7: invoke1
@Test
public void invoke1() throws Exception {
meths.reset();
PortletInvoker i = new PortletInvoker(ams, "portlet1");
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));
}
}
示例8: invoke3b
@Test
public void invoke3b() throws Exception {
meths.reset();
PortletInvoker i = new PortletInvoker(ams, "portlet3");
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());
}
示例9: PortletState
public PortletState(String id)
{
this.id = id;
portletMode = PortletMode.VIEW;
windowState = WindowState.NORMAL;
parameters = new HashMap();
}
示例10: test1header
@Test
public void test1header() throws Exception {
String expectedMeth = TestPortlet1.class.getSimpleName() + "#renderHeaders";
PortletMode pm = PortletMode.VIEW;
helper.header("Portlet1", pm, expectedMeth);
assertTrue(meths.isConfigExists());
}
示例11: test1render
@Test
public void test1render() throws Exception {
String expectedMeth = TestPortlet1.class.getSimpleName() + "#render";
PortletMode pm = PortletMode.VIEW;
helper.render("Portlet1", pm, expectedMeth);
assertTrue(meths.isConfigExists());
}
示例12: test2render
@Test
public void test2render() throws Exception {
String expectedMeth = TestPortlet2.class.getSimpleName() + "#myView";
PortletMode pm = PortletMode.VIEW;
helper.render("Portlet2", pm, expectedMeth);
assertFalse(meths.isConfigExists());
}
示例13: test3render
@Test
public void test3render() throws Exception {
String expectedMeth = TestPortlet3.class.getSimpleName() + "#render";
PortletMode pm = PortletMode.VIEW;
helper.render("Portlet3", pm, expectedMeth);
assertTrue(meths.isConfigExists());
}
示例14: test1header
@Test
public void test1header() throws Exception {
String expectedMeth = TestPortlet5.class.getSimpleName() + "#renderHeaders";
PortletMode pm = PortletMode.VIEW;
helper.header("Portlet5", pm, expectedMeth);
assertTrue(meths.isConfigExists());
}
示例15: test1render
@Test
public void test1render() throws Exception {
String expectedMeth = TestPortlet5.class.getSimpleName() + "#render";
PortletMode pm = PortletMode.VIEW;
helper.render("Portlet5", pm, expectedMeth);
assertTrue(meths.isConfigExists());
}