Skip to content

Commit 524f228

Browse files
committed
build: update native test binaries
1 parent ecdfe43 commit 524f228

File tree

16 files changed

+416
-0
lines changed

16 files changed

+416
-0
lines changed
-34 Bytes
Binary file not shown.
896 Bytes
Binary file not shown.
Binary file not shown.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
//
2+
// ATLBlockingQueue.h
3+
// AdjustTestLibrary
4+
//
5+
// Created by Pedro on 11.01.18.
6+
// Copyright © 2018 adjust. All rights reserved.
7+
//
8+
9+
#import <Foundation/Foundation.h>
10+
#import "ATLUtil.h"
11+
12+
@interface ATLBlockingQueue : NSObject
13+
14+
/**
15+
* Enqueues an object to the queue.
16+
* @param object Object to enqueue
17+
*/
18+
- (void)enqueue:(id)object;
19+
20+
/**
21+
* Dequeues an object from the queue. This method will block.
22+
*/
23+
- (id)dequeue;
24+
25+
- (void)teardown;
26+
27+
@end
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
//
2+
// ATLConstants.h
3+
// AdjustTestLibrary
4+
//
5+
// Created by Pedro on 20.04.17.
6+
// Copyright © 2017 adjust. All rights reserved.
7+
//
8+
9+
#ifndef ATLConstants_h
10+
#define ATLConstants_h
11+
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";
29+
30+
#endif /* ATLConstants_h */
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
//
2+
// ATLControlWebSocketClient.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+
#import "PocketSocket/PSWebSocket.h"
11+
#import "ATLTestLibrary.h"
12+
13+
NS_ASSUME_NONNULL_BEGIN
14+
15+
@interface ATLControlWebSocketClient : NSObject <PSWebSocketDelegate>
16+
17+
- (void)initializeWebSocketWithControlUrl:(NSString*)controlUrl
18+
andTestLibrary:(ATLTestLibrary*)testLibrary;
19+
20+
- (void)reconnectIfNeeded;
21+
22+
- (void)sendInitTestSessionSignal:(NSString*)testSessionId;
23+
24+
@end
25+
26+
NS_ASSUME_NONNULL_END
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
//
2+
// ATLNetworking.h
3+
// AdjustTestLibrary
4+
//
5+
// Created by Pedro Silva on 24.05.24.
6+
// Copyright © 2024 adjust. All rights reserved.
7+
//
8+
9+
#import <Foundation/Foundation.h>
10+
11+
@interface ATLHttpResponse : NSObject
12+
13+
@property (nonatomic, nullable, strong) NSString * responseString;
14+
@property (nonatomic, nullable, strong) id jsonFoundation;
15+
@property (nonatomic, nullable, strong) NSDictionary *headerFields;
16+
@property (nonatomic, assign) NSInteger statusCode;
17+
18+
@end
19+
20+
@interface ATLHttpRequest : NSObject
21+
22+
@property (nonatomic, nonnull, readonly, strong) NSString *path;
23+
@property (nonatomic, nullable, readonly, strong) NSString *base;
24+
@property (nonatomic, nullable, strong) NSString *bodyString;
25+
@property (nonatomic, nullable, strong) NSDictionary *headerFields;
26+
27+
- (nonnull id)initWithPath:(nonnull NSString *)path
28+
base:(nullable NSString *)base;
29+
@end
30+
31+
typedef void (^httpResponseHandler)(ATLHttpResponse *_Nonnull httpResponse);
32+
33+
@interface ATLNetworking : NSObject
34+
35+
- (void)sendPostRequestWithData:(nonnull ATLHttpRequest *)requestData
36+
baseUrl:(nonnull NSURL *)baseUrl
37+
responseHandler:(nonnull httpResponseHandler)responseHandler;
38+
39+
@end
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
//
2+
// AdjustTestLibrary.h
3+
// AdjustTestLibrary
4+
//
5+
// Created by Pedro on 18.04.17.
6+
// Copyright © 2017 adjust. All rights reserved.
7+
//
8+
9+
#import <Foundation/Foundation.h>
10+
#import "ATLNetworking.h"
11+
#import "ATLBlockingQueue.h"
12+
13+
@protocol AdjustCommandDelegate <NSObject>
14+
@optional
15+
- (void)executeCommand:(NSString *)className
16+
methodName:(NSString *)methodName
17+
parameters:(NSDictionary *)parameters;
18+
19+
- (void)executeCommand:(NSString *)className
20+
methodName:(NSString *)methodName
21+
jsonParameters:(NSString *)jsonParameters;
22+
23+
- (void)executeCommandRawJson:(NSString *)json;
24+
@end
25+
26+
@interface ATLTestLibrary : NSObject
27+
28+
- (NSString *)currentBasePath;
29+
30+
- (ATLBlockingQueue *)waitControlQueue;
31+
32+
- (void)addTest:(NSString *)testName;
33+
34+
- (void)addTestDirectory:(NSString *)testDirectory;
35+
36+
- (void)startTestSession:(NSString *)clientSdk;
37+
38+
- (void)resetTestLibrary;
39+
40+
- (void)readResponse:(ATLHttpResponse *)httpResponse;
41+
42+
- (void)addInfoToSend:(NSString *)key
43+
value:(NSString *)value;
44+
45+
- (void)sendInfoToServer:(NSString *)basePath;
46+
47+
- (void)signalEndWaitWithReason:(NSString *)reason;
48+
49+
- (void)cancelTestAndGetNext;
50+
51+
- (void)doNotExitAfterEnd;
52+
53+
+ (ATLTestLibrary *)testLibraryWithBaseUrl:(NSString *)baseUrl
54+
andControlUrl:(NSString *)controlUrl
55+
andCommandDelegate:(NSObject<AdjustCommandDelegate> *)commandDelegate;
56+
@end
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
//
2+
// ATLUtil.h
3+
// AdjustTestLibrary
4+
//
5+
// Created by Pedro on 18.04.17.
6+
// Copyright © 2017 adjust. All rights reserved.
7+
//
8+
9+
#import <Foundation/Foundation.h>
10+
11+
typedef void (^selfInjectedBlock)(id);
12+
typedef void (^operationBlock)(NSBlockOperation *);
13+
14+
@interface ATLUtil : NSObject
15+
16+
+ (void)debug:(NSString *)format, ...;
17+
+ (void)launchInQueue:(dispatch_queue_t)queue
18+
selfInject:(id)selfInject
19+
block:(selfInjectedBlock)block;
20+
+ (void)addOperationAfterLast:(NSOperationQueue *)operationQueue
21+
block:(dispatch_block_t)block;
22+
+ (void)addOperationAfterLast:(NSOperationQueue *)operationQueue
23+
blockWithOperation:(operationBlock)blockWithOperation;
24+
+ (BOOL)isNull:(id)value;
25+
+ (NSString *)adjTrim:(NSString *)value;
26+
+ (NSString *)formatDate:(NSDate *)value;
27+
+ (NSString *)parseDictionaryToJsonString:(NSDictionary *) dictionary;
28+
+ (NSString *)appendBasePath:(NSString *)basePath path:(NSString *)path;
29+
+ (NSString *)queryString:(NSDictionary *)parameters;
30+
@end
Binary file not shown.

0 commit comments

Comments
 (0)