Developer Guide
Developer Guide
Build 9.1.0.201906071207
Table of Contents
1. Preface .................................................................................................................... 1
1.1. Abstract ........................................................................................................ 1
1.2. Intended audience ........................................................................................... 1
1.3. License Information ........................................................................................ 1
1.4. Compatible Operating Systems .......................................................................... 1
1.4.1. Support of 32 Bit Operating Systems ....................................................... 2
1.4.2. Known Issues ...................................................................................... 2
1.4.2.1. KDE on Red Hat Enterprise Linux 7 ............................................. 2
1.4.2.2. KDE with Oxygen ..................................................................... 2
1.4.2.3. Jython scripts are executed sequentially .......................................... 2
1.4.2.4. 32-bit Java is not supported ......................................................... 2
2. Introduction .............................................................................................................. 3
2.1. Getting Started with RCE development ............................................................... 3
2.1.1. Preparing Eclipse ................................................................................. 3
2.1.2. Importing and building RCE ................................................................... 3
2.1.3. Running RCE from Eclipse .................................................................... 5
2.1.4. Configuring Workspace Mechanic (optional) ............................................. 6
2.1.5. Configuring Code Formatting and CheckStyle Rules (optional) ...................... 6
2.1.6. Building a standalone RCE version from Eclipse ........................................ 7
2.1.7. Building from the command line ............................................................. 8
2.2. Common Classes and Interfaces ........................................................................ 8
2.2.1. General ............................................................................................... 8
2.2.2. Components and Workflows ................................................................... 9
2.2.3. Utilities .............................................................................................. 9
3. Build and Infrastructure ............................................................................................ 10
3.1. Build Structure and Dependencies .................................................................... 10
3.1.1. Overview: Build and Versioning Scopes ................................................. 10
3.1.2. Changing Version Dependencies ............................................................ 10
3.1.2.1. Switching "RCE Core" to another version of "RCE Platform" ............ 10
3.2. Release and Versioning Process ....................................................................... 10
3.2.1. Overview: The Release and Versioning Process ........................................ 10
3.2.2. Step 1: Trunk preparations ................................................................... 10
3.2.3. Step 2: Release candidate building and testing .......................................... 10
3.2.4. Step 3: Publishing the final release ......................................................... 11
3.2.5. Step 4: Post-release actions ................................................................... 11
3.2.5.1. Upgrading Version Numbers (and Verification) .............................. 11
3.2.6. Creating a maintenance/hotfix release ..................................................... 11
3.3. Build Process FAQ / Tips and Tricks ................................................................ 12
4. Coding Guidelines ................................................................................................... 14
4.1. Developing a new Component ......................................................................... 14
4.1.1. Component Bundle Setup ..................................................................... 14
4.1.2. Creating the execution Bundle ............................................................... 14
4.1.3. Creating a common Bundle ................................................................... 18
4.1.4. Creating a gui Bundle .......................................................................... 18
4.1.5. Adding your new component to SVN ..................................................... 20
4.2. Logging ....................................................................................................... 20
4.2.1. General Configuration ......................................................................... 20
4.2.2. Verbose Logging ................................................................................ 20
5. Quality Assurance and Testing ................................................................................... 22
5.1. Automated GUI Testing ................................................................................. 22
5.1.1. Getting started .................................................................................... 22
5.2. Integrated Test Script Runner .......................................................................... 23
5.2.1. Configuration ..................................................................................... 23
5.2.2. Usage ............................................................................................... 24
5.2.3. Examples .......................................................................................... 24
ii
RCE Developer Guide
5.2.4. ......................................................................................................... 24
6. Licensing and Copyright ........................................................................................... 26
6.1. Copyright Statements ..................................................................................... 26
6.1.1. Current Year Definition ....................................................................... 26
iii
List of Tables
4.1. Useful Verbose Logging Identifiers .......................................................................... 21
iv
Chapter 1. Preface
This chapter gives an introduction to RCE.
1.1. Abstract
RCE (Remote Component Environment) is an open source software that helps engineers, scientists
and others to create, manage and execute complex calculation and simulation workflows. A workflow
in RCE consists of components with predefined inputs and outputs connected to each other. A
component can be a simulation tool, a tool for data access, or a user-defined script. Connections define
which data flows from one component to another. There are predefined components with common
functionalities, like an optimizer or a cluster component. Additionally, users can integrate their own
tools. RCE instances can be connected with each other. Components can be executed locally or on
remote instances of RCE (if the component is configured to allow this). Using these building blocks,
use cases for complex distributed applications can be solved with RCE.
• Windows 7
• Windows 10
• CentOS 7
• Debian 9
1
Preface
2. Go to Application Appearance
2
Chapter 2. Introduction
Note
If you are installing a JDK on a centrally administered computer that already has Java installed, it is usually a
good idea to uncheck the "Install public JRE" option during installation.
Currently, Oracle JDK 8.x is the reference development platform. In the near future, however, this
will most likely be replaced by OpenJDK on both Windows and Linux to simplify licensing issues.
OpenJDK has already been successfully tested in version 8 and 11, on Windows and Linux, for
development and building. Note that automated JUnit test execution as part of the build process is
currently only possible with 8.x versions of the JDK; this will be extended to JDK 11 soon.
• Download and run "Eclipse for RCP/RAP Developers", Version "Photon (4.8.x)" or later from
https://www.eclipse.org/downloads/. Using the latest Eclipse release instead is usually fine;
however, there may be slight differences between this guide and that version's UI.
• Set the proper path to your JDK installation (the -vm parameter; e.g. <your path>/jdk8/
bin immediately below the -vm line).
• Change the maximum heap size to at least 2 GiB (adapt the -Xmx line somewhere below -
vmargs, e.g. to -Xmx2048m, or add it if it does not exist yet)
• Optionally, install these plugins (for example using "Help > Eclipse Marketplace"):
• Disable "Project > Build Automatically" in the main menu to speed up the next steps.
• There are currently three ways to properly import the complete RCE source code: from the SVN
repository, from provided zip files, or from GitHub. At the moment, only the SVN approach
3
Introduction
provides access to the current development tree; for the time being, the zip files and the GitHub
repository are only updated on release.
• Option 1 - Importing from the RCE SVN repository, if you have access to it (as the repository is
currently hosted internally at DLR):
• Open the "SVN Repositories" view (Window > Show View > Other > SVN).
• Expand the location entry and select all projects (the entries starting with "de.rcenvironment")
inside of it.
• Right-click the selected projects, select "Checkout" and confirm if necessary. You should now
see a long list of projects in the "Package Explorer" on the left.
Note
If the checkout was performed correctly, there should be a small "M" (for "Maven") on most projects' icons,
and also a small "J" (for "Java") on most of them.
• Option 2 - Importing from the zip files provided with each release:
• Extract both archives into the same target directory. You should see a list of more than 200 sub-
folders, all except one beginning with "de.rcenvironment".
• In Eclipse, select "File > Import > General > Existing Projects into Workspace" and choose the
directory that you unpacked the archives into. You should see a long list of projects, once again,
all except one beginning with "de.rcenvironment". Select all projects confirm the import.
Note
Make sure not to change the "Search for nested projects" option in the import dialog; it must not be selected/
checked.
• For successfully importing the RCE project, you need a Git client with LFS support.
Note
The clone settings of certain Git clients (e.g. TortoiseGit), have an "LFS" option. Make sure that this option
is enabled before you clone.
• Check out the master branch; by default, this points to the source code of the latest release.
4
Introduction
• In Eclipse, select "File > Import > General > Existing Projects into Workspace" and choose the
directory that you unpacked the archives into. You should see a long list of projects, once again,
all except one beginning with "de.rcenvironment". Select all projects confirm the import.
Note
Make sure not to change the "Search for nested projects" option in the import dialog; it must not be selected/
checked.
• After you have successfully imported the RCE projects using one of the above methods, the next
step is to set the RCE target platform in your workspace. A target platform provides external artifacts
like the Eclipse RCP framework and various libraries. To get started with RCE development, the
easiest way is to use a precompiled target platform. For convenience, there is a Eclipse .target file
inside the code base that always points at an appropriate precompiled target platform release. Follow
these steps to apply it:
• Select the "Locations" list entry starting with "https://software.dlr.de/" and click
"Update". After a while, the list entry's description should end with something similar to "242
plugins available" (the exact number may vary). Save the file if necessary.
• Click "Set as target platform" in the top right corner. You can close the .target file after this.
• If you previously changed the global Java compiler compliance level to 1.7 for previous RCE
releases, it is recommended to revert this setting to default, or explicitly set it to 1.8. This setting
can be accessed by opening "Window > Preferences" from the menu, and then navigating to the
"Java > Compiler" tab. If you never actively changed this setting, no action is required.
• Enable "Project > Build Automatically". Eclipse will start building all projects against the new
target platform, which provides all required libraries and OSGi bundles.
• At this point, most projects will have a red error marker. To fix this, open the "Problems" view
("Window > Show View > Problems"). You should see a lot of "Plugin execution not covered
by lifecycle configuration" entries. Right-click one of them, select "Quick Fix" from the context
menu, select "Discover new m2e connectors" and click "Finish". Eclipse should present one or more
installation options with "Tycho" in their name. Confirm their installation and restart eclipse.
Note
• After this, all RCE bundles should compile without errors (with the exceptions noted below), and
you are ready to start developing. If this is not the case, try running "Project > Clean > Clean all
projects" from the main menu.
Note
On Linux platforms, there will be compilation errors in some Windows-only Excel and TiGLViewer bundles
(5 and 3 projects, respectively). We don't have an elegant solution for this problem yet. You can simply close
these projects to get rid of the errors, as they won't be loaded at runtime anyway.
5
Introduction
• There are several pre-defined launch configurations for RCE. To find them, navigate to
de.rcenvironment/eclipse/launch in the "Project Explorer" on the left.
• A good starting point is the "default" configuration. Expand the "default" sub-folder, right-click the
"rce.default.launch" file and choose "Run As > rce.default.launch" from the context menu.
• RCE should now start and prompt for an RCE workspace location. Confirm the default value or
choose another empty folder.
The Workspace Mechanic project in its original form is not being maintained anymore, and the original project site
is gone. However, it has been forked and is being continued by a new maintainer at this location [https://github.com/
alfsch/workspacemechanic/]. While this is not an "official" successor, it seems to be the de-facto location of this
project now.
Workspace Mechanic (which can be installed via Eclipse Marketplace from this location [https://
marketplace.eclipse.org/content/workspace-mechanic]) is an Eclipse plugin that automates common
settings in local workspaces. For RCE, the most important settings are the Java code formatting rules
and templates. Other settings are provided for convenience, like disabling the console output limit, or
showing line numbers in the editor.
Configuring Workspace Mechanic consists of copying a set of "rule" files to a location where the
plugin can find them. There are two options for this:
• If you want to apply the rules to all Eclipse installations on your machine, use the
.eclipse/mechanic subfolder in your home directory; by default, this is C:\Users\<user
id>\.eclipse\mechanic.
• To apply the rules to a single Eclipse installation only, use <eclipse installation
folder>\configuration\com.google.eclipse.mechanic\mechanic.
Using your system's file browser, navigate to the folder of your choice. Using any SVN tool, check out
https://svn.sistec.dlr.de/svn/rce/new/meta/eclipse/mechanic into a sub-
folder called "checkout" within it. (Note that the actual name of the sub-folder is not relevant; adapt
if you like.) This sub-folder now contains common rules on its top level, and optional or experimental
rules in sub-folders. Copy all common rules to the parent folder (the one you started in), and add any
optional rules that you want to apply as well. (TODO add and describe batch/shell files for this.)
Note
These rule files will most likely be integrated into the main project at some point, making this extra checkout step
unnecessary. Please note that these rule files are currently not available as part of the GitHub source code mirror
[https://github.com/rcenvironment/rce] or the released source zip files either, which makes them inaccessible unless
you have access to the internal SVN server.
The next time you open a workspace, Workspace Mechanic should pick up these rule files and
show a notice asking if it should apply them. See the plugin's web site [https://github.com/alfsch/
workspacemechanic/] for further information.
6
Introduction
accepted into the repository. Code that does not match the style guidelines will be refused on commit.
The Checkstyle-CS plugin simplifies development by highlighting violations that need to be fixed.
• Click "New" on the right side. Enter "RCE" as the name of the configuration.
• Click "Ok" in the main dialog. The list of configurations should now have three entries; select
"RCE" and click "Set as Default" on the right side.
Note
We are currently using version 6.19 of the Eclipse CheckStyle plugin within the development team. Using a newer
version (e.g. 8.0) works as well, but you may see error markers for constructs that do not actually violate the RCE
code guidelines. Versions > 8.0 do not work with current code guidelines. We will most likely adapt/migrate the
CheckStyle settings in the near future.
• Open the code formatter preferences (Window > Preferences > Java > Code Style > Formatter).
Note
There are rare cases where these code formatter settings lead to source files that are not being accepted by our
CheckStyle rules. These inconsistencies are being collected and tracked in issue #0005898, and will be fixed/
addressed in a future update.
• There are several pre-defined build configurations for RCE. To find them, navigate to
de.rcenvironment/eclipse/build in the "Project Explorer" on the left.
• To run a .launch file, right-click on it and choose the single entry in the "Run As" submenu of the
context menu that appears.
• Building a standalone RCE installation (which is called a "product" in Eclipse RCP terms) generally
consists of two steps: Providing a so-called "platform repository", and then building the actual
product on top of it. There are two possible approaches for this:
• Using the .launch files in the "using default remote repository builds" sub-
folder, it is possible to avoid building your own platform repository, and fetch a pre-built one
from the main repository servers (currently hosted at DLR) instead. One reason for this can be
be to ensure that you are building against the exact same platform repository as a certain RCE
release. Another reason is to simplify your local development setup if you have no reason to
customize the target platform setup (e.g. by adding libraries).
7
Introduction
• The most flexible way to build RCE from source is to compile a local platform repository yourself.
This is simply done by navigaring to the "de.rcenvironment.platform/eclipse
folder (from the root of your workspace) and executing the single .launch file that is located
there. On the first run, the build process may download quite a few resources from Maven
Central; subsequent runs should be fairly quick. Once the build has finished (there should be a
"SUCCESS" message near the bottom of the console output), you can build the main product
using the .launch files in the "using local repository builds" sub-folder of the
previously mentioned location.
• Regardless of whether you use a pre-build platform repository or compile one locally, running the
"RCE - build default product (snapshot, using <...>) .launch file is the
best way to produce a standard local product build. The other .launch files are intended for more
specific use cases.
• The main product build takes several minutes to complete. Once it has finished, you will
find the .zip files containing the final product in the folder de.rcenvironment/target/
de.rcenvironment.modules.repository.mainProduct/products (You may
have to refresh the de.rcenvironment project in the Project Explorer to see it.)
Note that both the Eclipse-based and the command-line build trigger the same Maven steps in the
background. Because of this, the build triggered from Eclipse produces the exact same artifacts as a
command-line build (which is used in Continuous Integration and for releases).
Note
Note that at this point, this list is probably incomplete. If you come across a class you wish you had
known earlier, please let us know.
2.2.1. General
ResolvableNodeId, Explanation for NodeIdentifier: This interface represents the
InstanceNodeId, "identity" of a node, and is used whenever nodes are specified
InstanceNodeSessionId, in API calls. In general, these node identifiers (or "node ids")
LogicalNodeId, are stored and reused by nodes, so they are persistent unless the
LogicalNodeSessionId (former: node's operator deletes its settings folder. From a developer's
NodeIdentifier) perspective, the inner format of these ids is usually not relevant.
8
Introduction
Package: de.rcenvironment.core.communication.common
2.2.3. Utilities
ThreadPool/SharedThreadPool This is a central thread pool that should be used for all
asynchronous operations (except for the SWT GUI thread
itself, and GUI-embedded "background tasks"). Always use
this instead of creating Thread or Executor/ExecutorService
instances.
Package: de.rcenvironment.core.utils.common.concurrent
9
Chapter 3. Build and Infrastructure
• Trunk preparations - actions that take place in the development trunk before the release branch is
split off.
• Release candidate building and testing - creation of the release branch, building RCs on the CI
server, and applying fixes if necessary.
• Final release - creating and publishing the final release build, SCM tagging, posting announcements
etc.
10
Build and Infrastructure
• Build the platform repository and the full product locally to verify that the build setup is consistent;
see the "getting started" section on how to do this.
• Create a Mantis issue "release x.y.z" for the new version if it does not exist yet (usually, it won't).
• (Option 2) Keep an eye on the standard periodic builds (nightly, "onCommit", ..) and see if they
complete normally. IMPORTANT: This is ONLY appropriate if you are around/available for
handling possible problems!
If the platform will change in the upcoming release, it is also necessary to upgrade the version of the
platform projects. However, we do not upgrade the platform version automatically with every RCE
release (for example RCE 8.2.0 still uses the 8.1.0 platform, as there were no changes in the platform
between these releases).
The version upgrade process for the platform projects is also mostly automated:
11
Build and Infrastructure
• Create a release branch (similar to a normal release) by copying the SVN release tag folder.
• As in step 4 of the standard process, upgrade the local version numbers, create a Mantis issue for
the release and commit the version changes to it. Note the change in ordering: in a standard release,
version numbers are upgraded in the trunk after the release; in a maintenance/hotfix release, they
are upgraded before the release, inside the release branch.
• Apply and commit the fixes or changes you want in the release; if you want to include specific trunk
changes, consider transfering them by using diff patches.
• If changes were made in the release branch that should also be in the trunk, merge them back
selectively . Unlike a normal release, you cannot simply merge all branch changes back to trunk;
take special care not to mix up version numbers when merging.
Q: After running a local product build, where do I find the generated product zips and files?
Q: When running a product build, how can I change the server URL where p2 artifacts (e.g. the
"target platform") are loaded from?
A: To support typical build use cases, p2 server URLs are normally assembled from two parts:
a common URL "root" part, and a repository-specific URL segment. The default values
for these are defined in the build pre-processor script at /de.rcenvironment/maven/
preprocessor/scripts/RCEBuildPreprocessor.groovy .
Note
For example, the default "target platform" repository URL for the 8.1.0 release is the concatenation of the
default URL "root" part https://software.dlr.de/updates/rce/8.x/repositories/
and the specific repository segment releases/8.1.0. The same pattern using the same "root" URL, but
different specific segments would also be used for other repositories. However, as of 8.1.0, the "platform"
repository is the only one used during the default build. The only other valid option is "intermediate", which
is only used in special builds.
There are three ways to change these URLs, depending on the build use case.
• If you want to switch to a different server that provides all of the required
repositories, you can simply override the URL "root" part, and all p2 repositories
will be loaded from there. This can be done by setting the Maven property
rce.maven.repositories.default.rootUrl.
• To override the URL root path of a single repository, set the Maven property
rce.maven.repositories.<id>.rootUrl, with <id> being "platform" or
"intermediate".
12
Build and Infrastructure
• Alternatively, you can also override the complete URL of a repository by setting the Maven
property rce.maven.repositories.<id>.url with the same ids as above.
All of these settings can be combined, with more specific settings overriding the more general
ones (e.g. a custom repository URL overrides a custom root URL).
Note that these approaches are only intended for adapting the build to your build
environment, or for local building and testing. To change the repository paths
permanently (e.g. when preparing a new release), edit the default values in the build
pre-processor script at /de.rcenvironment/maven/preprocessor/scripts/
RCEBuildPreprocessor.groovy. Note that there are two sets of specific repository URL
segments which are used for snapshot and RC/release builds, respectively.
Q: I created a new snapshot / RC / release build of the "platform" repository. What do I have to
edit to make the product build use it?
Note that when preparing for a new major release, you may also have to adapt the "root" URL
part (e.g. changing it from <...>/rce/8.x/repositories/ to <...>/rce/9.x/
repositories/), and have to deploy the referenced repository builds to that new location.
13
Chapter 4. Coding Guidelines
• GUI: Contains the user interface to configure the component. If a component does not require a
user interface this bundle can be ommitted.
• Common: Contains code resources which are used by both the execution and the GUI bundle. This
bundle is optional, too.
Note that in the context of Eclipse, OSGi bundles are called Plug-In Projects, and can be extended
with Eclipse-specific features. In practice, the terms bundle and plugin are often used interchangeably.
14
Coding Guidelines
Fill in the dialog properties to configure the plug-in project. The name of the new
project should match the RCE naming conventions. That means it should start with
"de.rcenvironment.components." and end with ".execution"; so the full name of the execution
bundle should be "de.rcenvironment.components.<yourcomponentid>.execution", where
<yourcomponentid> is the ID of your new component. Change the property "Source folder" to
"src/main/java" and "Output folder" to "target". Proceed by clicking "Next >".
Now specify the version of your component; you can choose this freely. The name of this plugin should
always be "RCE Components <YourComponentName> Execution" for the execution bundle,
where <YourComponentName> again is your component's display name. Press the "Finish" button
to complete the general configuration of this plugin.
15
Coding Guidelines
Eclipse now creates the configured structure of folders, but the plugin is not ready for being used as
an RCE component yet.
Create a folder called "resources" in the project you just created. If you have icon files
for your component, put them into this folder. Supported formats are PNG, JPG, BMP and
GIF. We recommend a resolution of 16×16 and 32×32 pixels. Conventionally these icons are
namend "<yourcomponentname>16.png" and "<yourcomponentname>32.png". Also create
an "inputs.json", an "outputs.json" and a "configuration.json" file in the resource folder you just
created, where you later define the inputs, outputs and configuration of your component.
As a start, the files can contain an empty JSON object as content. So it suffices to enter the following
text in these three files:
{ }
Note that the files must be present and must not be empty.
Now create a Java class in your source folder by right-clicking on "src/main/java" in the Eclipse
Project Explorer. As this will be the central class of your component, give it a name like
"<YourComponentName>Component.java" (<YourComponentName> is your component's
display name in camel case, and then add "Component.java"). This Java class must extend
de.rcenvironment.core.component.model.spi.DefaultComponent.
To implement the functionality of your component override the according methods. The most basic
methods to be overriden are:
• processInput: Is called whenever the component receives a new input. In loops this method is called
multiple times.
• dispose: Is called when the component disposes. Clean up methods can be placed here to release
resources.
16
Coding Guidelines
Now create a folder called "OSGI-INF" in your project folder, by using the standard
Eclipse function (File->New->Folder). This folder will contain all OSGi service definitions
for your project. One way to create an OSGi service definition is creating a file
"<yourComponentName>.xml" ("<yourComponentName>" is your own component's display
name again) and copying the following source code into it. Replace all occurences of
"<yourComponentName>" with the display name of your component, and all occurences of
"<yourcomponentname>" with its id:
Some of these definitions are optional or refer to elements that do not exist yet. The first lines provide
the general XML header, followed by the OSGi root element. The factory attribute is the part that
links this definition into the RCE framework. The name attribute defines your component's name
when inspected with OSGi tools and should be the same as the rce.component.name property
below. The implementation class entry defines the main Java class of the component. The
rce.component.group property sets the GUI group in which your component will appear. (Since
the component is still under development, something like "Test" is a good choice for now.) The
rce.component.icon-16 and rce-component.icon-32 properties are optional and define
the icon for your component. The rce.component.inputs, rce.component.outputs and
rce.component.configuration attributes define the locations of configuration files that will
be described later.
The created plugin project automatically contains a folder named "META-INF". Edit the
"MANIFEST.INF" file in this directory by double-clicking it and selecting the "MANIFEST.MF" tab.
Add the following lines to it and save:
Service-Component: OSGI-INF/*.xml
RCE-Component: true
Export-Package: de.rcenvironment.components.<yourcomponentname>.execution
Note that "Export Package: " and the first name have to be in the same line. A second element would
be added in the next line with a leading space. Moreover the file must end with a linebreak.
Also note that errors containing "inconsistent hierarchies" can be solved by adding the required
referenced packages in the Import-Package property analogous to the Export-Package property.
The first line tells the OSGi framework where to look for the component declaration we created before.
The second line declares this plug-in as an RCE component. The last line makes the package of your
main class visible to other bundles, which is required so RCE can load and initialized the component.
Next, edit the "build.properties" file in the main folder of your plugin project. This file should always
look the same for the execution bundles and can be copied from the sample component. It should
look like this:
source.. = src/main/java
bin.includes = META-INF/,\
OSGI-INF/,\
resources/,\
17
Coding Guidelines
After this step, the plugin configuration is complete. It should look like this in the Eclipse Package
Explorer:
When you start RCE from Eclipse and open a workflow file, your component should be shown in the
component palette on the right, in the group that you have set in the "OSGI-INF/..." XML file.
Add the Java classes to the source folder, within a package with the same name as the bundle's name
(or sub-packages of it). For holding shared constants, the usual convention is a Java class named
"<YourComponentName>ComponentConstants.java". Create this class, and add your first constant
for defining the component id and adapt the placeholders in the usual manner:
In order to keep track of your constants, it's advisable to give all constants a short comment.
To complete the setup, add the names of the all Java packages you created to the "Export-Package"
attribute in the source code of the META-INF/MANIFEST.MF file. Example:
Export-Package: de.rcenvironment.components.<yourcomponentname>.common
The graphical user interface is shown in the properties tab which is usually shown at the bottom of
RCE when the component is focused in the workflow editor.
Custom sections can be defined. Therefore create a package called like the project containing it.
Inside the package create a class called "<YourComponentName>Section.java" which extends
de.rcenvironment.core.gui.workflow.editor.properties.WorkflowNodePropertySection
Override the method createCompositeContent to fill the GUI.
18
Coding Guidelines
Each component GUI must provide a Component Filter. It is used to determine which
sections the GUI for the respective component consists of. Inside the package you
just created add a class called "<YourComponentName>ComponentFilter.java". extending
de.rcenvironment.core.gui.workflow.editor.properties.ComponentFilter.
To define the component filter, override the following method:
@Override
public boolean filterComponentName(String componentId) {
return componentId.startsWith(YourComponentNameComponentConstants.COMPONENT_ID);
}
As usual, change YourComponentName to the name of your own component. This method will
only return true for the component id used in the "execution" bundle, so it will only be shown for
that component.
To provide sections as GUI elements, add a new file called "plugin.xml" to the root of the project
folder. It is common to have a section where you can manage inputs and outputs and another section
where component specific GUI elements are located. The following code demonstrates this and can be
pasted into the plugin.xml you just created. As usual, adapt the component names and IDs accordingly.
It is explained below:
<propertySection
tab=
"workflow.editor.tab.<yourcomponentid>.General"
class=
"de.rcenvironment.components.<yourcomponentid>.
gui.<yourComponentName>Section"
id=
"workflow.editor.tab.Properties.Section.General"
filter=
"de.rcenvironment.components.<yourcomponentid>.
gui.<yourComponentName>ComponentFilter"
enablesFor="1">
</propertySection>
<propertySection
tab=
"workflow.editor.tab.<yourcomponentid>.InputsOutputs"
class=
"de.rcenvironment.core.gui.workflow.editor.
properties.DefaultEndpointPropertySection"
id=
"workflow.editor.tab.Properties.Section.InputsOutputs"
filter=
"de.rcenvironment.components.<yourcomponentid>.
gui.<yourComponentName>ComponentFilter"
enablesFor=
"1">
</propertySection>
</propertySections>
</extension>
<propertyTab
label="General"
category="default"
id="workflow.editor.tab.<yourcomponentid>.General">
</propertyTab>
<propertyTab
label="Inputs/Outputs"
category="default"
id="workflow.editor.tab.<yourcomponentid>.InputsOutputs">
</propertyTab>
19
Coding Guidelines
</propertyTabs>
</extension>
</plugin>
For each section that you would like to add to the "Properties" view, add the entries like you can see in
the propertySection and the propertyTab parts. Make sure that the "filter" attribute contains the correct
path of the component filter class created above. The first entry in property section and property tab
adds a general custom section to the GUI while the second entry adds a section to manage inputs and
outputs.
Remember to keep the file valid by closing the definition blocks with the corresponding end tags:
After assigning the property tabs to their classes, you have to register each tab as a propertyTab.
Note that the ID of the propertyTab should be the same as the "tab" in the propertySection above.
Customise the section title by editing the label attribute.
4.2. Logging
• static field / constant (preferred for classes that are instantiated very frequently):
private static final boolean VERBOSE_LOGGING =
DebugSettings.getVerboseLoggingEnabled(TheClassName.class);
20
Coding Guidelines
Note
As with any other JVM property, this parameter must be placed behind the -vmargs delimiter, which separates it
from the "direct" RCE command-line arguments (like --headless or -p <profile>). This rule also applies
when adding this parameter to an rce.ini file.
Identifiers created before 8.1.0 were fully qualified Java class names; since 8.1.0, identifiers are
arbitrary strings. For existing identifiers, these strings were set to the pre-8.1.0 FQNs. Over time, all
existing identifiers are planned to be migrated to more intuitive strings.
The following table lists some identifiers that may be useful for debugging:
21
Chapter 5. Quality Assurance and
Testing
• Start RCPTT
• In the view "Applications" add RCE as Application under test (AUT) via "New... ". Use RCE's
main folder as location.
• Configure AUT (Rightclick on entry in "Applications" view -> Configure... -> Advanced...):
1. Set a profile different from the default one to make sure your productive RCEs won't interfere with
RCPTT's RCE and vice versa. Therefore go to "Arguments" tab and add to Program arguments
e.g "-p my_rcptt_profile".
In "Configuration" tab select "Use an existing config.ini file as a template" and navigate to the file
you just downloaded.
4. Set allocate console for StdIn and StdOut: To access StdIn and StdOut directly from console
view in RCPTT go to "Common" tab and check "Allocate console (necessary for input)
• Check if RCE can be started from RCPTT by double clicking on the entry in the "Applications" view
• Now you can either run existing test cases (A) or create your own test cases (B):
• Create an RCP Testing Tool Project in the Test Explorer on the lefthand side
• In the folder "Testsuites" navigate to "AllPlatforms" and execute the testsuite (Rightclick -> Run
As -> Test Cases)
22
Quality Assurance and Testing
• Find the Execution View on the bottom left which shows the progress of the testcases
• For the next steps also refer to RCPTT's getting started guide: https://www.eclipse.org/rcptt/
documentation/userguide/getstarted/
• Create an RCP Testing Tool Project in the Test Explorer on the lefthand side
• Capture script via "Record" button in the upper right corner and then clicking around in RCE
• Capture verification by switching to Assertion Mode in the menu bar of the Control Panel and
then selecting some element in RCE
• Create a Context within the project (New -> Context). Contexts are proconditions for tests, e.g. to
make sure there is a clean setup. For instance, choose a context of type "Workspace" an leave the
default settings so it will clear the workspace upon being applied.
• Add the context to the test case by selecting the "Contexts" tab in the test case, click "+" and choose
the one you just created.
As of RCE 9.0.0, the Test Script Runner is included in the standard application release, as well as the
standard Eclipse checkout. Therefore, very little configuration is required to use it.
5.2.1. Configuration
The only configuration that is required for using the TSR is adding an Instance Management
configuration to the RCE instance that will execute the test scripts. This defines the root directory
where work files and directories of managed RCE test installations will be stored. Locate the profile
directory that is being launched and edit its configuration.json file. In this file, add this
configuration block on the root JSON level, and adjust the settings as necessary:
"instanceManagement": {
"dataRootDirectory": "C:\\MyWorkdir\\rce-im-dat"
}
Note that there are additional Instance Management configuration parameters available; however,
these are not usually needed for using the TSR.
23
Quality Assurance and Testing
Note
It is strongly recommended to use a short full filesystem path as the dataRootDirectory, as RCE installations
will be placed inside of it, and long filesystem paths are known to cause problems with these. The exact maximum
lenght will be determined, documented, and maybe also automatically checked in the future.
5.2.2. Usage
The TSR is invoked by a single RCE console command (run-test), with an alias for readability
(run-tests). The general syntax is:
• from within an RCE instance launched from Eclipse during development, usually using the GUI
workflow console
• from within a standalone RCE instance, also usually using the GUI workflow console
The RCE installation to be tested is defined by the <build id> parameter in the above command.
One important aspect to understand is that this installation is generally independent of the installation
being used to execute the TSR command. The latter is, in a sense, only the "host" of test scripts. There
are three ways of specifying the build to test:
1. A build download id, which corresponds to a certain part of the standard download URL, for
example snapshots/trunk or releases/9.0.0. The structure should be self-explanatory.
(The major release tree to use for snapshot builds is one of the optional Instance Management
settings mentioned above; the default is to use the current major version, ie 9.x.)
2. A path to an unpacked local standalone (product) build, which can, for example, result from a local
build run or from unpacking a downloaded product zip file. The syntax for this is local:<local
installation path>. This directory can be either writable or read-only. For example, it is
also possible to test a (read-only) .deb or .rpm package installation this way.
Note that this path must point to an already-unpacked RCE build, unlike the first approach, which
downloads zipped release packages and unpacks them automatically.
3. As it is a frequent use case when testing standalone builds to execute the test command the
installation itself, there is a convenient shortcut for this. By specifying :self as the build id, the
test scripts are executed on the installation of the instance used to run the test command.
Note that due to technical limitations, however, this shortcut is not possible when launching RCE
from Eclipse, as the test scripts require a standard product build to execute.
5.2.3. Examples
24
Quality Assurance and Testing
• run-test DefaultTestSuite :self - runs the default collection of tests on the current
installation
• rce --batch "run-test DefaultTestSuite :self" - the full command line for the
standard self-test of an installation
25
Chapter 6. Licensing and Copyright
• feature.xml files
26