Define local servers for testing portlets

 

+

Search Tips   |   Advanced Search

 

To test, debug, or profile a portlet project within the workbench, first define a local portal test environment server.

To use a local WebSphere Portal 6.0, or later, server, install WebSphere Portal 6.0, or later , using the WebSphere Portal CD-ROM provided with Rational tools. Before using the server, configure the WebSphere Portal Server as a Test Environment.

To create and configure a portal test environment server:

  1. Switch to the Servers view by selecting Window > Show View > Servers

  2. In the Servers view, right-click and select New > Server.

  3. Select localhost as the Host name.

  4. Select a WebSphere Portal Test Environment server from the server type list. Click Next.

  5. On the WebSphere Server Configuration Settings page, select one of the following values:

    • To use the default HTTP port, select Use default port numbers and set the HTTP port number.

    • To use port numbers other than the default numbers used by WAS, select Use consecutive port numbers and set the First port number. This setting causes the test environment to use sequential port numbers, starting with the number you specify. You must specify a port number that begins a range of port numbers that are not being used by another application. This option allows you to have a remote WebSphere Portal server or WAS running on your system, and allows the test environment to use different port numbers. You can also configure the test environment server's HTTP port numbers by editing the server configuration, as explained below.

  6. Click Finish.

Additional options for local servers can be viewed and changed by double-clicking on the server in the Servers view. This opens the server configuration editor. You can change any of the settings that were defined previously. In addition, the Portal tab has additional settings which are listed below

  1. Select Enable base portlets for portal administration and customization to use administration portlets in the test environment. Administration portlets are portlets provided by WebSphere Portal to provide administrative functions, such as portlet installation and configuration. Enable this option only when necessary. It slows down the startup of the test environment. Even when you have enabled the administration portlets, there are limitations. You cannot install portlets using the administration portlets. In addition, most changes that you make are reset to the default values the next time you start the test environment. To debug portlets in a particular layout, use the test and debug options of a portal project, not the administration portlets in the test environment.When you run cooperative portlet projects that use the JSR 168 or the JSR 286 portlet API, enable this option so that you can use the wiring tool.

  2. Select Enable multiple pages when deploying portlet projects to allow different portlet projects to use different pages in the portal during testing. By default, multiple pages are enabled. Each portlet project that is associated with a single server will be deployed to a different page. If you want to deploy them all into a single page on the server, you can disable multiple pages when deploying portlet projects.

  3. Select Enable console logging to redirect log entries to the console. Otherwise, the log entries are written to the <product_installation_root>/runtimes/portal_vXX/log directory, where product_installation_root is the directory where the workbench is installed and XX is the version of the WebSphere Portal Test Environment. Enable console logging is initially disabled.

  4. Select Enable anonymous user access to test portlets in the not-logged-in state.

  5. Enter JAR file or folder names in the Shared Library section to make the JAR files or the files in the folder available to all portlet applications. In addition, to make your project compile with the same JAR files, add the JAR files to the Java™ Build Path for your project. To add JAR files to your Java Build Path, follow these steps:

    1. In the Project Explorer view, highlight the portlet project.

    2. Right-click and select Properties.

    3. Select Java Build Path > Libraries.

    4. Add the required JAR files and click OK.

Save the changes to your server configuration by pressing Ctrl + S.

Note: An EAR project named wps is created when you run a portlet in the test environment (Run on Server or Debug on Server). If you plan to test or debug your portlet project locally, do not modify the wps project once it is created. When creating a project, do not name it wps.

 

Related tasks

Testing and debugging portlets

Associating servers with projects

Defining Web browsers and device emulators