mirror of
https://github.com/corda/corda.git
synced 2025-01-22 20:38:05 +00:00
CORDA-716 Configure api scanner for test modules (#2259)
This commit is contained in:
parent
d84105b60e
commit
8a3299fa2a
@ -3522,6 +3522,9 @@ public static final class net.corda.client.jackson.StringToMethodCallParser$Unpa
|
||||
public <init>(String)
|
||||
@org.jetbrains.annotations.NotNull public final String getMethodName()
|
||||
##
|
||||
public static interface net.corda.testing.node.InMemoryMessagingNetwork$LatencyCalculator
|
||||
@org.jetbrains.annotations.NotNull public abstract java.time.Duration between(net.corda.core.messaging.SingleMessageRecipient, net.corda.core.messaging.SingleMessageRecipient)
|
||||
##
|
||||
public final class net.corda.client.rpc.CordaRPCClient extends java.lang.Object
|
||||
public <init>(net.corda.core.utilities.NetworkHostAndPort)
|
||||
public <init>(net.corda.core.utilities.NetworkHostAndPort, net.corda.client.rpc.CordaRPCClientConfiguration)
|
||||
|
@ -2,6 +2,7 @@ apply plugin: 'kotlin'
|
||||
apply plugin: 'kotlin-jpa'
|
||||
apply plugin: 'net.corda.plugins.quasar-utils'
|
||||
apply plugin: 'net.corda.plugins.publish-utils'
|
||||
apply plugin: 'net.corda.plugins.api-scanner'
|
||||
apply plugin: 'com.jfrog.artifactory'
|
||||
|
||||
//noinspection GroovyAssignabilityCheck
|
||||
|
@ -3,6 +3,7 @@
|
||||
package net.corda.testing.driver
|
||||
|
||||
import net.corda.client.rpc.CordaRPCClient
|
||||
import net.corda.core.DoNotImplement
|
||||
import net.corda.core.concurrent.CordaFuture
|
||||
import net.corda.core.identity.CordaX500Name
|
||||
import net.corda.core.identity.Party
|
||||
@ -30,6 +31,7 @@ import java.util.concurrent.atomic.AtomicInteger
|
||||
*/
|
||||
data class NotaryHandle(val identity: Party, val validating: Boolean, val nodeHandles: CordaFuture<List<NodeHandle>>)
|
||||
|
||||
@DoNotImplement
|
||||
sealed class NodeHandle {
|
||||
abstract val nodeInfo: NodeInfo
|
||||
/**
|
||||
@ -90,6 +92,7 @@ data class WebserverHandle(
|
||||
val process: Process
|
||||
)
|
||||
|
||||
@DoNotImplement
|
||||
sealed class PortAllocation {
|
||||
abstract fun nextPort(): Int
|
||||
fun nextHostAndPort() = NetworkHostAndPort("localhost", nextPort())
|
||||
|
@ -1,5 +1,6 @@
|
||||
package net.corda.testing.driver
|
||||
|
||||
import net.corda.core.DoNotImplement
|
||||
import net.corda.core.concurrent.CordaFuture
|
||||
import net.corda.core.identity.CordaX500Name
|
||||
import net.corda.core.identity.Party
|
||||
@ -10,6 +11,7 @@ import net.corda.nodeapi.internal.config.User
|
||||
import net.corda.testing.node.NotarySpec
|
||||
import java.nio.file.Path
|
||||
|
||||
@DoNotImplement
|
||||
interface DriverDSL {
|
||||
/** Returns a list of [NotaryHandle]s matching the list of [NotarySpec]s passed into [driver]. */
|
||||
val notaryHandles: List<NotaryHandle>
|
||||
|
@ -1,5 +1,6 @@
|
||||
package net.corda.testing.node
|
||||
|
||||
import net.corda.core.DoNotImplement
|
||||
import net.corda.core.crypto.CompositeKey
|
||||
import net.corda.core.identity.CordaX500Name
|
||||
import net.corda.core.identity.Party
|
||||
@ -120,7 +121,7 @@ class InMemoryMessagingNetwork internal constructor(
|
||||
}
|
||||
}
|
||||
|
||||
interface LatencyCalculator {
|
||||
interface LatencyCalculator { // XXX: Used?
|
||||
fun between(sender: SingleMessageRecipient, receiver: SingleMessageRecipient): Duration
|
||||
}
|
||||
|
||||
@ -178,6 +179,7 @@ class InMemoryMessagingNetwork internal constructor(
|
||||
/**
|
||||
* Mock service loadbalancing
|
||||
*/
|
||||
@DoNotImplement
|
||||
sealed class ServicePeerAllocationStrategy {
|
||||
abstract fun <A> pickNext(service: ServiceHandle, pickFrom: List<A>): A
|
||||
class Random(val random: SplittableRandom = SplittableRandom()) : ServicePeerAllocationStrategy() {
|
||||
|
@ -4,6 +4,7 @@ import com.google.common.jimfs.Configuration.unix
|
||||
import com.google.common.jimfs.Jimfs
|
||||
import com.nhaarman.mockito_kotlin.doReturn
|
||||
import com.nhaarman.mockito_kotlin.whenever
|
||||
import net.corda.core.DoNotImplement
|
||||
import net.corda.core.crypto.entropyToKeyPair
|
||||
import net.corda.core.crypto.random63BitValue
|
||||
import net.corda.core.identity.CordaX500Name
|
||||
@ -490,6 +491,7 @@ fun StartedNode<MockNetwork.MockNode>.setMessagingServiceSpy(messagingServiceSpy
|
||||
}
|
||||
|
||||
private fun mockNodeConfiguration(): NodeConfiguration {
|
||||
@DoNotImplement
|
||||
abstract class AbstractNodeConfiguration : NodeConfiguration
|
||||
return rigorousMock<AbstractNodeConfiguration>().also {
|
||||
doReturn("cordacadevpass").whenever(it).keyStorePassword
|
||||
|
@ -1,5 +1,6 @@
|
||||
package net.corda.testing.node
|
||||
|
||||
import net.corda.core.DoNotImplement
|
||||
import net.corda.core.identity.CordaX500Name
|
||||
import net.corda.node.services.config.VerifierType
|
||||
import net.corda.nodeapi.internal.config.User
|
||||
@ -12,6 +13,7 @@ data class NotarySpec(
|
||||
val cluster: ClusterSpec? = null
|
||||
)
|
||||
|
||||
@DoNotImplement
|
||||
sealed class ClusterSpec {
|
||||
abstract val clusterSize: Int
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
apply plugin: 'net.corda.plugins.publish-utils'
|
||||
apply plugin: 'net.corda.plugins.api-scanner'
|
||||
apply plugin: 'com.jfrog.artifactory'
|
||||
|
||||
dependencies {
|
||||
|
@ -2,6 +2,7 @@ apply plugin: 'kotlin'
|
||||
apply plugin: 'kotlin-jpa'
|
||||
apply plugin: 'net.corda.plugins.quasar-utils'
|
||||
apply plugin: 'net.corda.plugins.publish-utils'
|
||||
apply plugin: 'net.corda.plugins.api-scanner'
|
||||
apply plugin: 'com.jfrog.artifactory'
|
||||
|
||||
description 'Testing utilities for Corda'
|
||||
|
@ -1,6 +1,7 @@
|
||||
package net.corda.testing
|
||||
|
||||
import com.google.common.util.concurrent.SettableFuture
|
||||
import net.corda.core.DoNotImplement
|
||||
import net.corda.core.internal.uncheckedCast
|
||||
import net.corda.core.utilities.getOrThrow
|
||||
import org.slf4j.Logger
|
||||
@ -189,6 +190,7 @@ fun <S, E : Any> S.genericExpectEvents(
|
||||
finishFuture.getOrThrow()
|
||||
}
|
||||
|
||||
@DoNotImplement
|
||||
sealed class ExpectCompose<out E> {
|
||||
internal class Single<out E, T : E>(val expect: Expect<E, T>) : ExpectCompose<E>()
|
||||
internal class Sequential<out E>(val sequence: List<ExpectCompose<E>>) : ExpectCompose<E>()
|
||||
|
@ -2,6 +2,7 @@ package net.corda.testing
|
||||
|
||||
import com.nhaarman.mockito_kotlin.*
|
||||
import net.corda.client.rpc.internal.KryoClientSerializationScheme
|
||||
import net.corda.core.DoNotImplement
|
||||
import net.corda.core.internal.staticField
|
||||
import net.corda.core.serialization.internal.*
|
||||
import net.corda.node.serialization.KryoServerSerializationScheme
|
||||
@ -62,6 +63,7 @@ class SerializationEnvironmentRule(private val inheritable: Boolean = false) : T
|
||||
}
|
||||
}
|
||||
|
||||
@DoNotImplement
|
||||
interface GlobalSerializationEnvironment : SerializationEnvironment {
|
||||
/** Unset this environment. */
|
||||
fun unset()
|
||||
|
@ -1,5 +1,6 @@
|
||||
package net.corda.testing.contracts
|
||||
|
||||
import net.corda.core.DoNotImplement
|
||||
import net.corda.core.contracts.*
|
||||
import net.corda.core.identity.AbstractParty
|
||||
import net.corda.core.identity.Party
|
||||
@ -12,6 +13,7 @@ data class DummyContract(val blank: Any? = null) : Contract {
|
||||
|
||||
val PROGRAM_ID = "net.corda.testing.contracts.DummyContract"
|
||||
|
||||
@DoNotImplement // State is effectively a sealed class.
|
||||
interface State : ContractState {
|
||||
val magicNumber: Int
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package net.corda.testing.dsl
|
||||
|
||||
import net.corda.core.DoNotImplement
|
||||
import net.corda.core.contracts.ContractState
|
||||
import net.corda.core.contracts.StateAndRef
|
||||
import net.corda.core.contracts.TransactionState
|
||||
@ -14,6 +15,7 @@ import java.io.InputStream
|
||||
* This interface defines output state lookup by label. It is split from the interpreter interfaces so that outputs may
|
||||
* be looked up both in ledger{..} and transaction{..} blocks.
|
||||
*/
|
||||
@DoNotImplement
|
||||
interface OutputStateLookup {
|
||||
/**
|
||||
* Retrieves an output previously defined by [TransactionDSLInterpreter.output] with a label passed in.
|
||||
@ -27,6 +29,7 @@ interface OutputStateLookup {
|
||||
/**
|
||||
* This interface asserts that the DSL at hand is capable of verifying its underlying construct(ledger/transaction).
|
||||
*/
|
||||
@DoNotImplement
|
||||
interface Verifies {
|
||||
/**
|
||||
* Verifies the ledger/transaction, throws if the verification fails.
|
||||
@ -83,6 +86,7 @@ interface Verifies {
|
||||
*
|
||||
* TODO (Kotlin 1.1): Use type synonyms to make the type params less unwieldy
|
||||
*/
|
||||
@DoNotImplement
|
||||
interface LedgerDSLInterpreter<out T : TransactionDSLInterpreter> : Verifies, OutputStateLookup {
|
||||
/**
|
||||
* Creates and adds a transaction to the ledger.
|
||||
|
@ -1,5 +1,6 @@
|
||||
package net.corda.testing.dsl
|
||||
|
||||
import net.corda.core.DoNotImplement
|
||||
import net.corda.core.contracts.*
|
||||
import net.corda.core.cordapp.CordappProvider
|
||||
import net.corda.core.crypto.*
|
||||
@ -50,6 +51,7 @@ import kotlin.collections.set
|
||||
* will have as the last line either an accept or a failure test. The name is deliberately long to help make sense of
|
||||
* the triggered diagnostic.
|
||||
*/
|
||||
@DoNotImplement
|
||||
sealed class EnforceVerifyOrFail {
|
||||
internal object Token : EnforceVerifyOrFail()
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package net.corda.testing.dsl
|
||||
|
||||
import net.corda.core.DoNotImplement
|
||||
import net.corda.core.contracts.*
|
||||
import net.corda.core.crypto.SecureHash
|
||||
import net.corda.core.identity.Party
|
||||
@ -14,6 +15,7 @@ import java.time.Instant
|
||||
* @param <R> The return type of [verifies]/[failsWith] and the like. It is generic so that we have control over whether
|
||||
* we want to enforce users to call these methods (see [EnforceVerifyOrFail]) or not.
|
||||
*/
|
||||
@DoNotImplement
|
||||
interface TransactionDSLInterpreter : Verifies, OutputStateLookup {
|
||||
/**
|
||||
* A reference to the enclosing ledger{..}'s interpreter.
|
||||
|
Loading…
Reference in New Issue
Block a user