Skip to content

Commit 724c8fe

Browse files
authored
Merge pull request #147 from adjust/readme-update
README update
2 parents b5733fb + adf39d8 commit 724c8fe

24 files changed

+203
-176
lines changed
Binary file not shown.

Assets/Adjust/Android/Test/Java-WebSocket-1.3.9.jar.meta

+31
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
2.91 KB
Binary file not shown.

Assets/Adjust/Test/TestApp.cs

+10-10
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,21 @@ public class TestApp : MonoBehaviour
1212
#if (UNITY_WSA || UNITY_WP8)
1313
private const string PORT = ":8080";
1414
private const string PROTOCOL = "http://";
15-
private const string BASE_URL = PROTOCOL + "localhost" + PORT;
16-
private const string GDPR_URL = PROTOCOL + "localhost" + PORT;
15+
private const string IP = "localhost";
1716
#elif UNITY_ANDROID
1817
private const string PORT = ":8443";
1918
private const string PROTOCOL = "https://";
20-
private const string BASE_URL = PROTOCOL + "192.168.8.197" + PORT;
21-
private const string GDPR_URL = PROTOCOL + "192.168.8.197" + PORT;
19+
private const string IP = "192.168.8.98";
2220
#elif UNITY_IOS
2321
private const string PORT = ":8080";
2422
private const string PROTOCOL = "http://";
25-
private const string BASE_URL = PROTOCOL + "192.168.8.197" + PORT;
26-
private const string GDPR_URL = PROTOCOL + "192.168.8.197" + PORT;
23+
private const string IP = "192.168.8.98";
2724
private TestLibraryiOS _testLibraryiOS;
2825
#endif
29-
26+
private const string BASE_URL = PROTOCOL + IP + PORT;
27+
private const string GDPR_URL = PROTOCOL + IP + PORT;
28+
private const string CONTROL_URL = "ws://" + IP + ":1987";
29+
3030
void OnGUI()
3131
{
3232
if (GUI.Button(new Rect(0, Screen.height * 0 / 2, Screen.width, Screen.height / 2), "Start test"))
@@ -53,11 +53,11 @@ private void StartTestSession()
5353
private ITestLibrary GetPlatformSpecificTestLibrary()
5454
{
5555
#if UNITY_IOS
56-
return new TestLibraryiOS(BASE_URL, GDPR_URL);
56+
return new TestLibraryiOS(BASE_URL, CONTROL_URL, GDPR_URL);
5757
#elif UNITY_ANDROID
58-
return new TestLibraryAndroid(BASE_URL, GDPR_URL);
58+
return new TestLibraryAndroid(BASE_URL, CONTROL_URL, GDPR_URL);
5959
#elif (UNITY_WSA || UNITY_WP8)
60-
return new TestLibraryWindows(BASE_URL, GDPR_URL);
60+
return new TestLibraryWindows(BASE_URL, CONTROL_URL, GDPR_URL);
6161
#else
6262
Debug.Log("Cannot run integration tests (Error in TestApp.GetPlatformSpecificTestLibrary(...)). None of the supported platforms selected.");
6363
return null;

Assets/Adjust/Test/TestLibraryAndroid.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@ public class TestLibraryAndroid : ITestLibrary
77
private AndroidJavaObject ajoTestLibrary;
88
private CommandListenerAndroid onCommandReceivedListener;
99

10-
public TestLibraryAndroid(string baseUrl, string gdprUrl)
10+
public TestLibraryAndroid(string baseUrl, string controlUrl, string gdprUrl)
1111
{
1212
CommandExecutor commandExecutor = new CommandExecutor(this, baseUrl, gdprUrl);
1313
onCommandReceivedListener = new CommandListenerAndroid(commandExecutor);
1414
ajoTestLibrary = new AndroidJavaObject(
1515
"com.adjust.test.TestLibrary",
1616
baseUrl,
17+
controlUrl,
1718
onCommandReceivedListener);
1819
}
1920

Assets/Adjust/Test/TestLibraryBridgeiOS.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace com.adjust.sdk.test
77
public static class TestLibraryBridgeiOS
88
{
99
[DllImport("__Internal")]
10-
private static extern void _ATLInitialize(string baseUrl);
10+
private static extern void _ATLInitialize(string baseUrl, string controlUrl);
1111

1212
[DllImport("__Internal")]
1313
private static extern void _ATLStartTestSession(string clientSdk);
@@ -24,9 +24,9 @@ public static class TestLibraryBridgeiOS
2424
[DllImport("__Internal")]
2525
private static extern void _ATLAddTestDirectory(string testDirectory);
2626

27-
public static void Initialize(string baseUrl)
27+
public static void Initialize(string baseUrl, string controlUrl)
2828
{
29-
_ATLInitialize(baseUrl);
29+
_ATLInitialize(baseUrl, controlUrl);
3030
}
3131

3232
public static void StartTestSession(string clientSdk)

Assets/Adjust/Test/TestLibraryWindows.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ public class TestLibraryWindows : ITestLibrary
1111
private readonly TestLibraryInterface.TestLibraryInterface _testLibraryInterface
1212
= new TestLibraryInterface.TestLibraryInterface();
1313

14-
public TestLibraryWindows(string baseUrl, string gdprUrl)
14+
public TestLibraryWindows(string baseUrl, string controlUrl, string gdprUrl)
1515
{
1616
IAdjustCommandExecutor adjustCommandExecutor = new CommandExecutor(this, baseUrl, gdprUrl);
17-
_testLibraryInterface.Init(adjustCommandExecutor, baseUrl, UnityEngine.Debug.Log);
17+
_testLibraryInterface.Init(adjustCommandExecutor, baseUrl, controlUrl, UnityEngine.Debug.Log);
1818
}
1919

2020
public void StartTestSession()

Assets/Adjust/Test/TestLibraryiOS.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ public class TestLibraryiOS : ITestLibrary
88
#if UNITY_IOS
99
private CommandExecutor _commandExecutor;
1010

11-
public TestLibraryiOS(string baseUrl, string gdprUrl)
11+
public TestLibraryiOS(string baseUrl, string controlUrl, string gdprUrl)
1212
{
1313
_commandExecutor = new CommandExecutor(this, baseUrl, gdprUrl);
14-
TestLibraryBridgeiOS.Initialize(baseUrl);
14+
TestLibraryBridgeiOS.Initialize(baseUrl, controlUrl);
1515
}
1616

1717
public void StartTestSession()
Binary file not shown.
3 KB
Binary file not shown.
Binary file not shown.

Assets/Adjust/iOS/Test/ATLConstants.h

+17-10
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,22 @@
99
#ifndef ATLConstants_h
1010
#define ATLConstants_h
1111

12-
static NSString * const TEST_SCRIPT_HEADER = @"TestScript";
13-
static NSString * const TEST_SESSION_END_HEADER = @"TestSessionEnd";
14-
static NSString * const TEST_CANCELTEST_HEADER = @"CancelTest";
15-
static NSString * const TEST_ENDWAIT_HEADER = @"EndWait";
16-
static NSString * const TEST_LIBRARY_CLASSNAME = @"TestLibrary";
17-
static NSString * const ADJUST_CLASSNAME = @"Adjust";
18-
static NSString * const WAIT_FOR_CONTROL = @"control";
19-
static NSString * const WAIT_FOR_SLEEP = @"sleep";
20-
static NSString * const BASE_PATH_PARAM = @"basePath";
21-
static NSString * const TEST_NAME_PARAM = @"basePath";
12+
static int const ONE_SECOND = 1000;
13+
static int const ONE_MINUTE = 60 * ONE_SECOND;
14+
15+
static NSString * const TEST_LIBRARY_CLASSNAME = @"TestLibrary";
16+
static NSString * const ADJUST_CLASSNAME = @"Adjust";
17+
static NSString * const WAIT_FOR_CONTROL = @"control";
18+
static NSString * const WAIT_FOR_SLEEP = @"sleep";
19+
static NSString * const BASE_PATH_PARAM = @"basePath";
20+
static NSString * const TEST_NAME_PARAM = @"basePath";
21+
static NSString * const TEST_SESSION_ID_HEADER = @"Test-Session-Id";
22+
23+
// web socket values
24+
static NSString * const SIGNAL_INFO = @"info";
25+
static NSString * const SIGNAL_INIT_TEST_SESSION = @"init-test-session";
26+
static NSString * const SIGNAL_END_WAIT = @"end-wait";
27+
static NSString * const SIGNAL_CANCEL_CURRENT_TEST = @"cancel-current-test";
28+
static NSString * const SIGNAL_UNKNOWN = @"unknown";
2229

2330
#endif /* ATLConstants_h */

Assets/Adjust/iOS/Test/ATLControlChannel.h

-18
This file was deleted.

Assets/Adjust/iOS/Test/ATLControlChannel.h.meta

-121
This file was deleted.
+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
//
2+
// ATLControlSignal.h
3+
// AdjustTestLibrary
4+
//
5+
// Created by Serj on 20.02.19.
6+
// Copyright © 2019 adjust. All rights reserved.
7+
//
8+
9+
#import <Foundation/Foundation.h>
10+
11+
NS_ASSUME_NONNULL_BEGIN
12+
13+
typedef enum {
14+
ATLSignalTypeInfo = 1,
15+
ATLSignalTypeInitTestSession = 2,
16+
ATLSignalTypeEndWait = 3,
17+
ATLSignalTypeCancelCurrentTest = 4,
18+
ATLSignalTypeUnknown = 5
19+
} ATLSignalType;
20+
21+
@interface ATLControlSignal : NSObject
22+
23+
- (id)initWithSignalType:(ATLSignalType)signalType;
24+
25+
- (id)initWithSignalType:(ATLSignalType)signalType
26+
andSignalValue:(NSString*)signalValue;
27+
28+
- (id)initWithJson:(NSString*)json;
29+
30+
- (NSString*)toJson;
31+
32+
- (NSString*)getValue;
33+
34+
- (ATLSignalType)getType;
35+
36+
@end
37+
38+
NS_ASSUME_NONNULL_END

Assets/Adjust/iOS/Test/ATLControlSignal.h.meta

+26
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)