Class MockPortletContext

Object
com.liferay.portal.kernel.test.portlet.MockPortletContext
All Implemented Interfaces:
jakarta.portlet.PortletContext

public class MockPortletContext extends Object implements jakarta.portlet.PortletContext
Author:
Dante Wang
  • Constructor Details

    • MockPortletContext

      public MockPortletContext()
    • MockPortletContext

      public MockPortletContext(org.springframework.core.io.ResourceLoader resourceLoader)
    • MockPortletContext

      public MockPortletContext(String resourceBasePath)
    • MockPortletContext

      public MockPortletContext(String resourceBasePath, org.springframework.core.io.ResourceLoader resourceLoader)
  • Method Details

    • addContainerRuntimeOption

      public void addContainerRuntimeOption(String key)
    • addInitParameter

      public void addInitParameter(String name, String value)
    • getAttribute

      public Object getAttribute(String name)
      Specified by:
      getAttribute in interface jakarta.portlet.PortletContext
    • getAttributeNames

      public Enumeration<String> getAttributeNames()
      Specified by:
      getAttributeNames in interface jakarta.portlet.PortletContext
    • getClassLoader

      public ClassLoader getClassLoader()
      Specified by:
      getClassLoader in interface jakarta.portlet.PortletContext
    • getContainerRuntimeOptions

      public Enumeration<String> getContainerRuntimeOptions()
      Specified by:
      getContainerRuntimeOptions in interface jakarta.portlet.PortletContext
    • getContextPath

      public String getContextPath()
      Specified by:
      getContextPath in interface jakarta.portlet.PortletContext
    • getEffectiveMajorVersion

      public int getEffectiveMajorVersion()
      Specified by:
      getEffectiveMajorVersion in interface jakarta.portlet.PortletContext
    • getEffectiveMinorVersion

      public int getEffectiveMinorVersion()
      Specified by:
      getEffectiveMinorVersion in interface jakarta.portlet.PortletContext
    • getInitParameter

      public String getInitParameter(String name)
      Specified by:
      getInitParameter in interface jakarta.portlet.PortletContext
    • getInitParameterNames

      public Enumeration<String> getInitParameterNames()
      Specified by:
      getInitParameterNames in interface jakarta.portlet.PortletContext
    • getMajorVersion

      public int getMajorVersion()
      Specified by:
      getMajorVersion in interface jakarta.portlet.PortletContext
    • getMimeType

      public String getMimeType(String filePath)
      Specified by:
      getMimeType in interface jakarta.portlet.PortletContext
    • getMinorVersion

      public int getMinorVersion()
      Specified by:
      getMinorVersion in interface jakarta.portlet.PortletContext
    • getNamedDispatcher

      public jakarta.portlet.PortletRequestDispatcher getNamedDispatcher(String path)
      Specified by:
      getNamedDispatcher in interface jakarta.portlet.PortletContext
    • getPortletContextName

      public String getPortletContextName()
      Specified by:
      getPortletContextName in interface jakarta.portlet.PortletContext
    • getRealPath

      public String getRealPath(String path)
      Specified by:
      getRealPath in interface jakarta.portlet.PortletContext
    • getRequestDispatcher

      public jakarta.portlet.PortletRequestDispatcher getRequestDispatcher(String path)
      Specified by:
      getRequestDispatcher in interface jakarta.portlet.PortletContext
    • getResource

      public URL getResource(String path) throws MalformedURLException
      Specified by:
      getResource in interface jakarta.portlet.PortletContext
      Throws:
      MalformedURLException
    • getResourceAsStream

      public InputStream getResourceAsStream(String path)
      Specified by:
      getResourceAsStream in interface jakarta.portlet.PortletContext
    • getResourcePaths

      public Set<String> getResourcePaths(String path)
      Specified by:
      getResourcePaths in interface jakarta.portlet.PortletContext
    • getServerInfo

      public String getServerInfo()
      Specified by:
      getServerInfo in interface jakarta.portlet.PortletContext
    • log

      public void log(String message)
      Specified by:
      log in interface jakarta.portlet.PortletContext
    • log

      public void log(String message, Throwable throwable)
      Specified by:
      log in interface jakarta.portlet.PortletContext
    • removeAttribute

      public void removeAttribute(String name)
      Specified by:
      removeAttribute in interface jakarta.portlet.PortletContext
    • setAttribute

      public void setAttribute(String name, Object value)
      Specified by:
      setAttribute in interface jakarta.portlet.PortletContext
    • setPortletContextName

      public void setPortletContextName(String portletContextName)
    • getResourceLocation

      protected String getResourceLocation(String path)