Skip to content

Development

Anton Wiedermann edited this page Jun 12, 2019 · 7 revisions

All jUnit tests and all integration tests need to pass for pull requests.

Build from source code

  1. clone repository https://github.com/proximax-storage/java-xpx-chain-sdk and cd to the working tree
  2. set variable JAVA_HOME to the location of Java8 JDK
  3. run build and jUnit tests ./gradlew build
  4. find the SDK jar in build/jars

If you need SDK jar together with all the dependencies then run ./gradlew distZip. That will create zip archive in build/distributions with all the jars needed to use the SDK.

Run unit tests

Basic batch of quick low-level tests is executed automatically with every build. HTML report can be found in build/reports/tests/test.

Run integration tests

Integration tests are not executed during build by default because they use actual network and burn tokens. To run integration tests you need to do following

  1. configure the test parameters (node url, network type, seed account, timeout). There are 2 options how to do this:
    • edit e2e/resources/config.properties (xpxsdk.conf.url, xpxsdk.conf.network_type, xpxsdk.conf.seed.private_key, xpxsdk.conf.timeout)
    • set environment variables (E2E_URL, E2E_NETWORK_TYPE, E2E_SEED_PRIVATE_KEY, E2E_TIMEOUT)
  2. run integration tests ./gradlew e2eTest

Integration tests generate HTML report. It can be found in build/reports/tests/e2eTest.

Code coverage

Code coverage report is generated from test execution reports. That means you need to run first tests and then the coverage report generator.

If you have already executed tests and are looking just for the coverage report then run ./gradlew jacocoTestReport.

If you want to get clean report then

  1. make configuration as needed for integration tests
  2. run ./gradlew clean build e2eTest jacocoTestReport

Report will be in directory build/reports/jacoco/test/html

Publishing

Publishing requires OpenPGP credentials to be configured for signing of the publication.

Before publishing make sure that

  • signing credentials are set-up and ~/.gradle/gradle.properties contains signing configuration
  • you have publishing credentials to maven central and those credentials are present in ~/.gradle/gradle.properties (nexusUsername, nexusPassword)

To perform publishing run ./gradlew publish

Copyright (c) 2019 ProximaX Limited

Clone this wiki locally