Search in sources :

Example 1 with InitParamType

use of org.apache.pluto.container.om.portlet.impl.InitParamType in project uPortal by Jasig.

the class FilterConfigImplTest method testParams.

@Test
public void testParams() {
    final List<InitParamType> initParams = new ArrayList<InitParamType>();
    InitParamType p1 = new InitParamType();
    p1.setParamName("param1");
    p1.setParamValue("value1");
    InitParamType p2 = new InitParamType();
    p2.setParamName("param2");
    p2.setParamValue("value2");
    initParams.add(p1);
    initParams.add(p2);
    final String filterName = "filterWithParams";
    PortletContext portletContext = EasyMock.createMock(PortletContext.class);
    EasyMock.replay(portletContext);
    FilterConfigImpl impl = new FilterConfigImpl(filterName, initParams, portletContext);
    Assert.assertEquals(filterName, impl.getFilterName());
    Assert.assertEquals("value1", impl.getInitParameter("param1"));
    Assert.assertEquals("value2", impl.getInitParameter("param2"));
    Assert.assertNotNull(impl.getPortletContext());
}
Also used : ArrayList(java.util.ArrayList) InitParamType(org.apache.pluto.container.om.portlet.impl.InitParamType) PortletContext(javax.portlet.PortletContext) Test(org.junit.Test)

Example 2 with InitParamType

use of org.apache.pluto.container.om.portlet.impl.InitParamType in project uPortal by Jasig.

the class FilterConfigImplTest method testControl.

@Test
public void testControl() {
    final List<InitParamType> initParams = new ArrayList<InitParamType>();
    final String filterName = "controlFilter";
    PortletContext portletContext = EasyMock.createMock(PortletContext.class);
    EasyMock.replay(portletContext);
    FilterConfigImpl impl = new FilterConfigImpl(filterName, initParams, portletContext);
    Assert.assertEquals(filterName, impl.getFilterName());
    Assert.assertNull(impl.getInitParameter("someparam"));
    Assert.assertNull(impl.getInitParameter("someparam2"));
    Assert.assertNotNull(impl.getPortletContext());
}
Also used : ArrayList(java.util.ArrayList) InitParamType(org.apache.pluto.container.om.portlet.impl.InitParamType) PortletContext(javax.portlet.PortletContext) Test(org.junit.Test)

Aggregations

ArrayList (java.util.ArrayList)2 PortletContext (javax.portlet.PortletContext)2 InitParamType (org.apache.pluto.container.om.portlet.impl.InitParamType)2 Test (org.junit.Test)2