forked from TBD54566975/tbdex-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue TBD54566975#94: Add an acceptance test for Kotlin
- Loading branch information
1 parent
ad73d03
commit 80cb5d5
Showing
3 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# tbDEX Kotlin Acceptance Test | ||
|
||
This is a simple Java main class which acts as an acceptance smoke test | ||
for the tbDEX Kotlin binary distribution. The Kotlin unit tests execute in | ||
Maven using the `classpath` as set by the Maven build process (ie. | ||
`target/classes`). This test intentionally lives outside of the Kotlin tbDEX | ||
project to test that it may be consumed as built (ie. the distributable JAR) | ||
and contains the native libraries necessary to run. | ||
|
||
This acceptance test is run by the CI jobs after building the Kotlin | ||
distribution to ensure it may be run in all supported environments. | ||
|
||
## Building | ||
|
||
From this folder, run: | ||
|
||
```shell | ||
javac TbdexAcceptanceTest.java \ | ||
-cp ../../bound/kt/target/tbdex-0.0.0-main-SNAPSHOT-jar-with-dependencies.jar | ||
``` | ||
|
||
You may need to replace the filename of this JAR with the version as built from | ||
Maven (note that this includes the version). | ||
|
||
## Running | ||
|
||
From this folder, run: | ||
|
||
```shell | ||
java -classpath \ | ||
../../bound/kt/target/tbdex-0.0.0-main-SNAPSHOT-jar-with-dependencies.jar:. \ | ||
TbdexAcceptanceTest | ||
``` | ||
|
||
You may need to replace the filename of this JAR with the version as built from | ||
Maven (note that this includes the version). | ||
|
||
You should see output similar to: | ||
|
||
```shell | ||
Successfully loaded shared library for tbdex_uniffi_aarch64_apple_darwin | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import tbdex.sdk.rust.SystemArchitecture; | ||
import tbdex.sdk.rust.UniffiLib; | ||
|
||
/** | ||
* A simple main class to act as an acceptance smoke test for the Kotlin | ||
* tbDEX binary. | ||
* | ||
* See README.md in this folder for usage and purpose. | ||
*/ | ||
public class TbdexAcceptanceTest { | ||
|
||
public static void main(String... args) { | ||
System.setProperty("TBDEX_SDK_LOG_LEVEL", "debug"); | ||
SystemArchitecture.INSTANCE.set(); | ||
UniffiLib.Companion.getINSTANCE$tbdex(); | ||
System.out.println( | ||
"Successfully loaded shared library for " + | ||
System.getProperty("uniffi.component.tbdex.libraryOverride")); | ||
} | ||
} |