jclouds Developer Setup instructions for Eclipse

Introduction

This guide will help you set up jclouds in Eclipse and includes instructions for running tests.

Pre-requisites

Adding projects to Eclipse

  1. Import jclouds projects as Maven projects. If you wish to optimize your workspace, you can exclude unneeded projects (such as those without a src folder)
  2. Accept any warnings about Incomplete Maven Goal Execution related to the maven-remote-resource-plugin:bundle goal for the jclouds-resources project. You can either:
    • Ignore the error, which will not affect your builds
    • Remove the jclouds-resources project from your workspace, unless developing against it
    • Right-click on the build error and use the Quick Fix option to ignore the bundle goal
    • Add this configuration snippet to your jclouds-resources POM file and refresh the project in Eclipse
  3. If working on jclouds-labs, import the jclouds-labs projects as Maven projects

Running tests in Eclipse

If you are not familiar with TestNG, please have a quick look.

Testing a live provider

Live tests require the following system properties to be provided as VM Arguments:

  • basedir (use . as the value)
  • test.provider.identity
  • test.provider.credential

Here, provider is e.g. "aws-s3", "cloudfiles-us", "aws-ec2" etc. Depending on the provider, you may also be able to specify additional system properties, e.g. test.vcloud.endpoint for vcloud:

-Dbasedir=. -Dtest.vcloud.identity=user@org -Dtest.vcloud.credential=password -Dtest.vcloud.endpoint=https://vcloudserverilike/api

Testing SSH connections

Tests making direct SSH connections, such as SshjSshClientLiveTest, also use system properties to determine the connection details to use. This only applies to direct SSH tests, not to tests that create and access machines via a compute provider. The following system properties are required:

  • test.ssh.host
  • test.ssh.port
  • test.ssh.username
  • test.ssh.password

The destination host must be a Unix-like host that contains a world readable /etc/passwd file.

You can use Eclipe's String Substitution feature to declare aliases for sensitive information such as your username and password and use these aliases in the Program Arguments.