4. Advanced
GreenPepper logs
Activating the GreenPepper logs is helpful for the GreenPepper support team.
To activate the GreenPepper logs, browse to the Logging and Profiling menu under the Confluence Administration screens. Under the Add New Entry, specify com.greenpepper for the Class/Package Name, select the ALL (or DEBUG) level and then click the Add Entry button.
For older version of Confluence
To activate the GreenPepper logs, you need to add this line
to the file
WEB-INF/classes/log4j.properties under the Confluence webapp directory.
You will need to restart Confluence.
 |
Don't forget to de-activate the GreenPepper logs when no more needed |
Maven Runner
These are the steps needed to configure the Maven runner.
Before you begin, you must verify the following:
Maven Runner
Configuring a System Under Test can be tedious if you are having a lot of library dependencies. The Maven Runner allow you to use your existing pom.xml
to resolve dependencies needed for the execution of specifications. Only the <dependencies> element of the pom.xml is read. Artifacts found will be resolved and added to the classpath of the runner. The artifact of the project itself will also be part of the classpath.
Maven Runner Configuration
From the Runner Configuration Panel, please follow these steps.
- Click on Add a new Runner
- Enter the name of your Runner (Mandatory)
- Enter the Command line (please refer to Executing a Specification)
Know that (similar to velocity)
- ${classpaths} will be replaced by the Runner, SUT and Fixtures classpaths -(Mandatory for GP)
- ${mainClass} will be replaced by the Runner specified Main Class -(Mandatory for GP)
- ${inputPath} will be replaced by an input path -(Mandatory for GP)
- ${outputPath} will be replaced by an output path -(Mandatory for GP)
- ${locale} will be replaced by the user locale -Default: English (java only)
- ${repository} will be replace by the repository of the Specification resolver class -Default: FileSystemRepository
- ${fixtureFactory} will be replaced by the SUT Fixture Factory Class;Fixture Factory Args -Default: CoreFixtureFactory
- ${projectDependencyDescriptor} will be replaced by the project dependency descriptor file location-(Mandatory for the Maven runner)
Example of a command line:
java -mx252m -cp ${classpaths} ${mainClass} ${inputPath} ${outputPath} -l ${locale} -r ${repository} -f ${fixtureFactory} --xml --pdd ${projectDependencyDescriptor}
- The main class : com.greenpepper.maven.runner.Main -(Mandatory, main Maven runner class)
- The Server name and port (if you are using the Remote agent)
- Click Save
- Enter the location of your Runner library and its dependencies.
- GreenPepper Maven Runner library
- greenpepper-maven-runner-x.x-complete.jar
- Maven libraries
- maven-2.x.x-uber.jar from the lib directory of your Maven home
- classworlds-1.1.jar from the boot directory of your Maven home

System Under Test Configuration
Make sure your Confluence Space is registered as a GreenPepper Project (see)
From the Space Registration Panel, please follow these steps.
- Click on Add a new System Under Test
- Enter the name of your System Under Test (Mandatory)
- Select your Maven runner (Mandatory)
- Enter the Fixture factory to use (optional)
- Enter the Fixture arguments (optional)
- Enter the Project Dependency Descriptor (Mandatory)
- Since we are using Maven, there is 2 possibilities :
- use a valid Project Object Model file (pom.xml)
- NEW in 2.8 use the groupId:artifactId:version (Maven Coordinates
) where the version can be a Version Ranges
Ex:
You may need to add required repositories to the settings.xml of Maven (or routing all repositories using the mirrors
) using the coordinates.
- Click Save
Maven Plugin Fixture Artifact Dependency
By default, the Maven Runner will detect if the pom.xml is using the Maven Plugin to create fixture artifact. If so, the fixture artifact will be automatically added to the list of dependencies.
However, if you want to use a fixture artifact from another project, you will need to add the <dependency> of that project with <classifier>fixtures</classifier>.
NEW in 2.7.1/2.8.1/2.9 scopes
You can now specify scope on the command line (by default, runtime and compile are always use) :
Remote Agent
The
remote agent is a small server that can be used to execute specifications from a GreenPepper Server to another machine.
This Agent is an answer to many purposes like this examples :
- Your GreenPepper server is installed on a unix machine and you need to execute .Net specifications on a windows machine.
- You do not want to execute your specifications directly on your GreenPepper Server.
Requirements
GreenPepper Remote Agent installation
The
remote agent is a simple executable java application that can be found here.
- Copy the remote agent Jar file on the machine where your GreenPepper Server will sends its remotes executions.
- To launch the remote agent, just double-click on the Jar file or by command line.
Command line to start the remote agent with default settings :
Command line to start the remote agent on a specified port :
 | By default, the Remote Agent is listening on port 56000
|
Secured mode
The communication between your GreenPepper server and your agent can be secured with SSL.
Requirements
- 1. On Remote Agent
Your Remote Agent must be version 1.3 or higher
You must have a KeyStore properly configured see Configuring my Agent keystore
- 2. On GreenPepper Server
Your GreenPepper Server must be version 1.3 or higher
You must have the agent certificate stored in your java cacerts file see Importing the Agent certificate
Enabling Secured Mode
- On the remote agent
To enable Secured mode start the remote agent with this command line :
- On GreenPepper Server
In Confluence or XWiki, get in GreenPepper Server Configuration, then Select the remote runner to be secured and just check the box "Secured Mode".
Configuration File
Starting with version 2.1, the remote agent can use a property file to specify parameters (instead of the command line parameters). By default, the remote agent will look for a property file remoteagent.properties in the current directory. You can also use the command line parameter -config [path of the configuration file] to override the default property file.
| Command line parameter |
Configuration file entry |
Default Value |
| -port |
greenpepper.remoteagent.port |
56000 |
| -secured |
greenpepper.remoteagent.secured=[true or false] |
false |
| -keystore |
greenpepper.remoteagent.keystore.file=[path of the keystore file] |
* Mandatory if secured=true |
| |
greenpepper.remoteagent.keystore.password=[the password of the keystore file] |
* Mandatory if secured=true and the keystore require a password |
The property greenpepper.remoteagent.keystore.password replace the command line input of the keystore password at remote agent startup.
Using SSL
HTTPS
You would need to setup your Web Container to server HTTPS requests.
Create a test certificate
I. Generating your key pair
 | Be Careful
When keytool will ask you to enter your First and Last name, you have to enter the network machine name (ex: myserver) or the domain name of your server (ex: www.myserver.com) where resides the your web container. |
II. Generating a self signed certificate
III. Importing the certificate to a Certificate Authority store
You have two solutions :
The certificate must be imported in the Java Virtual Machine used by tomcat.
Supposing your tomcat JVM location is C:\Program Files\Java\jdk1.6.0_02\
 | Default Cacerts password
The default java Cacerts keystore password is "changeit" |
- Creating a standalone 'cacerts'
Adding SSL support for Tomcat with the test certificate
Uncomments the definition of the SSL HTTP/1.0 Connector and specify attribute keystoreFile and keystorePass :
Start tomcat and using your internet browser, navigate to https://www.myserver.com:8443
. You should be alerted to accept the certificate.
- If you are using Firefox, you should see :
Hint : Select
Accept this certificate permanently and click
ok
- If you are using Internet Explorer, you should see :
Hint : Click on
Continue to this web site (not recommended)
Hint : Click on
Certificate Error
Hint : Click on
View Certificates
Hint : Click on
Install Certificate , follow the instructions and restart Internet Explorer when done
Runner Configuration
Java Runner
You would need to tell your runner the location of the trustStore and the password on the command line (Optional if you imported the certificate in the JVM)
.Net Runner
You only need to accept the certificate when navigating to https://www.myserver.com:8443
using Internet Explorer.
Troubleshooting : if for some reason the .Net runner doesn't work, try C# example from Using Trusted Roots Respectfully
. You may need to recompile your the GreenPepper - Open .Net binaries from source
.
Confluence / Jira Repository Update
From Confluence / Jira, make sure the base url is using https on port 8443 (goto Adminstration / General Configuration).
- For each Confluence Space's Registration repository, click edit and update (without changing anything, the repository url will be updated using the actual base url)
- For each Jira Project Registration repository, click edit and update
Using the Eclipse Plugin
If you are using the Eclipse Plugin, you would need to perform the following steps :
- Add information about the truststore and password to the eclipse.ini (Optional if you imported the certificate in the JVM)
- Change the Server's context path to use https on port 8443
Using the Visual Studio Plugin
You only need to accept the certificate when navigating to https://www.myserver.com:8443
using Internet Explorer.