diff --git a/.ci/api-current.txt b/.ci/api-current.txt index 03aed42800..64e351610e 100644 --- a/.ci/api-current.txt +++ b/.ci/api-current.txt @@ -6818,6 +6818,392 @@ public static final class net.corda.core.utilities.UuidGenerator$Companion exten public interface net.corda.core.utilities.VariablePropertyDelegate extends net.corda.core.utilities.PropertyDelegate public abstract void setValue(Object, kotlin.reflect.KProperty, T) ## +public final class net.corda.testing.contracts.DummyContract extends java.lang.Object implements net.corda.core.contracts.Contract + public () + public (Object) + public (Object, int, kotlin.jvm.internal.DefaultConstructorMarker) + @Nullable + public final Object component1() + @NotNull + public final net.corda.testing.contracts.DummyContract copy(Object) + public boolean equals(Object) + @NotNull + public static final net.corda.core.transactions.TransactionBuilder generateInitial(int, net.corda.core.identity.Party, net.corda.core.contracts.PartyAndReference, net.corda.core.contracts.PartyAndReference...) + @Nullable + public final Object getBlank() + @NotNull + public final String getPROGRAM_ID() + public int hashCode() + @NotNull + public static final net.corda.core.transactions.TransactionBuilder move(java.util.List>, net.corda.core.identity.AbstractParty) + @NotNull + public static final net.corda.core.transactions.TransactionBuilder move(net.corda.core.contracts.StateAndRef, net.corda.core.identity.AbstractParty) + @NotNull + public String toString() + public void verify(net.corda.core.transactions.LedgerTransaction) + public static final net.corda.testing.contracts.DummyContract$Companion Companion + @NotNull + public static final String PROGRAM_ID = "net.corda.testing.contracts.DummyContract" +## +public static interface net.corda.testing.contracts.DummyContract$Commands extends net.corda.core.contracts.CommandData +## +public static final class net.corda.testing.contracts.DummyContract$Commands$Create extends net.corda.core.contracts.TypeOnlyCommandData implements net.corda.testing.contracts.DummyContract$Commands + public () +## +public static final class net.corda.testing.contracts.DummyContract$Commands$Move extends net.corda.core.contracts.TypeOnlyCommandData implements net.corda.testing.contracts.DummyContract$Commands + public () +## +public static final class net.corda.testing.contracts.DummyContract$Companion extends java.lang.Object + public (kotlin.jvm.internal.DefaultConstructorMarker) + @NotNull + public final net.corda.core.transactions.TransactionBuilder generateInitial(int, net.corda.core.identity.Party, net.corda.core.contracts.PartyAndReference, net.corda.core.contracts.PartyAndReference...) + @NotNull + public final net.corda.core.transactions.TransactionBuilder move(java.util.List>, net.corda.core.identity.AbstractParty) + @NotNull + public final net.corda.core.transactions.TransactionBuilder move(net.corda.core.contracts.StateAndRef, net.corda.core.identity.AbstractParty) +## +@DoNotImplement +public static final class net.corda.testing.contracts.DummyContract$MultiOwnerState extends java.lang.Object implements net.corda.testing.contracts.DummyContract$State + public (int, java.util.List) + public (int, java.util.List, int, kotlin.jvm.internal.DefaultConstructorMarker) + public final int component1() + @NotNull + public final java.util.List component2() + @NotNull + public final net.corda.testing.contracts.DummyContract$MultiOwnerState copy(int, java.util.List) + public boolean equals(Object) + public int getMagicNumber() + @NotNull + public final java.util.List getOwners() + @NotNull + public java.util.List getParticipants() + public int hashCode() + @NotNull + public String toString() +## +@DoNotImplement +public static final class net.corda.testing.contracts.DummyContract$SingleOwnerState extends java.lang.Object implements net.corda.core.contracts.OwnableState, net.corda.testing.contracts.DummyContract$State + public (int, net.corda.core.identity.AbstractParty) + public (int, net.corda.core.identity.AbstractParty, int, kotlin.jvm.internal.DefaultConstructorMarker) + public final int component1() + @NotNull + public final net.corda.core.identity.AbstractParty component2() + @NotNull + public final net.corda.testing.contracts.DummyContract$SingleOwnerState copy(int, net.corda.core.identity.AbstractParty) + public boolean equals(Object) + public int getMagicNumber() + @NotNull + public net.corda.core.identity.AbstractParty getOwner() + @NotNull + public java.util.List getParticipants() + public int hashCode() + @NotNull + public String toString() + @NotNull + public net.corda.core.contracts.CommandAndState withNewOwner(net.corda.core.identity.AbstractParty) +## +@DoNotImplement +public static interface net.corda.testing.contracts.DummyContract$State extends net.corda.core.contracts.ContractState + public abstract int getMagicNumber() +## +public final class net.corda.testing.contracts.DummyContractV2 extends java.lang.Object implements net.corda.core.contracts.UpgradedContractWithLegacyConstraint + public () + @NotNull + public String getLegacyContract() + @NotNull + public net.corda.core.contracts.AttachmentConstraint getLegacyContractConstraint() + @NotNull + public net.corda.testing.contracts.DummyContractV2$State upgrade(net.corda.testing.contracts.DummyContract$State) + public void verify(net.corda.core.transactions.LedgerTransaction) + public static final net.corda.testing.contracts.DummyContractV2$Companion Companion + @NotNull + public static final String PROGRAM_ID = "net.corda.testing.contracts.DummyContractV2" +## +public static interface net.corda.testing.contracts.DummyContractV2$Commands extends net.corda.core.contracts.CommandData +## +public static final class net.corda.testing.contracts.DummyContractV2$Commands$Create extends net.corda.core.contracts.TypeOnlyCommandData implements net.corda.testing.contracts.DummyContractV2$Commands + public () +## +public static final class net.corda.testing.contracts.DummyContractV2$Commands$Move extends net.corda.core.contracts.TypeOnlyCommandData implements net.corda.testing.contracts.DummyContractV2$Commands + public () +## +public static final class net.corda.testing.contracts.DummyContractV2$Companion extends java.lang.Object + public (kotlin.jvm.internal.DefaultConstructorMarker) +## +public static final class net.corda.testing.contracts.DummyContractV2$State extends java.lang.Object implements net.corda.core.contracts.ContractState + public (int, java.util.List) + public (int, java.util.List, int, kotlin.jvm.internal.DefaultConstructorMarker) + public final int component1() + @NotNull + public final java.util.List component2() + @NotNull + public final net.corda.testing.contracts.DummyContractV2$State copy(int, java.util.List) + public boolean equals(Object) + public final int getMagicNumber() + @NotNull + public final java.util.List getOwners() + @NotNull + public java.util.List getParticipants() + public int hashCode() + @NotNull + public String toString() +## +public final class net.corda.testing.contracts.DummyContractV3 extends java.lang.Object implements net.corda.core.contracts.UpgradedContractWithLegacyConstraint + public () + @NotNull + public String getLegacyContract() + @NotNull + public net.corda.core.contracts.AttachmentConstraint getLegacyContractConstraint() + @NotNull + public net.corda.testing.contracts.DummyContractV3$State upgrade(net.corda.testing.contracts.DummyContractV2$State) + public void verify(net.corda.core.transactions.LedgerTransaction) + public static final net.corda.testing.contracts.DummyContractV3$Companion Companion + @NotNull + public static final String PROGRAM_ID = "net.corda.testing.contracts.DummyContractV3" +## +public static interface net.corda.testing.contracts.DummyContractV3$Commands extends net.corda.core.contracts.CommandData +## +public static final class net.corda.testing.contracts.DummyContractV3$Commands$Create extends net.corda.core.contracts.TypeOnlyCommandData implements net.corda.testing.contracts.DummyContractV3$Commands + public () +## +public static final class net.corda.testing.contracts.DummyContractV3$Commands$Move extends net.corda.core.contracts.TypeOnlyCommandData implements net.corda.testing.contracts.DummyContractV3$Commands + public () +## +public static final class net.corda.testing.contracts.DummyContractV3$Companion extends java.lang.Object + public (kotlin.jvm.internal.DefaultConstructorMarker) +## +public static final class net.corda.testing.contracts.DummyContractV3$State extends java.lang.Object implements net.corda.core.contracts.ContractState + public (int, java.util.List) + public (int, java.util.List, int, kotlin.jvm.internal.DefaultConstructorMarker) + public final int component1() + @NotNull + public final java.util.List component2() + @NotNull + public final net.corda.testing.contracts.DummyContractV3$State copy(int, java.util.List) + public boolean equals(Object) + public final int getMagicNumber() + @NotNull + public final java.util.List getOwners() + @NotNull + public java.util.List getParticipants() + public int hashCode() + @NotNull + public String toString() +## +@BelongsToContract +public final class net.corda.testing.contracts.DummyState extends java.lang.Object implements net.corda.core.contracts.ContractState + public () + public (int) + public (int, java.util.List) + public (int, java.util.List, int, kotlin.jvm.internal.DefaultConstructorMarker) + public final int component1() + @NotNull + public final java.util.List component2() + @NotNull + public final net.corda.testing.contracts.DummyState copy(int) + @NotNull + public final net.corda.testing.contracts.DummyState copy(int, java.util.List) + public boolean equals(Object) + public final int getMagicNumber() + @NotNull + public java.util.List getParticipants() + public int hashCode() + @NotNull + public String toString() +## +public final class net.corda.testing.core.DummyCommandData extends net.corda.core.contracts.TypeOnlyCommandData + public static final net.corda.testing.core.DummyCommandData INSTANCE +## +public final class net.corda.testing.core.Expect extends java.lang.Object + public (Class, kotlin.jvm.functions.Function1, kotlin.jvm.functions.Function1) + @NotNull + public final Class component1() + @NotNull + public final kotlin.jvm.functions.Function1 component2() + @NotNull + public final kotlin.jvm.functions.Function1 component3() + @NotNull + public final net.corda.testing.core.Expect copy(Class, kotlin.jvm.functions.Function1, kotlin.jvm.functions.Function1) + public boolean equals(Object) + @NotNull + public final Class getClazz() + @NotNull + public final kotlin.jvm.functions.Function1 getExpectClosure() + @NotNull + public final kotlin.jvm.functions.Function1 getMatch() + public int hashCode() + @NotNull + public String toString() +## +@DoNotImplement +public abstract class net.corda.testing.core.ExpectCompose extends java.lang.Object + public (kotlin.jvm.internal.DefaultConstructorMarker) +## +@DoNotImplement +public static final class net.corda.testing.core.ExpectCompose$Parallel extends net.corda.testing.core.ExpectCompose + public (java.util.List>) + @NotNull + public final java.util.List> getParallel() +## +@DoNotImplement +public static final class net.corda.testing.core.ExpectCompose$Sequential extends net.corda.testing.core.ExpectCompose + public (java.util.List>) + @NotNull + public final java.util.List> getSequence() +## +@DoNotImplement +public static final class net.corda.testing.core.ExpectCompose$Single extends net.corda.testing.core.ExpectCompose + public (net.corda.testing.core.Expect) + @NotNull + public final net.corda.testing.core.Expect getExpect() +## +public static final class net.corda.testing.core.ExpectComposeState$Companion extends java.lang.Object + public (kotlin.jvm.internal.DefaultConstructorMarker) + @NotNull + public final net.corda.testing.core.ExpectComposeState fromExpectCompose(net.corda.testing.core.ExpectCompose) +## +public static final class net.corda.testing.core.ExpectComposeState$Finished extends net.corda.testing.core.ExpectComposeState + public () + @NotNull + public java.util.List> getExpectedEvents() + @Nullable + public Void nextState(E) +## +public static final class net.corda.testing.core.ExpectComposeState$Parallel extends net.corda.testing.core.ExpectComposeState + public (net.corda.testing.core.ExpectCompose$Parallel, java.util.List>) + @NotNull + public java.util.List> getExpectedEvents() + @NotNull + public final net.corda.testing.core.ExpectCompose$Parallel getParallel() + @NotNull + public final java.util.List> getStates() + @Nullable + public kotlin.Pair, net.corda.testing.core.ExpectComposeState> nextState(E) +## +public static final class net.corda.testing.core.ExpectComposeState$Sequential extends net.corda.testing.core.ExpectComposeState + public (net.corda.testing.core.ExpectCompose$Sequential, int, net.corda.testing.core.ExpectComposeState) + @NotNull + public java.util.List> getExpectedEvents() + public final int getIndex() + @NotNull + public final net.corda.testing.core.ExpectCompose$Sequential getSequential() + @NotNull + public final net.corda.testing.core.ExpectComposeState getState() + @Nullable + public kotlin.Pair, net.corda.testing.core.ExpectComposeState> nextState(E) +## +public static final class net.corda.testing.core.ExpectComposeState$Single extends net.corda.testing.core.ExpectComposeState + public (net.corda.testing.core.ExpectCompose$Single) + @NotNull + public java.util.List> getExpectedEvents() + @NotNull + public final net.corda.testing.core.ExpectCompose$Single getSingle() + @Nullable + public kotlin.Pair, net.corda.testing.core.ExpectComposeState> nextState(E) +## +public final class net.corda.testing.core.ExpectKt extends java.lang.Object + @NotNull + public static final net.corda.testing.core.ExpectCompose expect(Class, kotlin.jvm.functions.Function1, kotlin.jvm.functions.Function1) + public static final void expectEvents(Iterable, boolean, kotlin.jvm.functions.Function0>) + public static final void expectEvents(rx.Observable, boolean, kotlin.jvm.functions.Function0>) + public static final void genericExpectEvents(S, boolean, kotlin.jvm.functions.Function2, kotlin.Unit>, kotlin.jvm.functions.Function0>) + @NotNull + public static final net.corda.testing.core.ExpectCompose parallel(java.util.List>) + @NotNull + public static final net.corda.testing.core.ExpectCompose parallel(net.corda.testing.core.ExpectCompose...) + @NotNull + public static final net.corda.testing.core.ExpectCompose replicate(int, kotlin.jvm.functions.Function1>) + @NotNull + public static final net.corda.testing.core.ExpectCompose sequence(java.util.List>) + @NotNull + public static final net.corda.testing.core.ExpectCompose sequence(net.corda.testing.core.ExpectCompose...) +## +public final class net.corda.testing.core.SerializationEnvironmentRule extends java.lang.Object implements org.junit.rules.TestRule + public () + public (boolean) + public (boolean, int, kotlin.jvm.internal.DefaultConstructorMarker) + @NotNull + public org.junit.runners.model.Statement apply(org.junit.runners.model.Statement, org.junit.runner.Description) + @NotNull + public final net.corda.core.serialization.SerializationFactory getSerializationFactory() + public static final net.corda.testing.core.SerializationEnvironmentRule$Companion Companion +## +public static final class net.corda.testing.core.SerializationEnvironmentRule$Companion extends java.lang.Object + public (kotlin.jvm.internal.DefaultConstructorMarker) +## +public final class net.corda.testing.core.TestConstants extends java.lang.Object + @NotNull + public static final net.corda.core.contracts.Command dummyCommand(java.security.PublicKey...) + @NotNull + public static final net.corda.core.identity.CordaX500Name ALICE_NAME + @NotNull + public static final net.corda.core.identity.CordaX500Name BOB_NAME + @NotNull + public static final net.corda.core.identity.CordaX500Name BOC_NAME + @NotNull + public static final net.corda.core.identity.CordaX500Name CHARLIE_NAME + @NotNull + public static final net.corda.core.identity.CordaX500Name DUMMY_BANK_A_NAME + @NotNull + public static final net.corda.core.identity.CordaX500Name DUMMY_BANK_B_NAME + @NotNull + public static final net.corda.core.identity.CordaX500Name DUMMY_BANK_C_NAME + @NotNull + public static final net.corda.core.identity.CordaX500Name DUMMY_NOTARY_NAME + public static final int MAX_MESSAGE_SIZE = 10485760 +## +public final class net.corda.testing.core.TestIdentity extends java.lang.Object + public (net.corda.core.identity.CordaX500Name) + public (net.corda.core.identity.CordaX500Name, long) + public (net.corda.core.identity.CordaX500Name, long, net.corda.core.crypto.SignatureScheme) + public (net.corda.core.identity.CordaX500Name, long, net.corda.core.crypto.SignatureScheme, int, kotlin.jvm.internal.DefaultConstructorMarker) + public (net.corda.core.identity.CordaX500Name, java.security.KeyPair) + public (net.corda.core.identity.CordaX500Name, net.corda.core.crypto.SignatureScheme) + public (net.corda.core.identity.CordaX500Name, net.corda.core.crypto.SignatureScheme, int, kotlin.jvm.internal.DefaultConstructorMarker) + @NotNull + public static final net.corda.testing.core.TestIdentity fresh(String) + @NotNull + public static final net.corda.testing.core.TestIdentity fresh(String, net.corda.core.crypto.SignatureScheme) + @NotNull + public final net.corda.core.identity.PartyAndCertificate getIdentity() + @NotNull + public final java.security.KeyPair getKeyPair() + @NotNull + public final net.corda.core.identity.CordaX500Name getName() + @NotNull + public final net.corda.core.identity.Party getParty() + @NotNull + public final java.security.PublicKey getPublicKey() + @NotNull + public final net.corda.core.contracts.PartyAndReference ref(byte...) + public static final net.corda.testing.core.TestIdentity$Companion Companion +## +public static final class net.corda.testing.core.TestIdentity$Companion extends java.lang.Object + public (kotlin.jvm.internal.DefaultConstructorMarker) + @NotNull + public final net.corda.testing.core.TestIdentity fresh(String) + @NotNull + public final net.corda.testing.core.TestIdentity fresh(String, net.corda.core.crypto.SignatureScheme) +## +public final class net.corda.testing.core.TestUtils extends java.lang.Object + @NotNull + public static final net.corda.core.utilities.NetworkHostAndPort freeLocalHostAndPort() + public static final int freePort() + @NotNull + public static final net.corda.core.contracts.StateRef generateStateRef() + @NotNull + public static final java.util.List getFreeLocalPorts(String, int) + @NotNull + public static final net.corda.core.identity.PartyAndCertificate getTestPartyAndCertificate(net.corda.core.identity.CordaX500Name, java.security.PublicKey) + @NotNull + public static final net.corda.core.identity.PartyAndCertificate getTestPartyAndCertificate(net.corda.core.identity.Party) + @NotNull + public static final net.corda.core.identity.CordaX500Name makeUnique(net.corda.core.identity.CordaX500Name) + @NotNull + public static final net.corda.core.identity.Party singleIdentity(net.corda.core.node.NodeInfo) + @NotNull + public static final net.corda.core.identity.PartyAndCertificate singleIdentityAndCert(net.corda.core.node.NodeInfo) +## public final class net.corda.client.jackson.JacksonSupport extends java.lang.Object @NotNull public static final com.fasterxml.jackson.databind.ObjectMapper createDefaultMapper(net.corda.core.messaging.CordaRPCOps) @@ -8148,392 +8534,6 @@ public static class net.corda.finance.test.SampleCashSchemaV3$PersistentCashStat public void setParticipants(java.util.Set) public void setPennies(long) ## -public final class net.corda.testing.contracts.DummyContract extends java.lang.Object implements net.corda.core.contracts.Contract - public () - public (Object) - public (Object, int, kotlin.jvm.internal.DefaultConstructorMarker) - @Nullable - public final Object component1() - @NotNull - public final net.corda.testing.contracts.DummyContract copy(Object) - public boolean equals(Object) - @NotNull - public static final net.corda.core.transactions.TransactionBuilder generateInitial(int, net.corda.core.identity.Party, net.corda.core.contracts.PartyAndReference, net.corda.core.contracts.PartyAndReference...) - @Nullable - public final Object getBlank() - @NotNull - public final String getPROGRAM_ID() - public int hashCode() - @NotNull - public static final net.corda.core.transactions.TransactionBuilder move(java.util.List>, net.corda.core.identity.AbstractParty) - @NotNull - public static final net.corda.core.transactions.TransactionBuilder move(net.corda.core.contracts.StateAndRef, net.corda.core.identity.AbstractParty) - @NotNull - public String toString() - public void verify(net.corda.core.transactions.LedgerTransaction) - public static final net.corda.testing.contracts.DummyContract$Companion Companion - @NotNull - public static final String PROGRAM_ID = "net.corda.testing.contracts.DummyContract" -## -public static interface net.corda.testing.contracts.DummyContract$Commands extends net.corda.core.contracts.CommandData -## -public static final class net.corda.testing.contracts.DummyContract$Commands$Create extends net.corda.core.contracts.TypeOnlyCommandData implements net.corda.testing.contracts.DummyContract$Commands - public () -## -public static final class net.corda.testing.contracts.DummyContract$Commands$Move extends net.corda.core.contracts.TypeOnlyCommandData implements net.corda.testing.contracts.DummyContract$Commands - public () -## -public static final class net.corda.testing.contracts.DummyContract$Companion extends java.lang.Object - public (kotlin.jvm.internal.DefaultConstructorMarker) - @NotNull - public final net.corda.core.transactions.TransactionBuilder generateInitial(int, net.corda.core.identity.Party, net.corda.core.contracts.PartyAndReference, net.corda.core.contracts.PartyAndReference...) - @NotNull - public final net.corda.core.transactions.TransactionBuilder move(java.util.List>, net.corda.core.identity.AbstractParty) - @NotNull - public final net.corda.core.transactions.TransactionBuilder move(net.corda.core.contracts.StateAndRef, net.corda.core.identity.AbstractParty) -## -@DoNotImplement -public static final class net.corda.testing.contracts.DummyContract$MultiOwnerState extends java.lang.Object implements net.corda.testing.contracts.DummyContract$State - public (int, java.util.List) - public (int, java.util.List, int, kotlin.jvm.internal.DefaultConstructorMarker) - public final int component1() - @NotNull - public final java.util.List component2() - @NotNull - public final net.corda.testing.contracts.DummyContract$MultiOwnerState copy(int, java.util.List) - public boolean equals(Object) - public int getMagicNumber() - @NotNull - public final java.util.List getOwners() - @NotNull - public java.util.List getParticipants() - public int hashCode() - @NotNull - public String toString() -## -@DoNotImplement -public static final class net.corda.testing.contracts.DummyContract$SingleOwnerState extends java.lang.Object implements net.corda.core.contracts.OwnableState, net.corda.testing.contracts.DummyContract$State - public (int, net.corda.core.identity.AbstractParty) - public (int, net.corda.core.identity.AbstractParty, int, kotlin.jvm.internal.DefaultConstructorMarker) - public final int component1() - @NotNull - public final net.corda.core.identity.AbstractParty component2() - @NotNull - public final net.corda.testing.contracts.DummyContract$SingleOwnerState copy(int, net.corda.core.identity.AbstractParty) - public boolean equals(Object) - public int getMagicNumber() - @NotNull - public net.corda.core.identity.AbstractParty getOwner() - @NotNull - public java.util.List getParticipants() - public int hashCode() - @NotNull - public String toString() - @NotNull - public net.corda.core.contracts.CommandAndState withNewOwner(net.corda.core.identity.AbstractParty) -## -@DoNotImplement -public static interface net.corda.testing.contracts.DummyContract$State extends net.corda.core.contracts.ContractState - public abstract int getMagicNumber() -## -public final class net.corda.testing.contracts.DummyContractV2 extends java.lang.Object implements net.corda.core.contracts.UpgradedContractWithLegacyConstraint - public () - @NotNull - public String getLegacyContract() - @NotNull - public net.corda.core.contracts.AttachmentConstraint getLegacyContractConstraint() - @NotNull - public net.corda.testing.contracts.DummyContractV2$State upgrade(net.corda.testing.contracts.DummyContract$State) - public void verify(net.corda.core.transactions.LedgerTransaction) - public static final net.corda.testing.contracts.DummyContractV2$Companion Companion - @NotNull - public static final String PROGRAM_ID = "net.corda.testing.contracts.DummyContractV2" -## -public static interface net.corda.testing.contracts.DummyContractV2$Commands extends net.corda.core.contracts.CommandData -## -public static final class net.corda.testing.contracts.DummyContractV2$Commands$Create extends net.corda.core.contracts.TypeOnlyCommandData implements net.corda.testing.contracts.DummyContractV2$Commands - public () -## -public static final class net.corda.testing.contracts.DummyContractV2$Commands$Move extends net.corda.core.contracts.TypeOnlyCommandData implements net.corda.testing.contracts.DummyContractV2$Commands - public () -## -public static final class net.corda.testing.contracts.DummyContractV2$Companion extends java.lang.Object - public (kotlin.jvm.internal.DefaultConstructorMarker) -## -public static final class net.corda.testing.contracts.DummyContractV2$State extends java.lang.Object implements net.corda.core.contracts.ContractState - public (int, java.util.List) - public (int, java.util.List, int, kotlin.jvm.internal.DefaultConstructorMarker) - public final int component1() - @NotNull - public final java.util.List component2() - @NotNull - public final net.corda.testing.contracts.DummyContractV2$State copy(int, java.util.List) - public boolean equals(Object) - public final int getMagicNumber() - @NotNull - public final java.util.List getOwners() - @NotNull - public java.util.List getParticipants() - public int hashCode() - @NotNull - public String toString() -## -public final class net.corda.testing.contracts.DummyContractV3 extends java.lang.Object implements net.corda.core.contracts.UpgradedContractWithLegacyConstraint - public () - @NotNull - public String getLegacyContract() - @NotNull - public net.corda.core.contracts.AttachmentConstraint getLegacyContractConstraint() - @NotNull - public net.corda.testing.contracts.DummyContractV3$State upgrade(net.corda.testing.contracts.DummyContractV2$State) - public void verify(net.corda.core.transactions.LedgerTransaction) - public static final net.corda.testing.contracts.DummyContractV3$Companion Companion - @NotNull - public static final String PROGRAM_ID = "net.corda.testing.contracts.DummyContractV3" -## -public static interface net.corda.testing.contracts.DummyContractV3$Commands extends net.corda.core.contracts.CommandData -## -public static final class net.corda.testing.contracts.DummyContractV3$Commands$Create extends net.corda.core.contracts.TypeOnlyCommandData implements net.corda.testing.contracts.DummyContractV3$Commands - public () -## -public static final class net.corda.testing.contracts.DummyContractV3$Commands$Move extends net.corda.core.contracts.TypeOnlyCommandData implements net.corda.testing.contracts.DummyContractV3$Commands - public () -## -public static final class net.corda.testing.contracts.DummyContractV3$Companion extends java.lang.Object - public (kotlin.jvm.internal.DefaultConstructorMarker) -## -public static final class net.corda.testing.contracts.DummyContractV3$State extends java.lang.Object implements net.corda.core.contracts.ContractState - public (int, java.util.List) - public (int, java.util.List, int, kotlin.jvm.internal.DefaultConstructorMarker) - public final int component1() - @NotNull - public final java.util.List component2() - @NotNull - public final net.corda.testing.contracts.DummyContractV3$State copy(int, java.util.List) - public boolean equals(Object) - public final int getMagicNumber() - @NotNull - public final java.util.List getOwners() - @NotNull - public java.util.List getParticipants() - public int hashCode() - @NotNull - public String toString() -## -@BelongsToContract -public final class net.corda.testing.contracts.DummyState extends java.lang.Object implements net.corda.core.contracts.ContractState - public () - public (int) - public (int, java.util.List) - public (int, java.util.List, int, kotlin.jvm.internal.DefaultConstructorMarker) - public final int component1() - @NotNull - public final java.util.List component2() - @NotNull - public final net.corda.testing.contracts.DummyState copy(int) - @NotNull - public final net.corda.testing.contracts.DummyState copy(int, java.util.List) - public boolean equals(Object) - public final int getMagicNumber() - @NotNull - public java.util.List getParticipants() - public int hashCode() - @NotNull - public String toString() -## -public final class net.corda.testing.core.DummyCommandData extends net.corda.core.contracts.TypeOnlyCommandData - public static final net.corda.testing.core.DummyCommandData INSTANCE -## -public final class net.corda.testing.core.Expect extends java.lang.Object - public (Class, kotlin.jvm.functions.Function1, kotlin.jvm.functions.Function1) - @NotNull - public final Class component1() - @NotNull - public final kotlin.jvm.functions.Function1 component2() - @NotNull - public final kotlin.jvm.functions.Function1 component3() - @NotNull - public final net.corda.testing.core.Expect copy(Class, kotlin.jvm.functions.Function1, kotlin.jvm.functions.Function1) - public boolean equals(Object) - @NotNull - public final Class getClazz() - @NotNull - public final kotlin.jvm.functions.Function1 getExpectClosure() - @NotNull - public final kotlin.jvm.functions.Function1 getMatch() - public int hashCode() - @NotNull - public String toString() -## -@DoNotImplement -public abstract class net.corda.testing.core.ExpectCompose extends java.lang.Object - public (kotlin.jvm.internal.DefaultConstructorMarker) -## -@DoNotImplement -public static final class net.corda.testing.core.ExpectCompose$Parallel extends net.corda.testing.core.ExpectCompose - public (java.util.List>) - @NotNull - public final java.util.List> getParallel() -## -@DoNotImplement -public static final class net.corda.testing.core.ExpectCompose$Sequential extends net.corda.testing.core.ExpectCompose - public (java.util.List>) - @NotNull - public final java.util.List> getSequence() -## -@DoNotImplement -public static final class net.corda.testing.core.ExpectCompose$Single extends net.corda.testing.core.ExpectCompose - public (net.corda.testing.core.Expect) - @NotNull - public final net.corda.testing.core.Expect getExpect() -## -public static final class net.corda.testing.core.ExpectComposeState$Companion extends java.lang.Object - public (kotlin.jvm.internal.DefaultConstructorMarker) - @NotNull - public final net.corda.testing.core.ExpectComposeState fromExpectCompose(net.corda.testing.core.ExpectCompose) -## -public static final class net.corda.testing.core.ExpectComposeState$Finished extends net.corda.testing.core.ExpectComposeState - public () - @NotNull - public java.util.List> getExpectedEvents() - @Nullable - public Void nextState(E) -## -public static final class net.corda.testing.core.ExpectComposeState$Parallel extends net.corda.testing.core.ExpectComposeState - public (net.corda.testing.core.ExpectCompose$Parallel, java.util.List>) - @NotNull - public java.util.List> getExpectedEvents() - @NotNull - public final net.corda.testing.core.ExpectCompose$Parallel getParallel() - @NotNull - public final java.util.List> getStates() - @Nullable - public kotlin.Pair, net.corda.testing.core.ExpectComposeState> nextState(E) -## -public static final class net.corda.testing.core.ExpectComposeState$Sequential extends net.corda.testing.core.ExpectComposeState - public (net.corda.testing.core.ExpectCompose$Sequential, int, net.corda.testing.core.ExpectComposeState) - @NotNull - public java.util.List> getExpectedEvents() - public final int getIndex() - @NotNull - public final net.corda.testing.core.ExpectCompose$Sequential getSequential() - @NotNull - public final net.corda.testing.core.ExpectComposeState getState() - @Nullable - public kotlin.Pair, net.corda.testing.core.ExpectComposeState> nextState(E) -## -public static final class net.corda.testing.core.ExpectComposeState$Single extends net.corda.testing.core.ExpectComposeState - public (net.corda.testing.core.ExpectCompose$Single) - @NotNull - public java.util.List> getExpectedEvents() - @NotNull - public final net.corda.testing.core.ExpectCompose$Single getSingle() - @Nullable - public kotlin.Pair, net.corda.testing.core.ExpectComposeState> nextState(E) -## -public final class net.corda.testing.core.ExpectKt extends java.lang.Object - @NotNull - public static final net.corda.testing.core.ExpectCompose expect(Class, kotlin.jvm.functions.Function1, kotlin.jvm.functions.Function1) - public static final void expectEvents(Iterable, boolean, kotlin.jvm.functions.Function0>) - public static final void expectEvents(rx.Observable, boolean, kotlin.jvm.functions.Function0>) - public static final void genericExpectEvents(S, boolean, kotlin.jvm.functions.Function2, kotlin.Unit>, kotlin.jvm.functions.Function0>) - @NotNull - public static final net.corda.testing.core.ExpectCompose parallel(java.util.List>) - @NotNull - public static final net.corda.testing.core.ExpectCompose parallel(net.corda.testing.core.ExpectCompose...) - @NotNull - public static final net.corda.testing.core.ExpectCompose replicate(int, kotlin.jvm.functions.Function1>) - @NotNull - public static final net.corda.testing.core.ExpectCompose sequence(java.util.List>) - @NotNull - public static final net.corda.testing.core.ExpectCompose sequence(net.corda.testing.core.ExpectCompose...) -## -public final class net.corda.testing.core.SerializationEnvironmentRule extends java.lang.Object implements org.junit.rules.TestRule - public () - public (boolean) - public (boolean, int, kotlin.jvm.internal.DefaultConstructorMarker) - @NotNull - public org.junit.runners.model.Statement apply(org.junit.runners.model.Statement, org.junit.runner.Description) - @NotNull - public final net.corda.core.serialization.SerializationFactory getSerializationFactory() - public static final net.corda.testing.core.SerializationEnvironmentRule$Companion Companion -## -public static final class net.corda.testing.core.SerializationEnvironmentRule$Companion extends java.lang.Object - public (kotlin.jvm.internal.DefaultConstructorMarker) -## -public final class net.corda.testing.core.TestConstants extends java.lang.Object - @NotNull - public static final net.corda.core.contracts.Command dummyCommand(java.security.PublicKey...) - @NotNull - public static final net.corda.core.identity.CordaX500Name ALICE_NAME - @NotNull - public static final net.corda.core.identity.CordaX500Name BOB_NAME - @NotNull - public static final net.corda.core.identity.CordaX500Name BOC_NAME - @NotNull - public static final net.corda.core.identity.CordaX500Name CHARLIE_NAME - @NotNull - public static final net.corda.core.identity.CordaX500Name DUMMY_BANK_A_NAME - @NotNull - public static final net.corda.core.identity.CordaX500Name DUMMY_BANK_B_NAME - @NotNull - public static final net.corda.core.identity.CordaX500Name DUMMY_BANK_C_NAME - @NotNull - public static final net.corda.core.identity.CordaX500Name DUMMY_NOTARY_NAME - public static final int MAX_MESSAGE_SIZE = 10485760 -## -public final class net.corda.testing.core.TestIdentity extends java.lang.Object - public (net.corda.core.identity.CordaX500Name) - public (net.corda.core.identity.CordaX500Name, long) - public (net.corda.core.identity.CordaX500Name, long, net.corda.core.crypto.SignatureScheme) - public (net.corda.core.identity.CordaX500Name, long, net.corda.core.crypto.SignatureScheme, int, kotlin.jvm.internal.DefaultConstructorMarker) - public (net.corda.core.identity.CordaX500Name, java.security.KeyPair) - public (net.corda.core.identity.CordaX500Name, net.corda.core.crypto.SignatureScheme) - public (net.corda.core.identity.CordaX500Name, net.corda.core.crypto.SignatureScheme, int, kotlin.jvm.internal.DefaultConstructorMarker) - @NotNull - public static final net.corda.testing.core.TestIdentity fresh(String) - @NotNull - public static final net.corda.testing.core.TestIdentity fresh(String, net.corda.core.crypto.SignatureScheme) - @NotNull - public final net.corda.core.identity.PartyAndCertificate getIdentity() - @NotNull - public final java.security.KeyPair getKeyPair() - @NotNull - public final net.corda.core.identity.CordaX500Name getName() - @NotNull - public final net.corda.core.identity.Party getParty() - @NotNull - public final java.security.PublicKey getPublicKey() - @NotNull - public final net.corda.core.contracts.PartyAndReference ref(byte...) - public static final net.corda.testing.core.TestIdentity$Companion Companion -## -public static final class net.corda.testing.core.TestIdentity$Companion extends java.lang.Object - public (kotlin.jvm.internal.DefaultConstructorMarker) - @NotNull - public final net.corda.testing.core.TestIdentity fresh(String) - @NotNull - public final net.corda.testing.core.TestIdentity fresh(String, net.corda.core.crypto.SignatureScheme) -## -public final class net.corda.testing.core.TestUtils extends java.lang.Object - @NotNull - public static final net.corda.core.utilities.NetworkHostAndPort freeLocalHostAndPort() - public static final int freePort() - @NotNull - public static final net.corda.core.contracts.StateRef generateStateRef() - @NotNull - public static final java.util.List getFreeLocalPorts(String, int) - @NotNull - public static final net.corda.core.identity.PartyAndCertificate getTestPartyAndCertificate(net.corda.core.identity.CordaX500Name, java.security.PublicKey) - @NotNull - public static final net.corda.core.identity.PartyAndCertificate getTestPartyAndCertificate(net.corda.core.identity.Party) - @NotNull - public static final net.corda.core.identity.CordaX500Name makeUnique(net.corda.core.identity.CordaX500Name) - @NotNull - public static final net.corda.core.identity.Party singleIdentity(net.corda.core.node.NodeInfo) - @NotNull - public static final net.corda.core.identity.PartyAndCertificate singleIdentityAndCert(net.corda.core.node.NodeInfo) -## public final class net.corda.testing.dsl.AttachmentResolutionException extends net.corda.core.flows.FlowException public (net.corda.core.crypto.SecureHash) ## diff --git a/build.gradle b/build.gradle index b43b778053..c045fcf197 100644 --- a/build.gradle +++ b/build.gradle @@ -83,6 +83,8 @@ buildscript { ext.tcnative_version = '2.0.14.Final' ext.typesafe_config_version = constants.getProperty("typesafeConfigVersion") ext.fileupload_version = '1.4' + ext.kryo_version = '4.0.2' + ext.kryo_serializer_version = '0.43' // Legacy JUnit 4 version ext.junit_version = '4.12' // Need this version to access classpath scanning error handling fix - @@ -515,6 +517,7 @@ bintrayConfig { 'corda-node-api', 'corda-node-djvm', 'corda-test-common', + 'corda-core-test-utils', 'corda-test-utils', 'corda-test-db', 'corda-jackson', diff --git a/client/jackson/src/test/kotlin/net/corda/client/jackson/JacksonSupportTest.kt b/client/jackson/src/test/kotlin/net/corda/client/jackson/JacksonSupportTest.kt index bd554c73e9..b6f8d20f23 100644 --- a/client/jackson/src/test/kotlin/net/corda/client/jackson/JacksonSupportTest.kt +++ b/client/jackson/src/test/kotlin/net/corda/client/jackson/JacksonSupportTest.kt @@ -42,8 +42,8 @@ import net.corda.nodeapi.internal.crypto.x509Certificates import net.corda.testing.common.internal.testNetworkParameters import net.corda.testing.contracts.DummyContract import net.corda.testing.core.* -import net.corda.testing.internal.createNodeInfoAndSigned -import net.corda.testing.internal.rigorousMock +import net.corda.coretesting.internal.createNodeInfoAndSigned +import net.corda.coretesting.internal.rigorousMock import org.assertj.core.api.Assertions.assertThat import org.assertj.core.api.Assertions.assertThatThrownBy import org.junit.Before diff --git a/client/rpc/build.gradle b/client/rpc/build.gradle index ee557d933b..d27d64c7d0 100644 --- a/client/rpc/build.gradle +++ b/client/rpc/build.gradle @@ -103,7 +103,7 @@ dependencies { smokeTestRuntimeOnly "org.junit.platform:junit-platform-launcher:${junit_platform_version}" // JDK11: required by Quasar at run-time - smokeTestRuntimeOnly "com.esotericsoftware:kryo:4.0.2" + smokeTestRuntimeOnly "com.esotericsoftware:kryo:$kryo_version" } task integrationTest(type: Test) { diff --git a/client/rpc/src/integration-test/kotlin/net/corda/client/rpc/RPCStabilityTests.kt b/client/rpc/src/integration-test/kotlin/net/corda/client/rpc/RPCStabilityTests.kt index b0c80244fa..96d83d1d81 100644 --- a/client/rpc/src/integration-test/kotlin/net/corda/client/rpc/RPCStabilityTests.kt +++ b/client/rpc/src/integration-test/kotlin/net/corda/client/rpc/RPCStabilityTests.kt @@ -20,7 +20,7 @@ import net.corda.testing.common.internal.eventually import net.corda.testing.common.internal.succeeds import net.corda.testing.core.SerializationEnvironmentRule import net.corda.testing.driver.internal.incrementalPortAllocation -import net.corda.testing.internal.testThreadFactory +import net.corda.coretesting.internal.testThreadFactory import net.corda.testing.node.internal.RPCDriverDSL import net.corda.testing.node.internal.RpcBrokerHandle import net.corda.testing.node.internal.RpcServerHandle diff --git a/client/rpc/src/main/kotlin/net/corda/client/rpc/CordaRPCClient.kt b/client/rpc/src/main/kotlin/net/corda/client/rpc/CordaRPCClient.kt index 8b43e35a26..6308ae1ebf 100644 --- a/client/rpc/src/main/kotlin/net/corda/client/rpc/CordaRPCClient.kt +++ b/client/rpc/src/main/kotlin/net/corda/client/rpc/CordaRPCClient.kt @@ -3,7 +3,7 @@ package net.corda.client.rpc import com.github.benmanes.caffeine.cache.Caffeine import net.corda.client.rpc.internal.RPCClient import net.corda.client.rpc.internal.ReconnectingCordaRPCOps -import net.corda.client.rpc.internal.serialization.amqp.AMQPClientSerializationScheme +import net.corda.nodeapi.internal.rpc.client.AMQPClientSerializationScheme import net.corda.client.rpc.reconnect.CouldNotStartFlowException import net.corda.core.CordaInternal import net.corda.core.context.Actor diff --git a/client/rpc/src/main/kotlin/net/corda/client/rpc/internal/RPCClientProxyHandler.kt b/client/rpc/src/main/kotlin/net/corda/client/rpc/internal/RPCClientProxyHandler.kt index aabea195fc..9dc7d5cc70 100644 --- a/client/rpc/src/main/kotlin/net/corda/client/rpc/internal/RPCClientProxyHandler.kt +++ b/client/rpc/src/main/kotlin/net/corda/client/rpc/internal/RPCClientProxyHandler.kt @@ -1,6 +1,5 @@ package net.corda.client.rpc.internal -import com.github.benmanes.caffeine.cache.Cache import com.github.benmanes.caffeine.cache.Caffeine import com.github.benmanes.caffeine.cache.RemovalCause import com.github.benmanes.caffeine.cache.RemovalListener @@ -11,7 +10,7 @@ import net.corda.client.rpc.ConnectionFailureException import net.corda.client.rpc.CordaRPCClientConfiguration import net.corda.client.rpc.RPCException import net.corda.client.rpc.RPCSinceVersion -import net.corda.client.rpc.internal.serialization.amqp.RpcClientObservableDeSerializer +import net.corda.nodeapi.internal.rpc.client.RpcClientObservableDeSerializer import net.corda.core.context.Actor import net.corda.core.context.Trace import net.corda.core.context.Trace.InvocationId @@ -33,6 +32,10 @@ import net.corda.core.utilities.getOrThrow import net.corda.nodeapi.RPCApi import net.corda.nodeapi.RPCApi.CLASS_METHOD_DIVIDER import net.corda.nodeapi.internal.DeduplicationChecker +import net.corda.nodeapi.internal.rpc.client.CallSite +import net.corda.nodeapi.internal.rpc.client.CallSiteMap +import net.corda.nodeapi.internal.rpc.client.ObservableContext +import net.corda.nodeapi.internal.rpc.client.RpcObservableMap import org.apache.activemq.artemis.api.core.ActiveMQException import org.apache.activemq.artemis.api.core.ActiveMQNotConnectedException import org.apache.activemq.artemis.api.core.RoutingType @@ -257,9 +260,6 @@ class RPCClientProxyHandler( startSessions() } - /** A throwable that doesn't represent a real error - it's just here to wrap a stack trace. */ - class CallSite(val rpcName: String) : Throwable("") - // This is the general function that transforms a client side RPC to internal Artemis messages. override fun invoke(proxy: Any, method: Method, arguments: Array?): Any? { lifeCycle.requireState { it == State.STARTED || it == State.SERVER_VERSION_NOT_SET } @@ -666,20 +666,5 @@ class RPCClientProxyHandler( } } -private typealias RpcObservableMap = Cache>> -private typealias RpcReplyMap = ConcurrentHashMap> -private typealias CallSiteMap = ConcurrentHashMap - -/** - * Holds a context available during de-serialisation of messages that are expected to contain Observables. - * - * @property observableMap holds the Observables that are ultimately exposed to the user. - * @property hardReferenceStore holds references to Observables we want to keep alive while they are subscribed to. - * @property callSiteMap keeps stack traces captured when an RPC was invoked, useful for debugging when an observable leaks. - */ -data class ObservableContext( - val callSiteMap: CallSiteMap?, - val observableMap: RpcObservableMap, - val hardReferenceStore: MutableSet> -) +private typealias RpcReplyMap = ConcurrentHashMap> diff --git a/client/rpc/src/test/kotlin/net/corda/client/rpc/RPCConcurrencyTests.kt b/client/rpc/src/test/kotlin/net/corda/client/rpc/RPCConcurrencyTests.kt index 01514e12d3..f5aa1357e8 100644 --- a/client/rpc/src/test/kotlin/net/corda/client/rpc/RPCConcurrencyTests.kt +++ b/client/rpc/src/test/kotlin/net/corda/client/rpc/RPCConcurrencyTests.kt @@ -8,7 +8,7 @@ import net.corda.core.serialization.CordaSerializable import net.corda.core.utilities.getOrThrow import net.corda.core.utilities.millis import net.corda.node.services.rpc.RPCServerConfiguration -import net.corda.testing.internal.testThreadFactory +import net.corda.coretesting.internal.testThreadFactory import net.corda.testing.node.internal.RPCDriverDSL import net.corda.testing.node.internal.rpcDriver import org.apache.activemq.artemis.utils.collections.ConcurrentHashSet diff --git a/client/rpc/src/test/kotlin/net/corda/client/rpc/RPCPerformanceTests.kt b/client/rpc/src/test/kotlin/net/corda/client/rpc/RPCPerformanceTests.kt index e1a0b3e853..ce423a748b 100644 --- a/client/rpc/src/test/kotlin/net/corda/client/rpc/RPCPerformanceTests.kt +++ b/client/rpc/src/test/kotlin/net/corda/client/rpc/RPCPerformanceTests.kt @@ -5,7 +5,7 @@ import net.corda.core.messaging.RPCOps import net.corda.core.utilities.minutes import net.corda.core.utilities.seconds import net.corda.node.services.rpc.RPCServerConfiguration -import net.corda.testing.internal.performance.div +import net.corda.coretesting.internal.performance.div import net.corda.testing.node.internal.RPCDriverDSL import net.corda.testing.node.internal.performance.startPublishingFixedRateInjector import net.corda.testing.node.internal.performance.startReporter diff --git a/common/logging/src/main/kotlin/net/corda/common/logging/Constants.kt b/common/logging/src/main/kotlin/net/corda/common/logging/Constants.kt index 6e878a6616..8d2d10d04f 100644 --- a/common/logging/src/main/kotlin/net/corda/common/logging/Constants.kt +++ b/common/logging/src/main/kotlin/net/corda/common/logging/Constants.kt @@ -9,4 +9,4 @@ package net.corda.common.logging * (originally added to source control for ease of use) */ -internal const val CURRENT_MAJOR_RELEASE = "4.5-SNAPSHOT" +internal const val CURRENT_MAJOR_RELEASE = "4.5-SNAPSHOT" \ No newline at end of file diff --git a/confidential-identities/src/test/kotlin/net/corda/confidential/SwapIdentitiesFlowTests.kt b/confidential-identities/src/test/kotlin/net/corda/confidential/SwapIdentitiesFlowTests.kt index 71d4ff23c6..fe99ca34ca 100644 --- a/confidential-identities/src/test/kotlin/net/corda/confidential/SwapIdentitiesFlowTests.kt +++ b/confidential-identities/src/test/kotlin/net/corda/confidential/SwapIdentitiesFlowTests.kt @@ -15,9 +15,9 @@ import net.corda.core.identity.AnonymousParty import net.corda.core.identity.Party import net.corda.core.identity.PartyAndCertificate import net.corda.testing.core.* -import net.corda.testing.internal.matchers.allOf -import net.corda.testing.internal.matchers.flow.willReturn -import net.corda.testing.internal.matchers.hasOnlyEntries +import net.corda.coretesting.internal.matchers.allOf +import net.corda.coretesting.internal.matchers.flow.willReturn +import net.corda.coretesting.internal.matchers.hasOnlyEntries import net.corda.testing.node.internal.InternalMockNetwork import net.corda.testing.node.internal.TestStartedNode import net.corda.testing.node.internal.enclosedCordapp diff --git a/core-tests/src/test/kotlin/net/corda/coretests/crypto/PartialMerkleTreeTest.kt b/core-tests/src/test/kotlin/net/corda/coretests/crypto/PartialMerkleTreeTest.kt index 4a50b3ffdc..edcca8e214 100644 --- a/core-tests/src/test/kotlin/net/corda/coretests/crypto/PartialMerkleTreeTest.kt +++ b/core-tests/src/test/kotlin/net/corda/coretests/crypto/PartialMerkleTreeTest.kt @@ -24,7 +24,7 @@ import net.corda.testing.core.TestIdentity import net.corda.testing.dsl.LedgerDSL import net.corda.testing.dsl.TestLedgerDSLInterpreter import net.corda.testing.dsl.TestTransactionDSLInterpreter -import net.corda.testing.internal.TEST_TX_TIME +import net.corda.coretesting.internal.TEST_TX_TIME import net.corda.testing.internal.createWireTransaction import net.corda.testing.node.MockServices import net.corda.testing.node.ledger diff --git a/core-tests/src/test/kotlin/net/corda/coretests/flows/AttachmentTests.kt b/core-tests/src/test/kotlin/net/corda/coretests/flows/AttachmentTests.kt index 445cfc4eb0..50fed81556 100644 --- a/core-tests/src/test/kotlin/net/corda/coretests/flows/AttachmentTests.kt +++ b/core-tests/src/test/kotlin/net/corda/coretests/flows/AttachmentTests.kt @@ -21,8 +21,8 @@ import net.corda.testing.core.BOB_NAME import net.corda.testing.core.makeUnique import net.corda.testing.core.singleIdentity import net.corda.testing.internal.fakeAttachment -import net.corda.testing.internal.matchers.flow.willReturn -import net.corda.testing.internal.matchers.flow.willThrow +import net.corda.coretesting.internal.matchers.flow.willReturn +import net.corda.coretesting.internal.matchers.flow.willThrow import net.corda.testing.node.internal.InternalMockNetwork import net.corda.testing.node.internal.InternalMockNodeParameters import net.corda.testing.node.internal.TestStartedNode diff --git a/core-tests/src/test/kotlin/net/corda/coretests/flows/CollectSignaturesFlowTests.kt b/core-tests/src/test/kotlin/net/corda/coretests/flows/CollectSignaturesFlowTests.kt index e047358d1e..f0d13e2123 100644 --- a/core-tests/src/test/kotlin/net/corda/coretests/flows/CollectSignaturesFlowTests.kt +++ b/core-tests/src/test/kotlin/net/corda/coretests/flows/CollectSignaturesFlowTests.kt @@ -30,9 +30,9 @@ import net.corda.testing.core.BOB_NAME import net.corda.testing.core.CHARLIE_NAME import net.corda.testing.core.TestIdentity import net.corda.testing.core.singleIdentity -import net.corda.testing.internal.matchers.flow.willReturn -import net.corda.testing.internal.matchers.flow.willThrow -import net.corda.testing.internal.rigorousMock +import net.corda.coretesting.internal.matchers.flow.willReturn +import net.corda.coretesting.internal.matchers.flow.willThrow +import net.corda.coretesting.internal.rigorousMock import net.corda.testing.node.MockServices import net.corda.testing.node.internal.DUMMY_CONTRACTS_CORDAPP import net.corda.testing.node.internal.InternalMockNetwork diff --git a/core-tests/src/test/kotlin/net/corda/coretests/flows/ContractUpgradeFlowRPCTest.kt b/core-tests/src/test/kotlin/net/corda/coretests/flows/ContractUpgradeFlowRPCTest.kt index 1c00ee69de..fa7fa39c6f 100644 --- a/core-tests/src/test/kotlin/net/corda/coretests/flows/ContractUpgradeFlowRPCTest.kt +++ b/core-tests/src/test/kotlin/net/corda/coretests/flows/ContractUpgradeFlowRPCTest.kt @@ -18,8 +18,8 @@ import net.corda.testing.contracts.DummyContractV2 import net.corda.testing.core.ALICE_NAME import net.corda.testing.core.BOB_NAME import net.corda.testing.core.singleIdentity -import net.corda.testing.internal.matchers.rpc.willReturn -import net.corda.testing.internal.matchers.rpc.willThrow +import net.corda.coretesting.internal.matchers.rpc.willReturn +import net.corda.coretesting.internal.matchers.rpc.willThrow import net.corda.testing.node.User import net.corda.testing.node.internal.* import org.junit.AfterClass diff --git a/core-tests/src/test/kotlin/net/corda/coretests/flows/ContractUpgradeFlowTest.kt b/core-tests/src/test/kotlin/net/corda/coretests/flows/ContractUpgradeFlowTest.kt index 7121630864..54678ff3c6 100644 --- a/core-tests/src/test/kotlin/net/corda/coretests/flows/ContractUpgradeFlowTest.kt +++ b/core-tests/src/test/kotlin/net/corda/coretests/flows/ContractUpgradeFlowTest.kt @@ -20,8 +20,8 @@ import net.corda.testing.contracts.DummyContractV3 import net.corda.testing.core.ALICE_NAME import net.corda.testing.core.BOB_NAME import net.corda.testing.core.singleIdentity -import net.corda.testing.internal.matchers.flow.willReturn -import net.corda.testing.internal.matchers.flow.willThrow +import net.corda.coretesting.internal.matchers.flow.willReturn +import net.corda.coretesting.internal.matchers.flow.willThrow import net.corda.testing.node.internal.* import org.junit.AfterClass import org.junit.Test diff --git a/core-tests/src/test/kotlin/net/corda/coretests/flows/FinalityFlowTests.kt b/core-tests/src/test/kotlin/net/corda/coretests/flows/FinalityFlowTests.kt index ef37af8364..175fcc0cfd 100644 --- a/core-tests/src/test/kotlin/net/corda/coretests/flows/FinalityFlowTests.kt +++ b/core-tests/src/test/kotlin/net/corda/coretests/flows/FinalityFlowTests.kt @@ -13,8 +13,8 @@ import net.corda.finance.POUNDS import net.corda.finance.contracts.asset.Cash import net.corda.finance.issuedBy import net.corda.testing.core.* -import net.corda.testing.internal.matchers.flow.willReturn -import net.corda.testing.internal.matchers.flow.willThrow +import net.corda.coretesting.internal.matchers.flow.willReturn +import net.corda.coretesting.internal.matchers.flow.willThrow import net.corda.testing.node.internal.* import org.assertj.core.api.Assertions.assertThat import org.junit.After diff --git a/core-tests/src/test/kotlin/net/corda/coretests/flows/ReceiveAllFlowTests.kt b/core-tests/src/test/kotlin/net/corda/coretests/flows/ReceiveAllFlowTests.kt index 92441fe7c6..8dff9e634b 100644 --- a/core-tests/src/test/kotlin/net/corda/coretests/flows/ReceiveAllFlowTests.kt +++ b/core-tests/src/test/kotlin/net/corda/coretests/flows/ReceiveAllFlowTests.kt @@ -11,7 +11,7 @@ import net.corda.testing.core.singleIdentity import net.corda.testing.flows.from import net.corda.testing.flows.receiveAll import net.corda.testing.flows.registerCordappFlowFactory -import net.corda.testing.internal.matchers.flow.willReturn +import net.corda.coretesting.internal.matchers.flow.willReturn import net.corda.testing.node.internal.InternalMockNetwork import net.corda.testing.node.internal.TestStartedNode import org.junit.AfterClass diff --git a/core-tests/src/test/kotlin/net/corda/coretests/indentity/PartyAndCertificateTest.kt b/core-tests/src/test/kotlin/net/corda/coretests/indentity/PartyAndCertificateTest.kt index 436e222b86..54898eeaeb 100644 --- a/core-tests/src/test/kotlin/net/corda/coretests/indentity/PartyAndCertificateTest.kt +++ b/core-tests/src/test/kotlin/net/corda/coretests/indentity/PartyAndCertificateTest.kt @@ -12,7 +12,7 @@ import net.corda.nodeapi.internal.crypto.X509KeyStore import net.corda.nodeapi.internal.crypto.X509Utilities import net.corda.testing.core.SerializationEnvironmentRule import net.corda.testing.core.getTestPartyAndCertificate -import net.corda.testing.internal.DEV_ROOT_CA +import net.corda.coretesting.internal.DEV_ROOT_CA import org.assertj.core.api.Assertions.assertThat import org.junit.Rule import org.junit.Test diff --git a/core-tests/src/test/kotlin/net/corda/coretests/serialization/TransactionSerializationTests.kt b/core-tests/src/test/kotlin/net/corda/coretests/serialization/TransactionSerializationTests.kt index b305a49610..bce4e67224 100644 --- a/core-tests/src/test/kotlin/net/corda/coretests/serialization/TransactionSerializationTests.kt +++ b/core-tests/src/test/kotlin/net/corda/coretests/serialization/TransactionSerializationTests.kt @@ -19,8 +19,8 @@ import net.corda.testing.common.internal.testNetworkParameters import net.corda.testing.core.DUMMY_NOTARY_NAME import net.corda.testing.core.SerializationEnvironmentRule import net.corda.testing.core.TestIdentity -import net.corda.testing.internal.TEST_TX_TIME -import net.corda.testing.internal.rigorousMock +import net.corda.coretesting.internal.TEST_TX_TIME +import net.corda.coretesting.internal.rigorousMock import net.corda.testing.node.MockServices import org.junit.Before import org.junit.Rule diff --git a/core-tests/src/test/kotlin/net/corda/coretests/transactions/TransactionBuilderTest.kt b/core-tests/src/test/kotlin/net/corda/coretests/transactions/TransactionBuilderTest.kt index 500bc101ab..55fb43f003 100644 --- a/core-tests/src/test/kotlin/net/corda/coretests/transactions/TransactionBuilderTest.kt +++ b/core-tests/src/test/kotlin/net/corda/coretests/transactions/TransactionBuilderTest.kt @@ -20,7 +20,7 @@ import net.corda.testing.common.internal.testNetworkParameters import net.corda.testing.contracts.DummyContract import net.corda.testing.contracts.DummyState import net.corda.testing.core.* -import net.corda.testing.internal.rigorousMock +import net.corda.coretesting.internal.rigorousMock import org.assertj.core.api.Assertions.assertThat import org.assertj.core.api.Assertions.assertThatThrownBy import org.junit.Assert.assertFalse diff --git a/core-tests/src/test/kotlin/net/corda/coretests/transactions/TransactionTests.kt b/core-tests/src/test/kotlin/net/corda/coretests/transactions/TransactionTests.kt index cec21d0f08..ec14b84029 100644 --- a/core-tests/src/test/kotlin/net/corda/coretests/transactions/TransactionTests.kt +++ b/core-tests/src/test/kotlin/net/corda/coretests/transactions/TransactionTests.kt @@ -17,7 +17,7 @@ import net.corda.testing.contracts.DummyContract import net.corda.testing.core.* import net.corda.testing.internal.createWireTransaction import net.corda.testing.internal.fakeAttachment -import net.corda.testing.internal.rigorousMock +import net.corda.coretesting.internal.rigorousMock import org.junit.Rule import org.junit.Test import java.math.BigInteger diff --git a/core-tests/src/test/kotlin/net/corda/coretests/utilities/KotlinUtilsTest.kt b/core-tests/src/test/kotlin/net/corda/coretests/utilities/KotlinUtilsTest.kt index 15dd6aef8d..e989b3a107 100644 --- a/core-tests/src/test/kotlin/net/corda/coretests/utilities/KotlinUtilsTest.kt +++ b/core-tests/src/test/kotlin/net/corda/coretests/utilities/KotlinUtilsTest.kt @@ -7,7 +7,7 @@ import net.corda.core.serialization.CordaSerializable import net.corda.core.serialization.internal.checkpointDeserialize import net.corda.core.serialization.internal.checkpointSerialize import net.corda.core.utilities.transient -import net.corda.node.serialization.kryo.KRYO_CHECKPOINT_CONTEXT +import net.corda.nodeapi.internal.serialization.kryo.KRYO_CHECKPOINT_CONTEXT import net.corda.serialization.internal.CheckpointSerializationContextImpl import net.corda.testing.core.SerializationEnvironmentRule import org.assertj.core.api.Assertions.assertThat diff --git a/core/build.gradle b/core/build.gradle index cbe24830ac..37b542c0e9 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -82,7 +82,7 @@ dependencies { testCompile "org.ow2.asm:asm:$asm_version" // JDK11: required by Quasar at run-time - testRuntimeOnly "com.esotericsoftware:kryo:4.0.2" + testRuntimeOnly "com.esotericsoftware:kryo:$kryo_version" testCompile "com.nhaarman:mockito-kotlin:$mockito_kotlin_version" testCompile "org.mockito:mockito-core:$mockito_version" diff --git a/detekt-baseline.xml b/detekt-baseline.xml index 39017a0c2b..3e147108a6 100644 --- a/detekt-baseline.xml +++ b/detekt-baseline.xml @@ -1198,7 +1198,7 @@ MagicNumber:X509Utilities.kt$X509Utilities$3650 MagicNumber:errorAndTerminate.kt$10 MatchingDeclarationName:AMQPSerializerFactories.kt$net.corda.serialization.internal.amqp.AMQPSerializerFactories.kt - MatchingDeclarationName:AMQPTestSerialiationScheme.kt$net.corda.node.internal.serialization.testutils.AMQPTestSerialiationScheme.kt + MatchingDeclarationName:AMQPTestSerialiationScheme.kt$net.corda.nodeapi.internal.serialization.testutils.AMQPTestSerialiationScheme.kt MatchingDeclarationName:AttachmentDemo.kt$net.corda.attachmentdemo.AttachmentDemo.kt MatchingDeclarationName:AzureRegistryLocator.kt$net.corda.networkbuilder.containers.push.azure.AzureRegistryLocator.kt MatchingDeclarationName:CheckpointSerializationScheme.kt$net.corda.serialization.internal.CheckpointSerializationScheme.kt @@ -2113,7 +2113,7 @@ WildcardImport:FlowFrameworkTests.kt$import net.corda.testing.node.internal.* WildcardImport:FlowFrameworkTripartyTests.kt$import net.corda.testing.node.internal.* WildcardImport:FlowLogicRefFactoryImpl.kt$import net.corda.core.flows.* - WildcardImport:FlowMatchers.kt$import net.corda.testing.internal.matchers.* + WildcardImport:FlowMatchers.kt$import net.corda.coretesting.internal.matchers.* WildcardImport:FlowOverrideTests.kt$import net.corda.core.flows.* WildcardImport:FlowRetryTest.kt$import net.corda.core.flows.* WildcardImport:FlowStackSnapshotTest.kt$import net.corda.core.flows.* diff --git a/docs/source/example-code/src/test/kotlin/net/corda/docs/kotlin/tutorial/testdsl/TutorialTestDSL.kt b/docs/source/example-code/src/test/kotlin/net/corda/docs/kotlin/tutorial/testdsl/TutorialTestDSL.kt index b5670ef17c..dc7e657ad5 100644 --- a/docs/source/example-code/src/test/kotlin/net/corda/docs/kotlin/tutorial/testdsl/TutorialTestDSL.kt +++ b/docs/source/example-code/src/test/kotlin/net/corda/docs/kotlin/tutorial/testdsl/TutorialTestDSL.kt @@ -17,7 +17,6 @@ import net.corda.finance.contracts.ICommercialPaperState import net.corda.finance.contracts.asset.CASH import net.corda.finance.contracts.asset.Cash import net.corda.testing.core.* -import net.corda.testing.internal.rigorousMock import net.corda.testing.node.MockServices import net.corda.testing.node.ledger import net.corda.testing.node.transaction diff --git a/finance/contracts/src/test/kotlin/net/corda/finance/contracts/CommercialPaperTests.kt b/finance/contracts/src/test/kotlin/net/corda/finance/contracts/CommercialPaperTests.kt index bdebb8f1cc..67b075dee0 100644 --- a/finance/contracts/src/test/kotlin/net/corda/finance/contracts/CommercialPaperTests.kt +++ b/finance/contracts/src/test/kotlin/net/corda/finance/contracts/CommercialPaperTests.kt @@ -22,7 +22,7 @@ import net.corda.testing.core.* import net.corda.testing.dsl.EnforceVerifyOrFail import net.corda.testing.dsl.TransactionDSL import net.corda.testing.dsl.TransactionDSLInterpreter -import net.corda.testing.internal.TEST_TX_TIME +import net.corda.coretesting.internal.TEST_TX_TIME import net.corda.testing.internal.vault.VaultFiller import net.corda.testing.node.MockServices import net.corda.testing.node.MockServices.Companion.makeTestDatabaseAndMockServices diff --git a/finance/contracts/src/test/kotlin/net/corda/finance/contracts/asset/ObligationTests.kt b/finance/contracts/src/test/kotlin/net/corda/finance/contracts/asset/ObligationTests.kt index 9f417b9a35..e2be35de43 100644 --- a/finance/contracts/src/test/kotlin/net/corda/finance/contracts/asset/ObligationTests.kt +++ b/finance/contracts/src/test/kotlin/net/corda/finance/contracts/asset/ObligationTests.kt @@ -24,7 +24,7 @@ import net.corda.finance.workflows.asset.ObligationUtils import net.corda.testing.contracts.DummyContract import net.corda.testing.core.* import net.corda.testing.dsl.* -import net.corda.testing.internal.TEST_TX_TIME +import net.corda.coretesting.internal.TEST_TX_TIME import net.corda.testing.internal.fakeAttachment import net.corda.testing.internal.vault.CommodityState import net.corda.testing.node.MockServices diff --git a/node-api/build.gradle b/node-api/build.gradle index e2ac2b7f66..3f1797aa94 100644 --- a/node-api/build.gradle +++ b/node-api/build.gradle @@ -30,6 +30,10 @@ dependencies { // ClassGraph: classpath scanning compile "io.github.classgraph:classgraph:$class_graph_version" + // Kryo: object graph serialization. + compile "com.esotericsoftware:kryo:$kryo_version" + compile "de.javakaffee:kryo-serializers:$kryo_serializer_version" + // For caches rather than guava compile "com.github.ben-manes.caffeine:caffeine:$caffeine_version" @@ -39,7 +43,7 @@ dependencies { runtime 'com.mattbertolini:liquibase-slf4j:2.0.0' // JDK11: required by Quasar at run-time - runtime "com.esotericsoftware:kryo:4.0.2" + runtime "com.esotericsoftware:kryo:$kryo_version" testImplementation "org.junit.jupiter:junit-jupiter-api:${junit_jupiter_version}" testImplementation "junit:junit:$junit_version" diff --git a/node/src/main/kotlin/net/corda/node/services/rpc/ObservableContextInterface.kt b/node-api/src/main/kotlin/net/corda/nodeapi/internal/rpc/ObservableContextInterface.kt similarity index 95% rename from node/src/main/kotlin/net/corda/node/services/rpc/ObservableContextInterface.kt rename to node-api/src/main/kotlin/net/corda/nodeapi/internal/rpc/ObservableContextInterface.kt index 030fd5721a..cd14529152 100644 --- a/node/src/main/kotlin/net/corda/node/services/rpc/ObservableContextInterface.kt +++ b/node-api/src/main/kotlin/net/corda/nodeapi/internal/rpc/ObservableContextInterface.kt @@ -1,4 +1,4 @@ -package net.corda.node.services.rpc +package net.corda.nodeapi.internal.rpc import com.github.benmanes.caffeine.cache.Cache import net.corda.core.context.Trace diff --git a/node-api/src/main/kotlin/net/corda/nodeapi/internal/rpc/ObservableSubscription.kt b/node-api/src/main/kotlin/net/corda/nodeapi/internal/rpc/ObservableSubscription.kt new file mode 100644 index 0000000000..1b3dabe04c --- /dev/null +++ b/node-api/src/main/kotlin/net/corda/nodeapi/internal/rpc/ObservableSubscription.kt @@ -0,0 +1,7 @@ +package net.corda.nodeapi.internal.rpc + +import rx.Subscription + +class ObservableSubscription( + val subscription: Subscription +) diff --git a/client/rpc/src/main/kotlin/net/corda/client/rpc/internal/serialization/amqp/AMQPClientSerializationScheme.kt b/node-api/src/main/kotlin/net/corda/nodeapi/internal/rpc/client/AMQPClientSerializationScheme.kt similarity index 84% rename from client/rpc/src/main/kotlin/net/corda/client/rpc/internal/serialization/amqp/AMQPClientSerializationScheme.kt rename to node-api/src/main/kotlin/net/corda/nodeapi/internal/rpc/client/AMQPClientSerializationScheme.kt index fc36e59ffd..e86796bf8b 100644 --- a/client/rpc/src/main/kotlin/net/corda/client/rpc/internal/serialization/amqp/AMQPClientSerializationScheme.kt +++ b/node-api/src/main/kotlin/net/corda/nodeapi/internal/rpc/client/AMQPClientSerializationScheme.kt @@ -1,4 +1,4 @@ -package net.corda.client.rpc.internal.serialization.amqp +package net.corda.nodeapi.internal.rpc.client import net.corda.core.cordapp.Cordapp import net.corda.core.internal.toSynchronised @@ -8,9 +8,18 @@ import net.corda.core.serialization.SerializationCustomSerializer import net.corda.core.serialization.SerializationWhitelist import net.corda.core.serialization.internal.SerializationEnvironment import net.corda.core.serialization.internal._rpcClientSerializationEnv -import net.corda.core.serialization.internal.nodeSerializationEnv -import net.corda.serialization.internal.* -import net.corda.serialization.internal.amqp.* +import net.corda.serialization.internal.AMQP_P2P_CONTEXT +import net.corda.serialization.internal.AMQP_RPC_CLIENT_CONTEXT +import net.corda.serialization.internal.AMQP_RPC_SERVER_CONTEXT +import net.corda.serialization.internal.AMQP_STORAGE_CONTEXT +import net.corda.serialization.internal.CordaSerializationMagic +import net.corda.serialization.internal.SerializationFactoryImpl +import net.corda.serialization.internal.amqp.AbstractAMQPSerializationScheme +import net.corda.serialization.internal.amqp.AccessOrderLinkedHashMap +import net.corda.serialization.internal.amqp.SerializationFactoryCacheKey +import net.corda.serialization.internal.amqp.SerializerFactory +import net.corda.serialization.internal.amqp.SerializerFactoryBuilder +import net.corda.serialization.internal.amqp.amqpMagic import net.corda.serialization.internal.amqp.custom.RxNotificationSerializer /** diff --git a/node-api/src/main/kotlin/net/corda/nodeapi/internal/rpc/client/ObservableContext.kt b/node-api/src/main/kotlin/net/corda/nodeapi/internal/rpc/client/ObservableContext.kt new file mode 100644 index 0000000000..8bd4d08bfa --- /dev/null +++ b/node-api/src/main/kotlin/net/corda/nodeapi/internal/rpc/client/ObservableContext.kt @@ -0,0 +1,27 @@ +package net.corda.nodeapi.internal.rpc.client + +import com.github.benmanes.caffeine.cache.Cache +import net.corda.core.context.Trace +import rx.Notification +import rx.Observable +import rx.subjects.UnicastSubject +import java.util.concurrent.ConcurrentHashMap + +/** A throwable that doesn't represent a real error - it's just here to wrap a stack trace. */ +class CallSite(val rpcName: String) : Throwable("") + +typealias RpcObservableMap = Cache>> +typealias CallSiteMap = ConcurrentHashMap + +/** + * Holds a context available during de-serialisation of messages that are expected to contain Observables. + * + * @property observableMap holds the Observables that are ultimately exposed to the user. + * @property hardReferenceStore holds references to Observables we want to keep alive while they are subscribed to. + * @property callSiteMap keeps stack traces captured when an RPC was invoked, useful for debugging when an observable leaks. + */ +data class ObservableContext( + val callSiteMap: CallSiteMap?, + val observableMap: RpcObservableMap, + val hardReferenceStore: MutableSet> +) diff --git a/client/rpc/src/main/kotlin/net/corda/client/rpc/internal/serialization/amqp/RpcClientCordaFutureSerializer.kt b/node-api/src/main/kotlin/net/corda/nodeapi/internal/rpc/client/RpcClientCordaFutureSerializer.kt similarity index 90% rename from client/rpc/src/main/kotlin/net/corda/client/rpc/internal/serialization/amqp/RpcClientCordaFutureSerializer.kt rename to node-api/src/main/kotlin/net/corda/nodeapi/internal/rpc/client/RpcClientCordaFutureSerializer.kt index 44e2a414a0..f7c23472f4 100644 --- a/client/rpc/src/main/kotlin/net/corda/client/rpc/internal/serialization/amqp/RpcClientCordaFutureSerializer.kt +++ b/node-api/src/main/kotlin/net/corda/nodeapi/internal/rpc/client/RpcClientCordaFutureSerializer.kt @@ -1,4 +1,4 @@ -package net.corda.client.rpc.internal.serialization.amqp +package net.corda.nodeapi.internal.rpc.client import net.corda.core.concurrent.CordaFuture import net.corda.core.toFuture @@ -14,7 +14,7 @@ import java.io.NotSerializableException class RpcClientCordaFutureSerializer (factory: SerializerFactory) : CustomSerializer.Proxy, RpcClientCordaFutureSerializer.FutureProxy>( CordaFuture::class.java, - RpcClientCordaFutureSerializer.FutureProxy::class.java, factory + FutureProxy::class.java, factory ) { override fun fromProxy(proxy: FutureProxy): CordaFuture<*> { try { diff --git a/client/rpc/src/main/kotlin/net/corda/client/rpc/internal/serialization/amqp/RpcClientObservableDeSerializer.kt b/node-api/src/main/kotlin/net/corda/nodeapi/internal/rpc/client/RpcClientObservableDeSerializer.kt similarity index 93% rename from client/rpc/src/main/kotlin/net/corda/client/rpc/internal/serialization/amqp/RpcClientObservableDeSerializer.kt rename to node-api/src/main/kotlin/net/corda/nodeapi/internal/rpc/client/RpcClientObservableDeSerializer.kt index 17ba71e200..765a70dd94 100644 --- a/client/rpc/src/main/kotlin/net/corda/client/rpc/internal/serialization/amqp/RpcClientObservableDeSerializer.kt +++ b/node-api/src/main/kotlin/net/corda/nodeapi/internal/rpc/client/RpcClientObservableDeSerializer.kt @@ -1,8 +1,6 @@ -package net.corda.client.rpc.internal.serialization.amqp +package net.corda.nodeapi.internal.rpc.client -import net.corda.client.rpc.internal.ObservableContext -import net.corda.client.rpc.internal.RPCClientProxyHandler import net.corda.core.context.Trace import net.corda.core.serialization.SerializationContext import net.corda.core.utilities.loggerFor @@ -86,7 +84,7 @@ object RpcClientObservableDeSerializer : CustomSerializer.Implements) throw NotSerializableException("Input must be a serialised list") if (obj.size != 2) throw NotSerializableException("Expecting two elements, have ${obj.size}") @@ -105,7 +103,8 @@ object RpcClientObservableDeSerializer : CustomSerializer.Implements() } - private fun getRpcCallSite(context: SerializationContext, observableContext: ObservableContext): RPCClientProxyHandler.CallSite? { + private fun getRpcCallSite(context: SerializationContext, observableContext: ObservableContext): CallSite? { val rpcRequestOrObservableId = context.properties[RPCApi.RpcRequestOrObservableIdKey] as Trace.InvocationId // Will only return non-null if the trackRpcCallSites option in the RPC configuration has been specified. return observableContext.callSiteMap?.get(rpcRequestOrObservableId) diff --git a/node/src/main/kotlin/net/corda/node/serialization/amqp/AMQPServerSerializationScheme.kt b/node-api/src/main/kotlin/net/corda/nodeapi/internal/serialization/amqp/AMQPServerSerializationScheme.kt similarity index 97% rename from node/src/main/kotlin/net/corda/node/serialization/amqp/AMQPServerSerializationScheme.kt rename to node-api/src/main/kotlin/net/corda/nodeapi/internal/serialization/amqp/AMQPServerSerializationScheme.kt index ab801c9cde..d16f9d6466 100644 --- a/node/src/main/kotlin/net/corda/node/serialization/amqp/AMQPServerSerializationScheme.kt +++ b/node-api/src/main/kotlin/net/corda/nodeapi/internal/serialization/amqp/AMQPServerSerializationScheme.kt @@ -1,4 +1,4 @@ -package net.corda.node.serialization.amqp +package net.corda.nodeapi.internal.serialization.amqp import net.corda.core.cordapp.Cordapp import net.corda.core.internal.toSynchronised diff --git a/node/src/main/kotlin/net/corda/node/serialization/amqp/RpcServerCordaFutureSerialiser.kt b/node-api/src/main/kotlin/net/corda/nodeapi/internal/serialization/amqp/RpcServerCordaFutureSerializer.kt similarity index 74% rename from node/src/main/kotlin/net/corda/node/serialization/amqp/RpcServerCordaFutureSerialiser.kt rename to node-api/src/main/kotlin/net/corda/nodeapi/internal/serialization/amqp/RpcServerCordaFutureSerializer.kt index 63430637d3..a604091f2e 100644 --- a/node/src/main/kotlin/net/corda/node/serialization/amqp/RpcServerCordaFutureSerialiser.kt +++ b/node-api/src/main/kotlin/net/corda/nodeapi/internal/serialization/amqp/RpcServerCordaFutureSerializer.kt @@ -1,4 +1,4 @@ -package net.corda.node.serialization.amqp +package net.corda.nodeapi.internal.serialization.amqp import net.corda.core.concurrent.CordaFuture import net.corda.core.toObservable @@ -14,13 +14,13 @@ import java.io.NotSerializableException class RpcServerCordaFutureSerializer(factory: SerializerFactory) : CustomSerializer.Proxy, RpcServerCordaFutureSerializer.FutureProxy>( - CordaFuture::class.java, RpcServerCordaFutureSerializer.FutureProxy::class.java, factory + CordaFuture::class.java, FutureProxy::class.java, factory ) { - override fun fromProxy(proxy: RpcServerCordaFutureSerializer.FutureProxy): CordaFuture<*> { + override fun fromProxy(proxy: FutureProxy): CordaFuture<*> { throw UnsupportedOperationException() } - override fun toProxy(obj: CordaFuture<*>): RpcServerCordaFutureSerializer.FutureProxy { + override fun toProxy(obj: CordaFuture<*>): FutureProxy { try { return FutureProxy(obj.toObservable()) } catch (e: NotSerializableException) { diff --git a/node/src/main/kotlin/net/corda/node/serialization/amqp/RpcServerObservableSerializer.kt b/node-api/src/main/kotlin/net/corda/nodeapi/internal/serialization/amqp/RpcServerObservableSerializer.kt similarity index 92% rename from node/src/main/kotlin/net/corda/node/serialization/amqp/RpcServerObservableSerializer.kt rename to node-api/src/main/kotlin/net/corda/nodeapi/internal/serialization/amqp/RpcServerObservableSerializer.kt index 441ac77da4..6bb822f558 100644 --- a/node/src/main/kotlin/net/corda/node/serialization/amqp/RpcServerObservableSerializer.kt +++ b/node-api/src/main/kotlin/net/corda/nodeapi/internal/serialization/amqp/RpcServerObservableSerializer.kt @@ -1,12 +1,12 @@ -package net.corda.node.serialization.amqp +package net.corda.nodeapi.internal.serialization.amqp import net.corda.core.context.Trace import net.corda.core.serialization.SerializationContext import net.corda.core.utilities.contextLogger import net.corda.core.utilities.loggerFor -import net.corda.node.services.rpc.ObservableContextInterface -import net.corda.node.services.rpc.ObservableSubscription import net.corda.nodeapi.RPCApi +import net.corda.nodeapi.internal.rpc.ObservableContextInterface +import net.corda.nodeapi.internal.rpc.ObservableSubscription import net.corda.serialization.internal.amqp.* import org.apache.qpid.proton.codec.Data import rx.Notification @@ -31,7 +31,7 @@ class RpcServerObservableSerializer : CustomSerializer.Implements> fun createContext( serializationContext: SerializationContext, observableContext: ObservableContextInterface - ) = serializationContext.withProperty(RpcServerObservableSerializer.RpcObservableContextKey, observableContext) + ) = serializationContext.withProperty(RpcObservableContextKey, observableContext) val log = contextLogger() } @@ -80,11 +80,11 @@ class RpcServerObservableSerializer : CustomSerializer.Implements> context: SerializationContext ) { val observableId = Trace.InvocationId.newInstance() - if (RpcServerObservableSerializer.RpcObservableContextKey !in context.properties) { + if (RpcObservableContextKey !in context.properties) { throw NotSerializableException("Missing Observable Key on serialization context - $type") } - val observableContext = context.properties[RpcServerObservableSerializer.RpcObservableContextKey] + val observableContext = context.properties[RpcObservableContextKey] as ObservableContextInterface data.withList { diff --git a/node/src/main/kotlin/net/corda/node/serialization/kryo/CordaClassResolver.kt b/node-api/src/main/kotlin/net/corda/nodeapi/internal/serialization/kryo/CordaClassResolver.kt similarity index 99% rename from node/src/main/kotlin/net/corda/node/serialization/kryo/CordaClassResolver.kt rename to node-api/src/main/kotlin/net/corda/nodeapi/internal/serialization/kryo/CordaClassResolver.kt index 87183504e8..66715858a4 100644 --- a/node/src/main/kotlin/net/corda/node/serialization/kryo/CordaClassResolver.kt +++ b/node-api/src/main/kotlin/net/corda/nodeapi/internal/serialization/kryo/CordaClassResolver.kt @@ -1,4 +1,4 @@ -package net.corda.node.serialization.kryo +package net.corda.nodeapi.internal.serialization.kryo import com.esotericsoftware.kryo.* import com.esotericsoftware.kryo.io.Input diff --git a/node/src/main/kotlin/net/corda/node/serialization/kryo/CordaClosureSerializer.kt b/node-api/src/main/kotlin/net/corda/nodeapi/internal/serialization/kryo/CordaClosureSerializer.kt similarity index 94% rename from node/src/main/kotlin/net/corda/node/serialization/kryo/CordaClosureSerializer.kt rename to node-api/src/main/kotlin/net/corda/nodeapi/internal/serialization/kryo/CordaClosureSerializer.kt index 2f005b7372..13ecd2682c 100644 --- a/node/src/main/kotlin/net/corda/node/serialization/kryo/CordaClosureSerializer.kt +++ b/node-api/src/main/kotlin/net/corda/nodeapi/internal/serialization/kryo/CordaClosureSerializer.kt @@ -1,4 +1,4 @@ -package net.corda.node.serialization.kryo +package net.corda.nodeapi.internal.serialization.kryo import com.esotericsoftware.kryo.Kryo import com.esotericsoftware.kryo.io.Output diff --git a/node/src/main/kotlin/net/corda/node/serialization/kryo/DefaultKryoCustomizer.kt b/node-api/src/main/kotlin/net/corda/nodeapi/internal/serialization/kryo/DefaultKryoCustomizer.kt similarity index 99% rename from node/src/main/kotlin/net/corda/node/serialization/kryo/DefaultKryoCustomizer.kt rename to node-api/src/main/kotlin/net/corda/nodeapi/internal/serialization/kryo/DefaultKryoCustomizer.kt index b8130dce5f..615f9a74f5 100644 --- a/node/src/main/kotlin/net/corda/node/serialization/kryo/DefaultKryoCustomizer.kt +++ b/node-api/src/main/kotlin/net/corda/nodeapi/internal/serialization/kryo/DefaultKryoCustomizer.kt @@ -1,4 +1,4 @@ -package net.corda.node.serialization.kryo +package net.corda.nodeapi.internal.serialization.kryo import com.esotericsoftware.kryo.Kryo import com.esotericsoftware.kryo.Serializer diff --git a/node/src/main/kotlin/net/corda/node/serialization/kryo/Kryo.kt b/node-api/src/main/kotlin/net/corda/nodeapi/internal/serialization/kryo/Kryo.kt similarity index 99% rename from node/src/main/kotlin/net/corda/node/serialization/kryo/Kryo.kt rename to node-api/src/main/kotlin/net/corda/nodeapi/internal/serialization/kryo/Kryo.kt index 6d2b2e4988..e5de8a1341 100644 --- a/node/src/main/kotlin/net/corda/node/serialization/kryo/Kryo.kt +++ b/node-api/src/main/kotlin/net/corda/nodeapi/internal/serialization/kryo/Kryo.kt @@ -1,4 +1,4 @@ -package net.corda.node.serialization.kryo +package net.corda.nodeapi.internal.serialization.kryo import com.esotericsoftware.kryo.* import com.esotericsoftware.kryo.factories.ReflectionSerializerFactory diff --git a/node/src/main/kotlin/net/corda/node/serialization/kryo/KryoCheckpointSerializer.kt b/node-api/src/main/kotlin/net/corda/nodeapi/internal/serialization/kryo/KryoCheckpointSerializer.kt similarity index 99% rename from node/src/main/kotlin/net/corda/node/serialization/kryo/KryoCheckpointSerializer.kt rename to node-api/src/main/kotlin/net/corda/nodeapi/internal/serialization/kryo/KryoCheckpointSerializer.kt index cd74dafb4c..7dddc2a65f 100644 --- a/node/src/main/kotlin/net/corda/node/serialization/kryo/KryoCheckpointSerializer.kt +++ b/node-api/src/main/kotlin/net/corda/nodeapi/internal/serialization/kryo/KryoCheckpointSerializer.kt @@ -1,4 +1,4 @@ -package net.corda.node.serialization.kryo +package net.corda.nodeapi.internal.serialization.kryo import co.paralleluniverse.fibers.Fiber import co.paralleluniverse.io.serialization.kryo.KryoSerializer diff --git a/node/src/main/kotlin/net/corda/node/serialization/kryo/KryoStreams.kt b/node-api/src/main/kotlin/net/corda/nodeapi/internal/serialization/kryo/KryoStreams.kt similarity index 95% rename from node/src/main/kotlin/net/corda/node/serialization/kryo/KryoStreams.kt rename to node-api/src/main/kotlin/net/corda/nodeapi/internal/serialization/kryo/KryoStreams.kt index 2a6bd1c0c4..80591ebc07 100644 --- a/node/src/main/kotlin/net/corda/node/serialization/kryo/KryoStreams.kt +++ b/node-api/src/main/kotlin/net/corda/nodeapi/internal/serialization/kryo/KryoStreams.kt @@ -1,6 +1,6 @@ @file:JvmName("KryoStreams") -package net.corda.node.serialization.kryo +package net.corda.nodeapi.internal.serialization.kryo import com.esotericsoftware.kryo.io.Input import com.esotericsoftware.kryo.io.Output diff --git a/node/src/main/kotlin/net/corda/node/serialization/kryo/SerializeAsTokenSerializer.kt b/node-api/src/main/kotlin/net/corda/nodeapi/internal/serialization/kryo/SerializeAsTokenSerializer.kt similarity index 96% rename from node/src/main/kotlin/net/corda/node/serialization/kryo/SerializeAsTokenSerializer.kt rename to node-api/src/main/kotlin/net/corda/nodeapi/internal/serialization/kryo/SerializeAsTokenSerializer.kt index 3fa6d0b034..142e9fe35e 100644 --- a/node/src/main/kotlin/net/corda/node/serialization/kryo/SerializeAsTokenSerializer.kt +++ b/node-api/src/main/kotlin/net/corda/nodeapi/internal/serialization/kryo/SerializeAsTokenSerializer.kt @@ -1,4 +1,4 @@ -package net.corda.node.serialization.kryo +package net.corda.nodeapi.internal.serialization.kryo import com.esotericsoftware.kryo.Kryo import com.esotericsoftware.kryo.KryoException diff --git a/node-api/src/test/kotlin/net/corda/nodeapi/internal/AttachmentsClassLoaderStaticContractTests.kt b/node-api/src/test/kotlin/net/corda/nodeapi/internal/AttachmentsClassLoaderStaticContractTests.kt index a63ca7dcdb..27276cb615 100644 --- a/node-api/src/test/kotlin/net/corda/nodeapi/internal/AttachmentsClassLoaderStaticContractTests.kt +++ b/node-api/src/test/kotlin/net/corda/nodeapi/internal/AttachmentsClassLoaderStaticContractTests.kt @@ -25,7 +25,7 @@ import net.corda.testing.core.DUMMY_NOTARY_NAME import net.corda.testing.core.SerializationEnvironmentRule import net.corda.testing.core.TestIdentity import net.corda.testing.internal.MockCordappConfigProvider -import net.corda.testing.internal.rigorousMock +import net.corda.coretesting.internal.rigorousMock import net.corda.testing.node.internal.cordappWithPackages import net.corda.testing.services.MockAttachmentStorage import org.assertj.core.api.Assertions.assertThat diff --git a/node-api/src/test/kotlin/net/corda/nodeapi/internal/SignedNodeInfoTest.kt b/node-api/src/test/kotlin/net/corda/nodeapi/internal/SignedNodeInfoTest.kt index 6b82e1b9d2..eb7f2c20b6 100644 --- a/node-api/src/test/kotlin/net/corda/nodeapi/internal/SignedNodeInfoTest.kt +++ b/node-api/src/test/kotlin/net/corda/nodeapi/internal/SignedNodeInfoTest.kt @@ -11,8 +11,8 @@ import net.corda.nodeapi.internal.crypto.X509Utilities import net.corda.testing.core.ALICE_NAME import net.corda.testing.core.BOB_NAME import net.corda.testing.core.SerializationEnvironmentRule -import net.corda.testing.internal.TestNodeInfoBuilder -import net.corda.testing.internal.signWith +import net.corda.coretesting.internal.TestNodeInfoBuilder +import net.corda.coretesting.internal.signWith import org.assertj.core.api.Assertions.assertThat import org.assertj.core.api.Assertions.assertThatThrownBy import org.junit.Rule diff --git a/node-api/src/test/kotlin/net/corda/nodeapi/internal/crypto/AliasPrivateKeyTest.kt b/node-api/src/test/kotlin/net/corda/nodeapi/internal/crypto/AliasPrivateKeyTest.kt index 983f59c185..e68871bbcb 100644 --- a/node-api/src/test/kotlin/net/corda/nodeapi/internal/crypto/AliasPrivateKeyTest.kt +++ b/node-api/src/test/kotlin/net/corda/nodeapi/internal/crypto/AliasPrivateKeyTest.kt @@ -1,7 +1,7 @@ package net.corda.nodeapi.internal.crypto import net.corda.core.crypto.internal.AliasPrivateKey -import net.corda.testing.internal.stubs.CertificateStoreStubs +import net.corda.coretesting.internal.stubs.CertificateStoreStubs import org.junit.Rule import org.junit.Test import org.junit.rules.TemporaryFolder diff --git a/node-api/src/test/kotlin/net/corda/nodeapi/internal/crypto/X509UtilitiesTest.kt b/node-api/src/test/kotlin/net/corda/nodeapi/internal/crypto/X509UtilitiesTest.kt index a086e91306..f548fb0487 100644 --- a/node-api/src/test/kotlin/net/corda/nodeapi/internal/crypto/X509UtilitiesTest.kt +++ b/node-api/src/test/kotlin/net/corda/nodeapi/internal/crypto/X509UtilitiesTest.kt @@ -21,7 +21,7 @@ import net.corda.core.serialization.deserialize import net.corda.core.serialization.serialize import net.corda.core.utilities.days import net.corda.core.utilities.hours -import net.corda.node.serialization.amqp.AMQPServerSerializationScheme +import net.corda.nodeapi.internal.serialization.amqp.AMQPServerSerializationScheme import net.corda.nodeapi.internal.config.MutualSslConfiguration import net.corda.nodeapi.internal.createDevNodeCa import net.corda.nodeapi.internal.crypto.X509Utilities.DEFAULT_IDENTITY_SIGNATURE_SCHEME @@ -37,11 +37,11 @@ import net.corda.testing.core.ALICE_NAME import net.corda.testing.core.BOB_NAME import net.corda.testing.core.TestIdentity import net.corda.testing.driver.internal.incrementalPortAllocation -import net.corda.testing.internal.NettyTestClient -import net.corda.testing.internal.NettyTestHandler -import net.corda.testing.internal.NettyTestServer +import net.corda.coretesting.internal.NettyTestClient +import net.corda.coretesting.internal.NettyTestHandler +import net.corda.coretesting.internal.NettyTestServer import net.corda.testing.internal.createDevIntermediateCaCertPath -import net.corda.testing.internal.stubs.CertificateStoreStubs +import net.corda.coretesting.internal.stubs.CertificateStoreStubs import net.i2p.crypto.eddsa.EdDSAPrivateKey import org.assertj.core.api.Assertions.assertThat import org.bouncycastle.asn1.x509.* diff --git a/node-api/src/test/kotlin/net/corda/nodeapi/internal/cryptoservice/bouncycastle/BCCryptoServiceTests.kt b/node-api/src/test/kotlin/net/corda/nodeapi/internal/cryptoservice/bouncycastle/BCCryptoServiceTests.kt index 0f441b0ae6..458cabdcba 100644 --- a/node-api/src/test/kotlin/net/corda/nodeapi/internal/cryptoservice/bouncycastle/BCCryptoServiceTests.kt +++ b/node-api/src/test/kotlin/net/corda/nodeapi/internal/cryptoservice/bouncycastle/BCCryptoServiceTests.kt @@ -12,7 +12,7 @@ import net.corda.nodeapi.internal.cryptoservice.CryptoServiceException import net.corda.nodeapi.internal.cryptoservice.WrappedPrivateKey import net.corda.nodeapi.internal.cryptoservice.WrappingMode import net.corda.testing.core.ALICE_NAME -import net.corda.testing.internal.stubs.CertificateStoreStubs +import net.corda.coretesting.internal.stubs.CertificateStoreStubs import org.assertj.core.api.Assertions.assertThat import org.assertj.core.api.Assertions.assertThatThrownBy import org.bouncycastle.jce.provider.BouncyCastleProvider diff --git a/node-api/src/test/kotlin/net/corda/nodeapi/internal/network/NetworkBootstrapperTest.kt b/node-api/src/test/kotlin/net/corda/nodeapi/internal/network/NetworkBootstrapperTest.kt index ff2cdb00eb..4d94be99a6 100644 --- a/node-api/src/test/kotlin/net/corda/nodeapi/internal/network/NetworkBootstrapperTest.kt +++ b/node-api/src/test/kotlin/net/corda/nodeapi/internal/network/NetworkBootstrapperTest.kt @@ -18,8 +18,12 @@ import net.corda.nodeapi.internal.config.toConfig import net.corda.nodeapi.internal.network.NetworkBootstrapper.Companion.DEFAULT_MAX_MESSAGE_SIZE import net.corda.nodeapi.internal.network.NetworkBootstrapper.Companion.DEFAULT_MAX_TRANSACTION_SIZE import net.corda.nodeapi.internal.network.NodeInfoFilesCopier.Companion.NODE_INFO_FILE_NAME_PREFIX -import net.corda.testing.core.* -import net.corda.testing.internal.createNodeInfoAndSigned +import net.corda.testing.core.ALICE_NAME +import net.corda.testing.core.BOB_NAME +import net.corda.testing.core.DUMMY_NOTARY_NAME +import net.corda.testing.core.SerializationEnvironmentRule +import net.corda.testing.core.TestIdentity +import net.corda.coretesting.internal.createNodeInfoAndSigned import org.assertj.core.api.Assertions.assertThat import org.assertj.core.api.Assertions.assertThatThrownBy import org.junit.After diff --git a/node/src/test/kotlin/net/corda/node/internal/serialization/RoundTripObservableSerializerTests.kt b/node-api/src/test/kotlin/net/corda/nodeapi/internal/serialization/RoundTripObservableSerializerTests.kt similarity index 85% rename from node/src/test/kotlin/net/corda/node/internal/serialization/RoundTripObservableSerializerTests.kt rename to node-api/src/test/kotlin/net/corda/nodeapi/internal/serialization/RoundTripObservableSerializerTests.kt index af1739b3c1..f60f5488f5 100644 --- a/node/src/test/kotlin/net/corda/node/internal/serialization/RoundTripObservableSerializerTests.kt +++ b/node-api/src/test/kotlin/net/corda/nodeapi/internal/serialization/RoundTripObservableSerializerTests.kt @@ -1,19 +1,19 @@ -package net.corda.node.internal.serialization +package net.corda.nodeapi.internal.serialization import co.paralleluniverse.common.util.SameThreadExecutor import com.github.benmanes.caffeine.cache.Cache import com.github.benmanes.caffeine.cache.Caffeine import com.github.benmanes.caffeine.cache.RemovalListener import com.nhaarman.mockito_kotlin.mock -import net.corda.client.rpc.internal.serialization.amqp.RpcClientObservableDeSerializer +import net.corda.nodeapi.internal.rpc.client.RpcClientObservableDeSerializer import net.corda.core.context.Trace import net.corda.core.internal.ThreadBox import net.corda.core.internal.toSynchronised -import net.corda.node.internal.serialization.testutils.AMQPRoundTripRPCSerializationScheme -import net.corda.node.internal.serialization.testutils.serializationContext -import net.corda.node.serialization.amqp.RpcServerObservableSerializer -import net.corda.node.services.rpc.ObservableSubscription +import net.corda.nodeapi.internal.serialization.testutils.AMQPRoundTripRPCSerializationScheme +import net.corda.nodeapi.internal.serialization.testutils.serializationContext +import net.corda.nodeapi.internal.serialization.amqp.RpcServerObservableSerializer import net.corda.nodeapi.RPCApi +import net.corda.nodeapi.internal.rpc.ObservableSubscription import net.corda.serialization.internal.amqp.* import org.apache.activemq.artemis.api.core.SimpleString import org.junit.Test @@ -24,8 +24,8 @@ import java.time.Instant import java.util.* import java.util.concurrent.ConcurrentHashMap import java.util.concurrent.TimeUnit -import net.corda.client.rpc.internal.ObservableContext as ClientObservableContext -import net.corda.node.internal.serialization.testutils.TestObservableContext as ServerObservableContext +import net.corda.nodeapi.internal.rpc.client.ObservableContext as ClientObservableContext +import net.corda.nodeapi.internal.serialization.testutils.TestObservableContext as ServerObservableContext class RoundTripObservableSerializerTests { private fun getID() = Trace.InvocationId("test1", Instant.now()) diff --git a/node/src/test/kotlin/net/corda/node/internal/serialization/RpcServerObservableSerializerTests.kt b/node-api/src/test/kotlin/net/corda/nodeapi/internal/serialization/RpcServerObservableSerializerTests.kt similarity index 89% rename from node/src/test/kotlin/net/corda/node/internal/serialization/RpcServerObservableSerializerTests.kt rename to node-api/src/test/kotlin/net/corda/nodeapi/internal/serialization/RpcServerObservableSerializerTests.kt index dad905cae4..d0f8f6b3f6 100644 --- a/node/src/test/kotlin/net/corda/node/internal/serialization/RpcServerObservableSerializerTests.kt +++ b/node-api/src/test/kotlin/net/corda/nodeapi/internal/serialization/RpcServerObservableSerializerTests.kt @@ -1,13 +1,13 @@ -package net.corda.node.internal.serialization +package net.corda.nodeapi.internal.serialization import com.github.benmanes.caffeine.cache.Cache import com.github.benmanes.caffeine.cache.Caffeine import com.nhaarman.mockito_kotlin.mock import net.corda.core.context.Trace -import net.corda.node.internal.serialization.testutils.TestObservableContext -import net.corda.node.internal.serialization.testutils.serializationContext -import net.corda.node.serialization.amqp.RpcServerObservableSerializer -import net.corda.node.services.rpc.ObservableSubscription +import net.corda.nodeapi.internal.serialization.testutils.TestObservableContext +import net.corda.nodeapi.internal.serialization.testutils.serializationContext +import net.corda.nodeapi.internal.rpc.ObservableSubscription +import net.corda.nodeapi.internal.serialization.amqp.RpcServerObservableSerializer import net.corda.serialization.internal.AllWhitelist import net.corda.serialization.internal.amqp.SerializationOutput import net.corda.serialization.internal.amqp.SerializerFactoryBuilder diff --git a/node/src/test/kotlin/net/corda/node/serialization/kryo/KryoStreamsTest.kt b/node-api/src/test/kotlin/net/corda/nodeapi/internal/serialization/kryo/KryoStreamsTest.kt similarity index 98% rename from node/src/test/kotlin/net/corda/node/serialization/kryo/KryoStreamsTest.kt rename to node-api/src/test/kotlin/net/corda/nodeapi/internal/serialization/kryo/KryoStreamsTest.kt index 67f7762129..b54bd8c458 100644 --- a/node/src/test/kotlin/net/corda/node/serialization/kryo/KryoStreamsTest.kt +++ b/node-api/src/test/kotlin/net/corda/nodeapi/internal/serialization/kryo/KryoStreamsTest.kt @@ -1,4 +1,4 @@ -package net.corda.node.serialization.kryo +package net.corda.nodeapi.internal.serialization.kryo import net.corda.core.internal.declaredField import net.corda.serialization.internal.ByteBufferOutputStream diff --git a/node/src/test/kotlin/net/corda/node/serialization/kryo/KryoTests.kt b/node-api/src/test/kotlin/net/corda/nodeapi/internal/serialization/kryo/KryoTests.kt similarity index 98% rename from node/src/test/kotlin/net/corda/node/serialization/kryo/KryoTests.kt rename to node-api/src/test/kotlin/net/corda/nodeapi/internal/serialization/kryo/KryoTests.kt index 02688df506..1fae69d049 100644 --- a/node/src/test/kotlin/net/corda/node/serialization/kryo/KryoTests.kt +++ b/node-api/src/test/kotlin/net/corda/nodeapi/internal/serialization/kryo/KryoTests.kt @@ -1,4 +1,4 @@ -package net.corda.node.serialization.kryo +package net.corda.nodeapi.internal.serialization.kryo import com.esotericsoftware.kryo.Kryo import com.esotericsoftware.kryo.KryoException @@ -23,7 +23,7 @@ import net.corda.serialization.internal.* import net.corda.testing.core.ALICE_NAME import net.corda.testing.core.TestIdentity import net.corda.testing.core.internal.CheckpointSerializationEnvironmentRule -import net.corda.testing.internal.rigorousMock +import net.corda.coretesting.internal.rigorousMock import org.apache.commons.lang3.SystemUtils import org.assertj.core.api.Assertions.* import org.junit.Assert.assertArrayEquals @@ -356,9 +356,9 @@ class KryoTests(private val compression: CordaSerializationEncoding?) { val compressedSize = obj.checkpointSerialize(context.withEncoding(CordaSerializationEncoding.SNAPPY)).size // If these need fixing, sounds like Kryo wire format changed and checkpoints might not survive an upgrade. if (SystemUtils.IS_JAVA_11) - assertEquals(20172, uncompressedSize) + assertEquals(20184, uncompressedSize) else - assertEquals(20222, uncompressedSize) - assertEquals(1111, compressedSize) + assertEquals(20234, uncompressedSize) + assertEquals(1123, compressedSize) } } diff --git a/node/src/test/kotlin/net/corda/node/internal/serialization/testutils/AMQPTestSerialiationScheme.kt b/node-api/src/test/kotlin/net/corda/nodeapi/internal/serialization/testutils/AMQPTestSerialiationScheme.kt similarity index 87% rename from node/src/test/kotlin/net/corda/node/internal/serialization/testutils/AMQPTestSerialiationScheme.kt rename to node-api/src/test/kotlin/net/corda/nodeapi/internal/serialization/testutils/AMQPTestSerialiationScheme.kt index 7234380773..5656ffff44 100644 --- a/node/src/test/kotlin/net/corda/node/internal/serialization/testutils/AMQPTestSerialiationScheme.kt +++ b/node-api/src/test/kotlin/net/corda/nodeapi/internal/serialization/testutils/AMQPTestSerialiationScheme.kt @@ -1,16 +1,16 @@ -package net.corda.node.internal.serialization.testutils +package net.corda.nodeapi.internal.serialization.testutils -import net.corda.client.rpc.internal.serialization.amqp.RpcClientObservableDeSerializer +import net.corda.nodeapi.internal.rpc.client.RpcClientObservableDeSerializer import net.corda.core.context.Trace import net.corda.core.serialization.SerializationContext import net.corda.core.serialization.SerializationCustomSerializer import net.corda.core.serialization.SerializationWhitelist -import net.corda.node.serialization.amqp.RpcServerObservableSerializer +import net.corda.nodeapi.internal.serialization.amqp.RpcServerObservableSerializer import net.corda.nodeapi.RPCApi import net.corda.serialization.internal.CordaSerializationMagic import net.corda.serialization.internal.AllWhitelist import net.corda.serialization.internal.amqp.* -import net.corda.client.rpc.internal.ObservableContext as ClientObservableContext +import net.corda.nodeapi.internal.rpc.client.ObservableContext as ClientObservableContext /** * Special serialization context for the round trip tests that allows for both server and client RPC diff --git a/node/src/test/kotlin/net/corda/node/internal/serialization/testutils/TestObservableContext.kt b/node-api/src/test/kotlin/net/corda/nodeapi/internal/serialization/testutils/TestObservableContext.kt similarity index 77% rename from node/src/test/kotlin/net/corda/node/internal/serialization/testutils/TestObservableContext.kt rename to node-api/src/test/kotlin/net/corda/nodeapi/internal/serialization/testutils/TestObservableContext.kt index d8282863ea..e44e15cdd0 100644 --- a/node/src/test/kotlin/net/corda/node/internal/serialization/testutils/TestObservableContext.kt +++ b/node-api/src/test/kotlin/net/corda/nodeapi/internal/serialization/testutils/TestObservableContext.kt @@ -1,10 +1,10 @@ -package net.corda.node.internal.serialization.testutils +package net.corda.nodeapi.internal.serialization.testutils import com.github.benmanes.caffeine.cache.Cache import net.corda.core.context.Trace -import net.corda.node.services.rpc.ObservableContextInterface -import net.corda.node.services.rpc.ObservableSubscription +import net.corda.nodeapi.internal.rpc.ObservableContextInterface import net.corda.nodeapi.RPCApi +import net.corda.nodeapi.internal.rpc.ObservableSubscription import org.apache.activemq.artemis.api.core.SimpleString import java.util.concurrent.ConcurrentHashMap diff --git a/node/src/test/kotlin/net/corda/node/internal/serialization/testutils/TestSerializationContext.kt b/node-api/src/test/kotlin/net/corda/nodeapi/internal/serialization/testutils/TestSerializationContext.kt similarity index 92% rename from node/src/test/kotlin/net/corda/node/internal/serialization/testutils/TestSerializationContext.kt rename to node-api/src/test/kotlin/net/corda/nodeapi/internal/serialization/testutils/TestSerializationContext.kt index c80e176e56..27690cf76e 100644 --- a/node/src/test/kotlin/net/corda/node/internal/serialization/testutils/TestSerializationContext.kt +++ b/node-api/src/test/kotlin/net/corda/nodeapi/internal/serialization/testutils/TestSerializationContext.kt @@ -1,4 +1,4 @@ -package net.corda.node.internal.serialization.testutils +package net.corda.nodeapi.internal.serialization.testutils import net.corda.core.serialization.SerializationContext import net.corda.serialization.internal.AllWhitelist diff --git a/node/build.gradle b/node/build.gradle index 542fd349e4..cfc7e38706 100644 --- a/node/build.gradle +++ b/node/build.gradle @@ -109,10 +109,6 @@ dependencies { compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" testCompile "org.jetbrains.kotlin:kotlin-test:$kotlin_version" - // Kryo: object graph serialization. - compile "com.esotericsoftware:kryo:4.0.2" - compile "de.javakaffee:kryo-serializers:0.43" - compile "com.google.guava:guava:$guava_version" // For caches rather than guava diff --git a/node/src/integration-test-slow/kotlin/net/corda/node/utilities/registration/NodeRegistrationTest.kt b/node/src/integration-test-slow/kotlin/net/corda/node/utilities/registration/NodeRegistrationTest.kt index b2e24591d7..889a4e880e 100644 --- a/node/src/integration-test-slow/kotlin/net/corda/node/utilities/registration/NodeRegistrationTest.kt +++ b/node/src/integration-test-slow/kotlin/net/corda/node/utilities/registration/NodeRegistrationTest.kt @@ -16,7 +16,7 @@ import net.corda.nodeapi.internal.crypto.X509Utilities.CORDA_ROOT_CA import net.corda.testing.common.internal.testNetworkParameters import net.corda.testing.core.SerializationEnvironmentRule import net.corda.testing.driver.internal.incrementalPortAllocation -import net.corda.testing.internal.DEV_ROOT_CA +import net.corda.coretesting.internal.DEV_ROOT_CA import net.corda.testing.node.NotarySpec import net.corda.testing.node.internal.SharedCompatibilityZoneParams import net.corda.testing.node.internal.internalDriver diff --git a/node/src/integration-test/kotlin/net/corda/node/BootTests.kt b/node/src/integration-test/kotlin/net/corda/node/BootTests.kt index 711d34a7f9..62aae2e54a 100644 --- a/node/src/integration-test/kotlin/net/corda/node/BootTests.kt +++ b/node/src/integration-test/kotlin/net/corda/node/BootTests.kt @@ -18,7 +18,7 @@ import net.corda.testing.driver.DriverParameters import net.corda.testing.driver.NodeHandle import net.corda.testing.driver.NodeParameters import net.corda.testing.driver.driver -import net.corda.testing.internal.stubs.CertificateStoreStubs +import net.corda.coretesting.internal.stubs.CertificateStoreStubs import net.corda.testing.node.User import net.corda.testing.node.internal.enclosedCordapp import net.corda.testing.node.internal.startNode diff --git a/node/src/integration-test/kotlin/net/corda/node/CordappConstraintsTests.kt b/node/src/integration-test/kotlin/net/corda/node/CordappConstraintsTests.kt index 44205c956b..da3b020143 100644 --- a/node/src/integration-test/kotlin/net/corda/node/CordappConstraintsTests.kt +++ b/node/src/integration-test/kotlin/net/corda/node/CordappConstraintsTests.kt @@ -13,6 +13,7 @@ import net.corda.core.node.services.Vault import net.corda.core.node.services.vault.QueryCriteria import net.corda.core.utilities.OpaqueBytes import net.corda.core.utilities.getOrThrow +import net.corda.coretesting.internal.DEV_ROOT_CA import net.corda.finance.DOLLARS import net.corda.finance.contracts.asset.Cash import net.corda.finance.flows.CashIssueFlow @@ -26,7 +27,6 @@ import net.corda.testing.core.* import net.corda.testing.core.internal.JarSignatureTestUtils.generateKey import net.corda.testing.core.internal.SelfCleaningDir import net.corda.testing.driver.* -import net.corda.testing.internal.DEV_ROOT_CA import net.corda.testing.node.NotarySpec import net.corda.testing.node.User import net.corda.testing.node.internal.cordappWithPackages diff --git a/node/src/integration-test/kotlin/net/corda/node/NodeKeystoreCheckTest.kt b/node/src/integration-test/kotlin/net/corda/node/NodeKeystoreCheckTest.kt index 43640b5860..dad3fdc467 100644 --- a/node/src/integration-test/kotlin/net/corda/node/NodeKeystoreCheckTest.kt +++ b/node/src/integration-test/kotlin/net/corda/node/NodeKeystoreCheckTest.kt @@ -9,7 +9,7 @@ import net.corda.nodeapi.internal.crypto.X509Utilities import net.corda.testing.core.ALICE_NAME import net.corda.testing.driver.DriverParameters import net.corda.testing.driver.driver -import net.corda.testing.internal.stubs.CertificateStoreStubs +import net.corda.coretesting.internal.stubs.CertificateStoreStubs import org.assertj.core.api.Assertions.assertThatThrownBy import org.junit.Test import javax.security.auth.x500.X500Principal diff --git a/node/src/integration-test/kotlin/net/corda/node/NodePerformanceTests.kt b/node/src/integration-test/kotlin/net/corda/node/NodePerformanceTests.kt index 0dd0ebc872..45e20f37ab 100644 --- a/node/src/integration-test/kotlin/net/corda/node/NodePerformanceTests.kt +++ b/node/src/integration-test/kotlin/net/corda/node/NodePerformanceTests.kt @@ -19,7 +19,7 @@ import net.corda.testing.driver.DriverParameters import net.corda.testing.driver.InProcess import net.corda.testing.driver.driver import net.corda.testing.driver.internal.internalServices -import net.corda.testing.internal.performance.div +import net.corda.coretesting.internal.performance.div import net.corda.testing.node.NotarySpec import net.corda.testing.node.User import net.corda.testing.node.internal.FINANCE_CORDAPPS diff --git a/node/src/integration-test/kotlin/net/corda/node/amqp/AMQPBridgeTest.kt b/node/src/integration-test/kotlin/net/corda/node/amqp/AMQPBridgeTest.kt index 0bcabb6ad4..221d11cd9a 100644 --- a/node/src/integration-test/kotlin/net/corda/node/amqp/AMQPBridgeTest.kt +++ b/node/src/integration-test/kotlin/net/corda/node/amqp/AMQPBridgeTest.kt @@ -20,8 +20,8 @@ import net.corda.testing.core.BOB_NAME import net.corda.testing.core.MAX_MESSAGE_SIZE import net.corda.testing.core.TestIdentity import net.corda.testing.driver.internal.incrementalPortAllocation -import net.corda.testing.internal.rigorousMock -import net.corda.testing.internal.stubs.CertificateStoreStubs +import net.corda.coretesting.internal.rigorousMock +import net.corda.coretesting.internal.stubs.CertificateStoreStubs import org.apache.activemq.artemis.api.core.Message.HDR_DUPLICATE_DETECTION_ID import org.apache.activemq.artemis.api.core.RoutingType import org.apache.activemq.artemis.api.core.SimpleString diff --git a/node/src/integration-test/kotlin/net/corda/node/amqp/CertificateRevocationListNodeTests.kt b/node/src/integration-test/kotlin/net/corda/node/amqp/CertificateRevocationListNodeTests.kt index 9512674d01..1ab13fc6d7 100644 --- a/node/src/integration-test/kotlin/net/corda/node/amqp/CertificateRevocationListNodeTests.kt +++ b/node/src/integration-test/kotlin/net/corda/node/amqp/CertificateRevocationListNodeTests.kt @@ -25,10 +25,10 @@ import net.corda.testing.core.BOB_NAME import net.corda.testing.core.CHARLIE_NAME import net.corda.testing.core.MAX_MESSAGE_SIZE import net.corda.testing.driver.internal.incrementalPortAllocation -import net.corda.testing.internal.DEV_INTERMEDIATE_CA -import net.corda.testing.internal.DEV_ROOT_CA -import net.corda.testing.internal.rigorousMock -import net.corda.testing.internal.stubs.CertificateStoreStubs +import net.corda.coretesting.internal.DEV_INTERMEDIATE_CA +import net.corda.coretesting.internal.DEV_ROOT_CA +import net.corda.coretesting.internal.rigorousMock +import net.corda.coretesting.internal.stubs.CertificateStoreStubs import org.assertj.core.api.Assertions.assertThatIllegalArgumentException import org.bouncycastle.asn1.x500.X500Name import org.bouncycastle.asn1.x509.* diff --git a/node/src/integration-test/kotlin/net/corda/node/amqp/ProtonWrapperTests.kt b/node/src/integration-test/kotlin/net/corda/node/amqp/ProtonWrapperTests.kt index 0f08714025..d3515e56bd 100644 --- a/node/src/integration-test/kotlin/net/corda/node/amqp/ProtonWrapperTests.kt +++ b/node/src/integration-test/kotlin/net/corda/node/amqp/ProtonWrapperTests.kt @@ -30,8 +30,8 @@ import net.corda.testing.core.CHARLIE_NAME import net.corda.testing.core.MAX_MESSAGE_SIZE import net.corda.testing.driver.internal.incrementalPortAllocation import net.corda.testing.internal.createDevIntermediateCaCertPath -import net.corda.testing.internal.rigorousMock -import net.corda.testing.internal.stubs.CertificateStoreStubs +import net.corda.coretesting.internal.rigorousMock +import net.corda.coretesting.internal.stubs.CertificateStoreStubs import org.apache.activemq.artemis.api.core.RoutingType import org.assertj.core.api.Assertions.assertThatThrownBy import org.junit.Assert.assertArrayEquals diff --git a/node/src/integration-test/kotlin/net/corda/node/services/messaging/ArtemisMessagingTest.kt b/node/src/integration-test/kotlin/net/corda/node/services/messaging/ArtemisMessagingTest.kt index 5990fbecd6..ff71513398 100644 --- a/node/src/integration-test/kotlin/net/corda/node/services/messaging/ArtemisMessagingTest.kt +++ b/node/src/integration-test/kotlin/net/corda/node/services/messaging/ArtemisMessagingTest.kt @@ -22,8 +22,8 @@ import net.corda.testing.driver.internal.incrementalPortAllocation import net.corda.testing.internal.LogHelper import net.corda.testing.internal.TestingNamedCacheFactory import net.corda.testing.internal.configureDatabase -import net.corda.testing.internal.rigorousMock -import net.corda.testing.internal.stubs.CertificateStoreStubs +import net.corda.coretesting.internal.rigorousMock +import net.corda.coretesting.internal.stubs.CertificateStoreStubs import net.corda.testing.node.MockServices.Companion.makeTestDataSourceProperties import net.corda.testing.node.internal.MOCK_VERSION_INFO import org.apache.activemq.artemis.api.core.ActiveMQConnectionTimedOutException diff --git a/node/src/integration-test/kotlin/net/corda/services/messaging/MQSecurityAsNodeTest.kt b/node/src/integration-test/kotlin/net/corda/services/messaging/MQSecurityAsNodeTest.kt index 6f95a7964c..261532c1e3 100644 --- a/node/src/integration-test/kotlin/net/corda/services/messaging/MQSecurityAsNodeTest.kt +++ b/node/src/integration-test/kotlin/net/corda/services/messaging/MQSecurityAsNodeTest.kt @@ -13,7 +13,7 @@ import net.corda.nodeapi.internal.DEV_ROOT_CA import net.corda.nodeapi.internal.crypto.CertificateType import net.corda.nodeapi.internal.crypto.X509Utilities import net.corda.nodeapi.internal.loadDevCaTrustStore -import net.corda.testing.internal.stubs.CertificateStoreStubs +import net.corda.coretesting.internal.stubs.CertificateStoreStubs import org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration import org.apache.activemq.artemis.api.core.ActiveMQClusterSecurityException import org.apache.activemq.artemis.api.core.ActiveMQNotConnectedException diff --git a/node/src/main/kotlin/net/corda/node/internal/Node.kt b/node/src/main/kotlin/net/corda/node/internal/Node.kt index 4914df4833..eee9e063f0 100644 --- a/node/src/main/kotlin/net/corda/node/internal/Node.kt +++ b/node/src/main/kotlin/net/corda/node/internal/Node.kt @@ -8,7 +8,7 @@ import com.jcabi.manifests.Manifests import com.palominolabs.metrics.newrelic.AllEnabledMetricAttributeFilter import com.palominolabs.metrics.newrelic.NewRelicReporter import io.netty.util.NettyRuntime -import net.corda.client.rpc.internal.serialization.amqp.AMQPClientSerializationScheme +import net.corda.nodeapi.internal.rpc.client.AMQPClientSerializationScheme import net.corda.cliutils.ShellConstants import net.corda.core.concurrent.CordaFuture import net.corda.core.flows.FlowLogic @@ -44,9 +44,9 @@ import net.corda.node.internal.artemis.BrokerAddresses import net.corda.node.internal.security.RPCSecurityManager import net.corda.node.internal.security.RPCSecurityManagerImpl import net.corda.node.internal.security.RPCSecurityManagerWithAdditionalUser -import net.corda.node.serialization.amqp.AMQPServerSerializationScheme -import net.corda.node.serialization.kryo.KRYO_CHECKPOINT_CONTEXT -import net.corda.node.serialization.kryo.KryoCheckpointSerializer +import net.corda.nodeapi.internal.serialization.amqp.AMQPServerSerializationScheme +import net.corda.nodeapi.internal.serialization.kryo.KRYO_CHECKPOINT_CONTEXT +import net.corda.nodeapi.internal.serialization.kryo.KryoCheckpointSerializer import net.corda.node.services.Permissions import net.corda.node.services.api.FlowStarter import net.corda.node.services.api.ServiceHubInternal diff --git a/node/src/main/kotlin/net/corda/node/services/rpc/RPCServer.kt b/node/src/main/kotlin/net/corda/node/services/rpc/RPCServer.kt index 35e093098e..9a1e1474d0 100644 --- a/node/src/main/kotlin/net/corda/node/services/rpc/RPCServer.kt +++ b/node/src/main/kotlin/net/corda/node/services/rpc/RPCServer.kt @@ -21,10 +21,14 @@ import net.corda.core.serialization.SerializationContext import net.corda.core.serialization.SerializationDefaults import net.corda.core.serialization.SerializationDefaults.RPC_SERVER_CONTEXT import net.corda.core.serialization.deserialize -import net.corda.core.utilities.* +import net.corda.core.utilities.Try +import net.corda.core.utilities.contextLogger +import net.corda.core.utilities.days +import net.corda.core.utilities.debug +import net.corda.core.utilities.seconds +import net.corda.core.utilities.trace import net.corda.node.internal.security.AuthorizingSubject import net.corda.node.internal.security.RPCSecurityManager -import net.corda.node.serialization.amqp.RpcServerObservableSerializer import net.corda.node.services.logging.pushToLoggingContext import net.corda.nodeapi.RPCApi import net.corda.nodeapi.RPCApi.CLASS_METHOD_DIVIDER @@ -34,20 +38,32 @@ import net.corda.nodeapi.internal.DeduplicationChecker import net.corda.nodeapi.internal.persistence.CordaPersistence import net.corda.nodeapi.internal.persistence.contextDatabase import net.corda.nodeapi.internal.persistence.contextDatabaseOrNull +import net.corda.nodeapi.internal.rpc.ObservableContextInterface +import net.corda.nodeapi.internal.rpc.ObservableSubscription +import net.corda.nodeapi.internal.serialization.amqp.RpcServerObservableSerializer import org.apache.activemq.artemis.api.core.Message import org.apache.activemq.artemis.api.core.SimpleString -import org.apache.activemq.artemis.api.core.client.* import org.apache.activemq.artemis.api.core.client.ActiveMQClient.DEFAULT_ACK_BATCH_SIZE +import org.apache.activemq.artemis.api.core.client.ClientConsumer +import org.apache.activemq.artemis.api.core.client.ClientMessage +import org.apache.activemq.artemis.api.core.client.ClientProducer +import org.apache.activemq.artemis.api.core.client.ClientSession +import org.apache.activemq.artemis.api.core.client.ClientSessionFactory +import org.apache.activemq.artemis.api.core.client.ServerLocator import org.apache.activemq.artemis.api.core.management.ActiveMQServerControl import org.apache.activemq.artemis.api.core.management.CoreNotificationType import org.apache.activemq.artemis.api.core.management.ManagementHelper import org.slf4j.MDC -import rx.Subscription import java.lang.reflect.InvocationTargetException import java.lang.reflect.Method import java.time.Duration import java.util.* -import java.util.concurrent.* +import java.util.concurrent.ConcurrentHashMap +import java.util.concurrent.Executors +import java.util.concurrent.LinkedBlockingQueue +import java.util.concurrent.ScheduledExecutorService +import java.util.concurrent.ScheduledFuture +import java.util.concurrent.TimeUnit import kotlin.concurrent.thread private typealias ObservableSubscriptionMap = Cache @@ -546,9 +562,3 @@ internal fun context(): InvocationContext = rpcContext().invocation * The [RpcAuthContext] includes permissions. */ fun rpcContext(): RpcAuthContext = CURRENT_RPC_CONTEXT.get() - -class ObservableSubscription( - val subscription: Subscription -) - - diff --git a/node/src/test/kotlin/net/corda/node/internal/NodeTest.kt b/node/src/test/kotlin/net/corda/node/internal/NodeTest.kt index 36c24b700b..3ae5c937a2 100644 --- a/node/src/test/kotlin/net/corda/node/internal/NodeTest.kt +++ b/node/src/test/kotlin/net/corda/node/internal/NodeTest.kt @@ -21,8 +21,8 @@ import net.corda.nodeapi.internal.persistence.DatabaseConfig import net.corda.testing.core.ALICE_NAME import net.corda.testing.core.SerializationEnvironmentRule import net.corda.testing.internal.configureDatabase -import net.corda.testing.internal.createNodeInfoAndSigned -import net.corda.testing.internal.rigorousMock +import net.corda.coretesting.internal.createNodeInfoAndSigned +import net.corda.coretesting.internal.rigorousMock import net.corda.testing.node.MockServices.Companion.makeTestDataSourceProperties import org.apache.commons.lang3.SystemUtils import org.assertj.core.api.Assertions.assertThat diff --git a/node/src/test/kotlin/net/corda/node/messaging/TwoPartyTradeFlowTests.kt b/node/src/test/kotlin/net/corda/node/messaging/TwoPartyTradeFlowTests.kt index 200b60742a..18fa7c40c4 100644 --- a/node/src/test/kotlin/net/corda/node/messaging/TwoPartyTradeFlowTests.kt +++ b/node/src/test/kotlin/net/corda/node/messaging/TwoPartyTradeFlowTests.kt @@ -25,6 +25,7 @@ import net.corda.core.utilities.days import net.corda.core.utilities.getOrThrow import net.corda.core.utilities.toNonEmptySet import net.corda.core.utilities.unwrap +import net.corda.coretesting.internal.TEST_TX_TIME import net.corda.finance.DOLLARS import net.corda.finance.`issued by` import net.corda.finance.contracts.CommercialPaper @@ -41,7 +42,6 @@ import net.corda.testing.dsl.LedgerDSL import net.corda.testing.dsl.TestLedgerDSLInterpreter import net.corda.testing.dsl.TestTransactionDSLInterpreter import net.corda.testing.internal.LogHelper -import net.corda.testing.internal.TEST_TX_TIME import net.corda.testing.internal.vault.VaultFiller import net.corda.testing.node.internal.* import net.corda.testing.node.ledger @@ -706,10 +706,10 @@ class TwoPartyTradeFlowTests(private val anonymous: Boolean) { notary: Party): Pair, List> { val ap = transaction(transactionBuilder = TransactionBuilder(notary = notary)) { output(CommercialPaper.CP_PROGRAM_ID, "alice's paper", notary = notary, - contractState = CommercialPaper.State(issuer, owner, amount, TEST_TX_TIME + 7.days)) + contractState = CommercialPaper.State(issuer, owner, amount, net.corda.coretesting.internal.TEST_TX_TIME + 7.days)) command(issuer.party.owningKey, CommercialPaper.Commands.Issue()) if (!withError) - timeWindow(time = TEST_TX_TIME) + timeWindow(time = net.corda.coretesting.internal.TEST_TX_TIME) if (attachmentID != null) attachment(attachmentID) if (withError) { diff --git a/node/src/test/kotlin/net/corda/node/services/attachments/AttachmentTrustCalculatorTest.kt b/node/src/test/kotlin/net/corda/node/services/attachments/AttachmentTrustCalculatorTest.kt index be6cddb7ac..315e401f2c 100644 --- a/node/src/test/kotlin/net/corda/node/services/attachments/AttachmentTrustCalculatorTest.kt +++ b/node/src/test/kotlin/net/corda/node/services/attachments/AttachmentTrustCalculatorTest.kt @@ -17,7 +17,7 @@ import net.corda.testing.core.internal.JarSignatureTestUtils.signJar import net.corda.testing.core.internal.SelfCleaningDir import net.corda.testing.internal.TestingNamedCacheFactory import net.corda.testing.internal.configureDatabase -import net.corda.testing.internal.rigorousMock +import net.corda.coretesting.internal.rigorousMock import net.corda.testing.node.MockServices import org.assertj.core.api.Assertions.assertThat import org.junit.After diff --git a/node/src/test/kotlin/net/corda/node/services/events/NodeSchedulerServiceTest.kt b/node/src/test/kotlin/net/corda/node/services/events/NodeSchedulerServiceTest.kt index 415400d0b4..4686238197 100644 --- a/node/src/test/kotlin/net/corda/node/services/events/NodeSchedulerServiceTest.kt +++ b/node/src/test/kotlin/net/corda/node/services/events/NodeSchedulerServiceTest.kt @@ -17,9 +17,9 @@ import net.corda.node.services.statemachine.ExternalEvent import net.corda.nodeapi.internal.persistence.CordaPersistence import net.corda.nodeapi.internal.persistence.DatabaseConfig import net.corda.testing.internal.configureDatabase -import net.corda.testing.internal.doLookup -import net.corda.testing.internal.rigorousMock -import net.corda.testing.internal.spectator +import net.corda.coretesting.internal.doLookup +import net.corda.coretesting.internal.rigorousMock +import net.corda.coretesting.internal.spectator import net.corda.testing.node.MockServices import net.corda.testing.node.TestClock import org.junit.* diff --git a/node/src/test/kotlin/net/corda/node/services/identity/InMemoryIdentityServiceTests.kt b/node/src/test/kotlin/net/corda/node/services/identity/InMemoryIdentityServiceTests.kt index c154620673..37df2cbe30 100644 --- a/node/src/test/kotlin/net/corda/node/services/identity/InMemoryIdentityServiceTests.kt +++ b/node/src/test/kotlin/net/corda/node/services/identity/InMemoryIdentityServiceTests.kt @@ -11,8 +11,8 @@ import net.corda.nodeapi.internal.crypto.CertificateType import net.corda.nodeapi.internal.crypto.X509Utilities import net.corda.nodeapi.internal.crypto.x509Certificates import net.corda.testing.core.* -import net.corda.testing.internal.DEV_INTERMEDIATE_CA -import net.corda.testing.internal.DEV_ROOT_CA +import net.corda.coretesting.internal.DEV_INTERMEDIATE_CA +import net.corda.coretesting.internal.DEV_ROOT_CA import org.junit.Rule import org.junit.Test import kotlin.test.assertEquals diff --git a/node/src/test/kotlin/net/corda/node/services/identity/PersistentIdentityServiceTests.kt b/node/src/test/kotlin/net/corda/node/services/identity/PersistentIdentityServiceTests.kt index 71b236aaa9..333e356b1a 100644 --- a/node/src/test/kotlin/net/corda/node/services/identity/PersistentIdentityServiceTests.kt +++ b/node/src/test/kotlin/net/corda/node/services/identity/PersistentIdentityServiceTests.kt @@ -7,16 +7,20 @@ import net.corda.core.identity.CordaX500Name import net.corda.core.identity.Party import net.corda.core.identity.PartyAndCertificate import net.corda.core.node.services.UnknownAnonymousPartyException -import net.corda.node.services.persistence.PublicKeyToOwningIdentityCacheImpl import net.corda.core.serialization.serialize +import net.corda.coretesting.internal.DEV_INTERMEDIATE_CA +import net.corda.coretesting.internal.DEV_ROOT_CA +import net.corda.node.services.persistence.PublicKeyToOwningIdentityCacheImpl import net.corda.nodeapi.internal.crypto.CertificateType import net.corda.nodeapi.internal.crypto.X509Utilities import net.corda.nodeapi.internal.crypto.x509Certificates import net.corda.nodeapi.internal.persistence.CordaPersistence import net.corda.nodeapi.internal.persistence.DatabaseConfig -import net.corda.testing.core.* -import net.corda.testing.internal.DEV_INTERMEDIATE_CA -import net.corda.testing.internal.DEV_ROOT_CA +import net.corda.testing.core.ALICE_NAME +import net.corda.testing.core.BOB_NAME +import net.corda.testing.core.SerializationEnvironmentRule +import net.corda.testing.core.TestIdentity +import net.corda.testing.core.getTestPartyAndCertificate import net.corda.testing.internal.TestingNamedCacheFactory import net.corda.testing.internal.configureDatabase import net.corda.testing.node.MockServices.Companion.makeTestDataSourceProperties @@ -26,7 +30,6 @@ import org.junit.Before import org.junit.Rule import org.junit.Test import org.junit.jupiter.api.assertDoesNotThrow -import org.junit.jupiter.api.assertThrows import kotlin.test.assertEquals import kotlin.test.assertFailsWith import kotlin.test.assertNull diff --git a/node/src/test/kotlin/net/corda/node/services/network/DBNetworkParametersStorageTest.kt b/node/src/test/kotlin/net/corda/node/services/network/DBNetworkParametersStorageTest.kt index 4d8736133e..0bb069a33f 100644 --- a/node/src/test/kotlin/net/corda/node/services/network/DBNetworkParametersStorageTest.kt +++ b/node/src/test/kotlin/net/corda/node/services/network/DBNetworkParametersStorageTest.kt @@ -15,8 +15,8 @@ import net.corda.nodeapi.internal.persistence.CordaPersistence import net.corda.nodeapi.internal.persistence.DatabaseConfig import net.corda.testing.common.internal.testNetworkParameters import net.corda.testing.core.SerializationEnvironmentRule -import net.corda.testing.internal.DEV_INTERMEDIATE_CA -import net.corda.testing.internal.DEV_ROOT_CA +import net.corda.coretesting.internal.DEV_INTERMEDIATE_CA +import net.corda.coretesting.internal.DEV_ROOT_CA import net.corda.testing.internal.TestingNamedCacheFactory import net.corda.testing.internal.configureDatabase import net.corda.testing.node.MockServices diff --git a/node/src/test/kotlin/net/corda/node/services/network/NetworkMapClientTest.kt b/node/src/test/kotlin/net/corda/node/services/network/NetworkMapClientTest.kt index eb2f06c006..9fa13bf67e 100644 --- a/node/src/test/kotlin/net/corda/node/services/network/NetworkMapClientTest.kt +++ b/node/src/test/kotlin/net/corda/node/services/network/NetworkMapClientTest.kt @@ -11,10 +11,10 @@ import net.corda.testing.common.internal.testNetworkParameters import net.corda.testing.core.ALICE_NAME import net.corda.testing.core.BOB_NAME import net.corda.testing.core.SerializationEnvironmentRule -import net.corda.testing.internal.DEV_ROOT_CA -import net.corda.testing.internal.TestNodeInfoBuilder -import net.corda.testing.internal.createNodeInfoAndSigned -import net.corda.testing.internal.signWith +import net.corda.coretesting.internal.DEV_ROOT_CA +import net.corda.coretesting.internal.TestNodeInfoBuilder +import net.corda.coretesting.internal.createNodeInfoAndSigned +import net.corda.coretesting.internal.signWith import net.corda.testing.node.internal.network.NetworkMapServer import org.assertj.core.api.Assertions.assertThat import org.assertj.core.api.Assertions.assertThatThrownBy diff --git a/node/src/test/kotlin/net/corda/node/services/network/NetworkMapUpdaterTest.kt b/node/src/test/kotlin/net/corda/node/services/network/NetworkMapUpdaterTest.kt index a418b89cc9..dd47140877 100644 --- a/node/src/test/kotlin/net/corda/node/services/network/NetworkMapUpdaterTest.kt +++ b/node/src/test/kotlin/net/corda/node/services/network/NetworkMapUpdaterTest.kt @@ -17,6 +17,7 @@ import net.corda.core.node.NodeInfo import net.corda.core.node.services.AttachmentId import net.corda.core.serialization.serialize import net.corda.core.utilities.millis +import net.corda.coretesting.internal.DEV_ROOT_CA import net.corda.node.VersionInfo import net.corda.node.services.api.NetworkMapCacheInternal import net.corda.node.services.config.NetworkParameterAcceptanceSettings @@ -29,11 +30,9 @@ import net.corda.nodeapi.internal.network.SignedNetworkParameters import net.corda.nodeapi.internal.network.verifiedNetworkParametersCert import net.corda.testing.common.internal.testNetworkParameters import net.corda.testing.core.* -import net.corda.testing.internal.DEV_ROOT_CA -import net.corda.testing.internal.TestNodeInfoBuilder -import net.corda.testing.internal.createNodeInfoAndSigned +import net.corda.coretesting.internal.TestNodeInfoBuilder +import net.corda.coretesting.internal.createNodeInfoAndSigned import net.corda.testing.node.internal.MockKeyManagementService -import net.corda.testing.node.internal.MockPublicKeyToOwningIdentityCache import net.corda.testing.node.internal.network.NetworkMapServer import net.corda.testing.node.makeTestIdentityService import org.assertj.core.api.Assertions.assertThat diff --git a/node/src/test/kotlin/net/corda/node/services/network/NetworkParametersReaderTest.kt b/node/src/test/kotlin/net/corda/node/services/network/NetworkParametersReaderTest.kt index 6a856d3246..f44331d296 100644 --- a/node/src/test/kotlin/net/corda/node/services/network/NetworkParametersReaderTest.kt +++ b/node/src/test/kotlin/net/corda/node/services/network/NetworkParametersReaderTest.kt @@ -11,7 +11,7 @@ import net.corda.node.internal.NetworkParametersReader import net.corda.nodeapi.internal.network.* import net.corda.testing.common.internal.testNetworkParameters import net.corda.testing.core.SerializationEnvironmentRule -import net.corda.testing.internal.DEV_ROOT_CA +import net.corda.coretesting.internal.DEV_ROOT_CA import net.corda.testing.node.internal.network.NetworkMapServer import org.assertj.core.api.Assertions.assertThat import org.junit.After diff --git a/node/src/test/kotlin/net/corda/node/services/network/NodeInfoWatcherTest.kt b/node/src/test/kotlin/net/corda/node/services/network/NodeInfoWatcherTest.kt index 99f08b5a17..6ec93664a3 100644 --- a/node/src/test/kotlin/net/corda/node/services/network/NodeInfoWatcherTest.kt +++ b/node/src/test/kotlin/net/corda/node/services/network/NodeInfoWatcherTest.kt @@ -11,9 +11,8 @@ import net.corda.nodeapi.internal.NodeInfoAndSigned import net.corda.nodeapi.internal.network.NodeInfoFilesCopier import net.corda.testing.core.ALICE_NAME import net.corda.testing.core.SerializationEnvironmentRule -import net.corda.testing.internal.createNodeInfoAndSigned +import net.corda.coretesting.internal.createNodeInfoAndSigned import net.corda.testing.node.internal.MockKeyManagementService -import net.corda.testing.node.internal.MockPublicKeyToOwningIdentityCache import net.corda.testing.node.makeTestIdentityService import org.assertj.core.api.Assertions.assertThat import org.junit.Before diff --git a/node/src/test/kotlin/net/corda/node/services/persistence/NodeAttachmentServiceTest.kt b/node/src/test/kotlin/net/corda/node/services/persistence/NodeAttachmentServiceTest.kt index aa0d828a7d..e7af37bb6f 100644 --- a/node/src/test/kotlin/net/corda/node/services/persistence/NodeAttachmentServiceTest.kt +++ b/node/src/test/kotlin/net/corda/node/services/persistence/NodeAttachmentServiceTest.kt @@ -24,7 +24,6 @@ import net.corda.nodeapi.exceptions.DuplicateAttachmentException import net.corda.nodeapi.internal.persistence.CordaPersistence import net.corda.nodeapi.internal.persistence.DatabaseConfig import net.corda.testing.common.internal.testNetworkParameters -import net.corda.testing.core.internal.ContractJarTestUtils import net.corda.testing.core.internal.ContractJarTestUtils.makeTestContractJar import net.corda.testing.core.internal.ContractJarTestUtils.makeTestJar import net.corda.testing.core.internal.ContractJarTestUtils.makeTestSignedContractJar @@ -34,7 +33,7 @@ import net.corda.testing.core.internal.SelfCleaningDir import net.corda.testing.internal.LogHelper import net.corda.testing.internal.TestingNamedCacheFactory import net.corda.testing.internal.configureDatabase -import net.corda.testing.internal.rigorousMock +import net.corda.coretesting.internal.rigorousMock import net.corda.testing.node.MockServices.Companion.makeTestDataSourceProperties import net.corda.testing.node.internal.InternalMockNetwork import net.corda.testing.node.internal.startFlow diff --git a/node/src/test/kotlin/net/corda/node/services/schema/PersistentStateServiceTests.kt b/node/src/test/kotlin/net/corda/node/services/schema/PersistentStateServiceTests.kt index 0b00c2adee..9f674c6233 100644 --- a/node/src/test/kotlin/net/corda/node/services/schema/PersistentStateServiceTests.kt +++ b/node/src/test/kotlin/net/corda/node/services/schema/PersistentStateServiceTests.kt @@ -15,7 +15,7 @@ import net.corda.testing.contracts.DummyContract import net.corda.testing.core.TestIdentity import net.corda.testing.internal.LogHelper import net.corda.testing.internal.configureDatabase -import net.corda.testing.internal.rigorousMock +import net.corda.coretesting.internal.rigorousMock import net.corda.testing.node.MockServices.Companion.makeTestDataSourceProperties import org.junit.After import org.junit.Before diff --git a/node/src/test/kotlin/net/corda/node/services/vault/VaultQueryTests.kt b/node/src/test/kotlin/net/corda/node/services/vault/VaultQueryTests.kt index 1166a1a500..ff362766b4 100644 --- a/node/src/test/kotlin/net/corda/node/services/vault/VaultQueryTests.kt +++ b/node/src/test/kotlin/net/corda/node/services/vault/VaultQueryTests.kt @@ -15,6 +15,7 @@ import net.corda.core.node.services.vault.QueryCriteria.* import net.corda.core.transactions.LedgerTransaction import net.corda.core.transactions.TransactionBuilder import net.corda.core.utilities.* +import net.corda.coretesting.internal.TEST_TX_TIME import net.corda.finance.* import net.corda.finance.contracts.CommercialPaper import net.corda.finance.contracts.Commodity @@ -31,7 +32,6 @@ import net.corda.nodeapi.internal.persistence.CordaPersistence import net.corda.nodeapi.internal.persistence.DatabaseConfig import net.corda.nodeapi.internal.persistence.DatabaseTransaction import net.corda.testing.core.* -import net.corda.testing.internal.TEST_TX_TIME import net.corda.testing.internal.chooseIdentity import net.corda.testing.internal.configureDatabase import net.corda.testing.internal.vault.* diff --git a/node/src/test/kotlin/net/corda/node/services/vault/VaultSoftLockManagerTest.kt b/node/src/test/kotlin/net/corda/node/services/vault/VaultSoftLockManagerTest.kt index 959a407429..7e771e9904 100644 --- a/node/src/test/kotlin/net/corda/node/services/vault/VaultSoftLockManagerTest.kt +++ b/node/src/test/kotlin/net/corda/node/services/vault/VaultSoftLockManagerTest.kt @@ -28,7 +28,7 @@ import net.corda.nodeapi.internal.cordapp.CordappLoader import net.corda.nodeapi.internal.persistence.CordaPersistence import net.corda.testing.core.singleIdentity import net.corda.testing.flows.registerCoreFlowFactory -import net.corda.testing.internal.rigorousMock +import net.corda.coretesting.internal.rigorousMock import net.corda.testing.node.internal.InternalMockNetwork import net.corda.testing.node.internal.enclosedCordapp import net.corda.testing.node.internal.startFlow diff --git a/node/src/test/kotlin/net/corda/node/utilities/registration/HTTPNetworkRegistrationServiceTest.kt b/node/src/test/kotlin/net/corda/node/utilities/registration/HTTPNetworkRegistrationServiceTest.kt index bbc5751118..52db6d3e84 100644 --- a/node/src/test/kotlin/net/corda/node/utilities/registration/HTTPNetworkRegistrationServiceTest.kt +++ b/node/src/test/kotlin/net/corda/node/utilities/registration/HTTPNetworkRegistrationServiceTest.kt @@ -6,7 +6,7 @@ import com.nhaarman.mockito_kotlin.mock import com.nhaarman.mockito_kotlin.whenever import net.corda.node.VersionInfo import net.corda.node.services.config.NetworkServicesConfig -import net.corda.testing.internal.rigorousMock +import net.corda.coretesting.internal.rigorousMock import org.bouncycastle.pkcs.PKCS10CertificationRequest import org.junit.Test import java.io.InputStream diff --git a/node/src/test/kotlin/net/corda/node/utilities/registration/NetworkRegistrationHelperTest.kt b/node/src/test/kotlin/net/corda/node/utilities/registration/NetworkRegistrationHelperTest.kt index caeacc5b71..dde5082f6b 100644 --- a/node/src/test/kotlin/net/corda/node/utilities/registration/NetworkRegistrationHelperTest.kt +++ b/node/src/test/kotlin/net/corda/node/utilities/registration/NetworkRegistrationHelperTest.kt @@ -26,8 +26,8 @@ import net.corda.nodeapi.internal.crypto.X509Utilities.DISTRIBUTED_NOTARY_KEY_AL import net.corda.nodeapi.internal.crypto.X509Utilities.createSelfSignedCACertificate import net.corda.testing.core.ALICE_NAME import net.corda.testing.internal.createDevIntermediateCaCertPath -import net.corda.testing.internal.rigorousMock -import net.corda.testing.internal.stubs.CertificateStoreStubs +import net.corda.coretesting.internal.rigorousMock +import net.corda.coretesting.internal.stubs.CertificateStoreStubs import org.assertj.core.api.Assertions.* import org.bouncycastle.asn1.x509.GeneralName import org.bouncycastle.asn1.x509.GeneralSubtree diff --git a/samples/irs-demo/cordapp/workflows-irs/src/test/kotlin/net/corda/irs/api/NodeInterestRatesTest.kt b/samples/irs-demo/cordapp/workflows-irs/src/test/kotlin/net/corda/irs/api/NodeInterestRatesTest.kt index bb82a178eb..1b9c75d25b 100644 --- a/samples/irs-demo/cordapp/workflows-irs/src/test/kotlin/net/corda/irs/api/NodeInterestRatesTest.kt +++ b/samples/irs-demo/cordapp/workflows-irs/src/test/kotlin/net/corda/irs/api/NodeInterestRatesTest.kt @@ -14,7 +14,7 @@ import net.corda.nodeapi.internal.persistence.CordaPersistence import net.corda.nodeapi.internal.persistence.DatabaseConfig import net.corda.testing.core.* import net.corda.testing.internal.configureDatabase -import net.corda.testing.internal.rigorousMock +import net.corda.coretesting.internal.rigorousMock import net.corda.testing.node.MockServices import net.corda.testing.node.MockServices.Companion.makeTestDataSourceProperties import net.corda.testing.node.createMockCordaService diff --git a/samples/trader-demo/workflows-trader/src/test/kotlin/net/corda/traderdemo/flow/TransactionGraphSearchTests.kt b/samples/trader-demo/workflows-trader/src/test/kotlin/net/corda/traderdemo/flow/TransactionGraphSearchTests.kt index d17bdbfc49..e59a56eb59 100644 --- a/samples/trader-demo/workflows-trader/src/test/kotlin/net/corda/traderdemo/flow/TransactionGraphSearchTests.kt +++ b/samples/trader-demo/workflows-trader/src/test/kotlin/net/corda/traderdemo/flow/TransactionGraphSearchTests.kt @@ -13,7 +13,7 @@ import net.corda.testing.core.DUMMY_NOTARY_NAME import net.corda.testing.core.SerializationEnvironmentRule import net.corda.testing.core.TestIdentity import net.corda.testing.core.dummyCommand -import net.corda.testing.internal.rigorousMock +import net.corda.coretesting.internal.rigorousMock import net.corda.testing.node.MockServices import net.corda.testing.node.internal.MockTransactionStorage import org.junit.Rule diff --git a/serialization-tests/src/test/java/net/corda/serialization/internal/LambdaCheckpointSerializationTest.java b/serialization-tests/src/test/java/net/corda/serialization/internal/LambdaCheckpointSerializationTest.java index 0c9c9f2b5a..5b844d5b86 100644 --- a/serialization-tests/src/test/java/net/corda/serialization/internal/LambdaCheckpointSerializationTest.java +++ b/serialization-tests/src/test/java/net/corda/serialization/internal/LambdaCheckpointSerializationTest.java @@ -3,7 +3,7 @@ package net.corda.serialization.internal; import net.corda.core.serialization.*; import net.corda.core.serialization.internal.CheckpointSerializationContext; import net.corda.core.serialization.internal.CheckpointSerializer; -import net.corda.node.serialization.kryo.CordaClosureSerializer; +import net.corda.nodeapi.internal.serialization.kryo.CordaClosureSerializer; import net.corda.testing.core.internal.CheckpointSerializationEnvironmentRule; import org.junit.Before; import org.junit.Rule; diff --git a/serialization-tests/src/test/kotlin/net/corda/serialization/internal/ContractAttachmentSerializerTest.kt b/serialization-tests/src/test/kotlin/net/corda/serialization/internal/ContractAttachmentSerializerTest.kt index fd854c14a0..ca341f68dd 100644 --- a/serialization-tests/src/test/kotlin/net/corda/serialization/internal/ContractAttachmentSerializerTest.kt +++ b/serialization-tests/src/test/kotlin/net/corda/serialization/internal/ContractAttachmentSerializerTest.kt @@ -8,7 +8,7 @@ import net.corda.core.serialization.internal.checkpointDeserialize import net.corda.core.serialization.internal.checkpointSerialize import net.corda.testing.contracts.DummyContract import net.corda.testing.core.internal.CheckpointSerializationEnvironmentRule -import net.corda.testing.internal.rigorousMock +import net.corda.coretesting.internal.rigorousMock import net.corda.testing.node.MockServices import org.apache.commons.lang3.ArrayUtils.EMPTY_BYTE_ARRAY import org.assertj.core.api.Assertions.assertThat diff --git a/serialization-tests/src/test/kotlin/net/corda/serialization/internal/CordaClassResolverTests.kt b/serialization-tests/src/test/kotlin/net/corda/serialization/internal/CordaClassResolverTests.kt index 5208324e7d..1fc4023ff9 100644 --- a/serialization-tests/src/test/kotlin/net/corda/serialization/internal/CordaClassResolverTests.kt +++ b/serialization-tests/src/test/kotlin/net/corda/serialization/internal/CordaClassResolverTests.kt @@ -16,12 +16,12 @@ import net.corda.core.node.services.AttachmentStorage import net.corda.core.serialization.CordaSerializable import net.corda.core.serialization.internal.AttachmentsClassLoader import net.corda.core.serialization.internal.CheckpointSerializationContext -import net.corda.node.serialization.kryo.CordaClassResolver -import net.corda.node.serialization.kryo.CordaKryo +import net.corda.nodeapi.internal.serialization.kryo.CordaClassResolver +import net.corda.nodeapi.internal.serialization.kryo.CordaKryo import net.corda.node.services.attachments.NodeAttachmentTrustCalculator import net.corda.testing.common.internal.testNetworkParameters import net.corda.testing.internal.TestingNamedCacheFactory -import net.corda.testing.internal.rigorousMock +import net.corda.coretesting.internal.rigorousMock import net.corda.testing.internal.services.InternalMockAttachmentStorage import net.corda.testing.services.MockAttachmentStorage import org.junit.Rule diff --git a/serialization-tests/src/test/kotlin/net/corda/serialization/internal/ListsSerializationTest.kt b/serialization-tests/src/test/kotlin/net/corda/serialization/internal/ListsSerializationTest.kt index 4dc26f1cb7..75762aaa36 100644 --- a/serialization-tests/src/test/kotlin/net/corda/serialization/internal/ListsSerializationTest.kt +++ b/serialization-tests/src/test/kotlin/net/corda/serialization/internal/ListsSerializationTest.kt @@ -3,7 +3,7 @@ package net.corda.serialization.internal import com.esotericsoftware.kryo.Kryo import com.esotericsoftware.kryo.util.DefaultClassResolver import net.corda.core.serialization.* -import net.corda.node.serialization.kryo.kryoMagic +import net.corda.nodeapi.internal.serialization.kryo.kryoMagic import net.corda.node.services.statemachine.DataSessionMessage import net.corda.serialization.internal.amqp.DeserializationInput import net.corda.serialization.internal.amqp.Envelope diff --git a/serialization-tests/src/test/kotlin/net/corda/serialization/internal/MapsSerializationTest.kt b/serialization-tests/src/test/kotlin/net/corda/serialization/internal/MapsSerializationTest.kt index 5e5ee8a606..24fd901408 100644 --- a/serialization-tests/src/test/kotlin/net/corda/serialization/internal/MapsSerializationTest.kt +++ b/serialization-tests/src/test/kotlin/net/corda/serialization/internal/MapsSerializationTest.kt @@ -6,7 +6,7 @@ import net.corda.core.identity.CordaX500Name import net.corda.core.serialization.CordaSerializable import net.corda.core.serialization.deserialize import net.corda.core.serialization.serialize -import net.corda.node.serialization.kryo.kryoMagic +import net.corda.nodeapi.internal.serialization.kryo.kryoMagic import net.corda.node.services.statemachine.DataSessionMessage import net.corda.testing.core.SerializationEnvironmentRule import net.corda.testing.internal.amqpSpecific diff --git a/serialization-tests/src/test/kotlin/net/corda/serialization/internal/SerializationTokenTest.kt b/serialization-tests/src/test/kotlin/net/corda/serialization/internal/SerializationTokenTest.kt index fbe7537199..2fc36c8976 100644 --- a/serialization-tests/src/test/kotlin/net/corda/serialization/internal/SerializationTokenTest.kt +++ b/serialization-tests/src/test/kotlin/net/corda/serialization/internal/SerializationTokenTest.kt @@ -8,11 +8,11 @@ import net.corda.core.serialization.internal.CheckpointSerializationContext import net.corda.core.serialization.internal.checkpointDeserialize import net.corda.core.serialization.internal.checkpointSerialize import net.corda.core.utilities.OpaqueBytes -import net.corda.node.serialization.kryo.CordaClassResolver -import net.corda.node.serialization.kryo.CordaKryo -import net.corda.node.serialization.kryo.DefaultKryoCustomizer -import net.corda.node.serialization.kryo.kryoMagic -import net.corda.testing.internal.rigorousMock +import net.corda.nodeapi.internal.serialization.kryo.CordaClassResolver +import net.corda.nodeapi.internal.serialization.kryo.CordaKryo +import net.corda.nodeapi.internal.serialization.kryo.DefaultKryoCustomizer +import net.corda.nodeapi.internal.serialization.kryo.kryoMagic +import net.corda.coretesting.internal.rigorousMock import net.corda.testing.core.internal.CheckpointSerializationEnvironmentRule import org.assertj.core.api.Assertions.assertThat import org.junit.Before diff --git a/serialization-tests/src/test/kotlin/net/corda/serialization/internal/SetsSerializationTest.kt b/serialization-tests/src/test/kotlin/net/corda/serialization/internal/SetsSerializationTest.kt index b0f9bac9d9..159e96fc1d 100644 --- a/serialization-tests/src/test/kotlin/net/corda/serialization/internal/SetsSerializationTest.kt +++ b/serialization-tests/src/test/kotlin/net/corda/serialization/internal/SetsSerializationTest.kt @@ -4,7 +4,7 @@ import com.esotericsoftware.kryo.Kryo import com.esotericsoftware.kryo.util.DefaultClassResolver import net.corda.core.serialization.deserialize import net.corda.core.serialization.serialize -import net.corda.node.serialization.kryo.kryoMagic +import net.corda.nodeapi.internal.serialization.kryo.kryoMagic import net.corda.node.services.statemachine.DataSessionMessage import net.corda.testing.core.SerializationEnvironmentRule import net.corda.testing.internal.kryoSpecific diff --git a/serialization-tests/src/test/kotlin/net/corda/serialization/internal/amqp/AbstractAMQPSerializationSchemeTest.kt b/serialization-tests/src/test/kotlin/net/corda/serialization/internal/amqp/AbstractAMQPSerializationSchemeTest.kt index 79438f3b60..095cf8785e 100644 --- a/serialization-tests/src/test/kotlin/net/corda/serialization/internal/amqp/AbstractAMQPSerializationSchemeTest.kt +++ b/serialization-tests/src/test/kotlin/net/corda/serialization/internal/amqp/AbstractAMQPSerializationSchemeTest.kt @@ -8,7 +8,7 @@ import net.corda.serialization.internal.AllWhitelist import net.corda.serialization.internal.CordaSerializationMagic import net.corda.serialization.internal.SerializationContextImpl import net.corda.serialization.internal.amqp.testutils.serializationProperties -import net.corda.testing.internal.createTestSerializationEnv +import net.corda.coretesting.internal.createTestSerializationEnv import org.hamcrest.CoreMatchers import org.hamcrest.CoreMatchers.`is` import org.hamcrest.Matchers diff --git a/serialization-tests/src/test/kotlin/net/corda/serialization/internal/amqp/DeserializeQueryableStateTest.kt b/serialization-tests/src/test/kotlin/net/corda/serialization/internal/amqp/DeserializeQueryableStateTest.kt index c37ebc6e1b..1aaeebd7af 100644 --- a/serialization-tests/src/test/kotlin/net/corda/serialization/internal/amqp/DeserializeQueryableStateTest.kt +++ b/serialization-tests/src/test/kotlin/net/corda/serialization/internal/amqp/DeserializeQueryableStateTest.kt @@ -1,12 +1,12 @@ package net.corda.serialization.internal.amqp -import net.corda.client.rpc.internal.serialization.amqp.AMQPClientSerializationScheme +import net.corda.nodeapi.internal.rpc.client.AMQPClientSerializationScheme import net.corda.core.identity.AbstractParty import net.corda.core.schemas.MappedSchema import net.corda.core.schemas.PersistentState import net.corda.core.schemas.QueryableState import net.corda.core.serialization.SerializedBytes -import net.corda.node.serialization.amqp.AMQPServerSerializationScheme +import net.corda.nodeapi.internal.serialization.amqp.AMQPServerSerializationScheme import net.corda.serialization.internal.AMQP_RPC_CLIENT_CONTEXT import net.corda.serialization.internal.AMQP_RPC_SERVER_CONTEXT import net.corda.serialization.internal.AllWhitelist diff --git a/serialization-tests/src/test/kotlin/net/corda/serialization/internal/amqp/SerializationOutputTests.kt b/serialization-tests/src/test/kotlin/net/corda/serialization/internal/amqp/SerializationOutputTests.kt index dade6b0f50..9dd1a398e8 100644 --- a/serialization-tests/src/test/kotlin/net/corda/serialization/internal/amqp/SerializationOutputTests.kt +++ b/serialization-tests/src/test/kotlin/net/corda/serialization/internal/amqp/SerializationOutputTests.kt @@ -18,7 +18,7 @@ import net.corda.core.internal.AbstractAttachment import net.corda.core.serialization.* import net.corda.core.transactions.LedgerTransaction import net.corda.core.utilities.OpaqueBytes -import net.corda.node.serialization.amqp.AMQPServerSerializationScheme +import net.corda.nodeapi.internal.serialization.amqp.AMQPServerSerializationScheme import net.corda.nodeapi.internal.crypto.ContentSignerBuilder import net.corda.serialization.internal.* import net.corda.serialization.internal.amqp.testutils.* @@ -27,7 +27,7 @@ import net.corda.testing.contracts.DummyContract import net.corda.testing.core.BOB_NAME import net.corda.testing.core.SerializationEnvironmentRule import net.corda.testing.core.TestIdentity -import net.corda.testing.internal.rigorousMock +import net.corda.coretesting.internal.rigorousMock import org.apache.activemq.artemis.api.core.SimpleString import org.apache.qpid.proton.amqp.* import org.apache.qpid.proton.codec.DecoderImpl diff --git a/settings.gradle b/settings.gradle index 78f158b144..8a636cdf94 100644 --- a/settings.gradle +++ b/settings.gradle @@ -42,8 +42,9 @@ include 'test-utils' include 'test-db' include 'smoke-test-utils' include 'node-driver' +include 'core-test-utils' // Avoid making 'testing' a project, and allow build.gradle files to refer to these by their simple names: -['test-common', 'test-utils', 'test-cli', 'test-db', 'smoke-test-utils', 'node-driver'].each { +['test-common', 'core-test-utils', 'test-utils', 'test-cli', 'test-db', 'smoke-test-utils', 'node-driver'].each { project(":$it").projectDir = new File("$settingsDir/testing/$it") } include 'tools:explorer' diff --git a/testing/core-test-utils/build.gradle b/testing/core-test-utils/build.gradle new file mode 100644 index 0000000000..53954ea735 --- /dev/null +++ b/testing/core-test-utils/build.gradle @@ -0,0 +1,22 @@ +plugins { + id 'org.jetbrains.kotlin.jvm' + id 'net.corda.plugins.publish-utils' + id 'net.corda.plugins.api-scanner' + id 'com.jfrog.artifactory' +} + +description 'Core test types and helpers for testing Corda' + +dependencies { + implementation project(':core') + implementation project(':test-common') + compile "org.jetbrains.kotlin:kotlin-test" +} + +jar { + baseName 'corda-core-test-utils' +} + +publish { + name jar.baseName +} \ No newline at end of file diff --git a/testing/test-utils/src/main/kotlin/net/corda/testing/internal/InternalSerializationTestHelpers.kt b/testing/core-test-utils/src/main/kotlin/net/corda/coretesting/internal/InternalSerializationTestHelpers.kt similarity index 73% rename from testing/test-utils/src/main/kotlin/net/corda/testing/internal/InternalSerializationTestHelpers.kt rename to testing/core-test-utils/src/main/kotlin/net/corda/coretesting/internal/InternalSerializationTestHelpers.kt index a9572f62fd..6e2253814b 100644 --- a/testing/test-utils/src/main/kotlin/net/corda/testing/internal/InternalSerializationTestHelpers.kt +++ b/testing/core-test-utils/src/main/kotlin/net/corda/coretesting/internal/InternalSerializationTestHelpers.kt @@ -1,14 +1,18 @@ -package net.corda.testing.internal +package net.corda.coretesting.internal -import net.corda.client.rpc.internal.serialization.amqp.AMQPClientSerializationScheme +import net.corda.nodeapi.internal.rpc.client.AMQPClientSerializationScheme import net.corda.core.internal.createInstancesOfClassesImplementing import net.corda.core.serialization.SerializationCustomSerializer import net.corda.core.serialization.SerializationWhitelist import net.corda.core.serialization.internal.SerializationEnvironment -import net.corda.node.serialization.amqp.AMQPServerSerializationScheme -import net.corda.node.serialization.kryo.KRYO_CHECKPOINT_CONTEXT -import net.corda.node.serialization.kryo.KryoCheckpointSerializer -import net.corda.serialization.internal.* +import net.corda.nodeapi.internal.serialization.amqp.AMQPServerSerializationScheme +import net.corda.nodeapi.internal.serialization.kryo.KRYO_CHECKPOINT_CONTEXT +import net.corda.nodeapi.internal.serialization.kryo.KryoCheckpointSerializer +import net.corda.serialization.internal.AMQP_P2P_CONTEXT +import net.corda.serialization.internal.AMQP_RPC_CLIENT_CONTEXT +import net.corda.serialization.internal.AMQP_RPC_SERVER_CONTEXT +import net.corda.serialization.internal.AMQP_STORAGE_CONTEXT +import net.corda.serialization.internal.SerializationFactoryImpl import net.corda.testing.common.internal.asContextEnv import java.util.ServiceLoader import java.util.concurrent.ConcurrentHashMap diff --git a/testing/test-utils/src/main/kotlin/net/corda/testing/internal/InternalTestConstants.kt b/testing/core-test-utils/src/main/kotlin/net/corda/coretesting/internal/InternalTestConstants.kt similarity index 91% rename from testing/test-utils/src/main/kotlin/net/corda/testing/internal/InternalTestConstants.kt rename to testing/core-test-utils/src/main/kotlin/net/corda/coretesting/internal/InternalTestConstants.kt index 664cbce7ab..1d3a7c6134 100644 --- a/testing/test-utils/src/main/kotlin/net/corda/testing/internal/InternalTestConstants.kt +++ b/testing/core-test-utils/src/main/kotlin/net/corda/coretesting/internal/InternalTestConstants.kt @@ -1,4 +1,4 @@ -package net.corda.testing.internal +package net.corda.coretesting.internal import net.corda.nodeapi.internal.crypto.CertificateAndKeyPair import java.time.Instant diff --git a/testing/test-utils/src/main/kotlin/net/corda/testing/internal/NettyTestClient.kt b/testing/core-test-utils/src/main/kotlin/net/corda/coretesting/internal/NettyTestClient.kt similarity index 98% rename from testing/test-utils/src/main/kotlin/net/corda/testing/internal/NettyTestClient.kt rename to testing/core-test-utils/src/main/kotlin/net/corda/coretesting/internal/NettyTestClient.kt index 532b7d1c94..185a289472 100644 --- a/testing/test-utils/src/main/kotlin/net/corda/testing/internal/NettyTestClient.kt +++ b/testing/core-test-utils/src/main/kotlin/net/corda/coretesting/internal/NettyTestClient.kt @@ -1,4 +1,4 @@ -package net.corda.testing.internal +package net.corda.coretesting.internal import io.netty.bootstrap.Bootstrap import io.netty.channel.ChannelFuture diff --git a/testing/test-utils/src/main/kotlin/net/corda/testing/internal/NettyTestHandler.kt b/testing/core-test-utils/src/main/kotlin/net/corda/coretesting/internal/NettyTestHandler.kt similarity index 98% rename from testing/test-utils/src/main/kotlin/net/corda/testing/internal/NettyTestHandler.kt rename to testing/core-test-utils/src/main/kotlin/net/corda/coretesting/internal/NettyTestHandler.kt index b62ed09805..9086938325 100644 --- a/testing/test-utils/src/main/kotlin/net/corda/testing/internal/NettyTestHandler.kt +++ b/testing/core-test-utils/src/main/kotlin/net/corda/coretesting/internal/NettyTestHandler.kt @@ -1,4 +1,4 @@ -package net.corda.testing.internal +package net.corda.coretesting.internal import io.netty.buffer.ByteBuf import io.netty.buffer.Unpooled diff --git a/testing/test-utils/src/main/kotlin/net/corda/testing/internal/NettyTestServer.kt b/testing/core-test-utils/src/main/kotlin/net/corda/coretesting/internal/NettyTestServer.kt similarity index 98% rename from testing/test-utils/src/main/kotlin/net/corda/testing/internal/NettyTestServer.kt rename to testing/core-test-utils/src/main/kotlin/net/corda/coretesting/internal/NettyTestServer.kt index a9effdd279..8fa9d23057 100644 --- a/testing/test-utils/src/main/kotlin/net/corda/testing/internal/NettyTestServer.kt +++ b/testing/core-test-utils/src/main/kotlin/net/corda/coretesting/internal/NettyTestServer.kt @@ -1,4 +1,4 @@ -package net.corda.testing.internal +package net.corda.coretesting.internal import io.netty.bootstrap.ServerBootstrap import io.netty.channel.ChannelFuture diff --git a/testing/test-utils/src/main/kotlin/net/corda/testing/internal/RigorousMock.kt b/testing/core-test-utils/src/main/kotlin/net/corda/coretesting/internal/RigorousMock.kt similarity index 98% rename from testing/test-utils/src/main/kotlin/net/corda/testing/internal/RigorousMock.kt rename to testing/core-test-utils/src/main/kotlin/net/corda/coretesting/internal/RigorousMock.kt index 72f4942635..fcd9b085aa 100644 --- a/testing/test-utils/src/main/kotlin/net/corda/testing/internal/RigorousMock.kt +++ b/testing/core-test-utils/src/main/kotlin/net/corda/coretesting/internal/RigorousMock.kt @@ -1,4 +1,5 @@ -package net.corda.testing.internal +@file: Suppress("MatchingDeclarationName") +package net.corda.coretesting.internal import com.nhaarman.mockito_kotlin.doAnswer import net.corda.core.utilities.contextLogger diff --git a/testing/test-utils/src/main/kotlin/net/corda/testing/internal/TestNodeInfoBuilder.kt b/testing/core-test-utils/src/main/kotlin/net/corda/coretesting/internal/TestNodeInfoBuilder.kt similarity index 96% rename from testing/test-utils/src/main/kotlin/net/corda/testing/internal/TestNodeInfoBuilder.kt rename to testing/core-test-utils/src/main/kotlin/net/corda/coretesting/internal/TestNodeInfoBuilder.kt index e7f16ad0ab..4b0fed9ba0 100644 --- a/testing/test-utils/src/main/kotlin/net/corda/testing/internal/TestNodeInfoBuilder.kt +++ b/testing/core-test-utils/src/main/kotlin/net/corda/coretesting/internal/TestNodeInfoBuilder.kt @@ -1,4 +1,4 @@ -package net.corda.testing.internal +package net.corda.coretesting.internal import net.corda.core.crypto.Crypto import net.corda.core.crypto.sign @@ -7,6 +7,8 @@ import net.corda.core.identity.PartyAndCertificate import net.corda.core.node.NodeInfo import net.corda.core.serialization.serialize import net.corda.core.utilities.NetworkHostAndPort +import net.corda.nodeapi.internal.DEV_INTERMEDIATE_CA +import net.corda.nodeapi.internal.DEV_ROOT_CA import net.corda.nodeapi.internal.NodeInfoAndSigned import net.corda.nodeapi.internal.SignedNodeInfo import net.corda.nodeapi.internal.createDevNodeCa diff --git a/testing/test-utils/src/main/kotlin/net/corda/testing/internal/TestThreadFactory.kt b/testing/core-test-utils/src/main/kotlin/net/corda/coretesting/internal/TestThreadFactory.kt similarity index 94% rename from testing/test-utils/src/main/kotlin/net/corda/testing/internal/TestThreadFactory.kt rename to testing/core-test-utils/src/main/kotlin/net/corda/coretesting/internal/TestThreadFactory.kt index 0d25111ca4..d64a5f8d3b 100644 --- a/testing/test-utils/src/main/kotlin/net/corda/testing/internal/TestThreadFactory.kt +++ b/testing/core-test-utils/src/main/kotlin/net/corda/coretesting/internal/TestThreadFactory.kt @@ -1,4 +1,4 @@ -package net.corda.testing.internal +package net.corda.coretesting.internal import java.util.concurrent.ConcurrentHashMap import java.util.concurrent.ThreadFactory diff --git a/testing/test-utils/src/main/kotlin/net/corda/testing/internal/matchers/Matchers.kt b/testing/core-test-utils/src/main/kotlin/net/corda/coretesting/internal/matchers/Matchers.kt similarity index 98% rename from testing/test-utils/src/main/kotlin/net/corda/testing/internal/matchers/Matchers.kt rename to testing/core-test-utils/src/main/kotlin/net/corda/coretesting/internal/matchers/Matchers.kt index e65c1b1cdb..08e3d7c891 100644 --- a/testing/test-utils/src/main/kotlin/net/corda/testing/internal/matchers/Matchers.kt +++ b/testing/core-test-utils/src/main/kotlin/net/corda/coretesting/internal/matchers/Matchers.kt @@ -1,4 +1,4 @@ -package net.corda.testing.internal.matchers +package net.corda.coretesting.internal.matchers import com.natpryce.hamkrest.* diff --git a/testing/test-utils/src/main/kotlin/net/corda/testing/internal/matchers/flow/FlowMatchers.kt b/testing/core-test-utils/src/main/kotlin/net/corda/coretesting/internal/matchers/flow/FlowMatchers.kt similarity index 69% rename from testing/test-utils/src/main/kotlin/net/corda/testing/internal/matchers/flow/FlowMatchers.kt rename to testing/core-test-utils/src/main/kotlin/net/corda/coretesting/internal/matchers/flow/FlowMatchers.kt index 2e66073fc9..42b27f10c9 100644 --- a/testing/test-utils/src/main/kotlin/net/corda/testing/internal/matchers/flow/FlowMatchers.kt +++ b/testing/core-test-utils/src/main/kotlin/net/corda/coretesting/internal/matchers/flow/FlowMatchers.kt @@ -1,14 +1,14 @@ -package net.corda.testing.internal.matchers.flow +package net.corda.coretesting.internal.matchers.flow import com.natpryce.hamkrest.Matcher import com.natpryce.hamkrest.equalTo import net.corda.core.internal.FlowStateMachine -import net.corda.testing.internal.matchers.* +import net.corda.coretesting.internal.matchers.* /** * Matches a Flow that succeeds with a result matched by the given matcher */ -fun willReturn(): Matcher> = net.corda.testing.internal.matchers.future.willReturn() +fun willReturn(): Matcher> = net.corda.coretesting.internal.matchers.future.willReturn() .extrude(FlowStateMachine::resultFuture) .redescribe { "is a flow that will return" } @@ -17,7 +17,7 @@ fun willReturn(expected: T): Matcher> = willReturn(equal /** * Matches a Flow that succeeds with a result matched by the given matcher */ -fun willReturn(successMatcher: Matcher) = net.corda.testing.internal.matchers.future.willReturn(successMatcher) +fun willReturn(successMatcher: Matcher) = net.corda.coretesting.internal.matchers.future.willReturn(successMatcher) .extrude(FlowStateMachine::resultFuture) .redescribe { "is a flow that will return with a value that ${successMatcher.description}" } @@ -25,7 +25,7 @@ fun willReturn(successMatcher: Matcher) = net.corda.testing.internal.matc * Matches a Flow that fails, with an exception matched by the given matcher. */ inline fun willThrow(failureMatcher: Matcher) = - net.corda.testing.internal.matchers.future.willThrow(failureMatcher) + net.corda.coretesting.internal.matchers.future.willThrow(failureMatcher) .extrude(FlowStateMachine<*>::resultFuture) .redescribe { "is a flow that will fail, throwing an exception that ${failureMatcher.description}" } @@ -33,6 +33,6 @@ inline fun willThrow(failureMatcher: Matcher) = * Matches a Flow that fails, with an exception of the specified type. */ inline fun willThrow() = - net.corda.testing.internal.matchers.future.willThrow() + net.corda.coretesting.internal.matchers.future.willThrow() .extrude(FlowStateMachine<*>::resultFuture) .redescribe { "is a flow that will fail with an exception of type ${E::class.java.simpleName}" } \ No newline at end of file diff --git a/testing/test-utils/src/main/kotlin/net/corda/testing/internal/matchers/future/FutureMatchers.kt b/testing/core-test-utils/src/main/kotlin/net/corda/coretesting/internal/matchers/future/FutureMatchers.kt similarity index 95% rename from testing/test-utils/src/main/kotlin/net/corda/testing/internal/matchers/future/FutureMatchers.kt rename to testing/core-test-utils/src/main/kotlin/net/corda/coretesting/internal/matchers/future/FutureMatchers.kt index e1e42108c8..59d3c7ff0b 100644 --- a/testing/test-utils/src/main/kotlin/net/corda/testing/internal/matchers/future/FutureMatchers.kt +++ b/testing/core-test-utils/src/main/kotlin/net/corda/coretesting/internal/matchers/future/FutureMatchers.kt @@ -1,10 +1,10 @@ -package net.corda.testing.internal.matchers.future +package net.corda.coretesting.internal.matchers.future import com.natpryce.hamkrest.MatchResult import com.natpryce.hamkrest.Matcher import com.natpryce.hamkrest.equalTo import net.corda.core.utilities.getOrThrow -import net.corda.testing.internal.matchers.modifyMismatchDescription +import net.corda.coretesting.internal.matchers.modifyMismatchDescription import java.util.concurrent.Future /** diff --git a/testing/test-utils/src/main/kotlin/net/corda/testing/internal/matchers/rpc/RpcMatchers.kt b/testing/core-test-utils/src/main/kotlin/net/corda/coretesting/internal/matchers/rpc/RpcMatchers.kt similarity index 65% rename from testing/test-utils/src/main/kotlin/net/corda/testing/internal/matchers/rpc/RpcMatchers.kt rename to testing/core-test-utils/src/main/kotlin/net/corda/coretesting/internal/matchers/rpc/RpcMatchers.kt index a5fb84997a..a6598ea5dc 100644 --- a/testing/test-utils/src/main/kotlin/net/corda/testing/internal/matchers/rpc/RpcMatchers.kt +++ b/testing/core-test-utils/src/main/kotlin/net/corda/coretesting/internal/matchers/rpc/RpcMatchers.kt @@ -1,21 +1,21 @@ -package net.corda.testing.internal.matchers.rpc +package net.corda.coretesting.internal.matchers.rpc import com.natpryce.hamkrest.Matcher import net.corda.core.messaging.FlowHandle -import net.corda.testing.internal.matchers.extrude -import net.corda.testing.internal.matchers.redescribe +import net.corda.coretesting.internal.matchers.extrude +import net.corda.coretesting.internal.matchers.redescribe /** * Matches a flow handle that succeeds with a result matched by the given matcher */ -fun willReturn() = net.corda.testing.internal.matchers.future.willReturn() +fun willReturn() = net.corda.coretesting.internal.matchers.future.willReturn() .extrude(FlowHandle::returnValue) .redescribe { "is an RPG flow handle that will return" } /** * Matches a flow handle that succeeds with a result matched by the given matcher */ -fun willReturn(successMatcher: Matcher) = net.corda.testing.internal.matchers.future.willReturn(successMatcher) +fun willReturn(successMatcher: Matcher) = net.corda.coretesting.internal.matchers.future.willReturn(successMatcher) .extrude(FlowHandle::returnValue) .redescribe { "is an RPG flow handle that will return a value that ${successMatcher.description}" } @@ -23,7 +23,7 @@ fun willReturn(successMatcher: Matcher) = net.corda.testing.internal.matc * Matches a flow handle that fails, with an exception matched by the given matcher. */ inline fun willThrow(failureMatcher: Matcher) = - net.corda.testing.internal.matchers.future.willThrow(failureMatcher) + net.corda.coretesting.internal.matchers.future.willThrow(failureMatcher) .extrude(FlowHandle<*>::returnValue) .redescribe { "is an RPG flow handle that will fail with an exception that ${failureMatcher.description}" } @@ -31,6 +31,6 @@ inline fun willThrow(failureMatcher: Matcher) = * Matches a flow handle that fails, with an exception of the specified type. */ inline fun willThrow() = - net.corda.testing.internal.matchers.future.willThrow() + net.corda.coretesting.internal.matchers.future.willThrow() .extrude(FlowHandle<*>::returnValue) .redescribe { "is an RPG flow handle that will fail with an exception of type ${E::class.java.simpleName}" } \ No newline at end of file diff --git a/testing/test-utils/src/main/kotlin/net/corda/testing/internal/performance/Rate.kt b/testing/core-test-utils/src/main/kotlin/net/corda/coretesting/internal/performance/Rate.kt similarity index 94% rename from testing/test-utils/src/main/kotlin/net/corda/testing/internal/performance/Rate.kt rename to testing/core-test-utils/src/main/kotlin/net/corda/coretesting/internal/performance/Rate.kt index dd79aed436..0f880d962e 100644 --- a/testing/test-utils/src/main/kotlin/net/corda/testing/internal/performance/Rate.kt +++ b/testing/core-test-utils/src/main/kotlin/net/corda/coretesting/internal/performance/Rate.kt @@ -1,4 +1,4 @@ -package net.corda.testing.internal.performance +package net.corda.coretesting.internal.performance import java.time.Duration import java.time.temporal.ChronoUnit diff --git a/testing/test-utils/src/main/kotlin/net/corda/testing/internal/stubs/CertificateStoreStubs.kt b/testing/core-test-utils/src/main/kotlin/net/corda/coretesting/internal/stubs/CertificateStoreStubs.kt similarity index 94% rename from testing/test-utils/src/main/kotlin/net/corda/testing/internal/stubs/CertificateStoreStubs.kt rename to testing/core-test-utils/src/main/kotlin/net/corda/coretesting/internal/stubs/CertificateStoreStubs.kt index e180769418..c23d458a80 100644 --- a/testing/test-utils/src/main/kotlin/net/corda/testing/internal/stubs/CertificateStoreStubs.kt +++ b/testing/core-test-utils/src/main/kotlin/net/corda/coretesting/internal/stubs/CertificateStoreStubs.kt @@ -1,4 +1,4 @@ -package net.corda.testing.internal.stubs +package net.corda.coretesting.internal.stubs import net.corda.core.internal.div import net.corda.nodeapi.internal.DEV_CA_KEY_STORE_PASS @@ -43,11 +43,13 @@ class CertificateStoreStubs { companion object { + @Suppress("LongParameterList") @JvmStatic fun withCertificatesDirectory(certificatesDirectory: Path, keyStoreFileName: String = KeyStore.DEFAULT_STORE_FILE_NAME, keyStorePassword: String = KeyStore.DEFAULT_STORE_PASSWORD, keyPassword: String = keyStorePassword, - trustStoreFileName: String = TrustStore.DEFAULT_STORE_FILE_NAME, trustStorePassword: String = TrustStore.DEFAULT_STORE_PASSWORD, trustStoreKeyPassword: String = TrustStore.DEFAULT_KEY_PASSWORD, - @Suppress("UNUSED_PARAMETER") useOpenSsl: Boolean = false): MutualSslConfiguration { + trustStoreFileName: String = TrustStore.DEFAULT_STORE_FILE_NAME, + trustStorePassword: String = TrustStore.DEFAULT_STORE_PASSWORD, + trustStoreKeyPassword: String = TrustStore.DEFAULT_KEY_PASSWORD): MutualSslConfiguration { val keyStore = FileBasedCertificateStoreSupplier(certificatesDirectory / keyStoreFileName, keyStorePassword, keyPassword) val trustStore = FileBasedCertificateStoreSupplier(certificatesDirectory / trustStoreFileName, trustStorePassword, trustStoreKeyPassword) diff --git a/testing/test-utils/src/main/kotlin/net/corda/testing/contracts/DummyContract.kt b/testing/core-test-utils/src/main/kotlin/net/corda/testing/contracts/DummyContract.kt similarity index 100% rename from testing/test-utils/src/main/kotlin/net/corda/testing/contracts/DummyContract.kt rename to testing/core-test-utils/src/main/kotlin/net/corda/testing/contracts/DummyContract.kt diff --git a/testing/test-utils/src/main/kotlin/net/corda/testing/contracts/DummyContractV2.kt b/testing/core-test-utils/src/main/kotlin/net/corda/testing/contracts/DummyContractV2.kt similarity index 95% rename from testing/test-utils/src/main/kotlin/net/corda/testing/contracts/DummyContractV2.kt rename to testing/core-test-utils/src/main/kotlin/net/corda/testing/contracts/DummyContractV2.kt index 331f613f0f..4bd26afe6d 100644 --- a/testing/test-utils/src/main/kotlin/net/corda/testing/contracts/DummyContractV2.kt +++ b/testing/core-test-utils/src/main/kotlin/net/corda/testing/contracts/DummyContractV2.kt @@ -29,10 +29,11 @@ class DummyContractV2 : UpgradedContractWithLegacyConstraint("threadPoolExecutor").value = rigorousMock().also { + InVMConnector::class.staticField("threadPoolExecutor").value = rigorousMock() + .also { doAnswer { inVMExecutors.computeIfAbsent(effectiveSerializationEnv) { Executors.newCachedThreadPool(testThreadFactory(true)) // Close enough to what InVMConnector makes normally. diff --git a/testing/test-utils/src/main/kotlin/net/corda/testing/core/TestConstants.kt b/testing/core-test-utils/src/main/kotlin/net/corda/testing/core/TestConstants.kt similarity index 100% rename from testing/test-utils/src/main/kotlin/net/corda/testing/core/TestConstants.kt rename to testing/core-test-utils/src/main/kotlin/net/corda/testing/core/TestConstants.kt diff --git a/testing/test-utils/src/main/kotlin/net/corda/testing/core/TestUtils.kt b/testing/core-test-utils/src/main/kotlin/net/corda/testing/core/TestUtils.kt similarity index 98% rename from testing/test-utils/src/main/kotlin/net/corda/testing/core/TestUtils.kt rename to testing/core-test-utils/src/main/kotlin/net/corda/testing/core/TestUtils.kt index 54b6e7e605..b26e5cbd3f 100644 --- a/testing/test-utils/src/main/kotlin/net/corda/testing/core/TestUtils.kt +++ b/testing/core-test-utils/src/main/kotlin/net/corda/testing/core/TestUtils.kt @@ -16,8 +16,8 @@ import net.corda.nodeapi.internal.createDevNodeCa import net.corda.nodeapi.internal.crypto.CertificateAndKeyPair import net.corda.nodeapi.internal.crypto.CertificateType import net.corda.nodeapi.internal.crypto.X509Utilities -import net.corda.testing.internal.DEV_INTERMEDIATE_CA -import net.corda.testing.internal.DEV_ROOT_CA +import net.corda.coretesting.internal.DEV_INTERMEDIATE_CA +import net.corda.coretesting.internal.DEV_ROOT_CA import java.math.BigInteger import java.security.KeyPair import java.security.PublicKey diff --git a/testing/test-utils/src/main/kotlin/net/corda/testing/core/internal/CheckpointSerializationTestHelpers.kt b/testing/core-test-utils/src/main/kotlin/net/corda/testing/core/internal/CheckpointSerializationTestHelpers.kt similarity index 89% rename from testing/test-utils/src/main/kotlin/net/corda/testing/core/internal/CheckpointSerializationTestHelpers.kt rename to testing/core-test-utils/src/main/kotlin/net/corda/testing/core/internal/CheckpointSerializationTestHelpers.kt index c1ad09e30e..78157094e8 100644 --- a/testing/test-utils/src/main/kotlin/net/corda/testing/core/internal/CheckpointSerializationTestHelpers.kt +++ b/testing/core-test-utils/src/main/kotlin/net/corda/testing/core/internal/CheckpointSerializationTestHelpers.kt @@ -8,10 +8,10 @@ import net.corda.core.serialization.internal.SerializationEnvironment import net.corda.core.serialization.internal.effectiveSerializationEnv import net.corda.testing.common.internal.asContextEnv import net.corda.testing.core.SerializationEnvironmentRule -import net.corda.testing.internal.createTestSerializationEnv -import net.corda.testing.internal.inVMExecutors -import net.corda.testing.internal.rigorousMock -import net.corda.testing.internal.testThreadFactory +import net.corda.coretesting.internal.createTestSerializationEnv +import net.corda.coretesting.internal.inVMExecutors +import net.corda.coretesting.internal.rigorousMock +import net.corda.coretesting.internal.testThreadFactory import org.apache.activemq.artemis.core.remoting.impl.invm.InVMConnector import org.junit.rules.TestRule import org.junit.runner.Description @@ -28,7 +28,8 @@ class CheckpointSerializationEnvironmentRule(private val inheritable: Boolean = companion object { init { // Can't turn it off, and it creates threads that do serialization, so hack it: - InVMConnector::class.staticField("threadPoolExecutor").value = rigorousMock().also { + InVMConnector::class.staticField("threadPoolExecutor").value = rigorousMock() + .also { doAnswer { inVMExecutors.computeIfAbsent(effectiveSerializationEnv) { Executors.newCachedThreadPool(testThreadFactory(true)) // Close enough to what InVMConnector makes normally. diff --git a/testing/test-utils/src/main/kotlin/net/corda/testing/core/internal/ContractJarTestUtils.kt b/testing/core-test-utils/src/main/kotlin/net/corda/testing/core/internal/ContractJarTestUtils.kt similarity index 100% rename from testing/test-utils/src/main/kotlin/net/corda/testing/core/internal/ContractJarTestUtils.kt rename to testing/core-test-utils/src/main/kotlin/net/corda/testing/core/internal/ContractJarTestUtils.kt diff --git a/testing/test-utils/src/main/kotlin/net/corda/testing/core/internal/JarSignatureTestUtils.kt b/testing/core-test-utils/src/main/kotlin/net/corda/testing/core/internal/JarSignatureTestUtils.kt similarity index 100% rename from testing/test-utils/src/main/kotlin/net/corda/testing/core/internal/JarSignatureTestUtils.kt rename to testing/core-test-utils/src/main/kotlin/net/corda/testing/core/internal/JarSignatureTestUtils.kt diff --git a/testing/test-utils/src/main/resources/mockito-extensions/org.mockito.plugins.MockMaker b/testing/core-test-utils/src/main/resources/mockito-extensions/org.mockito.plugins.MockMaker similarity index 100% rename from testing/test-utils/src/main/resources/mockito-extensions/org.mockito.plugins.MockMaker rename to testing/core-test-utils/src/main/resources/mockito-extensions/org.mockito.plugins.MockMaker diff --git a/testing/test-utils/src/test/kotlin/net/corda/testing/TestIdentityTests.kt b/testing/core-test-utils/src/test/kotlin/net/corda/coretesting/TestIdentityTests.kt similarity index 96% rename from testing/test-utils/src/test/kotlin/net/corda/testing/TestIdentityTests.kt rename to testing/core-test-utils/src/test/kotlin/net/corda/coretesting/TestIdentityTests.kt index 72d71f1adc..d4492119d9 100644 --- a/testing/test-utils/src/test/kotlin/net/corda/testing/TestIdentityTests.kt +++ b/testing/core-test-utils/src/test/kotlin/net/corda/coretesting/TestIdentityTests.kt @@ -1,4 +1,4 @@ -package net.corda.testing +package net.corda.coretesting import net.corda.testing.core.ALICE_NAME import net.corda.testing.core.BOB_NAME diff --git a/testing/test-utils/src/test/kotlin/net/corda/testing/internal/MatcherTests.kt b/testing/core-test-utils/src/test/kotlin/net/corda/coretesting/internal/MatcherTests.kt similarity index 95% rename from testing/test-utils/src/test/kotlin/net/corda/testing/internal/MatcherTests.kt rename to testing/core-test-utils/src/test/kotlin/net/corda/coretesting/internal/MatcherTests.kt index e7ac9a404b..5715276378 100644 --- a/testing/test-utils/src/test/kotlin/net/corda/testing/internal/MatcherTests.kt +++ b/testing/core-test-utils/src/test/kotlin/net/corda/coretesting/internal/MatcherTests.kt @@ -1,8 +1,8 @@ -package net.corda.testing.internal +package net.corda.coretesting.internal import com.natpryce.hamkrest.MatchResult import com.natpryce.hamkrest.equalTo -import net.corda.testing.internal.matchers.hasEntries +import net.corda.coretesting.internal.matchers.hasEntries import org.junit.Test import kotlin.test.assertEquals diff --git a/testing/test-utils/src/test/kotlin/net/corda/testing/internal/RigorousMockTest.kt b/testing/core-test-utils/src/test/kotlin/net/corda/coretesting/internal/RigorousMockTest.kt similarity index 99% rename from testing/test-utils/src/test/kotlin/net/corda/testing/internal/RigorousMockTest.kt rename to testing/core-test-utils/src/test/kotlin/net/corda/coretesting/internal/RigorousMockTest.kt index dc17245347..b2c9128544 100644 --- a/testing/test-utils/src/test/kotlin/net/corda/testing/internal/RigorousMockTest.kt +++ b/testing/core-test-utils/src/test/kotlin/net/corda/coretesting/internal/RigorousMockTest.kt @@ -1,4 +1,4 @@ -package net.corda.testing.internal +package net.corda.coretesting.internal import org.assertj.core.api.Assertions.catchThrowable import org.hamcrest.Matchers.isA diff --git a/testing/node-driver/src/main/kotlin/net/corda/testing/node/MockServices.kt b/testing/node-driver/src/main/kotlin/net/corda/testing/node/MockServices.kt index b46bfaeaae..ab767c3ff2 100644 --- a/testing/node-driver/src/main/kotlin/net/corda/testing/node/MockServices.kt +++ b/testing/node-driver/src/main/kotlin/net/corda/testing/node/MockServices.kt @@ -41,7 +41,7 @@ import net.corda.nodeapi.internal.persistence.DatabaseConfig import net.corda.nodeapi.internal.persistence.contextTransaction import net.corda.testing.common.internal.testNetworkParameters import net.corda.testing.core.TestIdentity -import net.corda.testing.internal.DEV_ROOT_CA +import net.corda.coretesting.internal.DEV_ROOT_CA import net.corda.testing.internal.MockCordappProvider import net.corda.testing.internal.TestingNamedCacheFactory import net.corda.testing.internal.configureDatabase diff --git a/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/DriverDSLImpl.kt b/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/DriverDSLImpl.kt index b7e5c9123f..0cba4f498f 100644 --- a/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/DriverDSLImpl.kt +++ b/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/DriverDSLImpl.kt @@ -73,7 +73,7 @@ import net.corda.testing.driver.* import net.corda.testing.driver.internal.InProcessImpl import net.corda.testing.driver.internal.NodeHandleInternal import net.corda.testing.driver.internal.OutOfProcessImpl -import net.corda.testing.internal.stubs.CertificateStoreStubs +import net.corda.coretesting.internal.stubs.CertificateStoreStubs import net.corda.testing.node.ClusterSpec import net.corda.testing.node.NotarySpec import okhttp3.OkHttpClient diff --git a/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/InternalMockNetwork.kt b/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/InternalMockNetwork.kt index 29425cab4e..1e7e81c2f5 100644 --- a/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/InternalMockNetwork.kt +++ b/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/InternalMockNetwork.kt @@ -51,9 +51,9 @@ import net.corda.nodeapi.internal.network.NetworkParametersCopier import net.corda.nodeapi.internal.persistence.CordaPersistence import net.corda.nodeapi.internal.persistence.DatabaseConfig import net.corda.testing.common.internal.testNetworkParameters -import net.corda.testing.internal.rigorousMock -import net.corda.testing.internal.stubs.CertificateStoreStubs -import net.corda.testing.internal.testThreadFactory +import net.corda.coretesting.internal.rigorousMock +import net.corda.coretesting.internal.stubs.CertificateStoreStubs +import net.corda.coretesting.internal.testThreadFactory import net.corda.testing.node.* import net.corda.testing.node.MockServices.Companion.makeTestDataSourceProperties import org.apache.activemq.artemis.utils.ReusableLatch diff --git a/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/InternalTestUtils.kt b/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/InternalTestUtils.kt index 633aa98b83..0793a740ba 100644 --- a/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/InternalTestUtils.kt +++ b/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/InternalTestUtils.kt @@ -26,8 +26,8 @@ import net.corda.node.services.messaging.Message import net.corda.testing.driver.DriverDSL import net.corda.testing.driver.NodeHandle import net.corda.testing.internal.chooseIdentity -import net.corda.testing.internal.createTestSerializationEnv -import net.corda.testing.internal.inVMExecutors +import net.corda.coretesting.internal.createTestSerializationEnv +import net.corda.coretesting.internal.inVMExecutors import net.corda.testing.node.InMemoryMessagingNetwork import net.corda.testing.node.TestCordapp import net.corda.testing.node.User diff --git a/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/NodeBasedTest.kt b/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/NodeBasedTest.kt index 3c43c99a97..b53a83c97f 100644 --- a/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/NodeBasedTest.kt +++ b/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/NodeBasedTest.kt @@ -22,7 +22,7 @@ import net.corda.nodeapi.internal.network.NetworkParametersCopier import net.corda.testing.common.internal.testNetworkParameters import net.corda.testing.core.SerializationEnvironmentRule import net.corda.testing.driver.internal.incrementalPortAllocation -import net.corda.testing.internal.testThreadFactory +import net.corda.coretesting.internal.testThreadFactory import net.corda.testing.node.User import org.apache.commons.lang3.SystemUtils import org.apache.logging.log4j.Level diff --git a/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/RPCDriver.kt b/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/RPCDriver.kt index d6eb12b0b1..0bb4000529 100644 --- a/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/RPCDriver.kt +++ b/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/RPCDriver.kt @@ -3,7 +3,7 @@ package net.corda.testing.node.internal import net.corda.client.mock.Generator import net.corda.client.rpc.CordaRPCClientConfiguration import net.corda.client.rpc.internal.RPCClient -import net.corda.client.rpc.internal.serialization.amqp.AMQPClientSerializationScheme +import net.corda.nodeapi.internal.rpc.client.AMQPClientSerializationScheme import net.corda.core.concurrent.CordaFuture import net.corda.core.context.AuthServiceId import net.corda.core.context.Trace diff --git a/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/performance/Injectors.kt b/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/performance/Injectors.kt index 4e173b657c..d1656fc86d 100644 --- a/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/performance/Injectors.kt +++ b/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/performance/Injectors.kt @@ -3,7 +3,7 @@ package net.corda.testing.node.internal.performance import com.codahale.metrics.Gauge import com.codahale.metrics.MetricRegistry import com.google.common.base.Stopwatch -import net.corda.testing.internal.performance.Rate +import net.corda.coretesting.internal.performance.Rate import net.corda.testing.node.internal.ShutdownManager import java.time.Duration import java.util.* diff --git a/testing/node-driver/src/test/kotlin/net/corda/testing/node/internal/InternalMockNetworkTests.kt b/testing/node-driver/src/test/kotlin/net/corda/testing/node/internal/InternalMockNetworkTests.kt index 5299204c2a..3a00a7b2c0 100644 --- a/testing/node-driver/src/test/kotlin/net/corda/testing/node/internal/InternalMockNetworkTests.kt +++ b/testing/node-driver/src/test/kotlin/net/corda/testing/node/internal/InternalMockNetworkTests.kt @@ -3,7 +3,7 @@ package net.corda.testing.node.internal import net.corda.core.messaging.AllPossibleRecipients import net.corda.core.serialization.internal.effectiveSerializationEnv import net.corda.node.services.messaging.Message -import net.corda.testing.internal.rigorousMock +import net.corda.coretesting.internal.rigorousMock import org.assertj.core.api.Assertions.assertThatThrownBy import org.junit.After import org.junit.Test diff --git a/testing/smoke-test-utils/src/main/kotlin/net/corda/smoketesting/NodeProcess.kt b/testing/smoke-test-utils/src/main/kotlin/net/corda/smoketesting/NodeProcess.kt index 0d4bc8af8f..d39d6817ea 100644 --- a/testing/smoke-test-utils/src/main/kotlin/net/corda/smoketesting/NodeProcess.kt +++ b/testing/smoke-test-utils/src/main/kotlin/net/corda/smoketesting/NodeProcess.kt @@ -2,7 +2,7 @@ package net.corda.smoketesting import net.corda.client.rpc.CordaRPCClient import net.corda.client.rpc.CordaRPCConnection -import net.corda.client.rpc.internal.serialization.amqp.AMQPClientSerializationScheme +import net.corda.nodeapi.internal.rpc.client.AMQPClientSerializationScheme import net.corda.core.identity.Party import net.corda.core.internal.* import net.corda.core.node.NotaryInfo diff --git a/testing/test-common/build.gradle b/testing/test-common/build.gradle index f522d75d40..3914277b77 100644 --- a/testing/test-common/build.gradle +++ b/testing/test-common/build.gradle @@ -5,8 +5,6 @@ apply plugin: 'com.jfrog.artifactory' dependencies { compile project(':core') compile project(':node-api') - compile project(':tools:cliutils') - compile project(":common-logging") // Unit testing helpers. compile "org.junit.jupiter:junit-jupiter-api:${junit_jupiter_version}" diff --git a/testing/test-utils/build.gradle b/testing/test-utils/build.gradle index 797c607c70..2f07b49d69 100644 --- a/testing/test-utils/build.gradle +++ b/testing/test-utils/build.gradle @@ -9,16 +9,13 @@ description 'Testing utilities for Corda' dependencies { compile project(':test-common') + compile project(':core-test-utils') compile(project(':node')) { // The Node only needs this for binary compatibility with Cordapps written in Kotlin 1.1. exclude group: 'org.jetbrains.kotlin', module: 'kotlin-stdlib-jre8' } compile project(':client:mock') - compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" - compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" - compile "org.jetbrains.kotlin:kotlin-test:$kotlin_version" - compile "com.google.guava:guava:$guava_version" // Guava: Google test library (collections test suite) diff --git a/testing/test-utils/src/main/kotlin/net/corda/testing/internal/InternalTestUtils.kt b/testing/test-utils/src/main/kotlin/net/corda/testing/internal/InternalTestUtils.kt index 8869068400..0d4698b58e 100644 --- a/testing/test-utils/src/main/kotlin/net/corda/testing/internal/InternalTestUtils.kt +++ b/testing/test-utils/src/main/kotlin/net/corda/testing/internal/InternalTestUtils.kt @@ -17,6 +17,8 @@ import net.corda.core.schemas.MappedSchema import net.corda.core.serialization.internal.effectiveSerializationEnv import net.corda.core.transactions.WireTransaction import net.corda.core.utilities.loggerFor +import net.corda.coretesting.internal.asTestContextEnv +import net.corda.coretesting.internal.createTestSerializationEnv import net.corda.node.internal.createCordaPersistence import net.corda.node.internal.security.RPCSecurityManagerImpl import net.corda.node.internal.startHikariPool @@ -38,7 +40,7 @@ import net.corda.serialization.internal.amqp.AMQP_ENABLED import net.corda.testing.core.ALICE_NAME import net.corda.testing.core.SerializationEnvironmentRule import net.corda.testing.core.TestIdentity -import net.corda.testing.internal.stubs.CertificateStoreStubs +import net.corda.coretesting.internal.stubs.CertificateStoreStubs import java.io.ByteArrayOutputStream import java.io.IOException import java.net.ServerSocket diff --git a/tools/checkpoint-agent/build.gradle b/tools/checkpoint-agent/build.gradle index 65e92220f2..33fc683eb6 100644 --- a/tools/checkpoint-agent/build.gradle +++ b/tools/checkpoint-agent/build.gradle @@ -34,7 +34,7 @@ dependencies { compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" compile "javassist:javassist:$javaassist_version" - compile "com.esotericsoftware:kryo:4.0.0" + compile "com.esotericsoftware:kryo:$kryo_version" compile "co.paralleluniverse:quasar-core:$quasar_version" compile (project(':core')) { diff --git a/tools/demobench/src/main/kotlin/net/corda/demobench/DemoBench.kt b/tools/demobench/src/main/kotlin/net/corda/demobench/DemoBench.kt index dfecae05ac..396a105c04 100644 --- a/tools/demobench/src/main/kotlin/net/corda/demobench/DemoBench.kt +++ b/tools/demobench/src/main/kotlin/net/corda/demobench/DemoBench.kt @@ -1,7 +1,7 @@ package net.corda.demobench import javafx.scene.image.Image -import net.corda.client.rpc.internal.serialization.amqp.AMQPClientSerializationScheme +import net.corda.nodeapi.internal.rpc.client.AMQPClientSerializationScheme import net.corda.core.serialization.internal.SerializationEnvironment import net.corda.core.serialization.internal.nodeSerializationEnv import net.corda.demobench.views.DemoBenchView diff --git a/tools/demobench/src/test/kotlin/net/corda/demobench/pty/ZeroFilterTest.kt b/tools/demobench/src/test/kotlin/net/corda/demobench/pty/ZeroFilterTest.kt index 62fb3d3ef6..063efa3a2a 100644 --- a/tools/demobench/src/test/kotlin/net/corda/demobench/pty/ZeroFilterTest.kt +++ b/tools/demobench/src/test/kotlin/net/corda/demobench/pty/ZeroFilterTest.kt @@ -3,7 +3,7 @@ package net.corda.demobench.pty import com.nhaarman.mockito_kotlin.doReturn import com.nhaarman.mockito_kotlin.verify import com.nhaarman.mockito_kotlin.whenever -import net.corda.testing.internal.rigorousMock +import net.corda.coretesting.internal.rigorousMock import org.junit.Assert.assertEquals import org.junit.Before import org.junit.Test diff --git a/tools/network-builder/src/main/kotlin/net/corda/networkbuilder/serialization/SerializationHelper.kt b/tools/network-builder/src/main/kotlin/net/corda/networkbuilder/serialization/SerializationHelper.kt index c019d666b5..301b1cfa68 100644 --- a/tools/network-builder/src/main/kotlin/net/corda/networkbuilder/serialization/SerializationHelper.kt +++ b/tools/network-builder/src/main/kotlin/net/corda/networkbuilder/serialization/SerializationHelper.kt @@ -2,9 +2,9 @@ package net.corda.networkbuilder.serialization import net.corda.core.serialization.internal.SerializationEnvironment import net.corda.core.serialization.internal.nodeSerializationEnv -import net.corda.node.serialization.amqp.AMQPServerSerializationScheme -import net.corda.node.serialization.kryo.KRYO_CHECKPOINT_CONTEXT -import net.corda.node.serialization.kryo.KryoCheckpointSerializer +import net.corda.nodeapi.internal.serialization.amqp.AMQPServerSerializationScheme +import net.corda.nodeapi.internal.serialization.kryo.KRYO_CHECKPOINT_CONTEXT +import net.corda.nodeapi.internal.serialization.kryo.KryoCheckpointSerializer import net.corda.serialization.internal.AMQP_P2P_CONTEXT import net.corda.serialization.internal.AMQP_STORAGE_CONTEXT import net.corda.serialization.internal.SerializationFactoryImpl diff --git a/tools/shell/src/test/java/net/corda/tools/shell/InteractiveShellJavaTest.java b/tools/shell/src/test/java/net/corda/tools/shell/InteractiveShellJavaTest.java index 5d7cabe089..7304eaac6b 100644 --- a/tools/shell/src/test/java/net/corda/tools/shell/InteractiveShellJavaTest.java +++ b/tools/shell/src/test/java/net/corda/tools/shell/InteractiveShellJavaTest.java @@ -19,9 +19,9 @@ import net.corda.core.internal.concurrent.CordaFutureImplKt; import net.corda.core.internal.concurrent.OpenFuture; import net.corda.core.messaging.FlowProgressHandleImpl; import net.corda.core.utilities.ProgressTracker; +import net.corda.coretesting.internal.InternalTestConstantsKt; import net.corda.node.services.identity.InMemoryIdentityService; import net.corda.testing.core.TestIdentity; -import net.corda.testing.internal.InternalTestConstantsKt; import org.jetbrains.annotations.Nullable; import org.junit.Test; import rx.Observable; diff --git a/tools/shell/src/test/kotlin/net/corda/tools/shell/InteractiveShellTest.kt b/tools/shell/src/test/kotlin/net/corda/tools/shell/InteractiveShellTest.kt index 4d4a49c169..279c0c7df4 100644 --- a/tools/shell/src/test/kotlin/net/corda/tools/shell/InteractiveShellTest.kt +++ b/tools/shell/src/test/kotlin/net/corda/tools/shell/InteractiveShellTest.kt @@ -23,12 +23,12 @@ import net.corda.core.messaging.FlowProgressHandleImpl import net.corda.core.node.NodeInfo import net.corda.core.utilities.NetworkHostAndPort import net.corda.core.utilities.ProgressTracker +import net.corda.coretesting.internal.DEV_ROOT_CA import net.corda.node.services.identity.InMemoryIdentityService import net.corda.testing.core.ALICE_NAME import net.corda.testing.core.BOB_NAME import net.corda.testing.core.TestIdentity import net.corda.testing.core.getTestPartyAndCertificate -import net.corda.testing.internal.DEV_ROOT_CA import org.crsh.command.InvocationContext import org.crsh.text.Color import org.crsh.text.Decoration