Eclipse.org Eclipse.org - Device Kit

Platform Validation Testing

Introduction

The Platform Validation Test verifies:

  1. Minimum Java version.
  2. API signatures and version numbers (where applicable) of:
  3. Availability of required OSGi R4 services.

What to verify is defined in the properties of the test, and these properties can be specified either in the xml test script or in esc.properties. See, for example, files platform.validation.test.bundle.xml and esc.properties in project org.eclipse.soda.dk.platform.validation.test.agent.bundle.

The example below is the default esc.properties file. Note that the actual execution environment required varies: some platforms will also require for example http services, javax.servlet and/or javax.comm.

#Licensed Materials - Property of IBM
#(C) Copyright IBM Corp. 2005, 2006 All Rights Reserved
#

# The definition of the min.java.version property triggers the
# immediate execution on the console of the PlatformValidationTest 
# upon activation of the bundle, without requiring the TestManager
# and http servlet support.
   
# =============== Required Java version ===============
min.java.version=1.4
# =============== Required Class Libraries ===============
required.libraries=ee.minimum11,\
		osgi.r4.core,\
		osgi.r4.service.event
# Use the following to check for all optional OSGi R4 service interfaces and some javax APIs:
#required.libraries=ee.minimum11,\
#		osgi.r4.core,\
#		osgi.r4.service.cm,\
#		osgi.r4.service.component,\
#		osgi.r4.service.device,\
#		osgi.r4.service.event,\
#		osgi.r4.service.http,\
#		osgi.r4.service.io,\
#		osgi.r4.service.log,\
#		osgi.r4.service.metatype,\
#		osgi.r4.service.prefs,\
#		osgi.r4.service.provisioning,\
#		osgi.r4.service.upnp,\
#		osgi.r4.service.useradmin,\
#		osgi.r4.util.measurement,\
#		osgi.r4.util.position,\
#		osgi.r4.util.xml,\
#		javax.servlet,\
#		javax.comm
# =============== Required OSGi Packages ===============
required.osgi.packages=org.osgi.framework;1.3,\
		org.osgi.service.condpermadmin;1.0,\
		org.osgi.service.packageadmin;1.2,\
		org.osgi.service.permissionadmin;1.2,\
		org.osgi.service.startlevel;1.0,\
		org.osgi.service.url;1.0,\
		org.osgi.service.event;1.0
# Use the following to check for all OSGi R4 packages:
#required.osgi.packages=org.osgi.framework;1.3,\
#		org.osgi.service.condpermadmin;1.0,\
#		org.osgi.service.packageadmin;1.2,\
#		org.osgi.service.permissionadmin;1.2,\
#		org.osgi.service.startlevel;1.0,\
#		org.osgi.service.url;1.0,\
#		org.osgi.service.log;1.3,\
#		org.osgi.service.http;1.2,\
#		org.osgi.service.device;1.1,\
#		org.osgi.service.cm;1.2,\
#		org.osgi.service.metatype;1.1,\
#		org.osgi.service.prefs;1.1,\
#		org.osgi.service.useradmin;1.1,\
#		org.osgi.service.wireadmin;1.0,\
#		org.osgi.service.io;1.0,\
#		org.osgi.service.provisioning;1.1,\
#		org.osgi.service.upnp;1.1,\
#		org.osgi.service.component;1.0,\
#		org.osgi.service.event;1.0,\
#		org.osgi.util.tracker;1.3,\
#		org.osgi.util.xml;1.0,\
#		org.osgi.util.position;1.0,\
#		org.osgi.util.measurement;1.0
# =============== Required OSGi services ===============
required.osgi.services=org.osgi.service.packageadmin.PackageAdmin,\
		org.osgi.service.url.URLStreamHandlerService,\
		org.osgi.service.http.HttpService,\
		org.osgi.service.event.EventAdmin
# Use the following to check for all OSGi R4 services:
#required.osgi.services=org.osgi.service.condpermadmin.ConditionalPermissionAdmin,\
#		org.osgi.service.packageadmin.PackageAdmin,\
#		org.osgi.service.permissionadmin.PermissionAdmin,\
#		org.osgi.service.startlevel.StartLevel,\
#		org.osgi.service.url.URLStreamHandlerService,\
#		org.osgi.service.log.LogService,\
#		org.osgi.service.log.LogReaderService,\
#		org.osgi.service.http.HttpService,\
#		org.osgi.service.device.Device;(filter),\
#		org.osgi.service.cm.ConfigurationAdmin,\
#		org.osgi.service.prefs.PreferencesService,\
#		org.osgi.service.metatype.MetaTypeService,\
#		org.osgi.service.wireadmin.WireAdmin,\
#		org.osgi.service.useradmin.UserAdmin,\
#		org.osgi.service.io.ConnectorService,\
#		org.osgi.service.provisioning.ProvisioningService,\
#		org.osgi.service.upnp.UPnPService,\
#		org.osgi.service.event.EventAdmin
		

Running the Platform Validation Test

There are different ways to run the Platform Validation Test:

  1. For a standard (non-OSGi) Java runtime environment, use the platform.validation.test.launch launch configuration. Note that this launch configuration specifies that the platform.validation.test.xml script is used, but alternatively the test properties could be specified in esc.properties.
  2. As a stand-alone test in an OSGi runtime environment, use the platform.validation.test.bundle.launch launch configuration with an esc.properties file. For this launch configuration, if the test properties are specified in esc.properties, as in the example above, the bundle will run the test automatically as soon as the bundle is activated. Note that the platform.validation.test.bundle has an increased startlevel to make sure that all services it is going to validate have been started.
  3. As bundle service in an OSGi runtime, use the platform.validation.test.bundle.launch launch configuration with the platform.validation.test.bundle.xml test script. If test properties are not specified in esc.properties, then the platform validation test can be run via the test manager using the platform.validation.test.bundle.xml test script.
  4. From a factory, using the platform.validation.test.factory.launch with the platform.validation.test.factory.xml test script. The org.eclipse.soda.dk.platform.validation.test.agent.factory allows a Platform Validation Test to be included as an extra step in for a Profile Validation Tests, to ensure the test is run in the correct environment.

For (1) and (2) the test results are printed on the console, and a successful test run for (2) looks as follows:

..[INFO] 2007-07-11 14:38:01.938 - Loading class library info for: ee.minimum11
[INFO] 2007-07-11 14:38:02.297 - Loading class library info for: osgi.r4.core
[INFO] 2007-07-11 14:38:02.312 - Loading class library info for: osgi.r4.service.event
[INFO] 2007-07-11 14:38:02.500 - 324 classes validated (324 required)
.[INFO] 2007-07-11 14:38:02.500 - 7 packages validated (7 required)
.[INFO] 2007-07-11 14:38:02.500 - 4 services validated (4 required)

Time: 0.562

OK (4 tests)

For (3) and (4) a succesful test run results in the following Test Log of the Test Manager:

Timestamp Message
2007-07-11 15:35:13.547 Running test script: TestAgentTest
version: 1.0.0
vendor: Eclipse
description: Factory-based Platform Validation Test
url: C:\workspaces\eclipse33\devicekit11\org.eclipse.soda.dk.platform.validation.test.agent.factory\platform.validation.test.factory.xml
2007-07-11 15:35:13.547 Starting script action: Configuration Create Request
2007-07-11 15:35:13.547 Creating configuration from factory: org.eclipse.soda.dk.platform.validation.test.agent.factory.PlatformValidationTestAgentFactory
2007-07-11 15:35:13.578 Script action ended: Configuration Create Request
2007-07-11 15:35:13.578 Starting script action: SequentialTest Action
2007-07-11 15:35:13.578 Start single test matching: (id=PlatformValidationTest)
2007-07-11 15:35:14.094 Running: Platform Validation Test: test000_ValidateJavaVersion(org.eclipse.soda.dk.platform.validation.test.agent.ClassLibraryValidationTestCase) [TestAgentTest]
2007-07-11 15:35:14.094 Running: Platform Validation Test: test001_ValidateClassLibraries(org.eclipse.soda.dk.platform.validation.test.agent.ClassLibraryValidationTestCase) [TestAgentTest]
2007-07-11 15:35:14.719 Running: Platform Validation Test: test000_ValidateOsgiPackages(org.eclipse.soda.dk.platform.validation.test.agent.OSGiValidationTestCase) [TestAgentTest]
2007-07-11 15:35:14.734 Running: Platform Validation Test: test001_ValidateOsgiServices(org.eclipse.soda.dk.platform.validation.test.agent.OSGiValidationTestCase) [TestAgentTest]
2007-07-11 15:35:14.734 Script action ended: SequentialTest Action
2007-07-11 15:35:14.734 Starting script action: Configuration Delete Request
2007-07-11 15:35:14.734 Deleting configurations with filter: (service.pid=org.eclipse.soda.dk.platform.validation.test.agent.factory.*)
2007-07-11 15:35:14.734 Script action ended: Configuration Delete Request
2007-07-11 15:35:14.734 TEST COMPLETED
2 Configuration changes (0 errors)
1 Tests (0 errors)
4 Test cases (0 errors, 0 failures)

Customizing the Platform Validation Test

The platform validation test can be customized via the following properties of the test provided in esc.properties or in the test script.

The Java API signatures that can be checked are defined by the signature files that are packaged as a resource in the folder org.eclipse.soda.dk.platform.validation.test.agent.cinfo of the org.eclipse.soda.dk.platform.validation.test.agent. These signature files are generated at development time by running the launch configuration platform.validation.test.builder.launch of the Platform Validation Test Builder in project org.eclipse.soda.dk.platform.validation.test.builder. The Platform Validation Test Builder parses the class files of the specified APIs in the target platform of the Eclipse workspace it is running in, with the exception of the OSGi minimum execution environment, which is provided by the OSGi Alliance.