Skip to content

Commit

Permalink
CORDA-1011 Add powershell script to update testing package imports (c…
Browse files Browse the repository at this point in the history
…orda#2528)

* Add powershell script to update testing package imports

* Make sure script works with java files

* Address review comments
  • Loading branch information
anthonykeenan authored Feb 16, 2018
1 parent ed0cf91 commit c248585
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/source/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,9 @@ UNRELEASED

* The test utils in ``Expect.kt``, ``SerializationTestHelpers.kt``, ``TestConstants.kt`` and ``TestUtils.kt`` have moved
from the ``net.corda.testing`` package to the ``net.corda.testing.core`` package, and ``FlowStackSnapshot.kt`` has moved to the
``net.corda.testing.services`` package. Moving items out of the ``net.corda.testing.*`` package will help make it clearer which
parts of the api are stable. The bash script ``tools\scripts\update-test-packages.sh`` can be used to smooth the upgrade
process for existing projects.
``net.corda.testing.services`` package. Moving existing classes out of the ``net.corda.testing.*`` package
will help make it clearer which parts of the api are stable. Scripts have been provided to smooth the upgrade
process for existing projects in the ``tools\scripts`` directory of the Corda repo.

.. _changelog_v1:

Expand Down
4 changes: 4 additions & 0 deletions tools/scripts/upgrade-test-packages.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Get-ChildItem $args[0] -Include *.kt, *.java -Recurse |
Foreach-Object {
(Get-Content $_.FullName) -replace 'net.corda.testing.(\*|generateStateRef|freeLocalHostAndPort|getFreeLocalPorts|getTestPartyAndCertificate|TestIdentity|chooseIdentity|singleIdentity|TEST_TX_TIME|DUMMY_NOTARY_NAME|DUMMY_BANK_A_NAME|DUMMY_BANK_B_NAME|DUMMY_BANK_C_NAME|BOC_NAME|ALICE_NAME|BOB_NAME|CHARLIE_NAME|DEV_INTERMEDIATE_CA|DEV_ROOT_CA|dummyCommand|DummyCommandData|MAX_MESSAGE_SIZE|SerializationEnvironmentRule|setGlobalSerialization|expect|sequence|parallel|replicate|genericExpectEvents)', 'net.corda.testing.core.$1' -replace 'net.corda.testing.FlowStackSnapshotFactoryImpl', 'net.corda.testing.services.FlowStackSnapshotFactoryImpl' -join "`r`n" | Set-Content -NoNewline -Force $_.FullName
}

0 comments on commit c248585

Please sign in to comment.