Java(TM) Portlet Technology Compatibility Kit, Version 1.0
Release Notes-1.0
Kit Contents
The Java(TM) Portlet Technology Compatibility Kit (TCK) 1.0 includes
the following items:
- JavaTest harness and documentation
- PORTLET TCK signature, API, and end-to-end tests
- A signature test that checks that all of the public APIs
in the Java(TM) Portlet 1.0 are supported by the implementation that is
being tested.
- API/SPEC tests
Platform Notes
The PORTLET TCK tests have been built and tested with the Reference
Implementation Pluto 1.0 running on the JavaTM2
Platform, Standard Edition SDK, Version 1.3.1_02. If you are using a
different implementation, you will need to make adjustments to the
procedures outlined in this document.
The PORTLET TCK tests run on the following platforms:
- Sun Solaris 8, 9
- Windows 2000, XP
- Linux Redhat 7.1
Variables in angle brackets need to be expanded for each platform. For
example, <TS_HOME> becomes $TS_HOME on
Solaris/Linux and %TS_HOME% on Windows. In addition, the
forward slashes (/) used in all of the examples need to be replaced
with backslashes (\) for Windows.
Installing, Setting Up, and
Running the PORTLET TCK
The following sections explain how to:
Installing the Required Software
Before you can run the PORTLET TCK tests, you must install and set up
the following software components:
- J2SE 1.3.1_02 software or later
- Pluto Reference Implementation 1.0 which provides an
implementation of the Java(TM) Portlet 1.0 Specification
- Java(TM) Portlet TCK, 1.0
- Java[tm] 2 Platform, Enterprise Edition (J2EE[tm]) SDK Version
1.3 (needed only if you are going to rebuild the TCK).
Complete the following steps to install the required software:
Install the J2SE 1.3.1_02 software or later
Download and install the J2SE software from the Java Software Web
site (http://java.sun.com/products).
Refer to the installation instructions that accompany the software for
additional information.
Install the Pluto Reference Implementation 1.0.
Download and install the Reference Implementation Pluto 1.0 from
the pluto website http://jakarta.apache.org/pluto. Refer to the
documentation included with Pluto 1.0 for specific installation
instructions.
Install the PORTLET TCK software.
cd <install_directory>
- Use the unzip command to extract the
bundle:
unzip portlet-1_0-tck.zip
This will create the portlettck directory. The <install_directory>/portlettck
directory will be TS_HOME.
Install Java[tm] 2 Platform, Enterprise Edition (J2EE[tm]) SDK
Version 1.3
Download and install this from
http://java.sun.com/products
Setting Up your Environment
Complete the following steps to set up your client environment for
running the JavaTest harness:
# Set the following environment
variables in your shell environment:
| JAVA_HOME |
Set the JAVA_HOME variable to the directory where the
Java[tm] 2 Platform,
Standard Edition (J2SE[tm]) software has been installed. |
| TS_HOME |
Set the TS_HOME variable to the directory where the Portlet
TCK software has been installed. |
| PATH |
Set the PATH variable to include the <TS_HOME>/bin
directory. |
- Edit your <TS_HOME>/bin/ts.jte file and modify the
following properties, for getting the correct portal URL.
Look at description in ts.jte file or in the PortletTCK User's guide for complete description.
| Name |
Description |
Pluto Reference Implementation |
| portalURLFetcherMode |
Set this value to 0, if vendor is using Declarative
Configuration to let TCK to obtain URL for each test. If this value is
0, you would need to set the vendorTestsToURLMappingFile
property. Content of this file are explained in details in
Chapter 22 of the JSR168 Spec.
Set this value to 1, if vendor is using Programmatic Configuration to
let TCK to obtain URL for each test. For this you would need to set the
property vendorPortalURL |
1 |
| vendorPortalURL |
Set this property only if portalURLFetcherMode=1
(Programmatic Configuration) |
http://<pluto-host-name:8080>/pluto/tck |
| vendorTestsToURLMappingFile |
Set this property only if portalURLFetcherMode=0
(Declarative Configuration.)
Set this to the name of file containing URLs for each test. Test cases
are available in file <TS_HOME>/bin/portletTCKTestCases.xml. |
not used |
- Edit your <TS_HOME>/bin/ts.jte file and modify
the following properties, ONLY if there are tests identified that need
authentication support. Such tests should be specified in the
${TS_HOME}/bin/authTestList.txt.
Look at description in ts.jte file or in the PortletTCK User's guide for complete description.
| Property Name |
Description |
Pluto Reference Implementation |
| authConfigType |
0 -- if no authentication needed for any test at
all.
1 -- if using the Basic Authentication for authUser/authpassword for
tests specified by the vendor in ${TS_HOME}/bin/authTestList.txt
2 -- if using a vendor specific implementation of
TSPortletAuthCookieInterface.java that returns a cookie to be used for
all tests specified by vendor in ${TS_HOME}/bin/authTestList.txt |
0 |
authuser
authpassword |
Need to be set both these properties only if
authConfigType is other than 0. |
n/a |
| porting.ts.portletAuthCookie.class |
Need to be set only if authConfigType=2
Set this property to implementation of
com.sun.ts.lib.porting.TSPortletAuthCookieInterface.
You would need to append the classpath to this file to current
value of local.classes property in build.properties. |
n/a |
- Edit the <TS_HOME>/bin/build.properties file and modify the
following properties ( Look at the description of these in
build.properties or in the PortletTCK User's guide for the description.)
| Name |
Description |
For pluto Reference Implementation |
| webapp.dir |
This property is used by tsant to copy all of the Portlet
TCK web applications to a single directory.
Vendors would need to deploy these applications using their
implementation specific tools. |
<PLUTO_HOME>/portlets |
| portlet.classes |
The classes for the Portlet api's
This property is set to work for Reference Implementation.Vendors
should set this to the jar file containing the Portlet api. This is
used for signature testing. |
<TS_HOME>/lib/portlet.jar |
| j2ee.home.ri |
The jars/classes needed for building/packaging
You would need to set this property only if you are building the TCK or
the TCK web applications.
Download j2ee 1.3 SDK from Java site |
You would need to set it, no default. |
Deploying the Portlet TCK Web
Applications in Pluto Reference Implementation.
Skip this step if you are not working on Pluto
Reference Implementation.
- set webapp.dir in <TS_HOME>/bin/build.properties to
<PLUTO_HOME>/portlets
- Change to <TS_HOME>/bin directory, the
following command would copy all the TCK portlet wars in location
specified by webapp.dir.
- tsant
deploy.all
- Change to the <PLUTO_HOME>/build
- Run the following command::
build.bat deploy_portlets
- Restart tomcat
- Try to point browser at the following URLs to make sure,
portlets are deployed correctly.
- http://<hostname>:8080/pluto/tck?portletName=portlet_jp_RenderRequest_web/GetAttributeTestPortlet
Deploying the Portlet TCK Web
Applications in a Vendor Implementation
Skip this step if you are working on Pluto Reference Implementation.
- set webapp.dir in <TS_HOME>/bin/build.properties to an
existing directory where all TCK test web applications need to be
copied.
- Change to the <TS_HOME>/bin directory, the
following command would copy all the TCK portlet wars in location
specified by webapp.dir.
- tsant
deploy.all
- Change to the directory specified by webapp.dir
Deploy all the portlet wars to the vendor implementation using
implementation specific deployment tools.
Configuring the JavaTest Harness and
Running the Portlet TCK Tests
To run the Portlet TCK tests, complete the following steps. Note that
you only need to complete steps 2-10 the first time you start the
JavaTestTM test harness. After you
complete these steps, you can either run all of the tests by completing
Step 11 or run a subset of the tests by completing the steps in the
section that follows this one.
- Change to the <TS_HOME>/bin directory and start
the JavaTest test harness:
cd <TS_HOME>/bin
tsant gui
- The Welcome screen displays. Click on the Create Work Directory button, enter the name
of the directory to which the JavaTest test harness will write
temporary files (/tmp/JTwork, for example), and press the New Work Dirbutton when you are done. After
running the test, for debugging purposes you can look at files created
in this directory for each test case.
- Pull down Configuration and
select Edit Configuration. The
Welcome screen displays. Press the Next
Question button (right arrow).
- You are prompted for the location of the environment files.
Accept the default file location and press the Next Question button.
- You are prompted to specify a test environment. Select either ts_unix
or ts_win32 and press the Next
Question button.
- You are prompted to select which tests to run. Accept the default
setting and press the Next Question
button.
- You are asked if you want to specify an exclude list. Accept the
default (yes) and press the Next Question
button.
- Verify the default location of the exclude list and press
the Next Question button.
- You are prompted for where you want to save this configuration
file. Give a location.
- The Congratulations screen displays. Press the Finished button (check mark).
- Select Run then Start. The tests in the {TS_HOME}/src/com/sun/ts/tests/portlet
directory will be executed.
NOTE: Do not run the Parameter
Editor before you run the Configuration Editor or you will lose all the
default settings.
Debugging
- Look at the temporary files created in the "Work Directory" for
each test
- To look at the complete request/response, turn on the
harness.traceflag flag in <TS_HOME>/bin/ts.jte
- In the output generated, look for text inserted between
tags <tck-portlet> and </tck-portlet>
Running a Subset of the Portlet TCK Tests
To run a subset of the Portlet TCK tests, complete the following steps:
Pull down Configuration and
select Configuration Editor.
The Welcome screen displays. Click Tests
to Run.
The default set of tests for the TCK is displayed in the window.
To select another area, click on the area or areas that you do not
want to run, then press Remove.
Click Add, select the new
subdirectory or test that you want to run, and click Add File.
Click the Finished button when
you are done.
Click Run and select Start to run the test.
Build/Deploy/Run the Portlet TCK Tests using
Ant
Complete the following steps to set up your environment to build,
deploy, and run the Portlet TCK tests using tsant. The
following example is for the Solaris platform:
Set the following environment variables in your shell environment to
use the build infrastructure that comes with the TCK:
TS_HOME to the directory where the Portlet TCK software
has been installed
PATH add TS_HOME/bin to your PATH in your
command shell
C Shell setenv PATH ${TS_HOME}/bin:${PATH}
Bourne Shell PATH=${TS_HOME}/bin:${PATH}
export PATH
JAVA_HOME to the directory where the J2SE SDK
software has been installed
Change to directory TS_HOME/bin
and edit the build.properties file to set the required
properties needed for using TCK build environment.
j2ee.home.ri to the directory where the J2EE SDK 1.3.1 is
installed for reference to the packager tool used by the build
infrastructure. You can download it from the Sun's site.
To build the Portlet TCK tests using tsant, complete the
following steps:
To build a single test directory, type the
following:
cd <TS_HOME>/src/com/sun/ts/tests/portlet/api/javax_portlet/RenderRequest
tsant clean build
This will clean and build the tests in the RenderRequest
test directory.
To list the classes directory for this test that
was built, type the following:
tsant lc or tsant llc
To list the distribution directory of archives
for this test that was built, type the following:
tsant ld or tsant lld
To build a subset of test directories, type the
following:
cd <TS_HOME>/src/com/sun/ts/tests/portlet/api
tsant clean build
This will clean and build all the test directories under the api
directory.
To deploy the Portlet TCK tests using tsant, complete the
following steps:
To deploy a single test directory, type the
following:
cd <TS_HOME>/src/com/sun/ts/tests/portlet/api/javax_portlet/PortletSession
tsant deploy
This will deploy the WAR file built for the PortletSession
test directory to the webapps.dir directory.
To deploy a subset of test directories, type the
following:
cd <TS_HOME>/src/com/sun/ts/tests/portlet/api
tsant deploy
This will deploy all the test WAR files for the api directory.
To run the Portlet TCK tests using tsant, complete the
following steps:
To run a single test directory, type the
following:
cd <TS_HOME>/src/com/sun/ts/tests/portlet/api/javax_portlet/PortletSession
tsant runclient
This will run all tests in the PortletSession
test directory.
To run a single test within a test directory, type
the following:
cd <TS_HOME>/src/com/sun/ts/tests/jaxrpc/api/javax_portlet/RenderRequest
tsant runclient -Dtest=GetAttributeTest
This will run only the GetAttributeTest
in the RenderRequest test directory.
You select the test name to run by looking at the testName tags in
the URLClient.java file.
If the test is in SpecURLClient.java, you would need to give an
addtional paramter -Dtest.client=SpecURLClient.java
To run a subset of test directories type the
following:
cd <TS_HOME>/src/com/sun/ts/tests/portlet/api
tsant runclient
This will run all the test directories under the api
directory.
Source Directory Structure
Java source is distributed in 3 directories
- <TS_HOME>/src/com/sun/ts/tests/common/webclient
- This has common framework used across many TCKs that depend on
http request/response paradigm (for example, servlet TCK, JSP TCK).
- <TS_HOME>/src/com/sun/ts/tests/portlet/common
- This has common classes used by the portlet tests.
- <TS_HOME>/src/com/sun/ts/tests/portlet/api (or ee)
- api tree has directories corresponding to each Interface/Class
defined in JSR168.
- Each such sub-directory has portlets/servlet that are used to
build a portlet web application. The portlet.xml and web.xml for each
of this application is in corresponding directory under
<TS_HOME>/src/web
- Lastly, these directories has URLClient.java and
SpecURLClient.java that are the clients invoking portlets that have
been deployed in the implementation being tested and reporting the
success/pass status to the harness.