Oracle Tools for Testing

Interfaces, classes and resources that extend and simplify traditional functional, integration and unit testing frameworks (like JUnit).

License

License

GroupId

GroupId

com.oracle.tools
ArtifactId

ArtifactId

oracle-tools-testing-support
Last Version

Last Version

2.0.0-RC9
Release Date

Release Date

Type

Type

jar
Description

Description

Oracle Tools for Testing
Interfaces, classes and resources that extend and simplify traditional functional, integration and unit testing frameworks (like JUnit).

Download oracle-tools-testing-support

How to add to project

<!-- https://jarcasting.com/artifacts/com.oracle.tools/oracle-tools-testing-support/ -->
<dependency>
    <groupId>com.oracle.tools</groupId>
    <artifactId>oracle-tools-testing-support</artifactId>
    <version>2.0.0-RC9</version>
</dependency>
// https://jarcasting.com/artifacts/com.oracle.tools/oracle-tools-testing-support/
implementation 'com.oracle.tools:oracle-tools-testing-support:2.0.0-RC9'
// https://jarcasting.com/artifacts/com.oracle.tools/oracle-tools-testing-support/
implementation ("com.oracle.tools:oracle-tools-testing-support:2.0.0-RC9")
'com.oracle.tools:oracle-tools-testing-support:jar:2.0.0-RC9'
<dependency org="com.oracle.tools" name="oracle-tools-testing-support" rev="2.0.0-RC9">
  <artifact name="oracle-tools-testing-support" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.oracle.tools', module='oracle-tools-testing-support', version='2.0.0-RC9')
)
libraryDependencies += "com.oracle.tools" % "oracle-tools-testing-support" % "2.0.0-RC9"
[com.oracle.tools/oracle-tools-testing-support "2.0.0-RC9"]

Dependencies

compile (4)

Group / Artifact Type Version
com.oracle.tools : oracle-tools-core jar 2.0.0-RC9
com.oracle.tools : oracle-tools-runtime jar 2.0.0-RC9
org.hamcrest : hamcrest-library jar 1.3
junit : junit jar 4.11

test (1)

Group / Artifact Type Version
org.mockito : mockito-core jar 1.9.5

Project Modules

There are no modules declared in this project.

Oracle Bedrock

Oracle Bedrock provides a general purpose Java framework for the development, orchestration and testing of highly concurrent distributed applications.

It's often used for orchestrating and testing multi-server, multi-process distributed applications, meaning it's especially useful for working with Coherence-based applications. However it can be used for any type of application or server, Java or not.

Oracle Bedrock provides extremely uniform mechanisms to start/stop and manage applications and processes on a variety of platforms, including;

  • Local Platforms
  • Remote Platforms (via ssh, powershell et al)
  • Virtualized Platforms (via Vagrant), including machine / platform orchestration (VirtualBox, VMWare etc)
  • Containerized Platforms (via Docker), including image management
  • Java Virtual Machines (aka: in-process applications)

Which means it can orchestrate launching applications/servers in any environment, locally, on-premise, across data-centers or in one or more clouds.

For example: To Launch a "HelloWorld" Java Application on the current classpath on the LocalPlatform, use the following:

    LocalPlatform platform = LocalPlatform.get();

    try (JavaApplication application = platform.launch(JavaApplication.class,
                                                       ClassName.of(HelloWorld.class))) {

        // potentially do something with the application ...

        // wait until it finishes execution
        application.waitFor();
    }

To launch this application on another platform, simply change the platform. The rest of the code remains the same.

    // launch using a RemotePlatform
    RemotePlatform platform = new RemotePlatform(address, username, authentication);

    // ... or launch inside the running JavaVirtualMachine Platform (ie: in-process)
    JavaVirtualMachine platform = JavaVirtualMachine.get();

For Java-based applications, Oracle Bedrock uniquely provides support for:

  • Packaging and automatically deploying applications (based on a ClassPath or Maven Dependency POM)
  • Dynamically interacting with applications at runtime, without requiring technologies like RMI, including the ability to dynamically execute lambdas / remote callables / runnables through an ExecutorService like interface.
    // execute the lambda in the java application, where ever it is running!
    application.submit(() -> { System.out.println("Hello World");});

    // request a lambda to execute (in the java application) and return a result (as a CompleteableFuture)
    CompletableFuture<String> property = application.submit(() -> System.getProperty("os.name"));

Lastly, Oracle Bedrock provides a powerful extension to testing tools, allow developers to Eventually assert that conditions in concurrent data-structures and distributed applications are reached.

   // ensure that the application internal state reaches some condition
   Eventually.assertThat(application, () -> { someFunction() }, is(someValue));

Contributing

Oracle Bedrock is an open source project. Pull Requests are accepted. See CONTRIBUTING for details.

License

Copyright (c) 2010, 2019 Oracle and/or its affiliates. Licensed under the Common Development and Distribution License v1.0 ("CDDL")

Building

Bedrock is a Maven project and can be built with standard Maven commands.

Prerequisites

  1. The Coherence modules have a dependency on four versions of Coherence. The exact versions can be found in the coherence.version property in pom.xml files

    bedrock-coherence/3.7.1/pom.xml
    bedrock-coherence/12.1.2/pom.xml
    bedrock-coherence/12.1.3/pom.xml
    bedrock-coherence/12.2.1/pom.xml

    As Coherence is not available in public Maven repos the coherence.jar files for each of those versions needs to be loaded to your own local or remote Maven repository under the groupId com.oracle.coherence and artifactId coherence.

  2. There are a number of tests in the bedrock-runtime-remote-tests module that will attempt to SSH into your local machine using private/public key pair. For this to work you need a key pair configured.

    1. By default the private key file is called 127.0.0.1_dsa and corresponding public key 127.0.0.1_dsa.pub. You can run the build with a system property to change this to any valid key that you already have configured for ssh'ing into your machine: For example to use id_rsa then add -Dbedrock.remote.privatekey.file=~/.ssh/id_rsa to the Maven command line.

    2. Alternatively you may need to generate a new key pair using ssh-keygen. NOTE ensure that they type of key-pair generated is a valid type to SSH into your machine. For example on MacOS an RSA key pair will be fine, a DSA key pair may not, so even though the default file name used in tests has the suffix _dsa it can contain any type of key.

      ssh-keygen -t rsa -f 127.0.0.1_dsa
      

      Do not set a passphrase for the keys.

    3. Add the public key to your ~/.ssh/authorized_keys file:

      cat ~/.ssh/127.0.0.1_dsa.pub >> ~/.ssh/authorized_keys
      
    4. Restart your SSH daemon to pick up the change to the ~/.ssh/authorized_keys file. On MacOS run

      sudo launchctl stop com.openssh.sshd
      sudo launchctl start com.openssh.sshd
      
    5. Test that you can ssh into your own machine with the new key

      ssh -i ~/.ssh/foo_rsa <your-user-name>@127.0.0.1
      

Run the build

To run a full build:

mvn clean install

To run a full build without tests:

mvn clean install -DskipTests
com.oracle.tools

Oracle Coherence Community

Versions

Version
2.0.0-RC9
2.0.0-RC3
2.0.0-RC2
2.0.0-RC1
1.2.2
1.2.1
1.2.0
1.1.0
1.0.0
0.0.8
0.0.7