corda/node/build.gradle

329 lines
13 KiB
Groovy
Raw Normal View History

plugins {
id 'com.google.cloud.tools.jib' version '0.9.4'
}
apply plugin: 'kotlin'
Vault Query Service JPA implementation (#840) * Vault Query Service API implementation using JPA Hibernate Added queryBy(QueryCriteria) Vault API and Junit tests. Minor cosmetic API changes following rebase. Fixes following rebase from master Upgraded to requery 1.3.1 WIP - removed 'latestOnly' from LinearStateQueryCriteria WIP - CommercialSchemas V2, V3, V4 testing WIP - sort out generics handling. WIP - most general queries completed. WIP - join queries, contractStateType derivation WIP - refactoring Requery WIP - refactored VaultService to extract a VaultQueryService interface (and associated Requery implementation). WIP - HibernateVaultQuery implementation WIP - Re-structured all Schema definitions (requery/jpa) and make Hibernate Config reusable. WIP - Multi-version schema testing, hibernate query testing. WIP - Custom Criteria and Fungible Criteria impl & testing. WIP - Kotlin Comparable Generics error WIP - Party queries all working now WIP - All VaultQueryTests now working (refactored for AND / OR composition) WIP - added schema registration in CordaPluginRegistry to enable custom vault queries on arbitrary schemas. WIP - added new default Sort NULL order to be NONE + added lots more tests for Logical Operator testing. Mostly identity fixes following rebase from master. Exception handling and public API cleanup in prep for PR. Additional tests for Logical Operators; additional tests for NULLS sort ordering; additional logging; Additional parser to handle Nullable attribute values; added Unary and Collection logical expression handlers Lots of cleanup: participants; trackBy interfaces; additional fungible tests; parser cleanup and improved support for Java Removed all traces of Requery implementation. Further minor cleanup and Junit test fix. Final identity and schema related identity clean-up. Revert unrelated changes. PR review updates: blank lines, isRelevant. Fixed wiring of updatesPublisher for dynamic trackBy queries. PR review changes: multi-versioned schema samples and associated dummy contracts moved to test packages. Fixed problem with sorted queries (not specifying any filterable criteria). PR review: minor updates to address RP comments. Typesafe custom query criteria Cleanup: remove redundant tests. Further clean-up and make all Java test work successfully. Remove debugging print statements. Rebased from master - changes required due to DealState module change. fixed broken assertion caused by DealState ordering change (different package) Fixed transaction demarcation issue causing "java.lang.IllegalStateException: Was not expecting to find existing database transaction on current strand" trackBy() now filters on ContractType and StateStatus (CONSUMED, UNCONSUMED, ALL) Added tests to exercise RPCOps trackBy and queryBy (RPC smoke test and CordaRPCOps) Added additional @CordaSerializable annotations. Updated documentation and referenced sample code. Added deprecation annotations. Re-added missing deprecation annotation. Hibernate debug logging is now configurable and disabled by default. Introduced common Sort attributes based on the node schemas. Completely removed NULL_HANDLING sort parameter as this is not supported in JPA. Revisited and fixed usage of @CordaSerializable. * Minor fix following rebase from master. * Remove blank line as per RP PR feedback request. * Minor Java documentation and example clean-up. * Disable BFT Notary Service tests.
2017-06-22 09:35:49 +00:00
// Java Persistence API support: create no-arg constructor
// see: http://stackoverflow.com/questions/32038177/kotlin-with-jpa-default-constructor-hell
apply plugin: 'kotlin-jpa'
apply plugin: 'java'
apply plugin: 'net.corda.plugins.quasar-utils'
apply plugin: 'net.corda.plugins.publish-utils'
2017-06-26 17:07:56 +00:00
apply plugin: 'com.jfrog.artifactory'
description 'Corda node modules'
ext {
Properties constants = new Properties()
file("$rootDir/constants.properties").withInputStream { constants.load(it) }
jolokia_version = constants.getProperty('jolokiaAgentVersion')
}
evaluationDependsOn(':core-deterministic')
evaluationDependsOn(':serialization-deterministic')
evaluationDependsOn(':serialization-djvm:deserializers')
evaluationDependsOn(':node:djvm')
//noinspection GroovyAssignabilityCheck
configurations {
integrationTestCompile.extendsFrom testCompile
integrationTestRuntimeOnly.extendsFrom testRuntimeOnly
WIP Kubenetes parallel build (#5396) * Split integration tests * add simple example of printing all methods annotated with @Test * add docker plugin to root project remove docker plugin from child projects add Dockerfile for image to use when testing add task to build testing image to root project * add comment describing proposed testing workflow * simple attempt at running tests in docker container * add my first k8s interaction script * add fabric8 as dependnency to buildSrc * before adding classpath * collect reports from containers and run through testReports * re-enable kubes backed testing * for each project 1. add a list tests task 2. use this list tests task to modify the included tests 3. add a parallel version of the test task * tweak logic for downloading test report XML files * use output of parallel testing tasks in report tasks to determine build resultCode * prepare for jenkins test * prepare for jenkins test * make docker reg password system property * add logging to print out docker reg creds * enable docker build * fix gradle build file * gather xml files into root project * change log level for gradle modification * stop printing gradle docker push passwd * tidy up report generation * fix compilation errors * split signature constraints test into two * change Sig constraint tests type hierarchy * tidy up build.gradle * try method based test includes * add unit test for test listing * fix bug with test slicing * stop filtering ignored tests to make the numbers match existing runs * change log level to ensure print out * move all plugin logic to buildSrc files * tidy up test modification add comments to explain what DistributedTesting plugin does * move new plugins into properly named packages * tidy up runConfigs * fix compile errors due to merge with slow-integration-test work * add system parameter to enable / disable build modification * add -Dkubenetise to build command * address review comments * type safe declaration of parameters in KubesTest
2019-09-03 15:40:08 +00:00
slowIntegrationTestCompile.extendsFrom testCompile
slowIntegrationTestRuntimeOnly.extendsFrom testRuntimeOnly
CORDA-2876: Integrate the DJVM with the Corda Node. (#5633) * * CORDA-2876: Migrate DJVM serialization modules into Corda. * Pre-generate Corda classes for DJVM sandbox when node boots in production mode. * Ensure that all DJVM test contract CorDapps are signed. * Test examining attachments within DJVM sandbox. * Test Contract.verify() using cryptographic verify function. * Add test cases for more non-determinism in Contract.verify(). * Update node-driver to support testing nodes with DJVM support. * Modify Node to allow alternative DJVM configurations for testing. * Refactor DeterministicVerifierFactoryService for default use-case. * Small whitespace and code-style refactors. * Create and activate a DJVM execution profile for the Node. * Revert making Verifier implement AutoCloseable. * Allow the node to cache sandboxed Corda byte-code for reuse. * Use updated Quasar agent that knows not to touch DJVM classloaders. * Fix Quasar's package exclusions globs for DJVM. * Deserialise LedgerTransaction into the sandbox for Contract.verify(). * Add the DJVM's serialisation modules to the Corda node. * Update the node for the latest DJVM API, and preserve the ConstructorForDeserialization annotation on user contract classes. * Add corda-dev to repositories while DJVM is SNAPSHOT. * Migrate DJVM specialisation into AbstractNode's ServiceHubInternalImpl. * Exclude sandbox.** and shaded djvm.** classes from Quasar agent. * Add the corda-dev repository to :node for the deterministic runtime. * Turn Verifier into an abstract base class that is specialised by BasicVerifier and DeterministicVerifier. * Add the Corda deterministic libraries to the Node, and split the DJVM sandbox across two SandboxClassLoader instances. * Add DJVM to contract verification path inside Corda Node. * Minor lambda simplifications and removing unused import. * CORDA-2871: Remove @CordaSerializable from LedgerTransaction. * CORDA-2871: Add a callback to ServicesForResolution to allow the Node to modify a LedgerTransaction object. * CORDA-2871: Refactor the contract verification code into a separate class, and allow LedgerTransaction to choose different Verifier objects. * Update DJVM to use Corda 4.4-SNAPSHOT. (#95) * CORDA-3330: Allow DJVM to preload / pregenerate classes from selected jars. (#92) * Add support for SourceClassLoader.getResources() to DJVM. * Allow a SandboxConfiguration to preload sandbox byte-code for all classes inside jars containing META-INF/DJVM-preload. * CORDA-3309: Remove explicit try-catch in favour of UncaughtExceptionHandler. (#91) * CORDA-3309: Install UncaughtExceptionHandler for DJVM tasks. (#88) * Fix tests broken by Windows line endings. (#82) * CORDA-3292: Reimplement ExecutionProfile as a data class. (#80) * CORDA-2877: Refactor how we create child SandboxConfiguration objects. (#76) * CORDA-2877: Load bytecode from a persistent cache to prevent repeated rewriting. (#75) * Refactor byte-code cache to SandboxConfiguration instead of AnalysisConfiguration. We cannot "mix and match" byte-code generated by different sets of rules. * CORDA-3137: Enhance annotation handling so that we can allow some annotations to be mapped into the sandbox without also needing to be stitched. (#72) * CORDA-2871: Minor cosmetic fixes. (#69) * CORDA-3218: Align DJVM with internal Corda Serialisation API. (#68) * Ensure we get the latest SNAPSHOT of the serialisation code. * CORDA-2871: Refactor SourceClassLoader to define source classes. (#66) * Rewrite SourceClassLoader to support parent/child relationships. * Revert catching TypNotPresebtException - it was a symptom of a bigger problem. * Remove AutoCloseable from AnalysisConfiguration and SourceClassLoader. * SourceClassLoader.getResource() must delegate to its parent first. * CORDA-2871: Ensure ClassLoader.loadClass() throws ClassNotFoundException for all cases where the class cannot be found. (#64) * CORDA-2871: Modify sandbox tasks to implement both java.Function and sandbox.Function (#62) * Make TaskExecutors implement BiFunction to make them composable. * Create ImportTask to wrap a java.Function inside a sandbox.Function. * Add createExecutor() and createRawExecutor() APIs to SandboxClassLoader. * Update serialization to use SandboxClassLoader.toSandboxClass(). * Remove a layer of lambdas from the serialisation code. * Update SandboxExecutor and SandboxRawExecutor. * Rename Executor to TaskFactory. * Rename dangling executor -> taskFactory. * CORDA-2871: Sanity fixes! (#63) * Improve message for SandboxClassLoadingException. * Fix serialisation API for using sandboxed environment. * CORDA-3174: Extend serialisation to include InputStream and OpaqueBytesSubSequence. (#60) * Update DJVM Example project for serialisation. * Add serializers for InputStream and OpaqueBytesSubSequence. * Support ZIP Inflater and CRC32 inside the sandbox. * Allow the DJVM to wrap java.io.InputStream as sandbox.java.io.InputStream. * Configure tests also to preserve @DeprecatedConstructorForDeserialization. * CORDA-3174: Implement Corda serialization modules. (#59) * Create DJVM serialization modules. * Create test cases for Array<T>, List<T> and List<Array<T>>. * Refactor SandboxPrimiveSerializer for all primitive types. * Implement SandboxCollectionSerializer to support Collection types. * Implement SandboxMapSerializer to support Map types. * Attempt to fix infinite loop when computing Collection and Map fingerprints. * Apply special handling when deserialising sandbox.java.lang.Character. * Remap Java primitive types to sandbox Java object types to deter evolution. * Use Class.getPackage().getName() to determine sandbox package name. * Implement SandboxEnumSerializer to support Enum types. * Implement SandboxPublicKeySerializer to support Java security keys. * Add serialization projects to the composite example project. * Implement serializers for BigInteger, BigDecimal, Currency and StringBuffer. * Test that deserialising does not instantiate the untrusted user classes. * Implement serializers for java.time.* types. * Add serialiser for BitSet - currently disabled until BitSet itself is supported. * Add serialisers for EnumSet and Class. * Include support for EnumMap in the SandboxMapSerializer. * Ensure the DJVM Example project's tests preserve @CordaSerializable. * Add support for UUID as a primitive type. * Use common abortReadOnly() method for declaring serialization as unsupported. * Streamline the API for deserialising into the sandbox. * Add preliminary support for deserialising X.509 certificates. * Implement serializer for java.util.Optional. * Refactor configuration of the sandbox serialization scheme. * Add tests for deserialising arrays of basic types. * Include method annotations in annotation stitching. This ensures that `@ConstructorForDeserialization` is not dropped. * Enable test for SandboxBitSetSerializer. * Enable tests for X.509 serializers. * Implement serializers for ProtonJ primitive types. * Serialize java.util.Date as a primitive type. * Add the bintray Gradle plugin to the serialisation modules. * Do not publish serialisation modules - they will become part of Corda itself. * CORDA-2876: Only apply DJVM sources to Node Driver when devMode=true. * Resolve DeteKT warnings. * Require Node's JVM to set -Dnet.corda.djvm=true in order to enable DJVM. * Enable DJVM for DemoBench nodes. * Disable Quasar instrumentation verification for DemoBench nodes. * Upgrade to DJVM 1.0-RC01. * Try to modify DriverParameters in a more "ABI friendly" way. * Refactor and simplify sandbox deserialisation of primitive objects. * Review fixes. * Update EvolutionSerializerFactory to handle sandboxed primitive boxed types.
2019-11-05 13:44:18 +00:00
jdkRt
CORDA-2876: Integrate the DJVM with the Corda Node. (#5633) * * CORDA-2876: Migrate DJVM serialization modules into Corda. * Pre-generate Corda classes for DJVM sandbox when node boots in production mode. * Ensure that all DJVM test contract CorDapps are signed. * Test examining attachments within DJVM sandbox. * Test Contract.verify() using cryptographic verify function. * Add test cases for more non-determinism in Contract.verify(). * Update node-driver to support testing nodes with DJVM support. * Modify Node to allow alternative DJVM configurations for testing. * Refactor DeterministicVerifierFactoryService for default use-case. * Small whitespace and code-style refactors. * Create and activate a DJVM execution profile for the Node. * Revert making Verifier implement AutoCloseable. * Allow the node to cache sandboxed Corda byte-code for reuse. * Use updated Quasar agent that knows not to touch DJVM classloaders. * Fix Quasar's package exclusions globs for DJVM. * Deserialise LedgerTransaction into the sandbox for Contract.verify(). * Add the DJVM's serialisation modules to the Corda node. * Update the node for the latest DJVM API, and preserve the ConstructorForDeserialization annotation on user contract classes. * Add corda-dev to repositories while DJVM is SNAPSHOT. * Migrate DJVM specialisation into AbstractNode's ServiceHubInternalImpl. * Exclude sandbox.** and shaded djvm.** classes from Quasar agent. * Add the corda-dev repository to :node for the deterministic runtime. * Turn Verifier into an abstract base class that is specialised by BasicVerifier and DeterministicVerifier. * Add the Corda deterministic libraries to the Node, and split the DJVM sandbox across two SandboxClassLoader instances. * Add DJVM to contract verification path inside Corda Node. * Minor lambda simplifications and removing unused import. * CORDA-2871: Remove @CordaSerializable from LedgerTransaction. * CORDA-2871: Add a callback to ServicesForResolution to allow the Node to modify a LedgerTransaction object. * CORDA-2871: Refactor the contract verification code into a separate class, and allow LedgerTransaction to choose different Verifier objects. * Update DJVM to use Corda 4.4-SNAPSHOT. (#95) * CORDA-3330: Allow DJVM to preload / pregenerate classes from selected jars. (#92) * Add support for SourceClassLoader.getResources() to DJVM. * Allow a SandboxConfiguration to preload sandbox byte-code for all classes inside jars containing META-INF/DJVM-preload. * CORDA-3309: Remove explicit try-catch in favour of UncaughtExceptionHandler. (#91) * CORDA-3309: Install UncaughtExceptionHandler for DJVM tasks. (#88) * Fix tests broken by Windows line endings. (#82) * CORDA-3292: Reimplement ExecutionProfile as a data class. (#80) * CORDA-2877: Refactor how we create child SandboxConfiguration objects. (#76) * CORDA-2877: Load bytecode from a persistent cache to prevent repeated rewriting. (#75) * Refactor byte-code cache to SandboxConfiguration instead of AnalysisConfiguration. We cannot "mix and match" byte-code generated by different sets of rules. * CORDA-3137: Enhance annotation handling so that we can allow some annotations to be mapped into the sandbox without also needing to be stitched. (#72) * CORDA-2871: Minor cosmetic fixes. (#69) * CORDA-3218: Align DJVM with internal Corda Serialisation API. (#68) * Ensure we get the latest SNAPSHOT of the serialisation code. * CORDA-2871: Refactor SourceClassLoader to define source classes. (#66) * Rewrite SourceClassLoader to support parent/child relationships. * Revert catching TypNotPresebtException - it was a symptom of a bigger problem. * Remove AutoCloseable from AnalysisConfiguration and SourceClassLoader. * SourceClassLoader.getResource() must delegate to its parent first. * CORDA-2871: Ensure ClassLoader.loadClass() throws ClassNotFoundException for all cases where the class cannot be found. (#64) * CORDA-2871: Modify sandbox tasks to implement both java.Function and sandbox.Function (#62) * Make TaskExecutors implement BiFunction to make them composable. * Create ImportTask to wrap a java.Function inside a sandbox.Function. * Add createExecutor() and createRawExecutor() APIs to SandboxClassLoader. * Update serialization to use SandboxClassLoader.toSandboxClass(). * Remove a layer of lambdas from the serialisation code. * Update SandboxExecutor and SandboxRawExecutor. * Rename Executor to TaskFactory. * Rename dangling executor -> taskFactory. * CORDA-2871: Sanity fixes! (#63) * Improve message for SandboxClassLoadingException. * Fix serialisation API for using sandboxed environment. * CORDA-3174: Extend serialisation to include InputStream and OpaqueBytesSubSequence. (#60) * Update DJVM Example project for serialisation. * Add serializers for InputStream and OpaqueBytesSubSequence. * Support ZIP Inflater and CRC32 inside the sandbox. * Allow the DJVM to wrap java.io.InputStream as sandbox.java.io.InputStream. * Configure tests also to preserve @DeprecatedConstructorForDeserialization. * CORDA-3174: Implement Corda serialization modules. (#59) * Create DJVM serialization modules. * Create test cases for Array<T>, List<T> and List<Array<T>>. * Refactor SandboxPrimiveSerializer for all primitive types. * Implement SandboxCollectionSerializer to support Collection types. * Implement SandboxMapSerializer to support Map types. * Attempt to fix infinite loop when computing Collection and Map fingerprints. * Apply special handling when deserialising sandbox.java.lang.Character. * Remap Java primitive types to sandbox Java object types to deter evolution. * Use Class.getPackage().getName() to determine sandbox package name. * Implement SandboxEnumSerializer to support Enum types. * Implement SandboxPublicKeySerializer to support Java security keys. * Add serialization projects to the composite example project. * Implement serializers for BigInteger, BigDecimal, Currency and StringBuffer. * Test that deserialising does not instantiate the untrusted user classes. * Implement serializers for java.time.* types. * Add serialiser for BitSet - currently disabled until BitSet itself is supported. * Add serialisers for EnumSet and Class. * Include support for EnumMap in the SandboxMapSerializer. * Ensure the DJVM Example project's tests preserve @CordaSerializable. * Add support for UUID as a primitive type. * Use common abortReadOnly() method for declaring serialization as unsupported. * Streamline the API for deserialising into the sandbox. * Add preliminary support for deserialising X.509 certificates. * Implement serializer for java.util.Optional. * Refactor configuration of the sandbox serialization scheme. * Add tests for deserialising arrays of basic types. * Include method annotations in annotation stitching. This ensures that `@ConstructorForDeserialization` is not dropped. * Enable test for SandboxBitSetSerializer. * Enable tests for X.509 serializers. * Implement serializers for ProtonJ primitive types. * Serialize java.util.Date as a primitive type. * Add the bintray Gradle plugin to the serialisation modules. * Do not publish serialisation modules - they will become part of Corda itself. * CORDA-2876: Only apply DJVM sources to Node Driver when devMode=true. * Resolve DeteKT warnings. * Require Node's JVM to set -Dnet.corda.djvm=true in order to enable DJVM. * Enable DJVM for DemoBench nodes. * Disable Quasar instrumentation verification for DemoBench nodes. * Upgrade to DJVM 1.0-RC01. * Try to modify DriverParameters in a more "ABI friendly" way. * Refactor and simplify sandbox deserialisation of primitive objects. * Review fixes. * Update EvolutionSerializerFactory to handle sandboxed primitive boxed types.
2019-11-05 13:44:18 +00:00
deterministic
}
sourceSets {
integrationTest {
kotlin {
compileClasspath += main.output + test.output
runtimeClasspath += main.output + test.output
srcDir file('src/integration-test/kotlin')
}
java {
compileClasspath += main.output + test.output
runtimeClasspath += main.output + test.output
srcDir file('src/integration-test/java')
}
resources {
srcDir file('src/integration-test/resources')
}
}
WIP Kubenetes parallel build (#5396) * Split integration tests * add simple example of printing all methods annotated with @Test * add docker plugin to root project remove docker plugin from child projects add Dockerfile for image to use when testing add task to build testing image to root project * add comment describing proposed testing workflow * simple attempt at running tests in docker container * add my first k8s interaction script * add fabric8 as dependnency to buildSrc * before adding classpath * collect reports from containers and run through testReports * re-enable kubes backed testing * for each project 1. add a list tests task 2. use this list tests task to modify the included tests 3. add a parallel version of the test task * tweak logic for downloading test report XML files * use output of parallel testing tasks in report tasks to determine build resultCode * prepare for jenkins test * prepare for jenkins test * make docker reg password system property * add logging to print out docker reg creds * enable docker build * fix gradle build file * gather xml files into root project * change log level for gradle modification * stop printing gradle docker push passwd * tidy up report generation * fix compilation errors * split signature constraints test into two * change Sig constraint tests type hierarchy * tidy up build.gradle * try method based test includes * add unit test for test listing * fix bug with test slicing * stop filtering ignored tests to make the numbers match existing runs * change log level to ensure print out * move all plugin logic to buildSrc files * tidy up test modification add comments to explain what DistributedTesting plugin does * move new plugins into properly named packages * tidy up runConfigs * fix compile errors due to merge with slow-integration-test work * add system parameter to enable / disable build modification * add -Dkubenetise to build command * address review comments * type safe declaration of parameters in KubesTest
2019-09-03 15:40:08 +00:00
slowIntegrationTest {
kotlin {
compileClasspath += main.output + test.output
runtimeClasspath += main.output + test.output
srcDir file('src/integration-test-slow/kotlin')
}
java {
compileClasspath += main.output + test.output
runtimeClasspath += main.output + test.output
srcDir file('src/integration-test-slow/java')
}
resources {
srcDir file('src/integration-test-slow/resources')
}
}
}
jib.container {
mainClass = "net.corda.node.Corda"
args = ['--log-to-console', '--no-local-shell', '--config-file=/config/node.conf']
// The Groovy string needs to be converted to a `java.lang.String` below.
jvmFlags = ['-Xmx1g', "-javaagent:/app/libs/quasar-core-${quasar_version}.jar".toString()]
}
// Use manual resource copying of log4j2.xml rather than source sets.
// This prevents problems in IntelliJ with regard to duplicate source roots.
processResources {
from file("$rootDir/config/dev/log4j2.xml")
from file("$rootDir/config/dev/jolokia-access.xml")
}
processTestResources {
from file("$rootDir/config/test/jolokia-access.xml")
}
// To find potential version conflicts, run "gradle htmlDependencyReport" and then look in
// build/reports/project/dependencies/index.html for green highlighted parts of the tree.
dependencies {
compile project(':node-api')
compile project(':client:rpc')
compile project(':tools:shell')
compile project(':tools:cliutils')
compile project(':common-validation')
compile project(':common-configuration-parsing')
compile project(':common-logging')
WIP Kubenetes parallel build (#5396) * Split integration tests * add simple example of printing all methods annotated with @Test * add docker plugin to root project remove docker plugin from child projects add Dockerfile for image to use when testing add task to build testing image to root project * add comment describing proposed testing workflow * simple attempt at running tests in docker container * add my first k8s interaction script * add fabric8 as dependnency to buildSrc * before adding classpath * collect reports from containers and run through testReports * re-enable kubes backed testing * for each project 1. add a list tests task 2. use this list tests task to modify the included tests 3. add a parallel version of the test task * tweak logic for downloading test report XML files * use output of parallel testing tasks in report tasks to determine build resultCode * prepare for jenkins test * prepare for jenkins test * make docker reg password system property * add logging to print out docker reg creds * enable docker build * fix gradle build file * gather xml files into root project * change log level for gradle modification * stop printing gradle docker push passwd * tidy up report generation * fix compilation errors * split signature constraints test into two * change Sig constraint tests type hierarchy * tidy up build.gradle * try method based test includes * add unit test for test listing * fix bug with test slicing * stop filtering ignored tests to make the numbers match existing runs * change log level to ensure print out * move all plugin logic to buildSrc files * tidy up test modification add comments to explain what DistributedTesting plugin does * move new plugins into properly named packages * tidy up runConfigs * fix compile errors due to merge with slow-integration-test work * add system parameter to enable / disable build modification * add -Dkubenetise to build command * address review comments * type safe declaration of parameters in KubesTest
2019-09-03 15:40:08 +00:00
// Backwards compatibility goo: Apps expect confidential-identities to be loaded by default.
// We could eventually gate this on a target-version check.
compile project(':confidential-identities')
2016-07-22 16:31:03 +00:00
// Log4J: logging framework (with SLF4J bindings)
compile "org.apache.logging.log4j:log4j-slf4j-impl:${log4j_version}"
compile "org.apache.logging.log4j:log4j-web:${log4j_version}"
compile "org.slf4j:jul-to-slf4j:$slf4j_version"
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
runtimeOnly "org.jetbrains.kotlin:kotlin-stdlib-jre8:$kotlin_version"
compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
testCompile "org.jetbrains.kotlin:kotlin-test:$kotlin_version"
compile "org.fusesource.jansi:jansi:$jansi_version"
compile "com.google.guava:guava:$guava_version"
// For caches rather than guava
compile "com.github.ben-manes.caffeine:caffeine:$caffeine_version"
// For async logging
compile "com.lmax:disruptor:$disruptor_version"
// Artemis: for reliable p2p message queues.
// TODO: remove the forced update of commons-collections and beanutils when artemis updates them
compile "org.apache.commons:commons-collections4:${commons_collections_version}"
compile "commons-beanutils:commons-beanutils:${beanutils_version}"
compile "org.apache.activemq:artemis-server:${artemis_version}"
compile "org.apache.activemq:artemis-core-client:${artemis_version}"
WIP Kubenetes parallel build (#5396) * Split integration tests * add simple example of printing all methods annotated with @Test * add docker plugin to root project remove docker plugin from child projects add Dockerfile for image to use when testing add task to build testing image to root project * add comment describing proposed testing workflow * simple attempt at running tests in docker container * add my first k8s interaction script * add fabric8 as dependnency to buildSrc * before adding classpath * collect reports from containers and run through testReports * re-enable kubes backed testing * for each project 1. add a list tests task 2. use this list tests task to modify the included tests 3. add a parallel version of the test task * tweak logic for downloading test report XML files * use output of parallel testing tasks in report tasks to determine build resultCode * prepare for jenkins test * prepare for jenkins test * make docker reg password system property * add logging to print out docker reg creds * enable docker build * fix gradle build file * gather xml files into root project * change log level for gradle modification * stop printing gradle docker push passwd * tidy up report generation * fix compilation errors * split signature constraints test into two * change Sig constraint tests type hierarchy * tidy up build.gradle * try method based test includes * add unit test for test listing * fix bug with test slicing * stop filtering ignored tests to make the numbers match existing runs * change log level to ensure print out * move all plugin logic to buildSrc files * tidy up test modification add comments to explain what DistributedTesting plugin does * move new plugins into properly named packages * tidy up runConfigs * fix compile errors due to merge with slow-integration-test work * add system parameter to enable / disable build modification * add -Dkubenetise to build command * address review comments * type safe declaration of parameters in KubesTest
2019-09-03 15:40:08 +00:00
runtime("org.apache.activemq:artemis-amqp-protocol:${artemis_version}") {
// Gains our proton-j version from core module.
exclude group: 'org.apache.qpid', module: 'proton-j'
}
// Manifests: for reading stuff from the manifest file
compile "com.jcabi:jcabi-manifests:$jcabi_manifests_version"
// Coda Hale's Metrics: for monitoring of key statistics
compile "io.dropwizard.metrics:metrics-jmx:$metrics_version"
// TypeSafe Config: for simple and human friendly config files.
compile "com.typesafe:config:$typesafe_config_version"
CORDA-2876: Integrate the DJVM with the Corda Node. (#5633) * * CORDA-2876: Migrate DJVM serialization modules into Corda. * Pre-generate Corda classes for DJVM sandbox when node boots in production mode. * Ensure that all DJVM test contract CorDapps are signed. * Test examining attachments within DJVM sandbox. * Test Contract.verify() using cryptographic verify function. * Add test cases for more non-determinism in Contract.verify(). * Update node-driver to support testing nodes with DJVM support. * Modify Node to allow alternative DJVM configurations for testing. * Refactor DeterministicVerifierFactoryService for default use-case. * Small whitespace and code-style refactors. * Create and activate a DJVM execution profile for the Node. * Revert making Verifier implement AutoCloseable. * Allow the node to cache sandboxed Corda byte-code for reuse. * Use updated Quasar agent that knows not to touch DJVM classloaders. * Fix Quasar's package exclusions globs for DJVM. * Deserialise LedgerTransaction into the sandbox for Contract.verify(). * Add the DJVM's serialisation modules to the Corda node. * Update the node for the latest DJVM API, and preserve the ConstructorForDeserialization annotation on user contract classes. * Add corda-dev to repositories while DJVM is SNAPSHOT. * Migrate DJVM specialisation into AbstractNode's ServiceHubInternalImpl. * Exclude sandbox.** and shaded djvm.** classes from Quasar agent. * Add the corda-dev repository to :node for the deterministic runtime. * Turn Verifier into an abstract base class that is specialised by BasicVerifier and DeterministicVerifier. * Add the Corda deterministic libraries to the Node, and split the DJVM sandbox across two SandboxClassLoader instances. * Add DJVM to contract verification path inside Corda Node. * Minor lambda simplifications and removing unused import. * CORDA-2871: Remove @CordaSerializable from LedgerTransaction. * CORDA-2871: Add a callback to ServicesForResolution to allow the Node to modify a LedgerTransaction object. * CORDA-2871: Refactor the contract verification code into a separate class, and allow LedgerTransaction to choose different Verifier objects. * Update DJVM to use Corda 4.4-SNAPSHOT. (#95) * CORDA-3330: Allow DJVM to preload / pregenerate classes from selected jars. (#92) * Add support for SourceClassLoader.getResources() to DJVM. * Allow a SandboxConfiguration to preload sandbox byte-code for all classes inside jars containing META-INF/DJVM-preload. * CORDA-3309: Remove explicit try-catch in favour of UncaughtExceptionHandler. (#91) * CORDA-3309: Install UncaughtExceptionHandler for DJVM tasks. (#88) * Fix tests broken by Windows line endings. (#82) * CORDA-3292: Reimplement ExecutionProfile as a data class. (#80) * CORDA-2877: Refactor how we create child SandboxConfiguration objects. (#76) * CORDA-2877: Load bytecode from a persistent cache to prevent repeated rewriting. (#75) * Refactor byte-code cache to SandboxConfiguration instead of AnalysisConfiguration. We cannot "mix and match" byte-code generated by different sets of rules. * CORDA-3137: Enhance annotation handling so that we can allow some annotations to be mapped into the sandbox without also needing to be stitched. (#72) * CORDA-2871: Minor cosmetic fixes. (#69) * CORDA-3218: Align DJVM with internal Corda Serialisation API. (#68) * Ensure we get the latest SNAPSHOT of the serialisation code. * CORDA-2871: Refactor SourceClassLoader to define source classes. (#66) * Rewrite SourceClassLoader to support parent/child relationships. * Revert catching TypNotPresebtException - it was a symptom of a bigger problem. * Remove AutoCloseable from AnalysisConfiguration and SourceClassLoader. * SourceClassLoader.getResource() must delegate to its parent first. * CORDA-2871: Ensure ClassLoader.loadClass() throws ClassNotFoundException for all cases where the class cannot be found. (#64) * CORDA-2871: Modify sandbox tasks to implement both java.Function and sandbox.Function (#62) * Make TaskExecutors implement BiFunction to make them composable. * Create ImportTask to wrap a java.Function inside a sandbox.Function. * Add createExecutor() and createRawExecutor() APIs to SandboxClassLoader. * Update serialization to use SandboxClassLoader.toSandboxClass(). * Remove a layer of lambdas from the serialisation code. * Update SandboxExecutor and SandboxRawExecutor. * Rename Executor to TaskFactory. * Rename dangling executor -> taskFactory. * CORDA-2871: Sanity fixes! (#63) * Improve message for SandboxClassLoadingException. * Fix serialisation API for using sandboxed environment. * CORDA-3174: Extend serialisation to include InputStream and OpaqueBytesSubSequence. (#60) * Update DJVM Example project for serialisation. * Add serializers for InputStream and OpaqueBytesSubSequence. * Support ZIP Inflater and CRC32 inside the sandbox. * Allow the DJVM to wrap java.io.InputStream as sandbox.java.io.InputStream. * Configure tests also to preserve @DeprecatedConstructorForDeserialization. * CORDA-3174: Implement Corda serialization modules. (#59) * Create DJVM serialization modules. * Create test cases for Array<T>, List<T> and List<Array<T>>. * Refactor SandboxPrimiveSerializer for all primitive types. * Implement SandboxCollectionSerializer to support Collection types. * Implement SandboxMapSerializer to support Map types. * Attempt to fix infinite loop when computing Collection and Map fingerprints. * Apply special handling when deserialising sandbox.java.lang.Character. * Remap Java primitive types to sandbox Java object types to deter evolution. * Use Class.getPackage().getName() to determine sandbox package name. * Implement SandboxEnumSerializer to support Enum types. * Implement SandboxPublicKeySerializer to support Java security keys. * Add serialization projects to the composite example project. * Implement serializers for BigInteger, BigDecimal, Currency and StringBuffer. * Test that deserialising does not instantiate the untrusted user classes. * Implement serializers for java.time.* types. * Add serialiser for BitSet - currently disabled until BitSet itself is supported. * Add serialisers for EnumSet and Class. * Include support for EnumMap in the SandboxMapSerializer. * Ensure the DJVM Example project's tests preserve @CordaSerializable. * Add support for UUID as a primitive type. * Use common abortReadOnly() method for declaring serialization as unsupported. * Streamline the API for deserialising into the sandbox. * Add preliminary support for deserialising X.509 certificates. * Implement serializer for java.util.Optional. * Refactor configuration of the sandbox serialization scheme. * Add tests for deserialising arrays of basic types. * Include method annotations in annotation stitching. This ensures that `@ConstructorForDeserialization` is not dropped. * Enable test for SandboxBitSetSerializer. * Enable tests for X.509 serializers. * Implement serializers for ProtonJ primitive types. * Serialize java.util.Date as a primitive type. * Add the bintray Gradle plugin to the serialisation modules. * Do not publish serialisation modules - they will become part of Corda itself. * CORDA-2876: Only apply DJVM sources to Node Driver when devMode=true. * Resolve DeteKT warnings. * Require Node's JVM to set -Dnet.corda.djvm=true in order to enable DJVM. * Enable DJVM for DemoBench nodes. * Disable Quasar instrumentation verification for DemoBench nodes. * Upgrade to DJVM 1.0-RC01. * Try to modify DriverParameters in a more "ABI friendly" way. * Refactor and simplify sandbox deserialisation of primitive objects. * Review fixes. * Update EvolutionSerializerFactory to handle sandboxed primitive boxed types.
2019-11-05 13:44:18 +00:00
// Sandbox for deterministic contract verification
compile "net.corda.djvm:corda-djvm:$djvm_version"
compile project(':serialization-djvm')
compile(project(':node:djvm')) {
transitive = false
}
jdkRt "net.corda:deterministic-rt:$deterministic_rt_version"
CORDA-2876: Integrate the DJVM with the Corda Node. (#5633) * * CORDA-2876: Migrate DJVM serialization modules into Corda. * Pre-generate Corda classes for DJVM sandbox when node boots in production mode. * Ensure that all DJVM test contract CorDapps are signed. * Test examining attachments within DJVM sandbox. * Test Contract.verify() using cryptographic verify function. * Add test cases for more non-determinism in Contract.verify(). * Update node-driver to support testing nodes with DJVM support. * Modify Node to allow alternative DJVM configurations for testing. * Refactor DeterministicVerifierFactoryService for default use-case. * Small whitespace and code-style refactors. * Create and activate a DJVM execution profile for the Node. * Revert making Verifier implement AutoCloseable. * Allow the node to cache sandboxed Corda byte-code for reuse. * Use updated Quasar agent that knows not to touch DJVM classloaders. * Fix Quasar's package exclusions globs for DJVM. * Deserialise LedgerTransaction into the sandbox for Contract.verify(). * Add the DJVM's serialisation modules to the Corda node. * Update the node for the latest DJVM API, and preserve the ConstructorForDeserialization annotation on user contract classes. * Add corda-dev to repositories while DJVM is SNAPSHOT. * Migrate DJVM specialisation into AbstractNode's ServiceHubInternalImpl. * Exclude sandbox.** and shaded djvm.** classes from Quasar agent. * Add the corda-dev repository to :node for the deterministic runtime. * Turn Verifier into an abstract base class that is specialised by BasicVerifier and DeterministicVerifier. * Add the Corda deterministic libraries to the Node, and split the DJVM sandbox across two SandboxClassLoader instances. * Add DJVM to contract verification path inside Corda Node. * Minor lambda simplifications and removing unused import. * CORDA-2871: Remove @CordaSerializable from LedgerTransaction. * CORDA-2871: Add a callback to ServicesForResolution to allow the Node to modify a LedgerTransaction object. * CORDA-2871: Refactor the contract verification code into a separate class, and allow LedgerTransaction to choose different Verifier objects. * Update DJVM to use Corda 4.4-SNAPSHOT. (#95) * CORDA-3330: Allow DJVM to preload / pregenerate classes from selected jars. (#92) * Add support for SourceClassLoader.getResources() to DJVM. * Allow a SandboxConfiguration to preload sandbox byte-code for all classes inside jars containing META-INF/DJVM-preload. * CORDA-3309: Remove explicit try-catch in favour of UncaughtExceptionHandler. (#91) * CORDA-3309: Install UncaughtExceptionHandler for DJVM tasks. (#88) * Fix tests broken by Windows line endings. (#82) * CORDA-3292: Reimplement ExecutionProfile as a data class. (#80) * CORDA-2877: Refactor how we create child SandboxConfiguration objects. (#76) * CORDA-2877: Load bytecode from a persistent cache to prevent repeated rewriting. (#75) * Refactor byte-code cache to SandboxConfiguration instead of AnalysisConfiguration. We cannot "mix and match" byte-code generated by different sets of rules. * CORDA-3137: Enhance annotation handling so that we can allow some annotations to be mapped into the sandbox without also needing to be stitched. (#72) * CORDA-2871: Minor cosmetic fixes. (#69) * CORDA-3218: Align DJVM with internal Corda Serialisation API. (#68) * Ensure we get the latest SNAPSHOT of the serialisation code. * CORDA-2871: Refactor SourceClassLoader to define source classes. (#66) * Rewrite SourceClassLoader to support parent/child relationships. * Revert catching TypNotPresebtException - it was a symptom of a bigger problem. * Remove AutoCloseable from AnalysisConfiguration and SourceClassLoader. * SourceClassLoader.getResource() must delegate to its parent first. * CORDA-2871: Ensure ClassLoader.loadClass() throws ClassNotFoundException for all cases where the class cannot be found. (#64) * CORDA-2871: Modify sandbox tasks to implement both java.Function and sandbox.Function (#62) * Make TaskExecutors implement BiFunction to make them composable. * Create ImportTask to wrap a java.Function inside a sandbox.Function. * Add createExecutor() and createRawExecutor() APIs to SandboxClassLoader. * Update serialization to use SandboxClassLoader.toSandboxClass(). * Remove a layer of lambdas from the serialisation code. * Update SandboxExecutor and SandboxRawExecutor. * Rename Executor to TaskFactory. * Rename dangling executor -> taskFactory. * CORDA-2871: Sanity fixes! (#63) * Improve message for SandboxClassLoadingException. * Fix serialisation API for using sandboxed environment. * CORDA-3174: Extend serialisation to include InputStream and OpaqueBytesSubSequence. (#60) * Update DJVM Example project for serialisation. * Add serializers for InputStream and OpaqueBytesSubSequence. * Support ZIP Inflater and CRC32 inside the sandbox. * Allow the DJVM to wrap java.io.InputStream as sandbox.java.io.InputStream. * Configure tests also to preserve @DeprecatedConstructorForDeserialization. * CORDA-3174: Implement Corda serialization modules. (#59) * Create DJVM serialization modules. * Create test cases for Array<T>, List<T> and List<Array<T>>. * Refactor SandboxPrimiveSerializer for all primitive types. * Implement SandboxCollectionSerializer to support Collection types. * Implement SandboxMapSerializer to support Map types. * Attempt to fix infinite loop when computing Collection and Map fingerprints. * Apply special handling when deserialising sandbox.java.lang.Character. * Remap Java primitive types to sandbox Java object types to deter evolution. * Use Class.getPackage().getName() to determine sandbox package name. * Implement SandboxEnumSerializer to support Enum types. * Implement SandboxPublicKeySerializer to support Java security keys. * Add serialization projects to the composite example project. * Implement serializers for BigInteger, BigDecimal, Currency and StringBuffer. * Test that deserialising does not instantiate the untrusted user classes. * Implement serializers for java.time.* types. * Add serialiser for BitSet - currently disabled until BitSet itself is supported. * Add serialisers for EnumSet and Class. * Include support for EnumMap in the SandboxMapSerializer. * Ensure the DJVM Example project's tests preserve @CordaSerializable. * Add support for UUID as a primitive type. * Use common abortReadOnly() method for declaring serialization as unsupported. * Streamline the API for deserialising into the sandbox. * Add preliminary support for deserialising X.509 certificates. * Implement serializer for java.util.Optional. * Refactor configuration of the sandbox serialization scheme. * Add tests for deserialising arrays of basic types. * Include method annotations in annotation stitching. This ensures that `@ConstructorForDeserialization` is not dropped. * Enable test for SandboxBitSetSerializer. * Enable tests for X.509 serializers. * Implement serializers for ProtonJ primitive types. * Serialize java.util.Date as a primitive type. * Add the bintray Gradle plugin to the serialisation modules. * Do not publish serialisation modules - they will become part of Corda itself. * CORDA-2876: Only apply DJVM sources to Node Driver when devMode=true. * Resolve DeteKT warnings. * Require Node's JVM to set -Dnet.corda.djvm=true in order to enable DJVM. * Enable DJVM for DemoBench nodes. * Disable Quasar instrumentation verification for DemoBench nodes. * Upgrade to DJVM 1.0-RC01. * Try to modify DriverParameters in a more "ABI friendly" way. * Refactor and simplify sandbox deserialisation of primitive objects. * Review fixes. * Update EvolutionSerializerFactory to handle sandboxed primitive boxed types.
2019-11-05 13:44:18 +00:00
deterministic project(path: ':core-deterministic', configuration: 'deterministicArtifacts')
deterministic project(path: ':serialization-deterministic', configuration: 'deterministicArtifacts')
deterministic project(':serialization-djvm:deserializers')
deterministic project(':node:djvm')
deterministic "org.slf4j:slf4j-nop:$slf4j_version"
testImplementation "org.junit.jupiter:junit-jupiter-api:${junit_jupiter_version}"
testImplementation "junit:junit:$junit_version"
testRuntimeOnly "org.junit.vintage:junit-vintage-engine:${junit_vintage_version}"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${junit_jupiter_version}"
testRuntimeOnly "org.junit.platform:junit-platform-launcher:${junit_platform_version}"
// Unit testing helpers.
2016-07-04 14:34:45 +00:00
testCompile "org.assertj:assertj-core:${assertj_version}"
testCompile project(':node-driver')
testCompile project(':test-utils')
testCompile project(':client:jfx')
testCompile project(':finance:contracts')
testCompile project(':finance:workflows')
Vault Query Service JPA implementation (#840) * Vault Query Service API implementation using JPA Hibernate Added queryBy(QueryCriteria) Vault API and Junit tests. Minor cosmetic API changes following rebase. Fixes following rebase from master Upgraded to requery 1.3.1 WIP - removed 'latestOnly' from LinearStateQueryCriteria WIP - CommercialSchemas V2, V3, V4 testing WIP - sort out generics handling. WIP - most general queries completed. WIP - join queries, contractStateType derivation WIP - refactoring Requery WIP - refactored VaultService to extract a VaultQueryService interface (and associated Requery implementation). WIP - HibernateVaultQuery implementation WIP - Re-structured all Schema definitions (requery/jpa) and make Hibernate Config reusable. WIP - Multi-version schema testing, hibernate query testing. WIP - Custom Criteria and Fungible Criteria impl & testing. WIP - Kotlin Comparable Generics error WIP - Party queries all working now WIP - All VaultQueryTests now working (refactored for AND / OR composition) WIP - added schema registration in CordaPluginRegistry to enable custom vault queries on arbitrary schemas. WIP - added new default Sort NULL order to be NONE + added lots more tests for Logical Operator testing. Mostly identity fixes following rebase from master. Exception handling and public API cleanup in prep for PR. Additional tests for Logical Operators; additional tests for NULLS sort ordering; additional logging; Additional parser to handle Nullable attribute values; added Unary and Collection logical expression handlers Lots of cleanup: participants; trackBy interfaces; additional fungible tests; parser cleanup and improved support for Java Removed all traces of Requery implementation. Further minor cleanup and Junit test fix. Final identity and schema related identity clean-up. Revert unrelated changes. PR review updates: blank lines, isRelevant. Fixed wiring of updatesPublisher for dynamic trackBy queries. PR review changes: multi-versioned schema samples and associated dummy contracts moved to test packages. Fixed problem with sorted queries (not specifying any filterable criteria). PR review: minor updates to address RP comments. Typesafe custom query criteria Cleanup: remove redundant tests. Further clean-up and make all Java test work successfully. Remove debugging print statements. Rebased from master - changes required due to DealState module change. fixed broken assertion caused by DealState ordering change (different package) Fixed transaction demarcation issue causing "java.lang.IllegalStateException: Was not expecting to find existing database transaction on current strand" trackBy() now filters on ContractType and StateStatus (CONSUMED, UNCONSUMED, ALL) Added tests to exercise RPCOps trackBy and queryBy (RPC smoke test and CordaRPCOps) Added additional @CordaSerializable annotations. Updated documentation and referenced sample code. Added deprecation annotations. Re-added missing deprecation annotation. Hibernate debug logging is now configurable and disabled by default. Introduced common Sort attributes based on the node schemas. Completely removed NULL_HANDLING sort parameter as this is not supported in JPA. Revisited and fixed usage of @CordaSerializable. * Minor fix following rebase from master. * Remove blank line as per RP PR feedback request. * Minor Java documentation and example clean-up. * Disable BFT Notary Service tests.
2017-06-22 09:35:49 +00:00
// sample test schemas
testCompile project(path: ':finance:contracts', configuration: 'testArtifacts')
Vault Query Service JPA implementation (#840) * Vault Query Service API implementation using JPA Hibernate Added queryBy(QueryCriteria) Vault API and Junit tests. Minor cosmetic API changes following rebase. Fixes following rebase from master Upgraded to requery 1.3.1 WIP - removed 'latestOnly' from LinearStateQueryCriteria WIP - CommercialSchemas V2, V3, V4 testing WIP - sort out generics handling. WIP - most general queries completed. WIP - join queries, contractStateType derivation WIP - refactoring Requery WIP - refactored VaultService to extract a VaultQueryService interface (and associated Requery implementation). WIP - HibernateVaultQuery implementation WIP - Re-structured all Schema definitions (requery/jpa) and make Hibernate Config reusable. WIP - Multi-version schema testing, hibernate query testing. WIP - Custom Criteria and Fungible Criteria impl & testing. WIP - Kotlin Comparable Generics error WIP - Party queries all working now WIP - All VaultQueryTests now working (refactored for AND / OR composition) WIP - added schema registration in CordaPluginRegistry to enable custom vault queries on arbitrary schemas. WIP - added new default Sort NULL order to be NONE + added lots more tests for Logical Operator testing. Mostly identity fixes following rebase from master. Exception handling and public API cleanup in prep for PR. Additional tests for Logical Operators; additional tests for NULLS sort ordering; additional logging; Additional parser to handle Nullable attribute values; added Unary and Collection logical expression handlers Lots of cleanup: participants; trackBy interfaces; additional fungible tests; parser cleanup and improved support for Java Removed all traces of Requery implementation. Further minor cleanup and Junit test fix. Final identity and schema related identity clean-up. Revert unrelated changes. PR review updates: blank lines, isRelevant. Fixed wiring of updatesPublisher for dynamic trackBy queries. PR review changes: multi-versioned schema samples and associated dummy contracts moved to test packages. Fixed problem with sorted queries (not specifying any filterable criteria). PR review: minor updates to address RP comments. Typesafe custom query criteria Cleanup: remove redundant tests. Further clean-up and make all Java test work successfully. Remove debugging print statements. Rebased from master - changes required due to DealState module change. fixed broken assertion caused by DealState ordering change (different package) Fixed transaction demarcation issue causing "java.lang.IllegalStateException: Was not expecting to find existing database transaction on current strand" trackBy() now filters on ContractType and StateStatus (CONSUMED, UNCONSUMED, ALL) Added tests to exercise RPCOps trackBy and queryBy (RPC smoke test and CordaRPCOps) Added additional @CordaSerializable annotations. Updated documentation and referenced sample code. Added deprecation annotations. Re-added missing deprecation annotation. Hibernate debug logging is now configurable and disabled by default. Introduced common Sort attributes based on the node schemas. Completely removed NULL_HANDLING sort parameter as this is not supported in JPA. Revisited and fixed usage of @CordaSerializable. * Minor fix following rebase from master. * Remove blank line as per RP PR feedback request. * Minor Java documentation and example clean-up. * Disable BFT Notary Service tests.
2017-06-22 09:35:49 +00:00
// For H2 database support in persistence
compile "com.h2database:h2:$h2_version"
// SQL connection pooling library
compile "com.zaxxer:HikariCP:${hikari_version}"
// Hibernate: an object relational mapper for writing state objects to the database automatically.
compile "org.hibernate:hibernate-core:$hibernate_version"
compile "org.hibernate:hibernate-java8:$hibernate_version"
// OkHTTP: Simple HTTP library.
compile "com.squareup.okhttp3:okhttp:$okhttp_version"
// Apache Shiro: authentication, authorization and session management.
compile "org.apache.shiro:shiro-core:${shiro_version}"
//Picocli for command line interface
compile "info.picocli:picocli:$picocli_version"
// Integration test helpers
integrationTestCompile "junit:junit:$junit_version"
integrationTestCompile "org.assertj:assertj-core:${assertj_version}"
integrationTestCompile "org.apache.qpid:qpid-jms-client:${protonj_version}"
// BFT-Smart dependencies
compile 'com.github.bft-smart:library:master-v1.1-beta-g6215ec8-87'
compile 'commons-codec:commons-codec:1.13'
// Java Atomix: RAFT library
compile 'io.atomix.copycat:copycat-client:1.2.3'
compile 'io.atomix.copycat:copycat-server:1.2.3'
compile 'io.atomix.catalyst:catalyst-netty:1.1.2'
// Jetty dependencies for NetworkMapClient test.
// Web stuff: for HTTP[S] servlets
testCompile "org.eclipse.jetty:jetty-servlet:${jetty_version}"
testCompile "org.eclipse.jetty:jetty-webapp:${jetty_version}"
testCompile "javax.servlet:javax.servlet-api:${servlet_version}"
// Jersey for JAX-RS implementation for use in Jetty
testCompile "org.glassfish.jersey.core:jersey-server:${jersey_version}"
testCompile "org.glassfish.jersey.containers:jersey-container-servlet-core:${jersey_version}"
testCompile "org.glassfish.jersey.containers:jersey-container-jetty-http:${jersey_version}"
2018-03-08 09:06:12 +00:00
// Jolokia JVM monitoring agent, required to push logs through slf4j
compile "org.jolokia:jolokia-jvm:${jolokia_version}:agent"
// Optional New Relic JVM reporter, used to push metrics to the configured account associated with a newrelic.yml configuration. See https://mvnrepository.com/artifact/com.palominolabs.metrics/metrics-new-relic
compile "com.palominolabs.metrics:metrics-new-relic:${metrics_new_relic_version}"
// Adding native SSL library to allow using native SSL with Artemis and AMQP
compile "io.netty:netty-tcnative-boringssl-static:$tcnative_version"
CORDA-3194 Wrap state transition exceptions and add flow hospital error handling for them (#2542) Wrap exceptions that occur in state machine transitions with a custom exception type which is then handled inside of the flow hospital. As part of this change, a number of side negative side effects have been addressed. General summary: - `StateTransitionException` wraps exceptions caught in `TransitionExecutorImpl` - `StateTransitionExceptions` are handled in the flow hospital, retried 3 times and then kept in for observation if errors persist (assuming conditions below are false) - Exceptions that occur in `FlowAsyncOperation` events are wrapped in `AsyncOperationTransitionException` and ignored by the flow hospital transition staff member - `InterruptException`s are given a `TERMINAL` diagnosis by the flow hospital transition staff member (can occur due to `killFlow`) - Allow flows which have not persisted their original checkpoint to still retry by replaying their start flow messages - Swallow exceptions in `AcknowledgeMessages` actions Detailed summary: * CORDA-3194 Add state machine transition error handling to flow hospital Wrap exceptions that are caught in `TransitionExecutorImpl` (coming from new errors) with `StateTransitionException`. This exception is then handled explicitly by the flow hospital. Add `TransitionErrorGeneralPractitioner` to `StaffedFlowHospital`. This staff member handles errors that mention `StateTransitionException`. Errors are retried and then kept in the hospital if the errors persist. * CORDA-3194 Remove a fiber from the `hospitalisedFlows` if its previous state was clean If the fiber's previous state was clean then remove it from `HospitalisingInterceptor.hospitalisedFlows`. This allows flows that are being retried to clean themselves. Doing this allows them to re-enter the flow hospital after executing the fiber's transition (if an error occurs). This is important for retrying a flow that has errored during a transition. * CORDA-3194 Set `isAnyCheckpointPersisted` to true when retrying a flow Added to prevent a single flow from creating multiple checkpoints when a failure occurs during `Action.AcknowledgeMessages`. More specifically, to `isAnyCheckpointPersisted` is false when retrying the flow, even though a checkpoint has actually been saved. Due to this a brand new flow is started with a new flow id (causing duplication). Setting `isAnyCheckpointPersisted` to true specifically when retrying a flow resolves this issue. * CORDA-3194 Add Byteman test to verify transition error handling Add `StatemachineErrorHandlingTest` to verify transition error handling. Byteman allows exceptions to be injected at certain points in the code's execution. Therefore exceptions can be thrown when needed inside of the state machine. The current tests check errors in events: - `InitiateFlow` - `AcknowledgeMessages` * CORDA-3194 Swallow all exceptions in `ActionExecutorImpl.executeAcknowledgeMessages` Swallow the exceptions that occur in the `DeduplicationHandler`s when inside of `ActionExecutorImpl.executeAcknowledgeMessages`. The side effects of the failures that can happen in the handlers are not serious enough to put the transition into a failure state. Therefore they are now caught. This allows the transition to continue as normal, even if an error occurs in one any of the handlers. * CORDA-3194 Wrap unexpected exceptions thrown in async operation transitions Exceptions thrown inside of `FlowAsyncOperation.execute` implementations that are not returned as part of the future, are caught, wrapped and rethrown. This prevents unexpected exceptions thrown by (most likely) user code from being handled by the hospital by the transition staff member. This handling might change moving forward, but it allows the async operation to continue working as it was before transition error handling was added. * CORDA-3194 Verify that errors inside of `AcknowledgeMessages` work as expected Update `StatemachineErrorHandlingTest` to correctly test errors that occur when executing the `AcknowledgeMessages` action. * CORDA-3194 Retry flows that failed to persist their original checkpoint Allow a flow that failed when creating their original checkpoint (for example - failing to commit the db transaction) to retry. The flow will create a brand new checkpoint (as the original did not saved). This required adding `flowId` to `ExternalStartFlowEvent` to allow the event to keep a record of the flow's id. When the flow is retried, the events are replayed which trigger a flow to be started that has the id stored in the event. To allow this change, code was removed from `retryFlowFromSafePoint` to allow the function to continue, even if no checkpoint matches the passed in flow id. * CORDA-3194 Correct `FlowFrameworkTests` test due to error handling Test assumed that errors in transitions are not retried, this has now been updated so the test passes with the flow succeeding after an exception is thrown. * CORDA-3194 Remove unneeded import * CORDA-3194 Make the state transition exceptions extend `CordaException` `StateTransitionException` and `AsyncOperationTransitionException` now extend `CordaException` instead of `Exception`. * CORDA-3194 Improve log messages * CORDA-3194 Remove unneeded code in `HospitalisingInterceptor` Due to a previous change, a section of code that removes a flow id from the `hospitalisedFlows` map is no longer required. This code has been removed. * CORDA-3194 Constraint violations are given `TERMINAL` diagnosis Add `Diagnosis.TERMINAL` to `StaffedFlowHospital` to allow an error to be ignored and left to die a quick and painful death. `StateTransitionException` changed so it does not cause serialisation errors when propagated from a flow. * CORDA-3194 `InterruptedExceptions` are given `TERMINAL` diagnosis
2019-09-23 08:31:38 +00:00
// Byteman for runtime (termination) rules injection on the running node
// Submission tool allowing to install rules on running nodes
slowIntegrationTestCompile "org.jboss.byteman:byteman-submit:4.0.11"
CORDA-3194 Wrap state transition exceptions and add flow hospital error handling for them (#2542) Wrap exceptions that occur in state machine transitions with a custom exception type which is then handled inside of the flow hospital. As part of this change, a number of side negative side effects have been addressed. General summary: - `StateTransitionException` wraps exceptions caught in `TransitionExecutorImpl` - `StateTransitionExceptions` are handled in the flow hospital, retried 3 times and then kept in for observation if errors persist (assuming conditions below are false) - Exceptions that occur in `FlowAsyncOperation` events are wrapped in `AsyncOperationTransitionException` and ignored by the flow hospital transition staff member - `InterruptException`s are given a `TERMINAL` diagnosis by the flow hospital transition staff member (can occur due to `killFlow`) - Allow flows which have not persisted their original checkpoint to still retry by replaying their start flow messages - Swallow exceptions in `AcknowledgeMessages` actions Detailed summary: * CORDA-3194 Add state machine transition error handling to flow hospital Wrap exceptions that are caught in `TransitionExecutorImpl` (coming from new errors) with `StateTransitionException`. This exception is then handled explicitly by the flow hospital. Add `TransitionErrorGeneralPractitioner` to `StaffedFlowHospital`. This staff member handles errors that mention `StateTransitionException`. Errors are retried and then kept in the hospital if the errors persist. * CORDA-3194 Remove a fiber from the `hospitalisedFlows` if its previous state was clean If the fiber's previous state was clean then remove it from `HospitalisingInterceptor.hospitalisedFlows`. This allows flows that are being retried to clean themselves. Doing this allows them to re-enter the flow hospital after executing the fiber's transition (if an error occurs). This is important for retrying a flow that has errored during a transition. * CORDA-3194 Set `isAnyCheckpointPersisted` to true when retrying a flow Added to prevent a single flow from creating multiple checkpoints when a failure occurs during `Action.AcknowledgeMessages`. More specifically, to `isAnyCheckpointPersisted` is false when retrying the flow, even though a checkpoint has actually been saved. Due to this a brand new flow is started with a new flow id (causing duplication). Setting `isAnyCheckpointPersisted` to true specifically when retrying a flow resolves this issue. * CORDA-3194 Add Byteman test to verify transition error handling Add `StatemachineErrorHandlingTest` to verify transition error handling. Byteman allows exceptions to be injected at certain points in the code's execution. Therefore exceptions can be thrown when needed inside of the state machine. The current tests check errors in events: - `InitiateFlow` - `AcknowledgeMessages` * CORDA-3194 Swallow all exceptions in `ActionExecutorImpl.executeAcknowledgeMessages` Swallow the exceptions that occur in the `DeduplicationHandler`s when inside of `ActionExecutorImpl.executeAcknowledgeMessages`. The side effects of the failures that can happen in the handlers are not serious enough to put the transition into a failure state. Therefore they are now caught. This allows the transition to continue as normal, even if an error occurs in one any of the handlers. * CORDA-3194 Wrap unexpected exceptions thrown in async operation transitions Exceptions thrown inside of `FlowAsyncOperation.execute` implementations that are not returned as part of the future, are caught, wrapped and rethrown. This prevents unexpected exceptions thrown by (most likely) user code from being handled by the hospital by the transition staff member. This handling might change moving forward, but it allows the async operation to continue working as it was before transition error handling was added. * CORDA-3194 Verify that errors inside of `AcknowledgeMessages` work as expected Update `StatemachineErrorHandlingTest` to correctly test errors that occur when executing the `AcknowledgeMessages` action. * CORDA-3194 Retry flows that failed to persist their original checkpoint Allow a flow that failed when creating their original checkpoint (for example - failing to commit the db transaction) to retry. The flow will create a brand new checkpoint (as the original did not saved). This required adding `flowId` to `ExternalStartFlowEvent` to allow the event to keep a record of the flow's id. When the flow is retried, the events are replayed which trigger a flow to be started that has the id stored in the event. To allow this change, code was removed from `retryFlowFromSafePoint` to allow the function to continue, even if no checkpoint matches the passed in flow id. * CORDA-3194 Correct `FlowFrameworkTests` test due to error handling Test assumed that errors in transitions are not retried, this has now been updated so the test passes with the flow succeeding after an exception is thrown. * CORDA-3194 Remove unneeded import * CORDA-3194 Make the state transition exceptions extend `CordaException` `StateTransitionException` and `AsyncOperationTransitionException` now extend `CordaException` instead of `Exception`. * CORDA-3194 Improve log messages * CORDA-3194 Remove unneeded code in `HospitalisingInterceptor` Due to a previous change, a section of code that removes a flow id from the `hospitalisedFlows` map is no longer required. This code has been removed. * CORDA-3194 Constraint violations are given `TERMINAL` diagnosis Add `Diagnosis.TERMINAL` to `StaffedFlowHospital` to allow an error to be ignored and left to die a quick and painful death. `StateTransitionException` changed so it does not cause serialisation errors when propagated from a flow. * CORDA-3194 `InterruptedExceptions` are given `TERMINAL` diagnosis
2019-09-23 08:31:38 +00:00
// The actual Byteman agent which should only be in the classpath of the out of process nodes
slowIntegrationTestCompile "org.jboss.byteman:byteman:4.0.11"
CORDA-3194 Wrap state transition exceptions and add flow hospital error handling for them (#2542) Wrap exceptions that occur in state machine transitions with a custom exception type which is then handled inside of the flow hospital. As part of this change, a number of side negative side effects have been addressed. General summary: - `StateTransitionException` wraps exceptions caught in `TransitionExecutorImpl` - `StateTransitionExceptions` are handled in the flow hospital, retried 3 times and then kept in for observation if errors persist (assuming conditions below are false) - Exceptions that occur in `FlowAsyncOperation` events are wrapped in `AsyncOperationTransitionException` and ignored by the flow hospital transition staff member - `InterruptException`s are given a `TERMINAL` diagnosis by the flow hospital transition staff member (can occur due to `killFlow`) - Allow flows which have not persisted their original checkpoint to still retry by replaying their start flow messages - Swallow exceptions in `AcknowledgeMessages` actions Detailed summary: * CORDA-3194 Add state machine transition error handling to flow hospital Wrap exceptions that are caught in `TransitionExecutorImpl` (coming from new errors) with `StateTransitionException`. This exception is then handled explicitly by the flow hospital. Add `TransitionErrorGeneralPractitioner` to `StaffedFlowHospital`. This staff member handles errors that mention `StateTransitionException`. Errors are retried and then kept in the hospital if the errors persist. * CORDA-3194 Remove a fiber from the `hospitalisedFlows` if its previous state was clean If the fiber's previous state was clean then remove it from `HospitalisingInterceptor.hospitalisedFlows`. This allows flows that are being retried to clean themselves. Doing this allows them to re-enter the flow hospital after executing the fiber's transition (if an error occurs). This is important for retrying a flow that has errored during a transition. * CORDA-3194 Set `isAnyCheckpointPersisted` to true when retrying a flow Added to prevent a single flow from creating multiple checkpoints when a failure occurs during `Action.AcknowledgeMessages`. More specifically, to `isAnyCheckpointPersisted` is false when retrying the flow, even though a checkpoint has actually been saved. Due to this a brand new flow is started with a new flow id (causing duplication). Setting `isAnyCheckpointPersisted` to true specifically when retrying a flow resolves this issue. * CORDA-3194 Add Byteman test to verify transition error handling Add `StatemachineErrorHandlingTest` to verify transition error handling. Byteman allows exceptions to be injected at certain points in the code's execution. Therefore exceptions can be thrown when needed inside of the state machine. The current tests check errors in events: - `InitiateFlow` - `AcknowledgeMessages` * CORDA-3194 Swallow all exceptions in `ActionExecutorImpl.executeAcknowledgeMessages` Swallow the exceptions that occur in the `DeduplicationHandler`s when inside of `ActionExecutorImpl.executeAcknowledgeMessages`. The side effects of the failures that can happen in the handlers are not serious enough to put the transition into a failure state. Therefore they are now caught. This allows the transition to continue as normal, even if an error occurs in one any of the handlers. * CORDA-3194 Wrap unexpected exceptions thrown in async operation transitions Exceptions thrown inside of `FlowAsyncOperation.execute` implementations that are not returned as part of the future, are caught, wrapped and rethrown. This prevents unexpected exceptions thrown by (most likely) user code from being handled by the hospital by the transition staff member. This handling might change moving forward, but it allows the async operation to continue working as it was before transition error handling was added. * CORDA-3194 Verify that errors inside of `AcknowledgeMessages` work as expected Update `StatemachineErrorHandlingTest` to correctly test errors that occur when executing the `AcknowledgeMessages` action. * CORDA-3194 Retry flows that failed to persist their original checkpoint Allow a flow that failed when creating their original checkpoint (for example - failing to commit the db transaction) to retry. The flow will create a brand new checkpoint (as the original did not saved). This required adding `flowId` to `ExternalStartFlowEvent` to allow the event to keep a record of the flow's id. When the flow is retried, the events are replayed which trigger a flow to be started that has the id stored in the event. To allow this change, code was removed from `retryFlowFromSafePoint` to allow the function to continue, even if no checkpoint matches the passed in flow id. * CORDA-3194 Correct `FlowFrameworkTests` test due to error handling Test assumed that errors in transitions are not retried, this has now been updated so the test passes with the flow succeeding after an exception is thrown. * CORDA-3194 Remove unneeded import * CORDA-3194 Make the state transition exceptions extend `CordaException` `StateTransitionException` and `AsyncOperationTransitionException` now extend `CordaException` instead of `Exception`. * CORDA-3194 Improve log messages * CORDA-3194 Remove unneeded code in `HospitalisingInterceptor` Due to a previous change, a section of code that removes a flow id from the `hospitalisedFlows` map is no longer required. This code has been removed. * CORDA-3194 Constraint violations are given `TERMINAL` diagnosis Add `Diagnosis.TERMINAL` to `StaffedFlowHospital` to allow an error to be ignored and left to die a quick and painful death. `StateTransitionException` changed so it does not cause serialisation errors when propagated from a flow. * CORDA-3194 `InterruptedExceptions` are given `TERMINAL` diagnosis
2019-09-23 08:31:38 +00:00
testCompile(project(':test-cli'))
2019-01-04 15:42:11 +00:00
testCompile(project(':test-utils'))
WIP Kubenetes parallel build (#5396) * Split integration tests * add simple example of printing all methods annotated with @Test * add docker plugin to root project remove docker plugin from child projects add Dockerfile for image to use when testing add task to build testing image to root project * add comment describing proposed testing workflow * simple attempt at running tests in docker container * add my first k8s interaction script * add fabric8 as dependnency to buildSrc * before adding classpath * collect reports from containers and run through testReports * re-enable kubes backed testing * for each project 1. add a list tests task 2. use this list tests task to modify the included tests 3. add a parallel version of the test task * tweak logic for downloading test report XML files * use output of parallel testing tasks in report tasks to determine build resultCode * prepare for jenkins test * prepare for jenkins test * make docker reg password system property * add logging to print out docker reg creds * enable docker build * fix gradle build file * gather xml files into root project * change log level for gradle modification * stop printing gradle docker push passwd * tidy up report generation * fix compilation errors * split signature constraints test into two * change Sig constraint tests type hierarchy * tidy up build.gradle * try method based test includes * add unit test for test listing * fix bug with test slicing * stop filtering ignored tests to make the numbers match existing runs * change log level to ensure print out * move all plugin logic to buildSrc files * tidy up test modification add comments to explain what DistributedTesting plugin does * move new plugins into properly named packages * tidy up runConfigs * fix compile errors due to merge with slow-integration-test work * add system parameter to enable / disable build modification * add -Dkubenetise to build command * address review comments * type safe declaration of parameters in KubesTest
2019-09-03 15:40:08 +00:00
slowIntegrationTestCompile sourceSets.main.output
slowIntegrationTestCompile sourceSets.test.output
slowIntegrationTestCompile configurations.compile
slowIntegrationTestCompile configurations.testCompile
slowIntegrationTestRuntime configurations.runtime
slowIntegrationTestRuntime configurations.testRuntime
testCompile project(':testing:cordapps:dbfailure:dbfworkflows')
}
tasks.withType(JavaCompile).configureEach {
// Resolves a Gradle warning about not scanning for pre-processors.
options.compilerArgs << '-proc:none'
}
tasks.withType(Test).configureEach {
CORDA-2876: Integrate the DJVM with the Corda Node. (#5633) * * CORDA-2876: Migrate DJVM serialization modules into Corda. * Pre-generate Corda classes for DJVM sandbox when node boots in production mode. * Ensure that all DJVM test contract CorDapps are signed. * Test examining attachments within DJVM sandbox. * Test Contract.verify() using cryptographic verify function. * Add test cases for more non-determinism in Contract.verify(). * Update node-driver to support testing nodes with DJVM support. * Modify Node to allow alternative DJVM configurations for testing. * Refactor DeterministicVerifierFactoryService for default use-case. * Small whitespace and code-style refactors. * Create and activate a DJVM execution profile for the Node. * Revert making Verifier implement AutoCloseable. * Allow the node to cache sandboxed Corda byte-code for reuse. * Use updated Quasar agent that knows not to touch DJVM classloaders. * Fix Quasar's package exclusions globs for DJVM. * Deserialise LedgerTransaction into the sandbox for Contract.verify(). * Add the DJVM's serialisation modules to the Corda node. * Update the node for the latest DJVM API, and preserve the ConstructorForDeserialization annotation on user contract classes. * Add corda-dev to repositories while DJVM is SNAPSHOT. * Migrate DJVM specialisation into AbstractNode's ServiceHubInternalImpl. * Exclude sandbox.** and shaded djvm.** classes from Quasar agent. * Add the corda-dev repository to :node for the deterministic runtime. * Turn Verifier into an abstract base class that is specialised by BasicVerifier and DeterministicVerifier. * Add the Corda deterministic libraries to the Node, and split the DJVM sandbox across two SandboxClassLoader instances. * Add DJVM to contract verification path inside Corda Node. * Minor lambda simplifications and removing unused import. * CORDA-2871: Remove @CordaSerializable from LedgerTransaction. * CORDA-2871: Add a callback to ServicesForResolution to allow the Node to modify a LedgerTransaction object. * CORDA-2871: Refactor the contract verification code into a separate class, and allow LedgerTransaction to choose different Verifier objects. * Update DJVM to use Corda 4.4-SNAPSHOT. (#95) * CORDA-3330: Allow DJVM to preload / pregenerate classes from selected jars. (#92) * Add support for SourceClassLoader.getResources() to DJVM. * Allow a SandboxConfiguration to preload sandbox byte-code for all classes inside jars containing META-INF/DJVM-preload. * CORDA-3309: Remove explicit try-catch in favour of UncaughtExceptionHandler. (#91) * CORDA-3309: Install UncaughtExceptionHandler for DJVM tasks. (#88) * Fix tests broken by Windows line endings. (#82) * CORDA-3292: Reimplement ExecutionProfile as a data class. (#80) * CORDA-2877: Refactor how we create child SandboxConfiguration objects. (#76) * CORDA-2877: Load bytecode from a persistent cache to prevent repeated rewriting. (#75) * Refactor byte-code cache to SandboxConfiguration instead of AnalysisConfiguration. We cannot "mix and match" byte-code generated by different sets of rules. * CORDA-3137: Enhance annotation handling so that we can allow some annotations to be mapped into the sandbox without also needing to be stitched. (#72) * CORDA-2871: Minor cosmetic fixes. (#69) * CORDA-3218: Align DJVM with internal Corda Serialisation API. (#68) * Ensure we get the latest SNAPSHOT of the serialisation code. * CORDA-2871: Refactor SourceClassLoader to define source classes. (#66) * Rewrite SourceClassLoader to support parent/child relationships. * Revert catching TypNotPresebtException - it was a symptom of a bigger problem. * Remove AutoCloseable from AnalysisConfiguration and SourceClassLoader. * SourceClassLoader.getResource() must delegate to its parent first. * CORDA-2871: Ensure ClassLoader.loadClass() throws ClassNotFoundException for all cases where the class cannot be found. (#64) * CORDA-2871: Modify sandbox tasks to implement both java.Function and sandbox.Function (#62) * Make TaskExecutors implement BiFunction to make them composable. * Create ImportTask to wrap a java.Function inside a sandbox.Function. * Add createExecutor() and createRawExecutor() APIs to SandboxClassLoader. * Update serialization to use SandboxClassLoader.toSandboxClass(). * Remove a layer of lambdas from the serialisation code. * Update SandboxExecutor and SandboxRawExecutor. * Rename Executor to TaskFactory. * Rename dangling executor -> taskFactory. * CORDA-2871: Sanity fixes! (#63) * Improve message for SandboxClassLoadingException. * Fix serialisation API for using sandboxed environment. * CORDA-3174: Extend serialisation to include InputStream and OpaqueBytesSubSequence. (#60) * Update DJVM Example project for serialisation. * Add serializers for InputStream and OpaqueBytesSubSequence. * Support ZIP Inflater and CRC32 inside the sandbox. * Allow the DJVM to wrap java.io.InputStream as sandbox.java.io.InputStream. * Configure tests also to preserve @DeprecatedConstructorForDeserialization. * CORDA-3174: Implement Corda serialization modules. (#59) * Create DJVM serialization modules. * Create test cases for Array<T>, List<T> and List<Array<T>>. * Refactor SandboxPrimiveSerializer for all primitive types. * Implement SandboxCollectionSerializer to support Collection types. * Implement SandboxMapSerializer to support Map types. * Attempt to fix infinite loop when computing Collection and Map fingerprints. * Apply special handling when deserialising sandbox.java.lang.Character. * Remap Java primitive types to sandbox Java object types to deter evolution. * Use Class.getPackage().getName() to determine sandbox package name. * Implement SandboxEnumSerializer to support Enum types. * Implement SandboxPublicKeySerializer to support Java security keys. * Add serialization projects to the composite example project. * Implement serializers for BigInteger, BigDecimal, Currency and StringBuffer. * Test that deserialising does not instantiate the untrusted user classes. * Implement serializers for java.time.* types. * Add serialiser for BitSet - currently disabled until BitSet itself is supported. * Add serialisers for EnumSet and Class. * Include support for EnumMap in the SandboxMapSerializer. * Ensure the DJVM Example project's tests preserve @CordaSerializable. * Add support for UUID as a primitive type. * Use common abortReadOnly() method for declaring serialization as unsupported. * Streamline the API for deserialising into the sandbox. * Add preliminary support for deserialising X.509 certificates. * Implement serializer for java.util.Optional. * Refactor configuration of the sandbox serialization scheme. * Add tests for deserialising arrays of basic types. * Include method annotations in annotation stitching. This ensures that `@ConstructorForDeserialization` is not dropped. * Enable test for SandboxBitSetSerializer. * Enable tests for X.509 serializers. * Implement serializers for ProtonJ primitive types. * Serialize java.util.Date as a primitive type. * Add the bintray Gradle plugin to the serialisation modules. * Do not publish serialisation modules - they will become part of Corda itself. * CORDA-2876: Only apply DJVM sources to Node Driver when devMode=true. * Resolve DeteKT warnings. * Require Node's JVM to set -Dnet.corda.djvm=true in order to enable DJVM. * Enable DJVM for DemoBench nodes. * Disable Quasar instrumentation verification for DemoBench nodes. * Upgrade to DJVM 1.0-RC01. * Try to modify DriverParameters in a more "ABI friendly" way. * Refactor and simplify sandbox deserialisation of primitive objects. * Review fixes. * Update EvolutionSerializerFactory to handle sandboxed primitive boxed types.
2019-11-05 13:44:18 +00:00
if (JavaVersion.current() == JavaVersion.VERSION_11) {
jvmArgs '-Djdk.attach.allowAttachSelf=true'
CORDA-2876: Integrate the DJVM with the Corda Node. (#5633) * * CORDA-2876: Migrate DJVM serialization modules into Corda. * Pre-generate Corda classes for DJVM sandbox when node boots in production mode. * Ensure that all DJVM test contract CorDapps are signed. * Test examining attachments within DJVM sandbox. * Test Contract.verify() using cryptographic verify function. * Add test cases for more non-determinism in Contract.verify(). * Update node-driver to support testing nodes with DJVM support. * Modify Node to allow alternative DJVM configurations for testing. * Refactor DeterministicVerifierFactoryService for default use-case. * Small whitespace and code-style refactors. * Create and activate a DJVM execution profile for the Node. * Revert making Verifier implement AutoCloseable. * Allow the node to cache sandboxed Corda byte-code for reuse. * Use updated Quasar agent that knows not to touch DJVM classloaders. * Fix Quasar's package exclusions globs for DJVM. * Deserialise LedgerTransaction into the sandbox for Contract.verify(). * Add the DJVM's serialisation modules to the Corda node. * Update the node for the latest DJVM API, and preserve the ConstructorForDeserialization annotation on user contract classes. * Add corda-dev to repositories while DJVM is SNAPSHOT. * Migrate DJVM specialisation into AbstractNode's ServiceHubInternalImpl. * Exclude sandbox.** and shaded djvm.** classes from Quasar agent. * Add the corda-dev repository to :node for the deterministic runtime. * Turn Verifier into an abstract base class that is specialised by BasicVerifier and DeterministicVerifier. * Add the Corda deterministic libraries to the Node, and split the DJVM sandbox across two SandboxClassLoader instances. * Add DJVM to contract verification path inside Corda Node. * Minor lambda simplifications and removing unused import. * CORDA-2871: Remove @CordaSerializable from LedgerTransaction. * CORDA-2871: Add a callback to ServicesForResolution to allow the Node to modify a LedgerTransaction object. * CORDA-2871: Refactor the contract verification code into a separate class, and allow LedgerTransaction to choose different Verifier objects. * Update DJVM to use Corda 4.4-SNAPSHOT. (#95) * CORDA-3330: Allow DJVM to preload / pregenerate classes from selected jars. (#92) * Add support for SourceClassLoader.getResources() to DJVM. * Allow a SandboxConfiguration to preload sandbox byte-code for all classes inside jars containing META-INF/DJVM-preload. * CORDA-3309: Remove explicit try-catch in favour of UncaughtExceptionHandler. (#91) * CORDA-3309: Install UncaughtExceptionHandler for DJVM tasks. (#88) * Fix tests broken by Windows line endings. (#82) * CORDA-3292: Reimplement ExecutionProfile as a data class. (#80) * CORDA-2877: Refactor how we create child SandboxConfiguration objects. (#76) * CORDA-2877: Load bytecode from a persistent cache to prevent repeated rewriting. (#75) * Refactor byte-code cache to SandboxConfiguration instead of AnalysisConfiguration. We cannot "mix and match" byte-code generated by different sets of rules. * CORDA-3137: Enhance annotation handling so that we can allow some annotations to be mapped into the sandbox without also needing to be stitched. (#72) * CORDA-2871: Minor cosmetic fixes. (#69) * CORDA-3218: Align DJVM with internal Corda Serialisation API. (#68) * Ensure we get the latest SNAPSHOT of the serialisation code. * CORDA-2871: Refactor SourceClassLoader to define source classes. (#66) * Rewrite SourceClassLoader to support parent/child relationships. * Revert catching TypNotPresebtException - it was a symptom of a bigger problem. * Remove AutoCloseable from AnalysisConfiguration and SourceClassLoader. * SourceClassLoader.getResource() must delegate to its parent first. * CORDA-2871: Ensure ClassLoader.loadClass() throws ClassNotFoundException for all cases where the class cannot be found. (#64) * CORDA-2871: Modify sandbox tasks to implement both java.Function and sandbox.Function (#62) * Make TaskExecutors implement BiFunction to make them composable. * Create ImportTask to wrap a java.Function inside a sandbox.Function. * Add createExecutor() and createRawExecutor() APIs to SandboxClassLoader. * Update serialization to use SandboxClassLoader.toSandboxClass(). * Remove a layer of lambdas from the serialisation code. * Update SandboxExecutor and SandboxRawExecutor. * Rename Executor to TaskFactory. * Rename dangling executor -> taskFactory. * CORDA-2871: Sanity fixes! (#63) * Improve message for SandboxClassLoadingException. * Fix serialisation API for using sandboxed environment. * CORDA-3174: Extend serialisation to include InputStream and OpaqueBytesSubSequence. (#60) * Update DJVM Example project for serialisation. * Add serializers for InputStream and OpaqueBytesSubSequence. * Support ZIP Inflater and CRC32 inside the sandbox. * Allow the DJVM to wrap java.io.InputStream as sandbox.java.io.InputStream. * Configure tests also to preserve @DeprecatedConstructorForDeserialization. * CORDA-3174: Implement Corda serialization modules. (#59) * Create DJVM serialization modules. * Create test cases for Array<T>, List<T> and List<Array<T>>. * Refactor SandboxPrimiveSerializer for all primitive types. * Implement SandboxCollectionSerializer to support Collection types. * Implement SandboxMapSerializer to support Map types. * Attempt to fix infinite loop when computing Collection and Map fingerprints. * Apply special handling when deserialising sandbox.java.lang.Character. * Remap Java primitive types to sandbox Java object types to deter evolution. * Use Class.getPackage().getName() to determine sandbox package name. * Implement SandboxEnumSerializer to support Enum types. * Implement SandboxPublicKeySerializer to support Java security keys. * Add serialization projects to the composite example project. * Implement serializers for BigInteger, BigDecimal, Currency and StringBuffer. * Test that deserialising does not instantiate the untrusted user classes. * Implement serializers for java.time.* types. * Add serialiser for BitSet - currently disabled until BitSet itself is supported. * Add serialisers for EnumSet and Class. * Include support for EnumMap in the SandboxMapSerializer. * Ensure the DJVM Example project's tests preserve @CordaSerializable. * Add support for UUID as a primitive type. * Use common abortReadOnly() method for declaring serialization as unsupported. * Streamline the API for deserialising into the sandbox. * Add preliminary support for deserialising X.509 certificates. * Implement serializer for java.util.Optional. * Refactor configuration of the sandbox serialization scheme. * Add tests for deserialising arrays of basic types. * Include method annotations in annotation stitching. This ensures that `@ConstructorForDeserialization` is not dropped. * Enable test for SandboxBitSetSerializer. * Enable tests for X.509 serializers. * Implement serializers for ProtonJ primitive types. * Serialize java.util.Date as a primitive type. * Add the bintray Gradle plugin to the serialisation modules. * Do not publish serialisation modules - they will become part of Corda itself. * CORDA-2876: Only apply DJVM sources to Node Driver when devMode=true. * Resolve DeteKT warnings. * Require Node's JVM to set -Dnet.corda.djvm=true in order to enable DJVM. * Enable DJVM for DemoBench nodes. * Disable Quasar instrumentation verification for DemoBench nodes. * Upgrade to DJVM 1.0-RC01. * Try to modify DriverParameters in a more "ABI friendly" way. * Refactor and simplify sandbox deserialisation of primitive objects. * Review fixes. * Update EvolutionSerializerFactory to handle sandboxed primitive boxed types.
2019-11-05 13:44:18 +00:00
}
systemProperty 'deterministic-rt.path', configurations.jdkRt.asPath
systemProperty 'deterministic-sources.path', configurations.deterministic.asPath
}
tasks.register('integrationTest', Test) {
testClassesDirs = sourceSets.integrationTest.output.classesDirs
classpath = sourceSets.integrationTest.runtimeClasspath
WIP Kubenetes parallel build (#5396) * Split integration tests * add simple example of printing all methods annotated with @Test * add docker plugin to root project remove docker plugin from child projects add Dockerfile for image to use when testing add task to build testing image to root project * add comment describing proposed testing workflow * simple attempt at running tests in docker container * add my first k8s interaction script * add fabric8 as dependnency to buildSrc * before adding classpath * collect reports from containers and run through testReports * re-enable kubes backed testing * for each project 1. add a list tests task 2. use this list tests task to modify the included tests 3. add a parallel version of the test task * tweak logic for downloading test report XML files * use output of parallel testing tasks in report tasks to determine build resultCode * prepare for jenkins test * prepare for jenkins test * make docker reg password system property * add logging to print out docker reg creds * enable docker build * fix gradle build file * gather xml files into root project * change log level for gradle modification * stop printing gradle docker push passwd * tidy up report generation * fix compilation errors * split signature constraints test into two * change Sig constraint tests type hierarchy * tidy up build.gradle * try method based test includes * add unit test for test listing * fix bug with test slicing * stop filtering ignored tests to make the numbers match existing runs * change log level to ensure print out * move all plugin logic to buildSrc files * tidy up test modification add comments to explain what DistributedTesting plugin does * move new plugins into properly named packages * tidy up runConfigs * fix compile errors due to merge with slow-integration-test work * add system parameter to enable / disable build modification * add -Dkubenetise to build command * address review comments * type safe declaration of parameters in KubesTest
2019-09-03 15:40:08 +00:00
maxParallelForks = (System.env.CORDA_NODE_INT_TESTING_FORKS == null) ? 1 : "$System.env.CORDA_NODE_INT_TESTING_FORKS".toInteger()
}
tasks.register('slowIntegrationTest', Test) {
WIP Kubenetes parallel build (#5396) * Split integration tests * add simple example of printing all methods annotated with @Test * add docker plugin to root project remove docker plugin from child projects add Dockerfile for image to use when testing add task to build testing image to root project * add comment describing proposed testing workflow * simple attempt at running tests in docker container * add my first k8s interaction script * add fabric8 as dependnency to buildSrc * before adding classpath * collect reports from containers and run through testReports * re-enable kubes backed testing * for each project 1. add a list tests task 2. use this list tests task to modify the included tests 3. add a parallel version of the test task * tweak logic for downloading test report XML files * use output of parallel testing tasks in report tasks to determine build resultCode * prepare for jenkins test * prepare for jenkins test * make docker reg password system property * add logging to print out docker reg creds * enable docker build * fix gradle build file * gather xml files into root project * change log level for gradle modification * stop printing gradle docker push passwd * tidy up report generation * fix compilation errors * split signature constraints test into two * change Sig constraint tests type hierarchy * tidy up build.gradle * try method based test includes * add unit test for test listing * fix bug with test slicing * stop filtering ignored tests to make the numbers match existing runs * change log level to ensure print out * move all plugin logic to buildSrc files * tidy up test modification add comments to explain what DistributedTesting plugin does * move new plugins into properly named packages * tidy up runConfigs * fix compile errors due to merge with slow-integration-test work * add system parameter to enable / disable build modification * add -Dkubenetise to build command * address review comments * type safe declaration of parameters in KubesTest
2019-09-03 15:40:08 +00:00
testClassesDirs = sourceSets.slowIntegrationTest.output.classesDirs
classpath = sourceSets.slowIntegrationTest.runtimeClasspath
maxParallelForks = 1
}
// quasar exclusions upon agent code instrumentation at run-time
quasar {
CORDA-2876: Integrate the DJVM with the Corda Node. (#5633) * * CORDA-2876: Migrate DJVM serialization modules into Corda. * Pre-generate Corda classes for DJVM sandbox when node boots in production mode. * Ensure that all DJVM test contract CorDapps are signed. * Test examining attachments within DJVM sandbox. * Test Contract.verify() using cryptographic verify function. * Add test cases for more non-determinism in Contract.verify(). * Update node-driver to support testing nodes with DJVM support. * Modify Node to allow alternative DJVM configurations for testing. * Refactor DeterministicVerifierFactoryService for default use-case. * Small whitespace and code-style refactors. * Create and activate a DJVM execution profile for the Node. * Revert making Verifier implement AutoCloseable. * Allow the node to cache sandboxed Corda byte-code for reuse. * Use updated Quasar agent that knows not to touch DJVM classloaders. * Fix Quasar's package exclusions globs for DJVM. * Deserialise LedgerTransaction into the sandbox for Contract.verify(). * Add the DJVM's serialisation modules to the Corda node. * Update the node for the latest DJVM API, and preserve the ConstructorForDeserialization annotation on user contract classes. * Add corda-dev to repositories while DJVM is SNAPSHOT. * Migrate DJVM specialisation into AbstractNode's ServiceHubInternalImpl. * Exclude sandbox.** and shaded djvm.** classes from Quasar agent. * Add the corda-dev repository to :node for the deterministic runtime. * Turn Verifier into an abstract base class that is specialised by BasicVerifier and DeterministicVerifier. * Add the Corda deterministic libraries to the Node, and split the DJVM sandbox across two SandboxClassLoader instances. * Add DJVM to contract verification path inside Corda Node. * Minor lambda simplifications and removing unused import. * CORDA-2871: Remove @CordaSerializable from LedgerTransaction. * CORDA-2871: Add a callback to ServicesForResolution to allow the Node to modify a LedgerTransaction object. * CORDA-2871: Refactor the contract verification code into a separate class, and allow LedgerTransaction to choose different Verifier objects. * Update DJVM to use Corda 4.4-SNAPSHOT. (#95) * CORDA-3330: Allow DJVM to preload / pregenerate classes from selected jars. (#92) * Add support for SourceClassLoader.getResources() to DJVM. * Allow a SandboxConfiguration to preload sandbox byte-code for all classes inside jars containing META-INF/DJVM-preload. * CORDA-3309: Remove explicit try-catch in favour of UncaughtExceptionHandler. (#91) * CORDA-3309: Install UncaughtExceptionHandler for DJVM tasks. (#88) * Fix tests broken by Windows line endings. (#82) * CORDA-3292: Reimplement ExecutionProfile as a data class. (#80) * CORDA-2877: Refactor how we create child SandboxConfiguration objects. (#76) * CORDA-2877: Load bytecode from a persistent cache to prevent repeated rewriting. (#75) * Refactor byte-code cache to SandboxConfiguration instead of AnalysisConfiguration. We cannot "mix and match" byte-code generated by different sets of rules. * CORDA-3137: Enhance annotation handling so that we can allow some annotations to be mapped into the sandbox without also needing to be stitched. (#72) * CORDA-2871: Minor cosmetic fixes. (#69) * CORDA-3218: Align DJVM with internal Corda Serialisation API. (#68) * Ensure we get the latest SNAPSHOT of the serialisation code. * CORDA-2871: Refactor SourceClassLoader to define source classes. (#66) * Rewrite SourceClassLoader to support parent/child relationships. * Revert catching TypNotPresebtException - it was a symptom of a bigger problem. * Remove AutoCloseable from AnalysisConfiguration and SourceClassLoader. * SourceClassLoader.getResource() must delegate to its parent first. * CORDA-2871: Ensure ClassLoader.loadClass() throws ClassNotFoundException for all cases where the class cannot be found. (#64) * CORDA-2871: Modify sandbox tasks to implement both java.Function and sandbox.Function (#62) * Make TaskExecutors implement BiFunction to make them composable. * Create ImportTask to wrap a java.Function inside a sandbox.Function. * Add createExecutor() and createRawExecutor() APIs to SandboxClassLoader. * Update serialization to use SandboxClassLoader.toSandboxClass(). * Remove a layer of lambdas from the serialisation code. * Update SandboxExecutor and SandboxRawExecutor. * Rename Executor to TaskFactory. * Rename dangling executor -> taskFactory. * CORDA-2871: Sanity fixes! (#63) * Improve message for SandboxClassLoadingException. * Fix serialisation API for using sandboxed environment. * CORDA-3174: Extend serialisation to include InputStream and OpaqueBytesSubSequence. (#60) * Update DJVM Example project for serialisation. * Add serializers for InputStream and OpaqueBytesSubSequence. * Support ZIP Inflater and CRC32 inside the sandbox. * Allow the DJVM to wrap java.io.InputStream as sandbox.java.io.InputStream. * Configure tests also to preserve @DeprecatedConstructorForDeserialization. * CORDA-3174: Implement Corda serialization modules. (#59) * Create DJVM serialization modules. * Create test cases for Array<T>, List<T> and List<Array<T>>. * Refactor SandboxPrimiveSerializer for all primitive types. * Implement SandboxCollectionSerializer to support Collection types. * Implement SandboxMapSerializer to support Map types. * Attempt to fix infinite loop when computing Collection and Map fingerprints. * Apply special handling when deserialising sandbox.java.lang.Character. * Remap Java primitive types to sandbox Java object types to deter evolution. * Use Class.getPackage().getName() to determine sandbox package name. * Implement SandboxEnumSerializer to support Enum types. * Implement SandboxPublicKeySerializer to support Java security keys. * Add serialization projects to the composite example project. * Implement serializers for BigInteger, BigDecimal, Currency and StringBuffer. * Test that deserialising does not instantiate the untrusted user classes. * Implement serializers for java.time.* types. * Add serialiser for BitSet - currently disabled until BitSet itself is supported. * Add serialisers for EnumSet and Class. * Include support for EnumMap in the SandboxMapSerializer. * Ensure the DJVM Example project's tests preserve @CordaSerializable. * Add support for UUID as a primitive type. * Use common abortReadOnly() method for declaring serialization as unsupported. * Streamline the API for deserialising into the sandbox. * Add preliminary support for deserialising X.509 certificates. * Implement serializer for java.util.Optional. * Refactor configuration of the sandbox serialization scheme. * Add tests for deserialising arrays of basic types. * Include method annotations in annotation stitching. This ensures that `@ConstructorForDeserialization` is not dropped. * Enable test for SandboxBitSetSerializer. * Enable tests for X.509 serializers. * Implement serializers for ProtonJ primitive types. * Serialize java.util.Date as a primitive type. * Add the bintray Gradle plugin to the serialisation modules. * Do not publish serialisation modules - they will become part of Corda itself. * CORDA-2876: Only apply DJVM sources to Node Driver when devMode=true. * Resolve DeteKT warnings. * Require Node's JVM to set -Dnet.corda.djvm=true in order to enable DJVM. * Enable DJVM for DemoBench nodes. * Disable Quasar instrumentation verification for DemoBench nodes. * Upgrade to DJVM 1.0-RC01. * Try to modify DriverParameters in a more "ABI friendly" way. * Refactor and simplify sandbox deserialisation of primitive objects. * Review fixes. * Update EvolutionSerializerFactory to handle sandboxed primitive boxed types.
2019-11-05 13:44:18 +00:00
excludeClassLoaders.addAll(
'net.corda.djvm.**',
'net.corda.core.serialization.internal.**'
CORDA-2876: Integrate the DJVM with the Corda Node. (#5633) * * CORDA-2876: Migrate DJVM serialization modules into Corda. * Pre-generate Corda classes for DJVM sandbox when node boots in production mode. * Ensure that all DJVM test contract CorDapps are signed. * Test examining attachments within DJVM sandbox. * Test Contract.verify() using cryptographic verify function. * Add test cases for more non-determinism in Contract.verify(). * Update node-driver to support testing nodes with DJVM support. * Modify Node to allow alternative DJVM configurations for testing. * Refactor DeterministicVerifierFactoryService for default use-case. * Small whitespace and code-style refactors. * Create and activate a DJVM execution profile for the Node. * Revert making Verifier implement AutoCloseable. * Allow the node to cache sandboxed Corda byte-code for reuse. * Use updated Quasar agent that knows not to touch DJVM classloaders. * Fix Quasar's package exclusions globs for DJVM. * Deserialise LedgerTransaction into the sandbox for Contract.verify(). * Add the DJVM's serialisation modules to the Corda node. * Update the node for the latest DJVM API, and preserve the ConstructorForDeserialization annotation on user contract classes. * Add corda-dev to repositories while DJVM is SNAPSHOT. * Migrate DJVM specialisation into AbstractNode's ServiceHubInternalImpl. * Exclude sandbox.** and shaded djvm.** classes from Quasar agent. * Add the corda-dev repository to :node for the deterministic runtime. * Turn Verifier into an abstract base class that is specialised by BasicVerifier and DeterministicVerifier. * Add the Corda deterministic libraries to the Node, and split the DJVM sandbox across two SandboxClassLoader instances. * Add DJVM to contract verification path inside Corda Node. * Minor lambda simplifications and removing unused import. * CORDA-2871: Remove @CordaSerializable from LedgerTransaction. * CORDA-2871: Add a callback to ServicesForResolution to allow the Node to modify a LedgerTransaction object. * CORDA-2871: Refactor the contract verification code into a separate class, and allow LedgerTransaction to choose different Verifier objects. * Update DJVM to use Corda 4.4-SNAPSHOT. (#95) * CORDA-3330: Allow DJVM to preload / pregenerate classes from selected jars. (#92) * Add support for SourceClassLoader.getResources() to DJVM. * Allow a SandboxConfiguration to preload sandbox byte-code for all classes inside jars containing META-INF/DJVM-preload. * CORDA-3309: Remove explicit try-catch in favour of UncaughtExceptionHandler. (#91) * CORDA-3309: Install UncaughtExceptionHandler for DJVM tasks. (#88) * Fix tests broken by Windows line endings. (#82) * CORDA-3292: Reimplement ExecutionProfile as a data class. (#80) * CORDA-2877: Refactor how we create child SandboxConfiguration objects. (#76) * CORDA-2877: Load bytecode from a persistent cache to prevent repeated rewriting. (#75) * Refactor byte-code cache to SandboxConfiguration instead of AnalysisConfiguration. We cannot "mix and match" byte-code generated by different sets of rules. * CORDA-3137: Enhance annotation handling so that we can allow some annotations to be mapped into the sandbox without also needing to be stitched. (#72) * CORDA-2871: Minor cosmetic fixes. (#69) * CORDA-3218: Align DJVM with internal Corda Serialisation API. (#68) * Ensure we get the latest SNAPSHOT of the serialisation code. * CORDA-2871: Refactor SourceClassLoader to define source classes. (#66) * Rewrite SourceClassLoader to support parent/child relationships. * Revert catching TypNotPresebtException - it was a symptom of a bigger problem. * Remove AutoCloseable from AnalysisConfiguration and SourceClassLoader. * SourceClassLoader.getResource() must delegate to its parent first. * CORDA-2871: Ensure ClassLoader.loadClass() throws ClassNotFoundException for all cases where the class cannot be found. (#64) * CORDA-2871: Modify sandbox tasks to implement both java.Function and sandbox.Function (#62) * Make TaskExecutors implement BiFunction to make them composable. * Create ImportTask to wrap a java.Function inside a sandbox.Function. * Add createExecutor() and createRawExecutor() APIs to SandboxClassLoader. * Update serialization to use SandboxClassLoader.toSandboxClass(). * Remove a layer of lambdas from the serialisation code. * Update SandboxExecutor and SandboxRawExecutor. * Rename Executor to TaskFactory. * Rename dangling executor -> taskFactory. * CORDA-2871: Sanity fixes! (#63) * Improve message for SandboxClassLoadingException. * Fix serialisation API for using sandboxed environment. * CORDA-3174: Extend serialisation to include InputStream and OpaqueBytesSubSequence. (#60) * Update DJVM Example project for serialisation. * Add serializers for InputStream and OpaqueBytesSubSequence. * Support ZIP Inflater and CRC32 inside the sandbox. * Allow the DJVM to wrap java.io.InputStream as sandbox.java.io.InputStream. * Configure tests also to preserve @DeprecatedConstructorForDeserialization. * CORDA-3174: Implement Corda serialization modules. (#59) * Create DJVM serialization modules. * Create test cases for Array<T>, List<T> and List<Array<T>>. * Refactor SandboxPrimiveSerializer for all primitive types. * Implement SandboxCollectionSerializer to support Collection types. * Implement SandboxMapSerializer to support Map types. * Attempt to fix infinite loop when computing Collection and Map fingerprints. * Apply special handling when deserialising sandbox.java.lang.Character. * Remap Java primitive types to sandbox Java object types to deter evolution. * Use Class.getPackage().getName() to determine sandbox package name. * Implement SandboxEnumSerializer to support Enum types. * Implement SandboxPublicKeySerializer to support Java security keys. * Add serialization projects to the composite example project. * Implement serializers for BigInteger, BigDecimal, Currency and StringBuffer. * Test that deserialising does not instantiate the untrusted user classes. * Implement serializers for java.time.* types. * Add serialiser for BitSet - currently disabled until BitSet itself is supported. * Add serialisers for EnumSet and Class. * Include support for EnumMap in the SandboxMapSerializer. * Ensure the DJVM Example project's tests preserve @CordaSerializable. * Add support for UUID as a primitive type. * Use common abortReadOnly() method for declaring serialization as unsupported. * Streamline the API for deserialising into the sandbox. * Add preliminary support for deserialising X.509 certificates. * Implement serializer for java.util.Optional. * Refactor configuration of the sandbox serialization scheme. * Add tests for deserialising arrays of basic types. * Include method annotations in annotation stitching. This ensures that `@ConstructorForDeserialization` is not dropped. * Enable test for SandboxBitSetSerializer. * Enable tests for X.509 serializers. * Implement serializers for ProtonJ primitive types. * Serialize java.util.Date as a primitive type. * Add the bintray Gradle plugin to the serialisation modules. * Do not publish serialisation modules - they will become part of Corda itself. * CORDA-2876: Only apply DJVM sources to Node Driver when devMode=true. * Resolve DeteKT warnings. * Require Node's JVM to set -Dnet.corda.djvm=true in order to enable DJVM. * Enable DJVM for DemoBench nodes. * Disable Quasar instrumentation verification for DemoBench nodes. * Upgrade to DJVM 1.0-RC01. * Try to modify DriverParameters in a more "ABI friendly" way. * Refactor and simplify sandbox deserialisation of primitive objects. * Review fixes. * Update EvolutionSerializerFactory to handle sandboxed primitive boxed types.
2019-11-05 13:44:18 +00:00
)
excludePackages.addAll(
"antlr**",
"com.codahale**",
"com.fasterxml.**",
"com.github.benmanes.caffeine.**",
"com.google.**",
"com.lmax.**",
"com.zaxxer.**",
CORDA-2876: Integrate the DJVM with the Corda Node. (#5633) * * CORDA-2876: Migrate DJVM serialization modules into Corda. * Pre-generate Corda classes for DJVM sandbox when node boots in production mode. * Ensure that all DJVM test contract CorDapps are signed. * Test examining attachments within DJVM sandbox. * Test Contract.verify() using cryptographic verify function. * Add test cases for more non-determinism in Contract.verify(). * Update node-driver to support testing nodes with DJVM support. * Modify Node to allow alternative DJVM configurations for testing. * Refactor DeterministicVerifierFactoryService for default use-case. * Small whitespace and code-style refactors. * Create and activate a DJVM execution profile for the Node. * Revert making Verifier implement AutoCloseable. * Allow the node to cache sandboxed Corda byte-code for reuse. * Use updated Quasar agent that knows not to touch DJVM classloaders. * Fix Quasar's package exclusions globs for DJVM. * Deserialise LedgerTransaction into the sandbox for Contract.verify(). * Add the DJVM's serialisation modules to the Corda node. * Update the node for the latest DJVM API, and preserve the ConstructorForDeserialization annotation on user contract classes. * Add corda-dev to repositories while DJVM is SNAPSHOT. * Migrate DJVM specialisation into AbstractNode's ServiceHubInternalImpl. * Exclude sandbox.** and shaded djvm.** classes from Quasar agent. * Add the corda-dev repository to :node for the deterministic runtime. * Turn Verifier into an abstract base class that is specialised by BasicVerifier and DeterministicVerifier. * Add the Corda deterministic libraries to the Node, and split the DJVM sandbox across two SandboxClassLoader instances. * Add DJVM to contract verification path inside Corda Node. * Minor lambda simplifications and removing unused import. * CORDA-2871: Remove @CordaSerializable from LedgerTransaction. * CORDA-2871: Add a callback to ServicesForResolution to allow the Node to modify a LedgerTransaction object. * CORDA-2871: Refactor the contract verification code into a separate class, and allow LedgerTransaction to choose different Verifier objects. * Update DJVM to use Corda 4.4-SNAPSHOT. (#95) * CORDA-3330: Allow DJVM to preload / pregenerate classes from selected jars. (#92) * Add support for SourceClassLoader.getResources() to DJVM. * Allow a SandboxConfiguration to preload sandbox byte-code for all classes inside jars containing META-INF/DJVM-preload. * CORDA-3309: Remove explicit try-catch in favour of UncaughtExceptionHandler. (#91) * CORDA-3309: Install UncaughtExceptionHandler for DJVM tasks. (#88) * Fix tests broken by Windows line endings. (#82) * CORDA-3292: Reimplement ExecutionProfile as a data class. (#80) * CORDA-2877: Refactor how we create child SandboxConfiguration objects. (#76) * CORDA-2877: Load bytecode from a persistent cache to prevent repeated rewriting. (#75) * Refactor byte-code cache to SandboxConfiguration instead of AnalysisConfiguration. We cannot "mix and match" byte-code generated by different sets of rules. * CORDA-3137: Enhance annotation handling so that we can allow some annotations to be mapped into the sandbox without also needing to be stitched. (#72) * CORDA-2871: Minor cosmetic fixes. (#69) * CORDA-3218: Align DJVM with internal Corda Serialisation API. (#68) * Ensure we get the latest SNAPSHOT of the serialisation code. * CORDA-2871: Refactor SourceClassLoader to define source classes. (#66) * Rewrite SourceClassLoader to support parent/child relationships. * Revert catching TypNotPresebtException - it was a symptom of a bigger problem. * Remove AutoCloseable from AnalysisConfiguration and SourceClassLoader. * SourceClassLoader.getResource() must delegate to its parent first. * CORDA-2871: Ensure ClassLoader.loadClass() throws ClassNotFoundException for all cases where the class cannot be found. (#64) * CORDA-2871: Modify sandbox tasks to implement both java.Function and sandbox.Function (#62) * Make TaskExecutors implement BiFunction to make them composable. * Create ImportTask to wrap a java.Function inside a sandbox.Function. * Add createExecutor() and createRawExecutor() APIs to SandboxClassLoader. * Update serialization to use SandboxClassLoader.toSandboxClass(). * Remove a layer of lambdas from the serialisation code. * Update SandboxExecutor and SandboxRawExecutor. * Rename Executor to TaskFactory. * Rename dangling executor -> taskFactory. * CORDA-2871: Sanity fixes! (#63) * Improve message for SandboxClassLoadingException. * Fix serialisation API for using sandboxed environment. * CORDA-3174: Extend serialisation to include InputStream and OpaqueBytesSubSequence. (#60) * Update DJVM Example project for serialisation. * Add serializers for InputStream and OpaqueBytesSubSequence. * Support ZIP Inflater and CRC32 inside the sandbox. * Allow the DJVM to wrap java.io.InputStream as sandbox.java.io.InputStream. * Configure tests also to preserve @DeprecatedConstructorForDeserialization. * CORDA-3174: Implement Corda serialization modules. (#59) * Create DJVM serialization modules. * Create test cases for Array<T>, List<T> and List<Array<T>>. * Refactor SandboxPrimiveSerializer for all primitive types. * Implement SandboxCollectionSerializer to support Collection types. * Implement SandboxMapSerializer to support Map types. * Attempt to fix infinite loop when computing Collection and Map fingerprints. * Apply special handling when deserialising sandbox.java.lang.Character. * Remap Java primitive types to sandbox Java object types to deter evolution. * Use Class.getPackage().getName() to determine sandbox package name. * Implement SandboxEnumSerializer to support Enum types. * Implement SandboxPublicKeySerializer to support Java security keys. * Add serialization projects to the composite example project. * Implement serializers for BigInteger, BigDecimal, Currency and StringBuffer. * Test that deserialising does not instantiate the untrusted user classes. * Implement serializers for java.time.* types. * Add serialiser for BitSet - currently disabled until BitSet itself is supported. * Add serialisers for EnumSet and Class. * Include support for EnumMap in the SandboxMapSerializer. * Ensure the DJVM Example project's tests preserve @CordaSerializable. * Add support for UUID as a primitive type. * Use common abortReadOnly() method for declaring serialization as unsupported. * Streamline the API for deserialising into the sandbox. * Add preliminary support for deserialising X.509 certificates. * Implement serializer for java.util.Optional. * Refactor configuration of the sandbox serialization scheme. * Add tests for deserialising arrays of basic types. * Include method annotations in annotation stitching. This ensures that `@ConstructorForDeserialization` is not dropped. * Enable test for SandboxBitSetSerializer. * Enable tests for X.509 serializers. * Implement serializers for ProtonJ primitive types. * Serialize java.util.Date as a primitive type. * Add the bintray Gradle plugin to the serialisation modules. * Do not publish serialisation modules - they will become part of Corda itself. * CORDA-2876: Only apply DJVM sources to Node Driver when devMode=true. * Resolve DeteKT warnings. * Require Node's JVM to set -Dnet.corda.djvm=true in order to enable DJVM. * Enable DJVM for DemoBench nodes. * Disable Quasar instrumentation verification for DemoBench nodes. * Upgrade to DJVM 1.0-RC01. * Try to modify DriverParameters in a more "ABI friendly" way. * Refactor and simplify sandbox deserialisation of primitive objects. * Review fixes. * Update EvolutionSerializerFactory to handle sandboxed primitive boxed types.
2019-11-05 13:44:18 +00:00
"djvm**",
"net.bytebuddy**",
"io.github.classgraph**",
"io.netty*",
"liquibase**",
CORDA-2876: Integrate the DJVM with the Corda Node. (#5633) * * CORDA-2876: Migrate DJVM serialization modules into Corda. * Pre-generate Corda classes for DJVM sandbox when node boots in production mode. * Ensure that all DJVM test contract CorDapps are signed. * Test examining attachments within DJVM sandbox. * Test Contract.verify() using cryptographic verify function. * Add test cases for more non-determinism in Contract.verify(). * Update node-driver to support testing nodes with DJVM support. * Modify Node to allow alternative DJVM configurations for testing. * Refactor DeterministicVerifierFactoryService for default use-case. * Small whitespace and code-style refactors. * Create and activate a DJVM execution profile for the Node. * Revert making Verifier implement AutoCloseable. * Allow the node to cache sandboxed Corda byte-code for reuse. * Use updated Quasar agent that knows not to touch DJVM classloaders. * Fix Quasar's package exclusions globs for DJVM. * Deserialise LedgerTransaction into the sandbox for Contract.verify(). * Add the DJVM's serialisation modules to the Corda node. * Update the node for the latest DJVM API, and preserve the ConstructorForDeserialization annotation on user contract classes. * Add corda-dev to repositories while DJVM is SNAPSHOT. * Migrate DJVM specialisation into AbstractNode's ServiceHubInternalImpl. * Exclude sandbox.** and shaded djvm.** classes from Quasar agent. * Add the corda-dev repository to :node for the deterministic runtime. * Turn Verifier into an abstract base class that is specialised by BasicVerifier and DeterministicVerifier. * Add the Corda deterministic libraries to the Node, and split the DJVM sandbox across two SandboxClassLoader instances. * Add DJVM to contract verification path inside Corda Node. * Minor lambda simplifications and removing unused import. * CORDA-2871: Remove @CordaSerializable from LedgerTransaction. * CORDA-2871: Add a callback to ServicesForResolution to allow the Node to modify a LedgerTransaction object. * CORDA-2871: Refactor the contract verification code into a separate class, and allow LedgerTransaction to choose different Verifier objects. * Update DJVM to use Corda 4.4-SNAPSHOT. (#95) * CORDA-3330: Allow DJVM to preload / pregenerate classes from selected jars. (#92) * Add support for SourceClassLoader.getResources() to DJVM. * Allow a SandboxConfiguration to preload sandbox byte-code for all classes inside jars containing META-INF/DJVM-preload. * CORDA-3309: Remove explicit try-catch in favour of UncaughtExceptionHandler. (#91) * CORDA-3309: Install UncaughtExceptionHandler for DJVM tasks. (#88) * Fix tests broken by Windows line endings. (#82) * CORDA-3292: Reimplement ExecutionProfile as a data class. (#80) * CORDA-2877: Refactor how we create child SandboxConfiguration objects. (#76) * CORDA-2877: Load bytecode from a persistent cache to prevent repeated rewriting. (#75) * Refactor byte-code cache to SandboxConfiguration instead of AnalysisConfiguration. We cannot "mix and match" byte-code generated by different sets of rules. * CORDA-3137: Enhance annotation handling so that we can allow some annotations to be mapped into the sandbox without also needing to be stitched. (#72) * CORDA-2871: Minor cosmetic fixes. (#69) * CORDA-3218: Align DJVM with internal Corda Serialisation API. (#68) * Ensure we get the latest SNAPSHOT of the serialisation code. * CORDA-2871: Refactor SourceClassLoader to define source classes. (#66) * Rewrite SourceClassLoader to support parent/child relationships. * Revert catching TypNotPresebtException - it was a symptom of a bigger problem. * Remove AutoCloseable from AnalysisConfiguration and SourceClassLoader. * SourceClassLoader.getResource() must delegate to its parent first. * CORDA-2871: Ensure ClassLoader.loadClass() throws ClassNotFoundException for all cases where the class cannot be found. (#64) * CORDA-2871: Modify sandbox tasks to implement both java.Function and sandbox.Function (#62) * Make TaskExecutors implement BiFunction to make them composable. * Create ImportTask to wrap a java.Function inside a sandbox.Function. * Add createExecutor() and createRawExecutor() APIs to SandboxClassLoader. * Update serialization to use SandboxClassLoader.toSandboxClass(). * Remove a layer of lambdas from the serialisation code. * Update SandboxExecutor and SandboxRawExecutor. * Rename Executor to TaskFactory. * Rename dangling executor -> taskFactory. * CORDA-2871: Sanity fixes! (#63) * Improve message for SandboxClassLoadingException. * Fix serialisation API for using sandboxed environment. * CORDA-3174: Extend serialisation to include InputStream and OpaqueBytesSubSequence. (#60) * Update DJVM Example project for serialisation. * Add serializers for InputStream and OpaqueBytesSubSequence. * Support ZIP Inflater and CRC32 inside the sandbox. * Allow the DJVM to wrap java.io.InputStream as sandbox.java.io.InputStream. * Configure tests also to preserve @DeprecatedConstructorForDeserialization. * CORDA-3174: Implement Corda serialization modules. (#59) * Create DJVM serialization modules. * Create test cases for Array<T>, List<T> and List<Array<T>>. * Refactor SandboxPrimiveSerializer for all primitive types. * Implement SandboxCollectionSerializer to support Collection types. * Implement SandboxMapSerializer to support Map types. * Attempt to fix infinite loop when computing Collection and Map fingerprints. * Apply special handling when deserialising sandbox.java.lang.Character. * Remap Java primitive types to sandbox Java object types to deter evolution. * Use Class.getPackage().getName() to determine sandbox package name. * Implement SandboxEnumSerializer to support Enum types. * Implement SandboxPublicKeySerializer to support Java security keys. * Add serialization projects to the composite example project. * Implement serializers for BigInteger, BigDecimal, Currency and StringBuffer. * Test that deserialising does not instantiate the untrusted user classes. * Implement serializers for java.time.* types. * Add serialiser for BitSet - currently disabled until BitSet itself is supported. * Add serialisers for EnumSet and Class. * Include support for EnumMap in the SandboxMapSerializer. * Ensure the DJVM Example project's tests preserve @CordaSerializable. * Add support for UUID as a primitive type. * Use common abortReadOnly() method for declaring serialization as unsupported. * Streamline the API for deserialising into the sandbox. * Add preliminary support for deserialising X.509 certificates. * Implement serializer for java.util.Optional. * Refactor configuration of the sandbox serialization scheme. * Add tests for deserialising arrays of basic types. * Include method annotations in annotation stitching. This ensures that `@ConstructorForDeserialization` is not dropped. * Enable test for SandboxBitSetSerializer. * Enable tests for X.509 serializers. * Implement serializers for ProtonJ primitive types. * Serialize java.util.Date as a primitive type. * Add the bintray Gradle plugin to the serialisation modules. * Do not publish serialisation modules - they will become part of Corda itself. * CORDA-2876: Only apply DJVM sources to Node Driver when devMode=true. * Resolve DeteKT warnings. * Require Node's JVM to set -Dnet.corda.djvm=true in order to enable DJVM. * Enable DJVM for DemoBench nodes. * Disable Quasar instrumentation verification for DemoBench nodes. * Upgrade to DJVM 1.0-RC01. * Try to modify DriverParameters in a more "ABI friendly" way. * Refactor and simplify sandbox deserialisation of primitive objects. * Review fixes. * Update EvolutionSerializerFactory to handle sandboxed primitive boxed types.
2019-11-05 13:44:18 +00:00
"net.corda.djvm**",
"net.i2p.crypto.**",
"nonapi.io.github.classgraph.**",
"org.apiguardian.**",
"org.bouncycastle**",
"org.codehaus.**",
"org.h2**",
"org.hibernate**",
"org.jboss.**",
"org.objenesis**",
"org.w3c.**",
"org.xml**",
"org.yaml**",
"rx**")
}
jar {
baseName 'corda-node'
exclude 'sandbox/java/**'
exclude 'sandbox/org/**'
exclude 'sandbox/net/corda/core/crypto/SecureHash.class'
exclude 'sandbox/net/corda/core/crypto/SignatureScheme.class'
exclude 'sandbox/net/corda/core/crypto/TransactionSignature.class'
CORDA-2876: Integrate the DJVM with the Corda Node. (#5633) * * CORDA-2876: Migrate DJVM serialization modules into Corda. * Pre-generate Corda classes for DJVM sandbox when node boots in production mode. * Ensure that all DJVM test contract CorDapps are signed. * Test examining attachments within DJVM sandbox. * Test Contract.verify() using cryptographic verify function. * Add test cases for more non-determinism in Contract.verify(). * Update node-driver to support testing nodes with DJVM support. * Modify Node to allow alternative DJVM configurations for testing. * Refactor DeterministicVerifierFactoryService for default use-case. * Small whitespace and code-style refactors. * Create and activate a DJVM execution profile for the Node. * Revert making Verifier implement AutoCloseable. * Allow the node to cache sandboxed Corda byte-code for reuse. * Use updated Quasar agent that knows not to touch DJVM classloaders. * Fix Quasar's package exclusions globs for DJVM. * Deserialise LedgerTransaction into the sandbox for Contract.verify(). * Add the DJVM's serialisation modules to the Corda node. * Update the node for the latest DJVM API, and preserve the ConstructorForDeserialization annotation on user contract classes. * Add corda-dev to repositories while DJVM is SNAPSHOT. * Migrate DJVM specialisation into AbstractNode's ServiceHubInternalImpl. * Exclude sandbox.** and shaded djvm.** classes from Quasar agent. * Add the corda-dev repository to :node for the deterministic runtime. * Turn Verifier into an abstract base class that is specialised by BasicVerifier and DeterministicVerifier. * Add the Corda deterministic libraries to the Node, and split the DJVM sandbox across two SandboxClassLoader instances. * Add DJVM to contract verification path inside Corda Node. * Minor lambda simplifications and removing unused import. * CORDA-2871: Remove @CordaSerializable from LedgerTransaction. * CORDA-2871: Add a callback to ServicesForResolution to allow the Node to modify a LedgerTransaction object. * CORDA-2871: Refactor the contract verification code into a separate class, and allow LedgerTransaction to choose different Verifier objects. * Update DJVM to use Corda 4.4-SNAPSHOT. (#95) * CORDA-3330: Allow DJVM to preload / pregenerate classes from selected jars. (#92) * Add support for SourceClassLoader.getResources() to DJVM. * Allow a SandboxConfiguration to preload sandbox byte-code for all classes inside jars containing META-INF/DJVM-preload. * CORDA-3309: Remove explicit try-catch in favour of UncaughtExceptionHandler. (#91) * CORDA-3309: Install UncaughtExceptionHandler for DJVM tasks. (#88) * Fix tests broken by Windows line endings. (#82) * CORDA-3292: Reimplement ExecutionProfile as a data class. (#80) * CORDA-2877: Refactor how we create child SandboxConfiguration objects. (#76) * CORDA-2877: Load bytecode from a persistent cache to prevent repeated rewriting. (#75) * Refactor byte-code cache to SandboxConfiguration instead of AnalysisConfiguration. We cannot "mix and match" byte-code generated by different sets of rules. * CORDA-3137: Enhance annotation handling so that we can allow some annotations to be mapped into the sandbox without also needing to be stitched. (#72) * CORDA-2871: Minor cosmetic fixes. (#69) * CORDA-3218: Align DJVM with internal Corda Serialisation API. (#68) * Ensure we get the latest SNAPSHOT of the serialisation code. * CORDA-2871: Refactor SourceClassLoader to define source classes. (#66) * Rewrite SourceClassLoader to support parent/child relationships. * Revert catching TypNotPresebtException - it was a symptom of a bigger problem. * Remove AutoCloseable from AnalysisConfiguration and SourceClassLoader. * SourceClassLoader.getResource() must delegate to its parent first. * CORDA-2871: Ensure ClassLoader.loadClass() throws ClassNotFoundException for all cases where the class cannot be found. (#64) * CORDA-2871: Modify sandbox tasks to implement both java.Function and sandbox.Function (#62) * Make TaskExecutors implement BiFunction to make them composable. * Create ImportTask to wrap a java.Function inside a sandbox.Function. * Add createExecutor() and createRawExecutor() APIs to SandboxClassLoader. * Update serialization to use SandboxClassLoader.toSandboxClass(). * Remove a layer of lambdas from the serialisation code. * Update SandboxExecutor and SandboxRawExecutor. * Rename Executor to TaskFactory. * Rename dangling executor -> taskFactory. * CORDA-2871: Sanity fixes! (#63) * Improve message for SandboxClassLoadingException. * Fix serialisation API for using sandboxed environment. * CORDA-3174: Extend serialisation to include InputStream and OpaqueBytesSubSequence. (#60) * Update DJVM Example project for serialisation. * Add serializers for InputStream and OpaqueBytesSubSequence. * Support ZIP Inflater and CRC32 inside the sandbox. * Allow the DJVM to wrap java.io.InputStream as sandbox.java.io.InputStream. * Configure tests also to preserve @DeprecatedConstructorForDeserialization. * CORDA-3174: Implement Corda serialization modules. (#59) * Create DJVM serialization modules. * Create test cases for Array<T>, List<T> and List<Array<T>>. * Refactor SandboxPrimiveSerializer for all primitive types. * Implement SandboxCollectionSerializer to support Collection types. * Implement SandboxMapSerializer to support Map types. * Attempt to fix infinite loop when computing Collection and Map fingerprints. * Apply special handling when deserialising sandbox.java.lang.Character. * Remap Java primitive types to sandbox Java object types to deter evolution. * Use Class.getPackage().getName() to determine sandbox package name. * Implement SandboxEnumSerializer to support Enum types. * Implement SandboxPublicKeySerializer to support Java security keys. * Add serialization projects to the composite example project. * Implement serializers for BigInteger, BigDecimal, Currency and StringBuffer. * Test that deserialising does not instantiate the untrusted user classes. * Implement serializers for java.time.* types. * Add serialiser for BitSet - currently disabled until BitSet itself is supported. * Add serialisers for EnumSet and Class. * Include support for EnumMap in the SandboxMapSerializer. * Ensure the DJVM Example project's tests preserve @CordaSerializable. * Add support for UUID as a primitive type. * Use common abortReadOnly() method for declaring serialization as unsupported. * Streamline the API for deserialising into the sandbox. * Add preliminary support for deserialising X.509 certificates. * Implement serializer for java.util.Optional. * Refactor configuration of the sandbox serialization scheme. * Add tests for deserialising arrays of basic types. * Include method annotations in annotation stitching. This ensures that `@ConstructorForDeserialization` is not dropped. * Enable test for SandboxBitSetSerializer. * Enable tests for X.509 serializers. * Implement serializers for ProtonJ primitive types. * Serialize java.util.Date as a primitive type. * Add the bintray Gradle plugin to the serialisation modules. * Do not publish serialisation modules - they will become part of Corda itself. * CORDA-2876: Only apply DJVM sources to Node Driver when devMode=true. * Resolve DeteKT warnings. * Require Node's JVM to set -Dnet.corda.djvm=true in order to enable DJVM. * Enable DJVM for DemoBench nodes. * Disable Quasar instrumentation verification for DemoBench nodes. * Upgrade to DJVM 1.0-RC01. * Try to modify DriverParameters in a more "ABI friendly" way. * Refactor and simplify sandbox deserialisation of primitive objects. * Review fixes. * Update EvolutionSerializerFactory to handle sandboxed primitive boxed types.
2019-11-05 13:44:18 +00:00
manifest {
attributes('Corda-Deterministic-Runtime': configurations.jdkRt.singleFile.name)
attributes('Corda-Deterministic-Classpath': configurations.deterministic.collect { it.name }.join(' '))
}
}
publish {
name jar.baseName
}
WIP Kubenetes parallel build (#5396) * Split integration tests * add simple example of printing all methods annotated with @Test * add docker plugin to root project remove docker plugin from child projects add Dockerfile for image to use when testing add task to build testing image to root project * add comment describing proposed testing workflow * simple attempt at running tests in docker container * add my first k8s interaction script * add fabric8 as dependnency to buildSrc * before adding classpath * collect reports from containers and run through testReports * re-enable kubes backed testing * for each project 1. add a list tests task 2. use this list tests task to modify the included tests 3. add a parallel version of the test task * tweak logic for downloading test report XML files * use output of parallel testing tasks in report tasks to determine build resultCode * prepare for jenkins test * prepare for jenkins test * make docker reg password system property * add logging to print out docker reg creds * enable docker build * fix gradle build file * gather xml files into root project * change log level for gradle modification * stop printing gradle docker push passwd * tidy up report generation * fix compilation errors * split signature constraints test into two * change Sig constraint tests type hierarchy * tidy up build.gradle * try method based test includes * add unit test for test listing * fix bug with test slicing * stop filtering ignored tests to make the numbers match existing runs * change log level to ensure print out * move all plugin logic to buildSrc files * tidy up test modification add comments to explain what DistributedTesting plugin does * move new plugins into properly named packages * tidy up runConfigs * fix compile errors due to merge with slow-integration-test work * add system parameter to enable / disable build modification * add -Dkubenetise to build command * address review comments * type safe declaration of parameters in KubesTest
2019-09-03 15:40:08 +00:00
tasks.named('test', Test) {
WIP Kubenetes parallel build (#5396) * Split integration tests * add simple example of printing all methods annotated with @Test * add docker plugin to root project remove docker plugin from child projects add Dockerfile for image to use when testing add task to build testing image to root project * add comment describing proposed testing workflow * simple attempt at running tests in docker container * add my first k8s interaction script * add fabric8 as dependnency to buildSrc * before adding classpath * collect reports from containers and run through testReports * re-enable kubes backed testing * for each project 1. add a list tests task 2. use this list tests task to modify the included tests 3. add a parallel version of the test task * tweak logic for downloading test report XML files * use output of parallel testing tasks in report tasks to determine build resultCode * prepare for jenkins test * prepare for jenkins test * make docker reg password system property * add logging to print out docker reg creds * enable docker build * fix gradle build file * gather xml files into root project * change log level for gradle modification * stop printing gradle docker push passwd * tidy up report generation * fix compilation errors * split signature constraints test into two * change Sig constraint tests type hierarchy * tidy up build.gradle * try method based test includes * add unit test for test listing * fix bug with test slicing * stop filtering ignored tests to make the numbers match existing runs * change log level to ensure print out * move all plugin logic to buildSrc files * tidy up test modification add comments to explain what DistributedTesting plugin does * move new plugins into properly named packages * tidy up runConfigs * fix compile errors due to merge with slow-integration-test work * add system parameter to enable / disable build modification * add -Dkubenetise to build command * address review comments * type safe declaration of parameters in KubesTest
2019-09-03 15:40:08 +00:00
maxHeapSize = "3g"
maxParallelForks = (System.env.CORDA_NODE_TESTING_FORKS == null) ? 1 : "$System.env.CORDA_NODE_TESTING_FORKS".toInteger()
CORDA-2876: Integrate the DJVM with the Corda Node. (#5633) * * CORDA-2876: Migrate DJVM serialization modules into Corda. * Pre-generate Corda classes for DJVM sandbox when node boots in production mode. * Ensure that all DJVM test contract CorDapps are signed. * Test examining attachments within DJVM sandbox. * Test Contract.verify() using cryptographic verify function. * Add test cases for more non-determinism in Contract.verify(). * Update node-driver to support testing nodes with DJVM support. * Modify Node to allow alternative DJVM configurations for testing. * Refactor DeterministicVerifierFactoryService for default use-case. * Small whitespace and code-style refactors. * Create and activate a DJVM execution profile for the Node. * Revert making Verifier implement AutoCloseable. * Allow the node to cache sandboxed Corda byte-code for reuse. * Use updated Quasar agent that knows not to touch DJVM classloaders. * Fix Quasar's package exclusions globs for DJVM. * Deserialise LedgerTransaction into the sandbox for Contract.verify(). * Add the DJVM's serialisation modules to the Corda node. * Update the node for the latest DJVM API, and preserve the ConstructorForDeserialization annotation on user contract classes. * Add corda-dev to repositories while DJVM is SNAPSHOT. * Migrate DJVM specialisation into AbstractNode's ServiceHubInternalImpl. * Exclude sandbox.** and shaded djvm.** classes from Quasar agent. * Add the corda-dev repository to :node for the deterministic runtime. * Turn Verifier into an abstract base class that is specialised by BasicVerifier and DeterministicVerifier. * Add the Corda deterministic libraries to the Node, and split the DJVM sandbox across two SandboxClassLoader instances. * Add DJVM to contract verification path inside Corda Node. * Minor lambda simplifications and removing unused import. * CORDA-2871: Remove @CordaSerializable from LedgerTransaction. * CORDA-2871: Add a callback to ServicesForResolution to allow the Node to modify a LedgerTransaction object. * CORDA-2871: Refactor the contract verification code into a separate class, and allow LedgerTransaction to choose different Verifier objects. * Update DJVM to use Corda 4.4-SNAPSHOT. (#95) * CORDA-3330: Allow DJVM to preload / pregenerate classes from selected jars. (#92) * Add support for SourceClassLoader.getResources() to DJVM. * Allow a SandboxConfiguration to preload sandbox byte-code for all classes inside jars containing META-INF/DJVM-preload. * CORDA-3309: Remove explicit try-catch in favour of UncaughtExceptionHandler. (#91) * CORDA-3309: Install UncaughtExceptionHandler for DJVM tasks. (#88) * Fix tests broken by Windows line endings. (#82) * CORDA-3292: Reimplement ExecutionProfile as a data class. (#80) * CORDA-2877: Refactor how we create child SandboxConfiguration objects. (#76) * CORDA-2877: Load bytecode from a persistent cache to prevent repeated rewriting. (#75) * Refactor byte-code cache to SandboxConfiguration instead of AnalysisConfiguration. We cannot "mix and match" byte-code generated by different sets of rules. * CORDA-3137: Enhance annotation handling so that we can allow some annotations to be mapped into the sandbox without also needing to be stitched. (#72) * CORDA-2871: Minor cosmetic fixes. (#69) * CORDA-3218: Align DJVM with internal Corda Serialisation API. (#68) * Ensure we get the latest SNAPSHOT of the serialisation code. * CORDA-2871: Refactor SourceClassLoader to define source classes. (#66) * Rewrite SourceClassLoader to support parent/child relationships. * Revert catching TypNotPresebtException - it was a symptom of a bigger problem. * Remove AutoCloseable from AnalysisConfiguration and SourceClassLoader. * SourceClassLoader.getResource() must delegate to its parent first. * CORDA-2871: Ensure ClassLoader.loadClass() throws ClassNotFoundException for all cases where the class cannot be found. (#64) * CORDA-2871: Modify sandbox tasks to implement both java.Function and sandbox.Function (#62) * Make TaskExecutors implement BiFunction to make them composable. * Create ImportTask to wrap a java.Function inside a sandbox.Function. * Add createExecutor() and createRawExecutor() APIs to SandboxClassLoader. * Update serialization to use SandboxClassLoader.toSandboxClass(). * Remove a layer of lambdas from the serialisation code. * Update SandboxExecutor and SandboxRawExecutor. * Rename Executor to TaskFactory. * Rename dangling executor -> taskFactory. * CORDA-2871: Sanity fixes! (#63) * Improve message for SandboxClassLoadingException. * Fix serialisation API for using sandboxed environment. * CORDA-3174: Extend serialisation to include InputStream and OpaqueBytesSubSequence. (#60) * Update DJVM Example project for serialisation. * Add serializers for InputStream and OpaqueBytesSubSequence. * Support ZIP Inflater and CRC32 inside the sandbox. * Allow the DJVM to wrap java.io.InputStream as sandbox.java.io.InputStream. * Configure tests also to preserve @DeprecatedConstructorForDeserialization. * CORDA-3174: Implement Corda serialization modules. (#59) * Create DJVM serialization modules. * Create test cases for Array<T>, List<T> and List<Array<T>>. * Refactor SandboxPrimiveSerializer for all primitive types. * Implement SandboxCollectionSerializer to support Collection types. * Implement SandboxMapSerializer to support Map types. * Attempt to fix infinite loop when computing Collection and Map fingerprints. * Apply special handling when deserialising sandbox.java.lang.Character. * Remap Java primitive types to sandbox Java object types to deter evolution. * Use Class.getPackage().getName() to determine sandbox package name. * Implement SandboxEnumSerializer to support Enum types. * Implement SandboxPublicKeySerializer to support Java security keys. * Add serialization projects to the composite example project. * Implement serializers for BigInteger, BigDecimal, Currency and StringBuffer. * Test that deserialising does not instantiate the untrusted user classes. * Implement serializers for java.time.* types. * Add serialiser for BitSet - currently disabled until BitSet itself is supported. * Add serialisers for EnumSet and Class. * Include support for EnumMap in the SandboxMapSerializer. * Ensure the DJVM Example project's tests preserve @CordaSerializable. * Add support for UUID as a primitive type. * Use common abortReadOnly() method for declaring serialization as unsupported. * Streamline the API for deserialising into the sandbox. * Add preliminary support for deserialising X.509 certificates. * Implement serializer for java.util.Optional. * Refactor configuration of the sandbox serialization scheme. * Add tests for deserialising arrays of basic types. * Include method annotations in annotation stitching. This ensures that `@ConstructorForDeserialization` is not dropped. * Enable test for SandboxBitSetSerializer. * Enable tests for X.509 serializers. * Implement serializers for ProtonJ primitive types. * Serialize java.util.Date as a primitive type. * Add the bintray Gradle plugin to the serialisation modules. * Do not publish serialisation modules - they will become part of Corda itself. * CORDA-2876: Only apply DJVM sources to Node Driver when devMode=true. * Resolve DeteKT warnings. * Require Node's JVM to set -Dnet.corda.djvm=true in order to enable DJVM. * Enable DJVM for DemoBench nodes. * Disable Quasar instrumentation verification for DemoBench nodes. * Upgrade to DJVM 1.0-RC01. * Try to modify DriverParameters in a more "ABI friendly" way. * Refactor and simplify sandbox deserialisation of primitive objects. * Review fixes. * Update EvolutionSerializerFactory to handle sandboxed primitive boxed types.
2019-11-05 13:44:18 +00:00
}