Commit Graph

133 Commits

Author SHA1 Message Date
Arshad Mahmood
1b4189b2b3 Added explicit publishing configuration for projects bundled as jars, this change was required when upgrading to kotlin 1.9.0 2023-11-08 10:48:10 +00:00
Arshad Mahmood
6dd33fb8f7 Upgrade to gradle 7.6, kotlin 1.8 and jdk 17
Major changes due to JDK 17:
1. JDK17 JCE Provider now has built-in support for eddsas, corda uses
   the bouncycastle (i2p) implementation. This PR removes the conflicting
   algorithms from the built-in JCE provider.

2. JavaScript scripting has been removed from the JDK, the corda log4j config was using
   scripting to conditionally output additional diagnostic info if the MDC
   was populated. This PR has removed the scripting.

3. The artifactory plug-ins used are now deprecated, this PR has removed them
   and uses the same code as Corda 5 for publishing to artifactory.

4. Javadoc generation has been modified to use the latest dokka plug-ins.

5. Gradle 7.6 has implemented an incredibly annoying change where transitive
   dependencies are not put on the compile classpath, so that they have to be
   explicitly added as dependencies to projects.

6. Mockito has been updated, which sadly meant that quite a few source files
   have to changes to use the new (org.mockito.kotlin) package name. This makes
   this PR appear much larger than it is.

7. A number of tests have been marked as ignored to get a green, broadly they fall
   into 3 classes.

   The first is related to crypto keypair tests, it appears some logic
   in the JDK prefers to use the SunJCE implementation and we prefer to use
   bouncycastle. I believe this issue can be fixed with better test setup.

   The second group is related to our use of a method called "uncheckedCast(..)",
   the purpose of this method was to get rid of the annoying unchecked cast compiler
   warning that would otherwise exist. It looks like the Kotlin 1.9 compiler type
   inference differs and at runtime sometimes the type it infers is "Void" which causes
   an exception at runtime. The simplest solution is to use an explicit cast instead of
   unchecked cast, Corda 5 have removed unchecked cast from their codebase.

   The third class are a number of ActiveMQ tests which appear to have a memory leak somewhere.
2023-11-06 10:24:17 +00:00
Adel El-Beik
4594c76259 ENT-6637: Targeted exclude of the jgroups dependency. 2022-03-04 11:52:14 +00:00
Stefano Franz
b23af5f0d2
add timeouts to all tests (#5875) 2020-02-11 10:14:05 +00:00
Ryan Fowler
b0cc5f5ca3 CORDA-3332: Add rpc reconnection to node explorer. 2019-10-18 16:25:49 +01:00
Ryan Fowler
6ca4b589e2 CORDA-3091: Move executor thread management into CordaRPCConnection (#5491) 2019-09-26 17:48:07 +01:00
josecoll
3fafbe551c
CORDA-2050 Upgrade Corda to Java 11 (compatibility mode) (#5356)
Upgrade Corda to run with Java 11 (compatibility mode) - see https://github.com/corda/corda/pull/5356
2019-09-18 10:26:26 +01:00
Ryan Fowler
75e66f9db9 CORDA-3141: Add GracefulReconnect callbacks which allow logic to be performed when RPC disconnects unexpectedly (#5430)
Also removed potential for growing stack trace on reconnects.
2019-09-17 10:00:27 +01:00
Zoltan Kiss
f171de7b69 TM-23 Fail build on compiler warnings (#5453)
* java compile respects compilation.allWarningsAsErrors

* suppress or cleanup warnings

* suppress warning

* use non-deprecated kotlin dependency

* rename property

* handle property existence check

* Deal with warnings
2019-09-11 16:34:51 +01:00
Dimos Raptis
8962d930d4 [CORDA-2923] - Make the RPC client reconnect with gracefulReconnect param (#5244)
When set to true the RPC client will:

* automatically reconnect when the connection is broken
* simple RPC calls will block until connection is established
* Observables returned from RPC will automatically resubscribe on reconnect so the client continues to receive events. This doesn't guarantee that events will not be lost during the reconnect.
2019-07-16 11:29:21 +01:00
josecoll
0263650a5f
Revert "Merge pull request #5145 from corda/jdk11-migration-gradle5-upgrade" (#5146)
This reverts commit f46377556c, reversing
changes made to ba675e73b9.
2019-05-20 16:16:49 +01:00
josecoll
38e84d46b4 Include JavaFX plugin (specify dependent JavaFX modules) and apply changes to relevant modules (explorer, demobench, client/jfx). 2019-05-20 15:08:27 +01:00
Chris Rankin
b9f7c1a08a CORDA-2893, ENT-3422: Tweak JUnit 5 configurations to keep vintage engine off compile classpaths. (#5138)
* Tweak JUnit 5 configurations to keep vintage engine off compile classpaths.

* Configure Gradle tests to use JUnit 5.
2019-05-20 11:57:56 +01:00
Dominic Fox
0b63157a4b ENT-3422 Add JUnit 5 dependencies to all projects (#5084)
* ENT-3422 Add JUnit 5 dependencies to all projects

* Remove explicit junit 4 imports where not needed

* Minor PR fixes

* Limit import scope
2019-05-15 16:40:12 +01:00
Tudor Malene
4a1f149b49 CORDA-2858: Wire-up Corda components with better RPC reconnect logic (#4933)
Implemented the ReconnectingRPC into the WebServer, Standalone Shell, Explorer and BankOfCordaClientApi
2019-04-15 11:26:53 +01:00
Chris Rankin
fae74eecde CORDA-2694: Prevent Node Explorer from crashing should it receive unknown transaction objects. (#4842)
* CORDA-2694: Prevent Node Explorer from crashing should it receive unknown transaction objects.
Also ensure that LazyMappedList can only handle TransactionDeserialisationExceptions.

* CORDA-2694: Add unit tests for eager LazyMappedList behaviour.

* CORDA-2694: Hide LazyMappedList from the client:jfx module.

* CORDA-2694: Create an unknown transaction state that has the correct notary.
2019-03-05 08:49:23 +00:00
Shams Asari
19325ebcb0
Removed NodeMonitorModelTest (#4643)
It seems outdated, testing things which are covered elsewhere. Also it's unnecessary to have full nodes for testing GUI components.
2019-01-28 10:21:18 +00:00
Roger Willis
0e1c20a883
CORDA-2497 fix (#4630)
CORDA-2497 fix
* Added test to show the fix working.
* Now backwards compatible.
* Refactored out some duped code.
* Added better explanations for what's going on.
* Fixed test which was failing due to the serializationEnvRule problem.
* Addressed Tudor's review comments.
2019-01-24 20:36:33 +00:00
Tudor Malene
24d91c5f89
CORDA-2384 - Fix driver classpath (#4472)
* Fix driver classpath

* Fix tests

* Fix classloader bug.

* Fix tests

* Fix tests

* Fix api

* Disable failing irs test.

* Address code review comments

* Remove @Ignore from test

* Remove @Ignore from tests

* Address code review comments.

* Attempt to fix simm valuation test

* Attempt to fix simm valuation test

* Comment failing functionality.
2019-01-03 20:06:35 +00:00
szymonsztuka
4aaefb4fe9 CORDA-2331 Split Workflow and contracts of Finance App into separate Cordapps (#4422)
* Split Workflow and contracts of Finance App into separate Cordapps, part 1 - content which is different between OS and ENT is still in contract Cordapp.

* Move CashSelection implementations to workflow module.

* Move CashSelection implmentations to workflow module.

* Move finance module to finance-flows, top level finance module is empty.

* Move finance module to finance-flows, top level finance module is empty.

* Updated build comment.

* Revert publication of combined (contracts and flows) corda-finance.jar (to maintain backwards compatibility with 3rd party cordapps dependent on finance)

* Added backwards compatibility clarification comment.

* Re-instate new cordapp metadata.

* Global rename of `finance-flows` to `finance-workflows` to follow adopted naming conventions.

* Addressed final review comments.

* Rename application to "Corda Finance Demo"

* Generation of original corda-finance jar from new sub-modules.

* Fixed and tested demobench with new split finance contract and workflow jars.

* Renamed finance sub-modules to contracts and workflows.

* Remove Michele!!!

* Minor fix to filtering logic.

* Align CorDapp configuration filename with workflows jar.

* Fix breaks caused by finance module naming changes.

* Final alignment between OS/ENT of finance contract code.
2018-12-19 18:02:51 +00:00
Stefano Franz
8f463c46a9 Add message to uses of require(...) (#4192) 2018-11-16 17:13:55 +00:00
Michele Sollecito
dc62b20c5d
[CORDA-1879]: Ensure Node dies on unrecoverable errors. (#4213) 2018-11-12 15:56:04 +00:00
Tudor Malene
391c6bf66f
Feature/corda 1947/add package ownership (#4097)
* Upgrade hibernate and fix tests

CORDA-1947 Address code review changes

CORDA-1947 Address code review changes

(cherry picked from commit ab98c03d1a)

* ENT-2506 Changes signers field type

ENT-2506 Clean up some docs

ENT-2506 Fix tests and api

ENT-2506 Fix compilation error

ENT-2506 Fix compilation error

(cherry picked from commit 32f279a243)

* CORDA-1947 added packageOwnership parameter

CORDA-1947 add signers field to DbAttachment. Add check when importing attachments

CORDA-1947 add signers field to DbAttachment. Add check when importing attachments

CORDA-1947 add tests

CORDA-1947 fix comment

CORDA-1947 Fix test

CORDA-1947 fix serialiser

CORDA-1947 fix tests

CORDA-1947 fix tests

CORDA-1947 fix serialiser

CORDA-1947 Address code review changes

CORDA-1947 Address code review changes

CORDA-1947 Revert test fixes

CORDA-1947 address code review comments

CORDA-1947 move verification logic to LedgerTransaction.verify

CORDA-1947 fix test

CORDA-1947 fix tests

CORDA-1947 fix tests

CORDA-1947 address code review comments

CORDA-1947 address code review comments

(cherry picked from commit 86bc0d9606)

CORDA-1947 fix merge
2018-10-22 15:00:08 +01:00
Rick Parker
55731ef816
ENT-2431 Tidy up buildNamed and CacheFactory 2018-10-18 10:38:43 +01:00
Rick Parker
965f9ce528
ENT-2431 Lay foundations for caching metrics (#3955) 2018-09-24 09:55:56 +01:00
Christian Sailer
bc330bd989
ENT-2414 Named caches (#3848)
* Add named caches and apply to NonInvalidingUnboundCache and all usages.

* Add named caches and apply to NonInvalidingCache and all usages.

* Add named caches and apply to NonInvalidingWeightBasedCache and all usages.

* Move NamedCache to core/internal

* Remove type `NamedCache` and `NamedLoadingCache`

* Suppressed 'name not used' warning, added comment, and fixed generic parameters on the buildNamed functions.

* Use `buildNamed` in all caffeine instances in production code. Not using it for caches that are created in test code.

* Add checks for the cache name

* Formatting

* Minor code review revisions
2018-08-24 17:17:22 +01:00
Shams Asari
244167d3e9
Enabled warnings as errors (#3514) 2018-07-04 17:17:27 +01:00
Chris Rankin
76c114502e
CORDA-1686: Make Node Explorer release its RPC connection on shutdown. (#3457)
* Make Node Explorer release its RPC connection on shutdown.
* Declare Explorer's login() function as tail-recursive.
* Replace lateinit rpcConnection with oridinary var.
* Notify the node when closing an RPC connection gracefully.
2018-06-28 13:33:07 +01:00
Viktor Kolomeyko
21d06a8aa9 ENT-2132 Introduce a boolean flag which controls whether we should re-try RPC connection. (#3433)
In case of initial logon - it will not be re-tried to cater for invalid endpoint and/or credentials.
However, if connection been successfully established once, re-try logic is getting activated.
2018-06-25 14:13:21 +01:00
Tudor Malene
41776ed374
CORDA-1407 Node Explorer - fix total column (#3395) 2018-06-19 09:19:19 +01:00
Florian Friemel
8f4973cd00
[CORDA-1617] Fix explorer login error handling. (#3365)
When specifying incorrect connection details for the nodes (e.g.,
  wrong port), an RPCException would be thrown which was not
  handled correctly, resulting in busy waiting on the UI thread.

  Ideally the login should not block the UI thread anyways, but
  for now this fix is the most pragmatic solution.
2018-06-14 13:09:03 +01:00
Tommy Lillehagen
fe313951ea CORDA-1609 - Don't use reserved keyword as method name
As reported in [CORDA-1609](https://r3-cev.atlassian.net/browse/CORDA-1609),
`CordaRPCClientConfiguration.default` is not accessible from Java since
`default` is a reserved keyword.

As part of the refactor made in #2831, `CordaRPCClientConfiguration` went
from being a data class to an interface with a backing implementation of
type `CordaRPCClientConfigurationImpl`.

This resulted in Java users having to rewrite code that was on the form:

```java
final CordaRPCClient client = new CordaRPCClient(
    nodeAddress, CordaRPCClientConfiguration.DEFAULT
);
```

to something like this:

```java
final CordaRPCClient client = new CordaRPCClient(
    nodeAddress, CordaRPCClientConfiguration.Companion.default()
);
```

However, this does not work. The user would get a compilation error because
`default` is a reserved keyword in Java.

Since `CordaRPCClientConfiguration` has been made an interface, there is no
easy way of introducing a static final field on the interface from Kotlin.

Consequently, I've changed this back to using a `class` with a static field
named `DEFAULT` instead of the static method `default()`.

It should be noted that `default()` / `DEFAULT` is currently only used
internally to pass in default values in `CordaRPCClient.kt` and
`CordaRPCClientUtils.kt`. That said, it is exposed as part of our API
surface and consequently shouldn't be broken.

The latter means that in the above example, the user would actually not
have to provide the parameter at all:

```java
final CordaRPCClient client = new CordaRPCClient(nodeAddress);
```

As can be seen from the definition of `CordaRPCClient`:

```kotlin
class CordaRPCClient private constructor(...) {
    @JvmOverloads
    constructor(
        hostAndPort: NetworkHostAndPort,
        configuration: CordaRPCClientConfiguration = CordaRPCClientConfiguration.DEFAULT
    ) : this(hostAndPort, configuration, null)
```

The mentioned [refactor](7a077e76f0 (diff-0948c125db93a22263eb81eaf3161c17R65))
did not make it into the 3.1 release, so from an API-stability perspective,
this change can be applied without affecting our commitment to a
backwards compatible API..
2018-06-13 15:39:03 +01:00
Shams Asari
d620e71bb6
Replaced all uses of assert with require (#3309)
JVM assertions have to be enabled with the -ea flag so it's possible for these checks to be ignored.
2018-06-06 00:31:41 +01:00
Viktor Kolomeyko
8a5978e881
CORDA-1536: Fix client infinitely re-trying when incorrect endpoint specified. (#3243)
Apparently, if incorrect endpoint provided, ActiveMQNotConnectedException is thrown
which is different to ActiveMQSecurityException. Extend catch block to: ActiveMQException
to cater for all such cases.
2018-05-29 14:05:51 +01:00
Viktor Kolomeyko
215e54f1ab
ENT-1902: If we are already in the JavaFX thread - perform direct invocation without postponing it. (#3177)
Or else if we are operating in JavaFX thread the sequence of invocations will change.
2018-05-18 11:09:02 +01:00
Michele Sollecito
d027b5b8f2
[CORDA-1472]: Crackdown on warnings. (#3136) 2018-05-14 21:15:52 +07:00
Viktor Kolomeyko
15e87050c7
CORDA-1393: Make Explorer GUI recover on RPC connection loss. (#3093)
* CORDA-1393: Install `onError()` handler for folding action
or else `ErrorNotImplementedAction` will be invoked which is never a good thing

* CORDA-1335: Improve exception handling in `cleanUpOnConnectionLoss()`

* CORDA-1335: Try to trick the logic to pretend we are running in HA mode to have a chance of re-connecting.

* CORDA-1416: Make `NodeMonitorModel` code react to proxy changing.

* CORDA-1416: Workaround `CordaRPCOps.equals()` calls when listener dispatching change.

* CORDA-1416: Increase re-try interval to allow enough time for server to come back online.

* CORDA-1355: Properly close RPC connection we are moving away from.

* CORDA-1355: Unsubscribe on Error to prevent propagation of it downstream.

* CORDA-1355: For downstream subscribers ignore errors properly. Thanka to @exfalso for the hint.

This fixes: Transaction Updates do not flow after re-connect

* CORDA-1355: Bugfix eliminate duplicating items on "Transactions" blotter after re-connect.

* CORDA-1355: Bugfix eliminate double counting on dashboards.

* CORDA-1355: Bugfix eliminate same parties in dropdowns.

* CORDA-1355: Stop using `SecureHash.randomSHA256()` for painting widget icon.
Instead use combined SHA hash such that icon represents the whole population of trades.
That way two transactions blotters can be compared by a single glimpse at corresponding icons.

Also minor refactoring.

* CORDA-1416: Make RPC re-connection faster/more robust.

* CORDA-1416: Properly announce thet Proxy may not be available during re-connect and prevent UI crashing.

* CORDA-1416: Disable UI until RPC proxy is available.

* CORDA-1416: Correct typo.

* CORDA-1416: Unit test fix.

* CORDA-1416: GUI cosmetic changes.

* CORDA-1416: Correct spaces.

* CORDA-1416: Remove un-necessary overrides in CordaRPCOpsWrapper.

* CORDA-1416: Switch from using `doOnError` to installing an error handler upon subscription.
2018-05-10 15:20:41 +01:00
Patrick Kuo
99129c1141
Merge pull request #3010 from corda/pat/explorer-networkview-bugfix
[Bug fix] - explorer doesn't remove node from network view.
2018-04-26 16:52:21 +01:00
Patrick Kuo
1b31574512 [Bug fix] - explorer doesn't remove node from network view. (#779)
(cherry picked from commit eb5b03e)
2018-04-26 13:23:16 +01:00
Chris Rankin
8e507d0b88
CORDA-1263: Replace deprecated kotlin-stdlib-jre8 with kotlin-stdlib-jdk8. (#2992) 2018-04-24 14:03:41 +01:00
Michele Sollecito
7a077e76f0
CORDA-1099: Orchestrated clean shutdown from Shell (#2831) 2018-03-19 14:20:10 +00:00
Andrius Dagys
f454b949e8 CORDA-1142: Fix explorer to support all transaction types 2018-03-14 18:22:52 +00:00
Rick Parker
a24a2105b1
CORDA-1217 Replace Guava caches with Caffeine (#2818) 2018-03-14 16:07:31 +00:00
Anthony Keenan
577033441a
[CORDA-1035] Testing api KDoc Updates (#2584)
* Testing api KDoc Updates

* Update after code review

* Update api-current

* Revert changes to compiler.xml

* Made comment changes from review

* Fixing merge conflict

* Don't expose net.corda.node through test API (first pass)

* Fixing merge conflicts

* Update api-current

* Addressing review commits

* Fix exposure of internal implementation of MessageHandlerRegistration

* Make InProcess expose ServiceHub instead of internal StartedNodeServices

* Move InternalMockMessaginService interface to internal namespace

* Move MOCK_VERSION_INFO to internal namespace to avoid exposing VersionInfo

* Don't expose WritableTransactionStorage via testing api

* Create public VerifierType enum

* Update api-current and modify check-api-changes to check for net.corda.node exposures

* Fix merge conflicts

* Fixing another merge conflict

* Fix accidentally broken unit tests

* Make getInternalServices a property

* Fix failing unit tests

* Add todo to check-api-changes

* Fix rpc sender thread busy looping

* Fix tests

* Fixing tests

* Address mike's comments

* Fixing tests

* Make random port allocation internal

* Update api
2018-02-28 13:26:49 +00:00
Maksymilian Pawlak
b91dd43a83
Test driver default parameters removal (#2519)
* Removed long parameter list in test driver, replaced with DriverParameters object
2018-02-13 13:15:05 +00:00
Anthony Keenan
7b65b7971a
CORDA-939 - Don't expose StartedNode and AbstractNode as part of public test api (#2472)
* Don't expose StartedNode via Node Driver

* Dont expose StartedNode/Abstract Node via MockNetwork

* Remove internal var from constructor as it doesn't hide from public api and change to internal initialisation method

* Update api

* Rename MockNode to StartedMockNode to avoid confusion
Update documentation
Update api-current.txt

* Fix typo

* Fix test failure

* Modify flow tests to use internal mock network and remove additional internal exposures from StartedMockNode

* Fix api-current

* Change InProcess and OutOfProcess to interfaces

* Explicitly declare MockNetwork parameters
Dont expose StateMachineManager
Move affected tests to use internal mock network

* Fix api-current

* Changes requested via review

* Fix IRS Demo address

* Fix api

* Remove internal attribute from classes in internal package

* Remove accidentally added code

* Move useHttps into NodeHandleInternal

* Remove duplicated code

* Update api-current

* Make webAddress internal on NodeHandle

* Make sure parameters in public api are explicitly specified

* Use correct address in IRS Demo

* Get webaddress from webserver handle

* Update api-current
2018-02-12 10:09:59 +00:00
Mike Hearn
82ece34ac8
Tweak the way invocation context is integrated to reduce the pain for devs using the old API (#2447)
Minor tweaks to the invocation context code.

1) Un-deprecate FlowInitiator, move the deprecation to the field. This
   eliminates large numbers of warnings and means developers are warned
   only once in the place where they obtain one.

2) Add documentation for StateMachineInfo and create a type alias to give
   it a better name in an ABI compatible way.

3) Improve markup on InvocationContext

4) Rename field from just "context" to "invocationContext" (Context is vague)
2018-02-02 17:09:08 +01:00
Michele Sollecito
142f52fa82
[CORDA:936]: Enable RPC layer to work with SSL 2018-01-23 16:23:37 +00:00
Andrzej Cichocki
1fc646cfa8 CORDA-716 Move test-utils and node-driver to stable API section in docs (#2335)
* Move test-utils and node-driver to stable section.

* Move FlowStackSnapshotFactory to testing.services package & update docs

* Move SerializationTestHelpers to testing.core package

* Move TestConstants.kt to core namespace

* Move Expect.kt to core namespace

* Move CoreTestUtils to core.TestUtils - rename class and update imports

* Added some clarification to documents after re-reading them

* Added static imports

* Removing unused import

* Fix merge conflict

* Fixing merge conflict
2018-01-22 11:28:41 +00:00
Anthony Keenan
1367cd4adb
CORDA-912 Stop exposing internal node user, create user in testing infrastructu… (#2361)
* Stop exposing internal node user, create user in testing infrastructure instead

* Update kdocs
2018-01-15 19:30:33 +00:00