-
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.
- Loading branch information
1 parent
95940e1
commit 6afee03
Showing
12 changed files
with
495 additions
and
21 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ build/ | |
*.podspec | ||
node_modules | ||
js-chat/dist | ||
test.properties | ||
|
||
### IntelliJ IDEA ### | ||
.idea/modules.xml | ||
|
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
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
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,63 @@ | ||
public abstract class com/pubnub/test/BaseIntegrationTest { | ||
public field config Lcom/pubnub/api/v2/PNConfiguration; | ||
public field config02 Lcom/pubnub/api/v2/PNConfiguration; | ||
public field configPamClient Lcom/pubnub/api/v2/PNConfiguration; | ||
public field configPamServer Lcom/pubnub/api/v2/PNConfiguration; | ||
public field pubnub Lcom/pubnub/api/PubNub; | ||
public field pubnub02 Lcom/pubnub/api/PubNub; | ||
public field pubnubPamClient Lcom/pubnub/api/PubNub; | ||
public field pubnubPamServer Lcom/pubnub/api/PubNub; | ||
public fun <init> ()V | ||
public fun after ()V | ||
public fun before ()V | ||
public final fun getConfig ()Lcom/pubnub/api/v2/PNConfiguration; | ||
public final fun getConfig02 ()Lcom/pubnub/api/v2/PNConfiguration; | ||
public final fun getConfigPamClient ()Lcom/pubnub/api/v2/PNConfiguration; | ||
public final fun getConfigPamServer ()Lcom/pubnub/api/v2/PNConfiguration; | ||
public final fun getPubnub ()Lcom/pubnub/api/PubNub; | ||
public final fun getPubnub02 ()Lcom/pubnub/api/PubNub; | ||
public final fun getPubnubPamClient ()Lcom/pubnub/api/PubNub; | ||
public final fun getPubnubPamServer ()Lcom/pubnub/api/PubNub; | ||
public final fun setConfig (Lcom/pubnub/api/v2/PNConfiguration;)V | ||
public final fun setConfig02 (Lcom/pubnub/api/v2/PNConfiguration;)V | ||
public final fun setConfigPamClient (Lcom/pubnub/api/v2/PNConfiguration;)V | ||
public final fun setConfigPamServer (Lcom/pubnub/api/v2/PNConfiguration;)V | ||
public final fun setPubnub (Lcom/pubnub/api/PubNub;)V | ||
public final fun setPubnub02 (Lcom/pubnub/api/PubNub;)V | ||
public final fun setPubnubPamClient (Lcom/pubnub/api/PubNub;)V | ||
public final fun setPubnubPamServer (Lcom/pubnub/api/PubNub;)V | ||
} | ||
|
||
public final class com/pubnub/test/BaseIntegrationTestKt { | ||
public static final fun await (Lcom/pubnub/kmp/PNFuture;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; | ||
public static final fun randomString ()Ljava/lang/String; | ||
public static final fun test (Lcom/pubnub/api/PubNub;Lkotlinx/coroutines/CoroutineScope;ZZLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; | ||
public static synthetic fun test$default (Lcom/pubnub/api/PubNub;Lkotlinx/coroutines/CoroutineScope;ZZLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; | ||
} | ||
|
||
public final class com/pubnub/test/Keys { | ||
public static final field INSTANCE Lcom/pubnub/test/Keys; | ||
public final fun getPamPubKey ()Ljava/lang/String; | ||
public final fun getPamSecKey ()Ljava/lang/String; | ||
public final fun getPamSubKey ()Ljava/lang/String; | ||
public final fun getPubKey ()Ljava/lang/String; | ||
public final fun getSubKey ()Ljava/lang/String; | ||
} | ||
|
||
public final class com/pubnub/test/PubNubTest { | ||
public fun <init> (Lcom/pubnub/api/PubNub;ZLkotlinx/coroutines/CoroutineScope;Z)V | ||
public synthetic fun <init> (Lcom/pubnub/api/PubNub;ZLkotlinx/coroutines/CoroutineScope;ZILkotlin/jvm/internal/DefaultConstructorMarker;)V | ||
public final fun awaitSubscribe (Lcom/pubnub/api/PubNub;Ljava/util/Collection;Ljava/util/Collection;ZLkotlin/jvm/functions/Function0;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; | ||
public final fun awaitSubscribe (Lcom/pubnub/api/v2/entities/Channel;Lcom/pubnub/api/v2/subscriptions/SubscriptionOptions;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; | ||
public static synthetic fun awaitSubscribe$default (Lcom/pubnub/test/PubNubTest;Lcom/pubnub/api/PubNub;Ljava/util/Collection;Ljava/util/Collection;ZLkotlin/jvm/functions/Function0;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; | ||
public static synthetic fun awaitSubscribe$default (Lcom/pubnub/test/PubNubTest;Lcom/pubnub/api/v2/entities/Channel;Lcom/pubnub/api/v2/subscriptions/SubscriptionOptions;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; | ||
public final fun awaitUnsubscribe (Lcom/pubnub/api/PubNub;Ljava/util/Collection;Ljava/util/Collection;Lkotlin/jvm/functions/Function0;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; | ||
public static synthetic fun awaitUnsubscribe$default (Lcom/pubnub/test/PubNubTest;Lcom/pubnub/api/PubNub;Ljava/util/Collection;Ljava/util/Collection;Lkotlin/jvm/functions/Function0;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; | ||
public final fun close ()V | ||
public final fun nextEvent (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; | ||
public final fun nextMessage (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; | ||
public final fun nextStatus (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; | ||
public final fun skip (ILkotlin/coroutines/Continuation;)Ljava/lang/Object; | ||
public static synthetic fun skip$default (Lcom/pubnub/test/PubNubTest;ILkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; | ||
} | ||
|
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,69 @@ | ||
|
||
import com.codingfeline.buildkonfig.compiler.FieldSpec.Type | ||
import java.util.Properties | ||
|
||
plugins { | ||
alias(libs.plugins.benmanes.versions) | ||
id("pubnub.shared") | ||
id("pubnub.ios-simulator-test") | ||
id("pubnub.base.multiplatform") | ||
alias(libs.plugins.codingfeline.buildkonfig) | ||
} | ||
|
||
kotlin { | ||
sourceSets { | ||
val commonMain by getting { | ||
dependencies { | ||
api(project(":pubnub-chat-api")) | ||
api(kotlin("test")) | ||
api(libs.coroutines.test) | ||
} | ||
} | ||
|
||
val jvmMain by getting { | ||
dependencies { | ||
api(kotlin("test-junit")) | ||
} | ||
} | ||
} | ||
|
||
ktlint { | ||
filter { | ||
exclude { it: FileTreeElement -> it.file.absolutePath.also { println(it) }.contains("/build/") } | ||
} | ||
} | ||
|
||
buildkonfig { | ||
packageName = "com.pubnub.test" | ||
exposeObjectWithName = "Keys" | ||
|
||
defaultConfigs { | ||
val testProps = Properties() | ||
try { | ||
val bytes = providers.fileContents(rootProject.layout.projectDirectory.file("test.properties")).asBytes.get() | ||
testProps.load(bytes.inputStream()) | ||
} catch (e: Exception) { | ||
println("No test.properties found in root project. Trying to get keys from env") | ||
try { | ||
testProps.setProperty("pubKey", providers.environmentVariable("SDK_PUB_KEY").get()) | ||
testProps.setProperty("subKey", providers.environmentVariable("SDK_SUB_KEY").get()) | ||
testProps.setProperty("pamPubKey", providers.environmentVariable("SDK_PAM_PUB_KEY").get()) | ||
testProps.setProperty("pamSubKey", providers.environmentVariable("SDK_PAM_SUB_KEY").get()) | ||
testProps.setProperty("pamSecKey", providers.environmentVariable("SDK_PAM_SEC_KEY").get()) | ||
} catch (e: IllegalStateException) { | ||
println("No env variables found. Setting all keys to demo") | ||
testProps.setProperty("pubKey", "demo") | ||
testProps.setProperty("subKey", "demo") | ||
testProps.setProperty("pamPubKey", "demo") | ||
testProps.setProperty("pamSubKey", "demo") | ||
testProps.setProperty("pamSecKey", "demo") | ||
} | ||
} | ||
buildConfigField(Type.STRING, "pubKey", testProps.getProperty("pubKey")) | ||
buildConfigField(Type.STRING, "subKey", testProps.getProperty("subKey")) | ||
buildConfigField(Type.STRING, "pamPubKey", testProps.getProperty("pamPubKey")) | ||
buildConfigField(Type.STRING, "pamSubKey", testProps.getProperty("pamSubKey")) | ||
buildConfigField(Type.STRING, "pamSecKey", testProps.getProperty("pamSecKey")) | ||
} | ||
} | ||
} |
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,3 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<baseline version="1.0"> | ||
</baseline> |
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 @@ | ||
package testlauncher | ||
|
||
import platform.CoreFoundation.CFRunLoopRun | ||
import kotlin.experimental.ExperimentalNativeApi | ||
import kotlin.native.concurrent.TransferMode | ||
import kotlin.native.concurrent.Worker | ||
import kotlin.native.concurrent.freeze | ||
import kotlin.native.internal.test.testLauncherEntryPoint | ||
import kotlin.system.exitProcess | ||
|
||
@OptIn(ExperimentalNativeApi::class) | ||
fun mainBackground(args: Array<String>) { | ||
val worker = Worker.start(name = "main-background") | ||
worker.execute(TransferMode.SAFE, { args.freeze() }) { | ||
val result = testLauncherEntryPoint(it) | ||
exitProcess(result) | ||
} | ||
CFRunLoopRun() | ||
error("CFRunLoopRun should never return") | ||
} |
Oops, something went wrong.