Skip to content

Commit

Permalink
Merge branch 'master' into multiple-services
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitry-timofeev committed Mar 18, 2019
2 parents b53fa67 + 8683a73 commit a91ff0d
Show file tree
Hide file tree
Showing 26 changed files with 67 additions and 79 deletions.
7 changes: 5 additions & 2 deletions .travis.yml
Expand Up @@ -18,9 +18,12 @@ addons:
sources:
- sourceline: 'ppa:chris-lea/libsodium'
- sourceline: 'ppa:maarten-fonville/protobuf'
- sourceline: 'ppa:exonum/rocksdb'
packages:
- build-essential
- libsodium-dev
- librocksdb5.17
- libsnappy-dev
- libssl-dev
- pkg-config
- protobuf-compiler
Expand All @@ -30,6 +33,8 @@ env:
global:
- RUST_COMPILER_VERSION=1.32.0
- OSX_PACKAGES="libsodium rocksdb pkg-config protobuf"
- ROCKSDB_LIB_DIR=/usr/lib
- SNAPPY_LIB_DIR=/usr/lib/x86_64-linux-gnu
# REPO_TOKEN used for integration with coveralls is encoded here
- secure: Fp22iaJpttsIArAyWmdCGNtljIALTYRVKO7O+H2hgBkwHHqrU7+15sbaq3xzhz4YNWNfuFMIkFUBgd/KYHgAuNDDrtm2agib13C0lQT1NFQO9ccmNCJNsXQrYrXGwpnNqPKp0YmfBfgNwzEpBerlbtvzV/T/RZukT/403XxwxU9y5tHfQokwVLibqP2jJsxdihTfCKIOs+o6hBfArmsn+e+panEv17ZrCjOmBIM/W70Rf2rEM26wFnYsfnAUTCkpl4Ong0SYNpZZxNMtw61W8ApDY8bpz7cKUxCv7SmD3kO7Y+TTHWfWYx6FNXtUpE1vCi6I7fZAY16rViTWOX55NCeFQz56XER7ArJQZtC/nC1lZ9tGKtcofu2Rq7WUoRuTwvLTaf6VzAP/CUj0DUxkV+8WUggl3s/Im7Y9rn8Aqvh8LReZmqzTY+dJ0hFG4DLoLtl71eTEnNoumi5UleBhJPaei3wPNPHg1WlOmhFyhRCsbIIGiyFtSj/faLmdc7tN/sBFANb0g4Exl0mRNvB0IfS1gM6XouEGUTlVree68p11PnsGJGs/QaUB9F9AAGVKTZ2kz7sqkCDdGmLxzbdidYDHZtYWfOIYSJCQsA09n2Txi0fwNByKfl/spdyMmtI1uGeT803rhN9vu0NGrQFG3mU7mqO33fUDEStIQ6/xn0A=

Expand Down Expand Up @@ -76,8 +81,6 @@ before_install:
# Install OSX requirements
# TODO: Temporary fix, the problem is described here: https://jira.bf.local/browse/ECR-2795
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install $OSX_PACKAGES || brew install $OSX_PACKAGES; fi
# force building instead of using from apt.
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export ROCKSDB_BUILD=1; export SNAPPY_BUILD=1; fi

install: true # Skip the installation step, as Maven requires
# several extra properties when run on a CI server (see below).
Expand Down
18 changes: 14 additions & 4 deletions exonum-java-binding/CHANGELOG.md
Expand Up @@ -15,11 +15,20 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

## [0.5.0] - 2019-03-13

### Overview

This release brings support of Exonum Time Oracle. It is based on Exonum 0.10.3.

### Added
- Support of Time oracle. Instruction on how to enable built-in services can be found
[here](https://exonum.com/doc/version/0.4/get-started/java-binding/#built-in-services). (#667)
- `com.exonum.binding.common.serialization.json.JsonSerializer` provides support for `ZonedDateTime`
JSON serialization in `java.time.format.DateTimeFormatter.ISO_ZONED_DATE_TIME` format. (#762)
[here](https://exonum.com/doc/version/0.10/get-started/java-binding/#built-in-services). (#667)
- [`JsonSerializer`][json-serializer-0.5.0] provides support for `ZonedDateTime`
JSON serialization in [`ISO_ZONED_DATE_TIME`][iso-zdt-format] format. (#762)

[json-serializer-0.5.0]: https://exonum.com/doc/api/java-binding-common/0.5.0/com/exonum/binding/common/serialization/json/JsonSerializer.html
[iso-zdt-format]: https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/time/format/DateTimeFormatter.html#ISO_ZONED_DATE_TIME

### Changed
- `TransactionResult` and `TransactionLocation` classes moved to the common module. (#725)
Expand Down Expand Up @@ -168,7 +177,8 @@ Parent module and BOM module were released as they are required dependencies to

The first release of Exonum Java Binding.

[Unreleased]: https://github.com/exonum/exonum-java-binding/compare/v0.4...HEAD
[Unreleased]: https://github.com/exonum/exonum-java-binding/compare/ejb/v0.5.0...HEAD
[0.5.0]: https://github.com/exonum/exonum-java-binding/compare/v0.4...ejb/v0.5.0
[0.4]: https://github.com/exonum/exonum-java-binding/compare/v0.3...v0.4
[0.3]: https://github.com/exonum/exonum-java-binding/compare/v0.2...v0.3
[0.2]: https://github.com/exonum/exonum-java-binding/compare/v0.1.2...v0.2
Expand Down
4 changes: 2 additions & 2 deletions exonum-java-binding/bom/pom.xml
Expand Up @@ -5,11 +5,11 @@
<parent>
<groupId>com.exonum.binding</groupId>
<artifactId>exonum-java-binding-parent</artifactId>
<version>0.5-SNAPSHOT</version>
<version>0.6.0-SNAPSHOT</version>
</parent>

<artifactId>exonum-java-binding-bom</artifactId>
<version>0.5-SNAPSHOT</version>
<version>0.6.0-SNAPSHOT</version>
<packaging>pom</packaging>

<name>Exonum Java Binding: Bill of Materials</name>
Expand Down
4 changes: 2 additions & 2 deletions exonum-java-binding/common/pom.xml
Expand Up @@ -5,11 +5,11 @@
<parent>
<groupId>com.exonum.binding</groupId>
<artifactId>exonum-java-binding-parent</artifactId>
<version>0.5-SNAPSHOT</version>
<version>0.6.0-SNAPSHOT</version>
</parent>

<artifactId>exonum-java-binding-common</artifactId>
<version>0.5-SNAPSHOT</version>
<version>0.6.0-SNAPSHOT</version>
<packaging>jar</packaging>

<name>Exonum Java Binding: Common</name>
Expand Down
4 changes: 2 additions & 2 deletions exonum-java-binding/core/pom.xml
Expand Up @@ -5,11 +5,11 @@
<parent>
<groupId>com.exonum.binding</groupId>
<artifactId>exonum-java-binding-parent</artifactId>
<version>0.5-SNAPSHOT</version>
<version>0.6.0-SNAPSHOT</version>
</parent>

<artifactId>exonum-java-binding-core</artifactId>
<version>0.5-SNAPSHOT</version>
<version>0.6.0-SNAPSHOT</version>
<packaging>jar</packaging>

<name>Exonum Java Binding: Core</name>
Expand Down
10 changes: 5 additions & 5 deletions exonum-java-binding/core/rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion exonum-java-binding/core/rust/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "java_bindings"
version = "0.5.0-SNAPSHOT"
version = "0.6.0-SNAPSHOT"
authors = ["Exonum Team <exonum@bitfury.com>"]

[workspace]
Expand Down
2 changes: 1 addition & 1 deletion exonum-java-binding/core/rust/ejb-app/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "ejb-app"
version = "0.5.0-SNAPSHOT"
version = "0.6.0-SNAPSHOT"
authors = ["Exonum team <exonum@bitfury.com>"]

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion exonum-java-binding/core/rust/integration_tests/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "integration_tests"
version = "0.5.0-SNAPSHOT"
version = "0.6.0-SNAPSHOT"
authors = ["Exonum Team <exonum@bitfury.com>"]
publish = false
workspace = ".."
Expand Down
Expand Up @@ -62,8 +62,6 @@ lazy_static! {
}

#[test]
// TODO: reenable these tests after ECR-2789
#[cfg_attr(target_os = "linux", ignore)]
fn service_id() {
let service_id: u16 = 24;
let service = ServiceMockBuilder::new(EXECUTOR.clone())
Expand All @@ -73,7 +71,6 @@ fn service_id() {
}

#[test]
#[cfg_attr(target_os = "linux", ignore)]
fn service_id_negative() {
// Check that value is converted between rust `u16` and java `short` without loss.
let service_id: u16 = -24_i16 as u16; // 65512;
Expand All @@ -84,7 +81,6 @@ fn service_id_negative() {
}

#[test]
#[cfg_attr(target_os = "linux", ignore)]
fn service_name() {
let service_name: &str = "test_service";
let service = ServiceMockBuilder::new(EXECUTOR.clone())
Expand All @@ -94,7 +90,6 @@ fn service_name() {
}

#[test]
#[cfg_attr(target_os = "linux", ignore)]
fn state_hash() {
let db = MemoryDB::new();
let snapshot = db.snapshot();
Expand All @@ -106,7 +101,6 @@ fn state_hash() {
}

#[test]
#[cfg_attr(target_os = "linux", ignore)]
#[should_panic(expected = "Java exception: java.lang.OutOfMemoryError")]
fn tx_from_raw_should_panic_if_java_error_occurred() {
let raw = create_empty_raw_transaction();
Expand All @@ -117,7 +111,6 @@ fn tx_from_raw_should_panic_if_java_error_occurred() {
}

#[test]
#[cfg_attr(target_os = "linux", ignore)]
fn tx_from_raw_should_return_err_if_java_exception_occurred() {
let raw = create_empty_raw_transaction();
let service = ServiceMockBuilder::new(EXECUTOR.clone())
Expand All @@ -132,7 +125,6 @@ fn tx_from_raw_should_return_err_if_java_exception_occurred() {
}

#[test]
#[cfg_attr(target_os = "linux", ignore)]
fn initialize_config() {
let db = MemoryDB::new();
let mut fork = db.fork();
Expand All @@ -146,7 +138,6 @@ fn initialize_config() {
}

#[test]
#[cfg_attr(target_os = "linux", ignore)]
fn initialize_config_null() {
let db = MemoryDB::new();
let mut fork = db.fork();
Expand All @@ -160,7 +151,6 @@ fn initialize_config_null() {
}

#[test]
#[cfg_attr(target_os = "linux", ignore)]
fn initialize_config_parse_error() {
let db = MemoryDB::new();
let mut fork = db.fork();
Expand All @@ -180,7 +170,6 @@ fn initialize_config_parse_error() {
}

#[test]
#[cfg_attr(target_os = "linux", ignore)]
#[should_panic(expected = "Java exception: java.lang.RuntimeException")]
fn initialize_should_panic_if_java_exception_occurred() {
let db = MemoryDB::new();
Expand All @@ -194,7 +183,6 @@ fn initialize_should_panic_if_java_exception_occurred() {
}

#[test]
#[cfg_attr(target_os = "linux", ignore)]
fn service_can_modify_db_on_initialize() {
let db = MemoryDB::new();
let service = create_test_service(EXECUTOR.clone());
Expand All @@ -216,7 +204,6 @@ fn service_can_modify_db_on_initialize() {
}

#[test]
#[cfg_attr(target_os = "linux", ignore)]
#[should_panic(expected = "Java exception: com.exonum.binding.fakes.mocks.TestException")]
fn after_commit_throwing() {
let service = ServiceMockBuilder::new(EXECUTOR.clone())
Expand All @@ -233,7 +220,6 @@ fn after_commit_throwing() {
}

#[test]
#[cfg_attr(target_os = "linux", ignore)]
fn after_commit_validator() {
let (builder, interactor) =
ServiceMockBuilder::new(EXECUTOR.clone()).get_mock_interaction_after_commit();
Expand Down Expand Up @@ -263,7 +249,6 @@ fn after_commit_validator() {
}

#[test]
#[cfg_attr(target_os = "linux", ignore)]
fn after_commit_auditor() {
let (builder, interactor) =
ServiceMockBuilder::new(EXECUTOR.clone()).get_mock_interaction_after_commit();
Expand Down
Expand Up @@ -24,9 +24,7 @@ use java_bindings::{Config, JavaServiceRuntime, JvmConfig, RuntimeConfig, Servic

#[test]
#[ignore]
// Disabled till ECR-2999/ECR-3011
// TODO: reenable this test after ECR-2789
//#[cfg_attr(target_os = "linux", ignore)]
// TODO: Reenable after ECR-2999/ECR-3011
fn bootstrap() {
let artifact_uri = "".to_owned();
let system_class_path = get_fakes_classpath();
Expand Down
Expand Up @@ -50,8 +50,6 @@ lazy_static! {
}

#[test]
// TODO: reenable these tests after ECR-2789
#[cfg_attr(target_os = "linux", ignore)]
fn execute_valid_transaction() {
let db = MemoryDB::new();
let snapshot = db.snapshot();
Expand All @@ -75,7 +73,6 @@ fn execute_valid_transaction() {
}

#[test]
#[cfg_attr(target_os = "linux", ignore)]
#[should_panic(expected = "Java exception: java.lang.OutOfMemoryError")]
fn execute_should_panic_if_java_error_occurred() {
let (panic_tx, raw) = create_throwing_mock_transaction_proxy(EXECUTOR.clone(), OOM_ERROR_CLASS);
Expand All @@ -87,7 +84,6 @@ fn execute_should_panic_if_java_error_occurred() {
}

#[test]
#[cfg_attr(target_os = "linux", ignore)]
#[should_panic(expected = "Java exception: java.lang.ArithmeticException")]
fn execute_should_panic_if_java_exception_occurred() {
let (panic_tx, raw) =
Expand All @@ -100,7 +96,6 @@ fn execute_should_panic_if_java_exception_occurred() {
}

#[test]
#[cfg_attr(target_os = "linux", ignore)]
fn execute_should_return_err_if_tx_exec_exception_occurred() {
let err_code: i8 = 1;
let err_message = "Expected exception";
Expand All @@ -123,7 +118,6 @@ fn execute_should_return_err_if_tx_exec_exception_occurred() {
}

#[test]
#[cfg_attr(target_os = "linux", ignore)]
fn execute_should_return_err_if_tx_exec_exception_subclass_occurred() {
let err_code: i8 = 2;
let err_message = "Expected exception subclass";
Expand All @@ -146,7 +140,6 @@ fn execute_should_return_err_if_tx_exec_exception_subclass_occurred() {
}

#[test]
#[cfg_attr(target_os = "linux", ignore)]
fn execute_should_return_err_if_tx_exec_exception_occurred_no_message() {
let err_code: i8 = 3;
let (invalid_tx, raw) = create_throwing_exec_exception_mock_transaction_proxy(
Expand All @@ -168,7 +161,6 @@ fn execute_should_return_err_if_tx_exec_exception_occurred_no_message() {
}

#[test]
#[cfg_attr(target_os = "linux", ignore)]
fn execute_should_return_err_if_tx_exec_exception_subclass_occurred_no_message() {
let err_code: i8 = 4;
let (invalid_tx, raw) = create_throwing_exec_exception_mock_transaction_proxy(
Expand All @@ -189,22 +181,19 @@ fn execute_should_return_err_if_tx_exec_exception_subclass_occurred_no_message()
assert!(err.description().is_none());
}

#[cfg_attr(target_os = "linux", ignore)]
#[test]
fn json_serialize() {
let valid_tx = create_mock_transaction_proxy(EXECUTOR.clone());
assert_eq!(serde_json::to_value(&valid_tx.0).unwrap(), *INFO_VALUE);
}

#[cfg_attr(target_os = "linux", ignore)]
#[test]
#[should_panic(expected = "Java exception: java.lang.OutOfMemoryError")]
fn json_serialize_should_panic_if_java_error_occurred() {
let panic_tx = create_throwing_mock_transaction_proxy(EXECUTOR.clone(), OOM_ERROR_CLASS);
serde_json::to_string(&panic_tx.0).unwrap();
}

#[cfg_attr(target_os = "linux", ignore)]
#[test]
fn json_serialize_should_return_err_if_java_exception_occurred() {
let invalid_tx =
Expand All @@ -217,7 +206,6 @@ fn json_serialize_should_return_err_if_java_exception_occurred() {
}

#[test]
#[cfg_attr(target_os = "linux", ignore)]
fn passing_transaction_context() {
let db = MemoryDB::new();
let keypair = crypto::gen_keypair();
Expand Down
4 changes: 2 additions & 2 deletions exonum-java-binding/cryptocurrency-demo/pom.xml
Expand Up @@ -5,11 +5,11 @@
<parent>
<groupId>com.exonum.binding</groupId>
<artifactId>exonum-java-binding-parent</artifactId>
<version>0.5-SNAPSHOT</version>
<version>0.6.0-SNAPSHOT</version>
</parent>

<artifactId>exonum-java-binding-cryptocurrency-demo</artifactId>
<version>0.5-SNAPSHOT</version>
<version>0.6.0-SNAPSHOT</version>
<packaging>jar</packaging>

<name>Exonum Java Binding: Cryptocurrency Java service</name>
Expand Down

0 comments on commit a91ff0d

Please sign in to comment.