This test portlet simply increments and displays a number each time it renders, which should show you if view caching has been successfully turned off or not.
Explanation
Every time a portal page loads, all the portlets on that page must be rendered. This can potentially take a while, if there are many portlets and/or some portlets have 'doView()'s that take a long time to execute.
Portals can optionally cache portlet views to speed up page generation. If a cached view is served to the client, 'doView()' will not be called on that portlet for that page reload. If you are trying to check the state of something (e.g. a session variable for messaging) during the 'doView()', this will therefore not get a chance to happen.
JSR 168 allows you to define a time limit for caching, or turn it off completely, by setting the 'expiration-cache' property for the portlet in the portlet.xml. (A value of "-1" means "never expire", while "0" will turn off caching.)
However, some portals may still ignore this 'expiration-cache', and so will not allow you to turn off view caching.