CORDA-939 - Modify Api Scanner to check api for internal exposures (#2534)

* CORDA-939 Modify Api Scanner to check api for internal exposures (#2510)

* Update check api changes to look for internals

* Update several more uses of internal

* Make check-api-changes script filter out internal class usages

* Make CordaClock part of API

* Update api-current.txt

* Remove exclusion of nodeapi.internal

* Remove access to CordaPersistence from public api

* Don't expose DB Connection from StartedMockNode and remove unnecessary transaction from CustomVaultQueryTest

* Make internal tests that use need db access use InternalMockNetwork

* Make test certificates internal

* Address further review comments

* Revert some accidental changes to api-current.txt

* Address Shams' review comments

* Update Api Scanner to filter out CordaInternal attribute

* Update api-current.txt

* Remove superfluous brackets

* Add transaction to StartedMockNode

* More leaky transaction fixes

# Conflicts:
#	.ci/api-current.txt
#	node-api/src/test/kotlin/net/corda/nodeapi/internal/AttachmentsClassLoaderStaticContractTests.kt
#	node-api/src/test/kotlin/net/corda/nodeapi/internal/AttachmentsClassLoaderTests.kt
#	node/src/integration-test/kotlin/net/corda/node/services/AttachmentLoadingTests.kt
#	node/src/test/kotlin/net/corda/node/internal/cordapp/CordappProviderImplTests.kt
#	testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/InternalMockNetwork.kt
#	testing/test-utils/src/main/kotlin/net/corda/testing/internal/MockCordappConfigProvider.kt
#	testing/test-utils/src/main/kotlin/net/corda/testing/internal/MockCordappProvider.kt

* Bump gradle plugins version

* One last internal exposure

* Update constants.properties

* Fix api-current

* Address mikes review comments
This commit is contained in:
Anthony Keenan
2018-02-16 15:22:13 +00:00
committed by Katelyn Baker
parent b68957cf83
commit b24ec9f680
47 changed files with 220 additions and 133 deletions

View File

@ -74,16 +74,14 @@ class CustomVaultQueryTest {
private fun getBalances(): Pair<Map<Currency, Amount<Currency>>, Map<Currency, Amount<Currency>>> {
// Print out the balances
val balancesNodesA =
nodeA.database.transaction {
nodeA.services.getCashBalances()
}
val balancesNodesA = nodeA.transaction {
nodeA.services.getCashBalances()
}
println("BalanceA\n" + balancesNodesA)
val balancesNodesB =
nodeB.database.transaction {
nodeB.services.getCashBalances()
}
val balancesNodesB = nodeB.transaction {
nodeB.services.getCashBalances()
}
println("BalanceB\n" + balancesNodesB)
return Pair(balancesNodesA, balancesNodesB)

View File

@ -68,13 +68,14 @@ class FxTransactionBuildTutorialTest {
doIt.getOrThrow()
// Get the balances when the vault updates
nodeAVaultUpdate.get()
val balancesA = nodeA.database.transaction {
val balancesA = nodeA.transaction {
nodeA.services.getCashBalances()
}
nodeBVaultUpdate.get()
val balancesB = nodeB.database.transaction {
val balancesB = nodeB.transaction {
nodeB.services.getCashBalances()
}
println("BalanceA\n" + balancesA)
println("BalanceB\n" + balancesB)
// Verify the transfers occurred as expected
@ -86,10 +87,10 @@ class FxTransactionBuildTutorialTest {
private fun printBalances() {
// Print out the balances
nodeA.database.transaction {
nodeA.transaction {
println("BalanceA\n" + nodeA.services.getCashBalances())
}
nodeB.database.transaction {
nodeB.transaction {
println("BalanceB\n" + nodeB.services.getCashBalances())
}
}