From f5af8ca5372c0fe499fa99c6514895db59cf4f0c Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Fri, 11 Aug 2023 15:44:30 +0200 Subject: [PATCH 001/110] Add schema and empty package --- packages/patrol_gen/bin/main.dart | 12 ++ packages/patrol_gen/lib/src/patrol_gen.dart | 5 + packages/patrol_gen/pubspec.lock | 173 ++++++++++++++++++++ packages/patrol_gen/pubspec.yaml | 18 ++ schema.dart | 33 ++++ 5 files changed, 241 insertions(+) create mode 100644 packages/patrol_gen/bin/main.dart create mode 100644 packages/patrol_gen/lib/src/patrol_gen.dart create mode 100644 packages/patrol_gen/pubspec.lock create mode 100644 packages/patrol_gen/pubspec.yaml create mode 100644 schema.dart diff --git a/packages/patrol_gen/bin/main.dart b/packages/patrol_gen/bin/main.dart new file mode 100644 index 000000000..55111c6ea --- /dev/null +++ b/packages/patrol_gen/bin/main.dart @@ -0,0 +1,12 @@ +import 'package:patrol_gen/src/patrol_gen.dart'; + +void main(List args) { + if (args.length == 1) { + PatrolGen().run(args[0]); + } else { + print(''' +You should only pass one argument (path to schema). Example: +dart run bin/main.dart ../schema.dart +'''); + } +} diff --git a/packages/patrol_gen/lib/src/patrol_gen.dart b/packages/patrol_gen/lib/src/patrol_gen.dart new file mode 100644 index 000000000..2203d79f2 --- /dev/null +++ b/packages/patrol_gen/lib/src/patrol_gen.dart @@ -0,0 +1,5 @@ +class PatrolGen { + void run(String schemaPath) { + print(schemaPath); + } +} diff --git a/packages/patrol_gen/pubspec.lock b/packages/patrol_gen/pubspec.lock new file mode 100644 index 000000000..23c512310 --- /dev/null +++ b/packages/patrol_gen/pubspec.lock @@ -0,0 +1,173 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + _fe_analyzer_shared: + dependency: transitive + description: + name: _fe_analyzer_shared + sha256: "58826e40314219b223f4723dd4205845040161cdc2df3e6a1cdceed5d8165084" + url: "https://pub.dev" + source: hosted + version: "63.0.0" + analyzer: + dependency: "direct main" + description: + name: analyzer + sha256: f85566ec7b3d25cbea60f7dd4f157c5025f2f19233ca4feeed33b616c78a26a3 + url: "https://pub.dev" + source: hosted + version: "6.1.0" + async: + dependency: transitive + description: + name: async + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" + source: hosted + version: "2.11.0" + collection: + dependency: transitive + description: + name: collection + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a + url: "https://pub.dev" + source: hosted + version: "1.18.0" + convert: + dependency: transitive + description: + name: convert + sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592" + url: "https://pub.dev" + source: hosted + version: "3.1.1" + crypto: + dependency: transitive + description: + name: crypto + sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab + url: "https://pub.dev" + source: hosted + version: "3.0.3" + file: + dependency: transitive + description: + name: file + sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c" + url: "https://pub.dev" + source: hosted + version: "7.0.0" + flutter_lints: + dependency: transitive + description: + name: flutter_lints + sha256: "2118df84ef0c3ca93f96123a616ae8540879991b8b57af2f81b76a7ada49b2a4" + url: "https://pub.dev" + source: hosted + version: "2.0.2" + glob: + dependency: transitive + description: + name: glob + sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + leancode_lint: + dependency: "direct dev" + description: + name: leancode_lint + sha256: "7351ee2eebd94944880d4d58ac56a3f2fa0fbde3372f73337b3b8f734905078a" + url: "https://pub.dev" + source: hosted + version: "3.0.0" + lints: + dependency: transitive + description: + name: lints + sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + meta: + dependency: "direct main" + description: + name: meta + sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + url: "https://pub.dev" + source: hosted + version: "1.9.1" + package_config: + dependency: transitive + description: + name: package_config + sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd" + url: "https://pub.dev" + source: hosted + version: "2.1.0" + path: + dependency: "direct main" + description: + name: path + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + url: "https://pub.dev" + source: hosted + version: "1.8.3" + pub_semver: + dependency: transitive + description: + name: pub_semver + sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + source_span: + dependency: transitive + description: + name: source_span + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + url: "https://pub.dev" + source: hosted + version: "1.10.0" + string_scanner: + dependency: transitive + description: + name: string_scanner + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" + source: hosted + version: "1.2.0" + term_glyph: + dependency: transitive + description: + name: term_glyph + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" + source: hosted + version: "1.2.1" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c + url: "https://pub.dev" + source: hosted + version: "1.3.2" + watcher: + dependency: transitive + description: + name: watcher + sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + yaml: + dependency: transitive + description: + name: yaml + sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" + url: "https://pub.dev" + source: hosted + version: "3.1.2" +sdks: + dart: ">=3.0.0 <4.0.0" diff --git a/packages/patrol_gen/pubspec.yaml b/packages/patrol_gen/pubspec.yaml new file mode 100644 index 000000000..46fdde9f3 --- /dev/null +++ b/packages/patrol_gen/pubspec.yaml @@ -0,0 +1,18 @@ +name: patrol_gen +description: > + Generate contracts for all languages +version: 1.0.0 +homepage: https://patrol.leancode.co +repository: https://github.com/leancodepl/patrol +issue_tracker: https://github.com/leancodepl/patrol/issues + +environment: + sdk: '>=2.18.0 <4.0.0' + +dependencies: + meta: ^1.7.0 + path: ^1.8.2 + analyzer: ^6.1.0 + +dev_dependencies: + leancode_lint: ^3.0.0 diff --git a/schema.dart b/schema.dart new file mode 100644 index 000000000..f58cca865 --- /dev/null +++ b/schema.dart @@ -0,0 +1,33 @@ +class DartTestCase { + late String name; +} + +class DartTestGroup { + String? name; + List? tests; + List? groups; +} + +class ListDartTestsResponse { + late DartTestGroup group; +} + +enum RunDartTestResponseResult { + success, + skipped, + failure, +} + +class RunDartTestRequest { + String? name; +} + +class RunDartTestResponse { + late RunDartTestResponseResult result; + String? details; +} + +abstract class PatrolAppService { + ListDartTestsResponse listDartTests(); + RunDartTestResponse runDartTest(RunDartTestRequest request); +} From 9abecbbbf1a83f865a7fe9d05a2880aea273d60e Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Fri, 11 Aug 2023 17:51:25 +0200 Subject: [PATCH 002/110] Add schema definition, and resolveSchema function --- packages/patrol_gen/lib/src/patrol_gen.dart | 8 +- .../patrol_gen/lib/src/resolve_schema.dart | 82 +++++++++++++++++++ packages/patrol_gen/lib/src/schema.dart | 44 ++++++++++ 3 files changed, 132 insertions(+), 2 deletions(-) create mode 100644 packages/patrol_gen/lib/src/resolve_schema.dart create mode 100644 packages/patrol_gen/lib/src/schema.dart diff --git a/packages/patrol_gen/lib/src/patrol_gen.dart b/packages/patrol_gen/lib/src/patrol_gen.dart index 2203d79f2..cad32bb02 100644 --- a/packages/patrol_gen/lib/src/patrol_gen.dart +++ b/packages/patrol_gen/lib/src/patrol_gen.dart @@ -1,5 +1,9 @@ +import 'package:patrol_gen/src/resolve_schema.dart'; + +class PatrolGenOptions {} + class PatrolGen { - void run(String schemaPath) { - print(schemaPath); + Future run(String schemaPath) async { + await resolveSchema(schemaPath); } } diff --git a/packages/patrol_gen/lib/src/resolve_schema.dart b/packages/patrol_gen/lib/src/resolve_schema.dart new file mode 100644 index 000000000..cfc5f4649 --- /dev/null +++ b/packages/patrol_gen/lib/src/resolve_schema.dart @@ -0,0 +1,82 @@ +import 'package:analyzer/dart/analysis/results.dart'; +import 'package:analyzer/dart/analysis/utilities.dart'; +import 'package:analyzer/dart/ast/ast.dart'; +import 'package:path/path.dart' as path; +import 'package:patrol_gen/src/schema.dart'; + +Future resolveSchema(String schemaPath) async { + final file = path.normalize(path.absolute(schemaPath)); + final result = await resolveFile2(path: file); + + final enums = []; + final messages = []; + final classServices = []; + + if (result is ResolvedUnitResult) { + for (var declaration in result.unit.declarations) { + if (declaration is EnumDeclaration) { + enums.add(Enum(declaration.name.lexeme, + declaration.constants.map((e) => e.name.lexeme).toList())); + } else if (declaration is ClassDeclaration) { + if (declaration.abstractKeyword != null) { + classServices.add(declaration); + } else { + messages.add(_createMessage(declaration)); + } + } + } + } + + return Schema(enums, messages, + classServices.map((e) => _createService(e, messages)).toList()); +} + +Service _createService(ClassDeclaration declaration, List messages) { + return Service( + declaration.name.lexeme, + declaration.members.whereType().map((method) { + final returnType = method.returnType; + if (returnType is NamedType) { + final responseMessage = returnType.name2.lexeme == 'void' + ? null + : messages + .firstWhere((msg) => msg.name == returnType.name2.lexeme); + + Message? requestMessage; + if (method.parameters!.parameters.isNotEmpty) { + final parameter = method.parameters!.parameters.first; + if (parameter is SimpleFormalParameter) { + final parameterTypeName = + (parameter.type as NamedType).name2.lexeme; + + requestMessage = + messages.firstWhere((msg) => msg.name == parameterTypeName); + } else { + throw 'unsupported parameter $parameter'; + } + } + + return Endpoint(responseMessage, requestMessage, method.name.lexeme); + } else { + throw 'unsupported return type $returnType'; + } + }).toList()); +} + +Message _createMessage(ClassDeclaration declaration) { + return Message( + declaration.name.lexeme, + declaration.members + .whereType() + .map((e) => e.fields) + .whereType() + .map((e) { + final type = e.type; + if (type is NamedType) { + return MessageField(type.question != null, + e.variables.first.name.lexeme, type.name2.lexeme); + } else { + throw 'unsupported type $type'; + } + }).toList()); +} diff --git a/packages/patrol_gen/lib/src/schema.dart b/packages/patrol_gen/lib/src/schema.dart new file mode 100644 index 000000000..4a94a8ca8 --- /dev/null +++ b/packages/patrol_gen/lib/src/schema.dart @@ -0,0 +1,44 @@ +class Enum { + const Enum(this.name, this.fields); + + final String name; + final List fields; +} + +class MessageField { + const MessageField(this.optional, this.name, this.type); + + final bool optional; + final String name; + final String type; +} + +class Message { + const Message(this.name, this.properties); + + final String name; + final List properties; +} + +class Endpoint { + const Endpoint(this.response, this.request, this.name); + + final Message? response; + final Message? request; + final String name; +} + +class Service { + const Service(this.name, this.endpoints); + + final List endpoints; + final String name; +} + +class Schema { + const Schema(this.enums, this.messages, this.services); + + final List enums; + final List messages; + final List services; +} From 8bcfe7283553191cd8dc664c9bdf8dd1efebf675 Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Fri, 11 Aug 2023 17:51:58 +0200 Subject: [PATCH 003/110] Add dart generator --- .../lib/src/generators/dart_generator.dart | 70 +++++++++++++++++++ packages/patrol_gen/lib/src/patrol_gen.dart | 9 ++- packages/patrol_gen/lib/src/schema.dart | 4 +- packages/patrol_gen/pubspec.lock | 16 +++++ packages/patrol_gen/pubspec.yaml | 1 + 5 files changed, 97 insertions(+), 3 deletions(-) create mode 100644 packages/patrol_gen/lib/src/generators/dart_generator.dart diff --git a/packages/patrol_gen/lib/src/generators/dart_generator.dart b/packages/patrol_gen/lib/src/generators/dart_generator.dart new file mode 100644 index 000000000..80ceddbd6 --- /dev/null +++ b/packages/patrol_gen/lib/src/generators/dart_generator.dart @@ -0,0 +1,70 @@ +import 'package:patrol_gen/src/schema.dart'; +import 'package:path/path.dart' as path; +import 'package:dart_style/dart_style.dart'; + +class DartOutputConfig { + const DartOutputConfig({required this.path}); + + final String path; +} + +class DartGenerator { + String generateContent(Schema schema, DartOutputConfig outputConfig) { + final buffer = StringBuffer()..write(_contentPrefix(outputConfig)); + + schema.enums.forEach((e) => buffer.writeln(_createEnum(e))); + schema.messages.forEach((e) => buffer.writeln(_createMessage(e))); + + return DartFormatter().format(buffer.toString()); + } + + String _contentPrefix(DartOutputConfig outputConfig) { + return ''' +/// +// Generated code. Do not modify. +// source: schema.dart +// +import 'package:json_annotation/json_annotation.dart'; + +part '${path.basenameWithoutExtension(outputConfig.path)}.g.dart'; + +'''; + } + + String _createEnum(Enum enumDefinition) { + final fieldsContent = enumDefinition.fields.map((e) { + return ''' +@JsonValue('${e}') +${e}'''; + }).join(',\n'); + + return ''' +enum ${enumDefinition.name} { + $fieldsContent +} +'''; + } + + String? _createMessage(Message message) { + final fieldsContent = message.fields + .map((f) => 'final ${f.type}${f.optional ? '?' : ''} ${f.name};') + .join('\n'); + + final constructorParameters = message.fields + .map((e) => '${e.optional ? '' : 'required'} this.${e.name}') + .join(','); + + return ''' +@JsonSerializable() +class ${message.name} { + ${message.name}({${constructorParameters}}); + + $fieldsContent + + factory ${message.name}.fromJson(Map json) => _\$${message.name}FromJson(json); + + Map toJson() => _\$${message.name}ToJson(this); +} +'''; + } +} diff --git a/packages/patrol_gen/lib/src/patrol_gen.dart b/packages/patrol_gen/lib/src/patrol_gen.dart index cad32bb02..95adabc04 100644 --- a/packages/patrol_gen/lib/src/patrol_gen.dart +++ b/packages/patrol_gen/lib/src/patrol_gen.dart @@ -1,9 +1,16 @@ +import 'package:patrol_gen/src/generators/dart_generator.dart'; import 'package:patrol_gen/src/resolve_schema.dart'; +import 'dart:io'; class PatrolGenOptions {} class PatrolGen { Future run(String schemaPath) async { - await resolveSchema(schemaPath); + final schema = await resolveSchema(schemaPath); + final dartOutputConfig = DartOutputConfig(path: 'contracts.dart'); + final dartContent = + DartGenerator().generateContent(schema, dartOutputConfig); + + await File(dartOutputConfig.path).writeAsString(dartContent, flush: true); } } diff --git a/packages/patrol_gen/lib/src/schema.dart b/packages/patrol_gen/lib/src/schema.dart index 4a94a8ca8..17528b15b 100644 --- a/packages/patrol_gen/lib/src/schema.dart +++ b/packages/patrol_gen/lib/src/schema.dart @@ -14,10 +14,10 @@ class MessageField { } class Message { - const Message(this.name, this.properties); + const Message(this.name, this.fields); final String name; - final List properties; + final List fields; } class Endpoint { diff --git a/packages/patrol_gen/pubspec.lock b/packages/patrol_gen/pubspec.lock index 23c512310..0014aca80 100644 --- a/packages/patrol_gen/pubspec.lock +++ b/packages/patrol_gen/pubspec.lock @@ -17,6 +17,14 @@ packages: url: "https://pub.dev" source: hosted version: "6.1.0" + args: + dependency: transitive + description: + name: args + sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596 + url: "https://pub.dev" + source: hosted + version: "2.4.2" async: dependency: transitive description: @@ -49,6 +57,14 @@ packages: url: "https://pub.dev" source: hosted version: "3.0.3" + dart_style: + dependency: "direct main" + description: + name: dart_style + sha256: "1efa911ca7086affd35f463ca2fc1799584fb6aa89883cf0af8e3664d6a02d55" + url: "https://pub.dev" + source: hosted + version: "2.3.2" file: dependency: transitive description: diff --git a/packages/patrol_gen/pubspec.yaml b/packages/patrol_gen/pubspec.yaml index 46fdde9f3..860e66d4b 100644 --- a/packages/patrol_gen/pubspec.yaml +++ b/packages/patrol_gen/pubspec.yaml @@ -13,6 +13,7 @@ dependencies: meta: ^1.7.0 path: ^1.8.2 analyzer: ^6.1.0 + dart_style: ^2.3.2 dev_dependencies: leancode_lint: ^3.0.0 From a809e5ec099725d4a2379839e7c1ac921806ea7c Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Fri, 11 Aug 2023 18:14:40 +0200 Subject: [PATCH 004/110] Add simple swift message builder --- .../lib/src/generators/swift_generator.dart | 43 +++++++++++++++++++ packages/patrol_gen/lib/src/patrol_gen.dart | 6 +++ 2 files changed, 49 insertions(+) create mode 100644 packages/patrol_gen/lib/src/generators/swift_generator.dart diff --git a/packages/patrol_gen/lib/src/generators/swift_generator.dart b/packages/patrol_gen/lib/src/generators/swift_generator.dart new file mode 100644 index 000000000..94444b4c2 --- /dev/null +++ b/packages/patrol_gen/lib/src/generators/swift_generator.dart @@ -0,0 +1,43 @@ +import 'package:patrol_gen/src/schema.dart'; + +class SwiftOutputConfig { + const SwiftOutputConfig({required this.path}); + + final String path; +} + +class SwiftGenerator { + String generateContent(Schema schema, SwiftOutputConfig outputConfig) { + final buffer = StringBuffer()..write(_contentPrefix(outputConfig)); + + schema.messages.forEach((e) => buffer.writeln(_createMessage(e))); + + return buffer.toString(); + } + + String _contentPrefix(SwiftOutputConfig outputConfig) { + return ''' +/// +// Generated code. Do not modify. +// source: schema.dart +// + +'''; + } + + String _createMessage(Message message) { + final fields = message.fields + .map((e) => ' var ${e.name}: ${_transformDartType(e.type)}') + .join('\n'); + + return ''' +struct ${message.name}: Codable { +$fields +} +'''; + } + + String _transformDartType(String type) { + return type; + } +} diff --git a/packages/patrol_gen/lib/src/patrol_gen.dart b/packages/patrol_gen/lib/src/patrol_gen.dart index 95adabc04..02a3b89c0 100644 --- a/packages/patrol_gen/lib/src/patrol_gen.dart +++ b/packages/patrol_gen/lib/src/patrol_gen.dart @@ -1,4 +1,5 @@ import 'package:patrol_gen/src/generators/dart_generator.dart'; +import 'package:patrol_gen/src/generators/swift_generator.dart'; import 'package:patrol_gen/src/resolve_schema.dart'; import 'dart:io'; @@ -11,6 +12,11 @@ class PatrolGen { final dartContent = DartGenerator().generateContent(schema, dartOutputConfig); + final swiftOutputConfig = SwiftOutputConfig(path: 'contracts.swift'); + final swiftContent = + SwiftGenerator().generateContent(schema, swiftOutputConfig); + await File(dartOutputConfig.path).writeAsString(dartContent, flush: true); + await File(swiftOutputConfig.path).writeAsString(swiftContent, flush: true); } } From fce81a6f87331ba456fc17499b53f5e15fa1bef3 Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Fri, 11 Aug 2023 18:29:24 +0200 Subject: [PATCH 005/110] Extend schema --- .../patrol_gen/lib/src/resolve_schema.dart | 65 ++++++++++++------- packages/patrol_gen/lib/src/schema.dart | 11 +++- schema.dart | 2 +- 3 files changed, 52 insertions(+), 26 deletions(-) diff --git a/packages/patrol_gen/lib/src/resolve_schema.dart b/packages/patrol_gen/lib/src/resolve_schema.dart index cfc5f4649..9c87d1cf9 100644 --- a/packages/patrol_gen/lib/src/resolve_schema.dart +++ b/packages/patrol_gen/lib/src/resolve_schema.dart @@ -32,35 +32,52 @@ Future resolveSchema(String schemaPath) async { } Service _createService(ClassDeclaration declaration, List messages) { + final genericTypes = declaration.typeParameters?.typeParameters + .map((e) => e.name.lexeme) + .toSet() ?? + {}; + + final swiftGenConfig = ServiceGenConfig( + genericTypes.contains('SwiftClient'), + genericTypes.contains('SwiftServer'), + ); + + final dartGenConfig = ServiceGenConfig( + genericTypes.contains('DartClient'), + genericTypes.contains('DartServer'), + ); + return Service( - declaration.name.lexeme, - declaration.members.whereType().map((method) { - final returnType = method.returnType; - if (returnType is NamedType) { - final responseMessage = returnType.name2.lexeme == 'void' - ? null - : messages - .firstWhere((msg) => msg.name == returnType.name2.lexeme); + declaration.name.lexeme, + swiftGenConfig, + dartGenConfig, + declaration.members.whereType().map((method) { + final returnType = method.returnType; + if (returnType is NamedType) { + final responseMessage = returnType.name2.lexeme == 'void' + ? null + : messages.firstWhere((msg) => msg.name == returnType.name2.lexeme); - Message? requestMessage; - if (method.parameters!.parameters.isNotEmpty) { - final parameter = method.parameters!.parameters.first; - if (parameter is SimpleFormalParameter) { - final parameterTypeName = - (parameter.type as NamedType).name2.lexeme; + Message? requestMessage; + if (method.parameters!.parameters.isNotEmpty) { + final parameter = method.parameters!.parameters.first; + if (parameter is SimpleFormalParameter) { + final parameterTypeName = + (parameter.type as NamedType).name2.lexeme; - requestMessage = - messages.firstWhere((msg) => msg.name == parameterTypeName); - } else { - throw 'unsupported parameter $parameter'; - } + requestMessage = + messages.firstWhere((msg) => msg.name == parameterTypeName); + } else { + throw 'unsupported parameter $parameter'; } - - return Endpoint(responseMessage, requestMessage, method.name.lexeme); - } else { - throw 'unsupported return type $returnType'; } - }).toList()); + + return Endpoint(responseMessage, requestMessage, method.name.lexeme); + } else { + throw 'unsupported return type $returnType'; + } + }).toList(), + ); } Message _createMessage(ClassDeclaration declaration) { diff --git a/packages/patrol_gen/lib/src/schema.dart b/packages/patrol_gen/lib/src/schema.dart index 17528b15b..5dad73185 100644 --- a/packages/patrol_gen/lib/src/schema.dart +++ b/packages/patrol_gen/lib/src/schema.dart @@ -28,11 +28,20 @@ class Endpoint { final String name; } +class ServiceGenConfig { + const ServiceGenConfig(this.needsClient, this.needsServer); + + final bool needsClient; + final bool needsServer; +} + class Service { - const Service(this.name, this.endpoints); + const Service(this.name, this.swift, this.dart, this.endpoints); final List endpoints; final String name; + final ServiceGenConfig swift; + final ServiceGenConfig dart; } class Schema { diff --git a/schema.dart b/schema.dart index f58cca865..21f9559b3 100644 --- a/schema.dart +++ b/schema.dart @@ -27,7 +27,7 @@ class RunDartTestResponse { String? details; } -abstract class PatrolAppService { +abstract class PatrolAppService { ListDartTestsResponse listDartTests(); RunDartTestResponse runDartTest(RunDartTestRequest request); } From c1ba15724ac18dd128cd465db90abd9e937b5b92 Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Fri, 11 Aug 2023 18:52:46 +0200 Subject: [PATCH 006/110] Add NativeAutomator to schema --- schema.dart | 151 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 151 insertions(+) diff --git a/schema.dart b/schema.dart index 21f9559b3..ae884c681 100644 --- a/schema.dart +++ b/schema.dart @@ -31,3 +31,154 @@ abstract class PatrolAppService { ListDartTestsResponse listDartTests(); RunDartTestResponse runDartTest(RunDartTestRequest request); } + +class ConfigureRequest { + late int findTimeoutMillis; +} + +class OpenAppRequest { + String? appId; +} + +class OpenQuickSettingsRequest {} + +class Selector { + String? text; + String? textStartsWith; + String? textContains; + String? className; + String? contentDescription; + String? contentDescriptionStartsWith; + String? contentDescriptionContains; + String? resourceId; + int? instance; + bool? enabled; + bool? focused; + String? pkg; +} + +class GetNativeViewsRequest { + Selector? selector; + String? appId; +} + +class NativeView { + String? className; + String? text; + String? contentDescription; + bool? focused; + bool? enabled; + int? childCount; + String? resourceName; + String? applicationPackage; + List? children; +} + +class GetNativeViewsResponse { + List? nativeViews; +} + +class TapRequest { + Selector? selector; + String? appId; +} + +class EnterTextRequest { + String? data; + String? appId; + int? index; + Selector? selector; + bool? showKeyboard; +} + +class SwipeRequest { + double? startX; + double? startY; + double? endX; + double? endY; + int? steps; + String? appId; +} + +class WaitUntilVisibleRequest { + Selector? selector; + String? appId; +} + +class DarkModeRequest { + String? appId; +} + +class Notification { + String? appName; + String? title; + String? content; + String? raw; +} + +class GetNotificationsResponse { + List? notifications; +} + +class GetNotificationsRequest {} + +class TapOnNotificationRequest { + int? index; + Selector? selector; +} + +class PermissionDialogVisibleResponse { + bool? visible; +} + +abstract class NativeAutomator { + void initialize(); + void configure(ConfigureRequest request); + +// general + void pressHome(); + void pressBack(); + void pressRecentApps(); + void doublePressRecentApps(); + void openApp(OpenAppRequest request); + void openQuickSettings(OpenQuickSettingsRequest request); + +// general UI interaction + GetNativeViewsResponse getNativeViews(GetNativeViewsRequest request); + void tap(TapRequest request); + void doubleTap(TapRequest request); + void enterText(EnterTextRequest request); + void swipe(SwipeRequest request); + void waitUntilVisible(WaitUntilVisibleRequest request); + +// services + void enableAirplaneMode(); + void disableAirplaneMode(); + void enableWiFi(); + void disableWiFi(); + void enableCellular(); + void disableCellular(); + void enableBluetooth(); + void disableBluetooth(); + void enableDarkMode(DarkModeRequest request); + void disableDarkMode(DarkModeRequest request); + +// notifications + void openNotifications(); + void closeNotifications(); + void closeHeadsUpNotification(); + GetNotificationsResponse getNotifications(GetNotificationsRequest request); + void tapOnNotification(TapOnNotificationRequest request); + +// permissions + PermissionDialogVisibleResponse isPermissionDialogVisible( + PermissionDialogVisibleRequest); + void handlePermissionDialog(HandlePermissionRequest); + void setLocationAccuracy(SetLocationAccuracyRequest); + +// other + void debug(); + +// TODO(bartekpacia): Move this RPC into a new PatrolNativeTestService service because it doesn't fit here + void markPatrolAppServiceReady(); +} From 4b3977692ea1db99a80424f24d0c8bea00ad479e Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Fri, 11 Aug 2023 19:03:50 +0200 Subject: [PATCH 007/110] Fix schema and dart generator --- .../lib/src/generators/dart_generator.dart | 7 +++-- schema.dart | 29 +++++++++++++++++-- 2 files changed, 31 insertions(+), 5 deletions(-) diff --git a/packages/patrol_gen/lib/src/generators/dart_generator.dart b/packages/patrol_gen/lib/src/generators/dart_generator.dart index 80ceddbd6..c5cc7c08f 100644 --- a/packages/patrol_gen/lib/src/generators/dart_generator.dart +++ b/packages/patrol_gen/lib/src/generators/dart_generator.dart @@ -50,14 +50,17 @@ enum ${enumDefinition.name} { .map((f) => 'final ${f.type}${f.optional ? '?' : ''} ${f.name};') .join('\n'); - final constructorParameters = message.fields + var constructorParameters = message.fields .map((e) => '${e.optional ? '' : 'required'} this.${e.name}') .join(','); + constructorParameters = + message.fields.isEmpty ? '' : '{$constructorParameters}'; + return ''' @JsonSerializable() class ${message.name} { - ${message.name}({${constructorParameters}}); + ${message.name}(${constructorParameters}); $fieldsContent diff --git a/schema.dart b/schema.dart index ae884c681..d15044ab4 100644 --- a/schema.dart +++ b/schema.dart @@ -131,6 +131,29 @@ class PermissionDialogVisibleResponse { bool? visible; } +class PermissionDialogVisibleRequest { + int? timeoutMillis; +} + +enum HandlePermissionRequestCode { + whileUsing, + onlyThisTime, + denied, +} + +class HandlePermissionRequest { + HandlePermissionRequestCode? code; +} + +enum SetLocationAccuracyRequestLocationAccuracy { + coarse, + fine, +} + +class SetLocationAccuracyRequest { + SetLocationAccuracyRequestLocationAccuracy? locationAccuracy; +} + abstract class NativeAutomator { void initialize(); void configure(ConfigureRequest request); @@ -172,9 +195,9 @@ abstract class NativeAutomator { // permissions PermissionDialogVisibleResponse isPermissionDialogVisible( - PermissionDialogVisibleRequest); - void handlePermissionDialog(HandlePermissionRequest); - void setLocationAccuracy(SetLocationAccuracyRequest); + PermissionDialogVisibleRequest request); + void handlePermissionDialog(HandlePermissionRequest request); + void setLocationAccuracy(SetLocationAccuracyRequest request); // other void debug(); From 051250f830f9f56eb9f89ff392d2fab984e50093 Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Fri, 11 Aug 2023 19:25:08 +0200 Subject: [PATCH 008/110] Add simple telegraph generator --- .../lib/src/generators/swift_generator.dart | 17 +++++++++ .../generators/swift_telegraph_generator.dart | 38 +++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 packages/patrol_gen/lib/src/generators/swift_telegraph_generator.dart diff --git a/packages/patrol_gen/lib/src/generators/swift_generator.dart b/packages/patrol_gen/lib/src/generators/swift_generator.dart index 94444b4c2..46d2f29ef 100644 --- a/packages/patrol_gen/lib/src/generators/swift_generator.dart +++ b/packages/patrol_gen/lib/src/generators/swift_generator.dart @@ -1,3 +1,4 @@ +import 'package:patrol_gen/src/generators/swift_telegraph_generator.dart'; import 'package:patrol_gen/src/schema.dart'; class SwiftOutputConfig { @@ -12,6 +13,15 @@ class SwiftGenerator { schema.messages.forEach((e) => buffer.writeln(_createMessage(e))); + for (var service in schema.services) { + if (service.swift.needsServer) { + buffer.writeln(_createServer(service)); + } + if (service.swift.needsClient) { + buffer.writeln(_createClient(service)); + } + } + return buffer.toString(); } @@ -37,6 +47,13 @@ $fields '''; } + String _createServer(Service service) => + SwiftTelegraphGenerator().generateServer(service); + + String _createClient(Service service) { + return ''; + } + String _transformDartType(String type) { return type; } diff --git a/packages/patrol_gen/lib/src/generators/swift_telegraph_generator.dart b/packages/patrol_gen/lib/src/generators/swift_telegraph_generator.dart new file mode 100644 index 000000000..efdfb6306 --- /dev/null +++ b/packages/patrol_gen/lib/src/generators/swift_telegraph_generator.dart @@ -0,0 +1,38 @@ +import 'package:patrol_gen/src/schema.dart'; + +class SwiftTelegraphGenerator { + String generateServer(Service service) { + return ''' +${_generateInterface(service)} + +${_generateSetUpRoutes(service)} +'''; + } + + String _generateSetUpRoutes(Service service) { + return service.endpoints.map((e) => _generateRoute(e)).join('\n'); + } + + String _generateRoute(Endpoint endpoint) { + final command = endpoint.request != null + ? ''' + + let command = try self.decoder.decode(${endpoint.request!.name}.self, from: request.body)''' + : ''; + + return ''' +server.route(.POST, "${endpoint.name}") { request in + do {$command + interface.${endpoint.name}(${command.isNotEmpty ? 'command' : ''}) + return HTTPResponse(.ok) + } catch let err { + return HTTPResponse(.badRequest, headers: [:], error: err) + } +} +'''; + } + + String _generateInterface(Service service) { + return ''; + } +} From 0913afbd394f9f7ab9591fca52bfbdac0afbf849 Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Thu, 17 Aug 2023 11:33:40 +0200 Subject: [PATCH 009/110] Add list support in schema --- .../lib/src/generators/dart_generator.dart | 6 ++++-- packages/patrol_gen/lib/src/resolve_schema.dart | 14 ++++++++++++-- packages/patrol_gen/lib/src/schema.dart | 5 +++-- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/packages/patrol_gen/lib/src/generators/dart_generator.dart b/packages/patrol_gen/lib/src/generators/dart_generator.dart index c5cc7c08f..b5132d7d8 100644 --- a/packages/patrol_gen/lib/src/generators/dart_generator.dart +++ b/packages/patrol_gen/lib/src/generators/dart_generator.dart @@ -47,11 +47,13 @@ enum ${enumDefinition.name} { String? _createMessage(Message message) { final fieldsContent = message.fields - .map((f) => 'final ${f.type}${f.optional ? '?' : ''} ${f.name};') + .map((f) => f.isList + ? 'final List<${f.type}>${f.isOptional ? '?' : ''} ${f.name};' + : 'final ${f.type}${f.isOptional ? '?' : ''} ${f.name};') .join('\n'); var constructorParameters = message.fields - .map((e) => '${e.optional ? '' : 'required'} this.${e.name}') + .map((e) => '${e.isOptional ? '' : 'required'} this.${e.name}') .join(','); constructorParameters = diff --git a/packages/patrol_gen/lib/src/resolve_schema.dart b/packages/patrol_gen/lib/src/resolve_schema.dart index 9c87d1cf9..f73d82638 100644 --- a/packages/patrol_gen/lib/src/resolve_schema.dart +++ b/packages/patrol_gen/lib/src/resolve_schema.dart @@ -90,8 +90,18 @@ Message _createMessage(ClassDeclaration declaration) { .map((e) { final type = e.type; if (type is NamedType) { - return MessageField(type.question != null, - e.variables.first.name.lexeme, type.name2.lexeme); + final isOptional = type.question != null; + final fieldName = e.variables.first.name.lexeme; + + if (type.type?.isDartCoreList ?? false) { + final genericType = + type.typeArguments!.arguments.first as NamedType; + return MessageField( + isOptional, fieldName, genericType.name2.lexeme, true); + } else { + return MessageField( + isOptional, fieldName, type.name2.lexeme, false); + } } else { throw 'unsupported type $type'; } diff --git a/packages/patrol_gen/lib/src/schema.dart b/packages/patrol_gen/lib/src/schema.dart index 5dad73185..3ab5e2d07 100644 --- a/packages/patrol_gen/lib/src/schema.dart +++ b/packages/patrol_gen/lib/src/schema.dart @@ -6,9 +6,10 @@ class Enum { } class MessageField { - const MessageField(this.optional, this.name, this.type); + const MessageField(this.isOptional, this.name, this.type, this.isList); - final bool optional; + final bool isOptional; + final bool isList; final String name; final String type; } From 3123f5d0cd606a9121f57c3565c2e600d97694bd Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Thu, 17 Aug 2023 13:00:07 +0200 Subject: [PATCH 010/110] Add json_serializable to patrol. Add script to generate models from schema --- gen_from_schema | 18 +++++++++++++ packages/patrol/analysis_options.yaml | 1 + packages/patrol/pubspec.yaml | 2 ++ packages/patrol_gen/bin/main.dart | 20 +++++++------- .../lib/src/generators/dart/dart_config.dart | 10 +++++++ .../generators/{ => dart}/dart_generator.dart | 27 +++++++++---------- packages/patrol_gen/lib/src/patrol_gen.dart | 24 ++++++++++++----- packages/patrol_gen/lib/src/utils.dart | 3 +++ 8 files changed, 74 insertions(+), 31 deletions(-) create mode 100755 gen_from_schema create mode 100644 packages/patrol_gen/lib/src/generators/dart/dart_config.dart rename packages/patrol_gen/lib/src/generators/{ => dart}/dart_generator.dart (79%) create mode 100644 packages/patrol_gen/lib/src/utils.dart diff --git a/gen_from_schema b/gen_from_schema new file mode 100755 index 000000000..b14a46ef9 --- /dev/null +++ b/gen_from_schema @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +set -euo pipefail + +# gen_from_schema generates classes from schema.dart for every used language +# (Dart, Swift, Kotlin/Java) in the appropriate directory. + +cd "$(dirname "$0")" || exit + +schema="./schema.dart" +patrol_package="./packages/patrol" +patrol_out_dir="/lib/src/native/contracts" + +dart_out="$patrol_package/$patrol_out_dir" + +dart run packages/patrol_gen/bin/main.dart $schema $dart_out + +cd "${patrol_package}" +dart run build_runner build --delete-conflicting-outputs --build-filter="$patrol_out_dir/*.dart" diff --git a/packages/patrol/analysis_options.yaml b/packages/patrol/analysis_options.yaml index 724b4595e..76a7fea8a 100644 --- a/packages/patrol/analysis_options.yaml +++ b/packages/patrol/analysis_options.yaml @@ -9,3 +9,4 @@ analyzer: - lib/**/*.pbjson.dart - lib/**/*.pbserver.dart - lib/**/*.pbgrpc.dart + - lib/**/*.g.dart diff --git a/packages/patrol/pubspec.yaml b/packages/patrol/pubspec.yaml index 229063fc4..e1cc6cf54 100644 --- a/packages/patrol/pubspec.yaml +++ b/packages/patrol/pubspec.yaml @@ -20,6 +20,7 @@ dependencies: grpc: ^3.1.0 integration_test: sdk: flutter + json_annotation: ^4.8.1 meta: ^1.7.0 path: ^1.8.2 patrol_finders: ^1.0.0 @@ -28,6 +29,7 @@ dependencies: dev_dependencies: build_runner: ^2.3.3 + json_serializable: ^6.7.1 leancode_lint: ^3.0.0 flutter: diff --git a/packages/patrol_gen/bin/main.dart b/packages/patrol_gen/bin/main.dart index 55111c6ea..a07e78299 100644 --- a/packages/patrol_gen/bin/main.dart +++ b/packages/patrol_gen/bin/main.dart @@ -1,12 +1,14 @@ +import 'package:patrol_gen/src/generators/dart/dart_config.dart'; import 'package:patrol_gen/src/patrol_gen.dart'; +import 'package:patrol_gen/src/utils.dart'; -void main(List args) { - if (args.length == 1) { - PatrolGen().run(args[0]); - } else { - print(''' -You should only pass one argument (path to schema). Example: -dart run bin/main.dart ../schema.dart -'''); - } +Future main(List args) { + return PatrolGen().run( + PatrolGenConfig( + schemaFilename: normalizePath(args[0]), + dartConfig: DartConfig( + outputDirectory: normalizePath(args[1]), + ), + ), + ); } diff --git a/packages/patrol_gen/lib/src/generators/dart/dart_config.dart b/packages/patrol_gen/lib/src/generators/dart/dart_config.dart new file mode 100644 index 000000000..a563d686c --- /dev/null +++ b/packages/patrol_gen/lib/src/generators/dart/dart_config.dart @@ -0,0 +1,10 @@ +import 'package:path/path.dart' as path; + +class DartConfig { + DartConfig({ + required this.outputDirectory, + }) : contractsFilename = path.join(outputDirectory, 'contracts.dart'); + + final String outputDirectory; + final String contractsFilename; +} diff --git a/packages/patrol_gen/lib/src/generators/dart_generator.dart b/packages/patrol_gen/lib/src/generators/dart/dart_generator.dart similarity index 79% rename from packages/patrol_gen/lib/src/generators/dart_generator.dart rename to packages/patrol_gen/lib/src/generators/dart/dart_generator.dart index b5132d7d8..96bcffd95 100644 --- a/packages/patrol_gen/lib/src/generators/dart_generator.dart +++ b/packages/patrol_gen/lib/src/generators/dart/dart_generator.dart @@ -1,16 +1,11 @@ +import 'package:patrol_gen/src/generators/dart/dart_config.dart'; import 'package:patrol_gen/src/schema.dart'; import 'package:path/path.dart' as path; import 'package:dart_style/dart_style.dart'; -class DartOutputConfig { - const DartOutputConfig({required this.path}); - - final String path; -} - class DartGenerator { - String generateContent(Schema schema, DartOutputConfig outputConfig) { - final buffer = StringBuffer()..write(_contentPrefix(outputConfig)); + String generateContent(Schema schema, DartConfig config) { + final buffer = StringBuffer()..write(_contentPrefix(config)); schema.enums.forEach((e) => buffer.writeln(_createEnum(e))); schema.messages.forEach((e) => buffer.writeln(_createMessage(e))); @@ -18,15 +13,17 @@ class DartGenerator { return DartFormatter().format(buffer.toString()); } - String _contentPrefix(DartOutputConfig outputConfig) { + String _contentPrefix(DartConfig config) { return ''' -/// +// // Generated code. Do not modify. // source: schema.dart // +// ignore_for_file: public_member_api_docs + import 'package:json_annotation/json_annotation.dart'; -part '${path.basenameWithoutExtension(outputConfig.path)}.g.dart'; +part '${path.basenameWithoutExtension(config.contractsFilename)}.g.dart'; '''; } @@ -53,8 +50,8 @@ enum ${enumDefinition.name} { .join('\n'); var constructorParameters = message.fields - .map((e) => '${e.isOptional ? '' : 'required'} this.${e.name}') - .join(','); + .map((e) => '${e.isOptional ? '' : 'required'} this.${e.name},') + .join(); constructorParameters = message.fields.isEmpty ? '' : '{$constructorParameters}'; @@ -64,10 +61,10 @@ enum ${enumDefinition.name} { class ${message.name} { ${message.name}(${constructorParameters}); - $fieldsContent - factory ${message.name}.fromJson(Map json) => _\$${message.name}FromJson(json); + $fieldsContent + Map toJson() => _\$${message.name}ToJson(this); } '''; diff --git a/packages/patrol_gen/lib/src/patrol_gen.dart b/packages/patrol_gen/lib/src/patrol_gen.dart index 02a3b89c0..9f2e83fb1 100644 --- a/packages/patrol_gen/lib/src/patrol_gen.dart +++ b/packages/patrol_gen/lib/src/patrol_gen.dart @@ -1,22 +1,32 @@ -import 'package:patrol_gen/src/generators/dart_generator.dart'; +import 'package:patrol_gen/src/generators/dart/dart_config.dart'; +import 'package:patrol_gen/src/generators/dart/dart_generator.dart'; import 'package:patrol_gen/src/generators/swift_generator.dart'; import 'package:patrol_gen/src/resolve_schema.dart'; import 'dart:io'; -class PatrolGenOptions {} +class PatrolGenConfig { + const PatrolGenConfig({ + required this.schemaFilename, + required this.dartConfig, + }); + + final DartConfig dartConfig; + final String schemaFilename; +} class PatrolGen { - Future run(String schemaPath) async { - final schema = await resolveSchema(schemaPath); - final dartOutputConfig = DartOutputConfig(path: 'contracts.dart'); + Future run(PatrolGenConfig config) async { + final schema = await resolveSchema(config.schemaFilename); final dartContent = - DartGenerator().generateContent(schema, dartOutputConfig); + DartGenerator().generateContent(schema, config.dartConfig); final swiftOutputConfig = SwiftOutputConfig(path: 'contracts.swift'); final swiftContent = SwiftGenerator().generateContent(schema, swiftOutputConfig); - await File(dartOutputConfig.path).writeAsString(dartContent, flush: true); + await File(config.dartConfig.contractsFilename) + .writeAsString(dartContent, flush: true); + await File(swiftOutputConfig.path).writeAsString(swiftContent, flush: true); } } diff --git a/packages/patrol_gen/lib/src/utils.dart b/packages/patrol_gen/lib/src/utils.dart new file mode 100644 index 000000000..46ca82447 --- /dev/null +++ b/packages/patrol_gen/lib/src/utils.dart @@ -0,0 +1,3 @@ +import 'package:path/path.dart' as p; + +String normalizePath(String path) => p.normalize(p.absolute(path)); From 64cdc964b3f87a129596aa5b6bef903297c65b00 Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Thu, 17 Aug 2023 16:27:20 +0200 Subject: [PATCH 011/110] Add type mapping to ios generator --- gen_from_schema | 9 ++--- packages/patrol_gen/bin/main.dart | 4 +++ .../lib/src/generators/ios/ios_config.dart | 10 ++++++ .../ios_generator.dart} | 36 +++++++++++-------- .../ios_telegraph_generator.dart} | 2 +- packages/patrol_gen/lib/src/patrol_gen.dart | 11 +++--- 6 files changed, 48 insertions(+), 24 deletions(-) create mode 100644 packages/patrol_gen/lib/src/generators/ios/ios_config.dart rename packages/patrol_gen/lib/src/generators/{swift_generator.dart => ios/ios_generator.dart} (50%) rename packages/patrol_gen/lib/src/generators/{swift_telegraph_generator.dart => ios/ios_telegraph_generator.dart} (96%) diff --git a/gen_from_schema b/gen_from_schema index b14a46ef9..fbaa73cd1 100755 --- a/gen_from_schema +++ b/gen_from_schema @@ -8,11 +8,12 @@ cd "$(dirname "$0")" || exit schema="./schema.dart" patrol_package="./packages/patrol" -patrol_out_dir="/lib/src/native/contracts" +patrol_dart_out_dir="lib/src/native/contracts" -dart_out="$patrol_package/$patrol_out_dir" +ios_out="$patrol_package/ios/Classes/AutomatorServer" +dart_out="$patrol_package/$patrol_dart_out_dir" -dart run packages/patrol_gen/bin/main.dart $schema $dart_out +dart run packages/patrol_gen/bin/main.dart $schema $dart_out $ios_out cd "${patrol_package}" -dart run build_runner build --delete-conflicting-outputs --build-filter="$patrol_out_dir/*.dart" +dart run build_runner build --delete-conflicting-outputs --build-filter="$patrol_dart_out_dir/*.dart" diff --git a/packages/patrol_gen/bin/main.dart b/packages/patrol_gen/bin/main.dart index a07e78299..f6ce5b9a5 100644 --- a/packages/patrol_gen/bin/main.dart +++ b/packages/patrol_gen/bin/main.dart @@ -1,4 +1,5 @@ import 'package:patrol_gen/src/generators/dart/dart_config.dart'; +import 'package:patrol_gen/src/generators/ios/ios_config.dart'; import 'package:patrol_gen/src/patrol_gen.dart'; import 'package:patrol_gen/src/utils.dart'; @@ -9,6 +10,9 @@ Future main(List args) { dartConfig: DartConfig( outputDirectory: normalizePath(args[1]), ), + iosConfig: IOSConfig( + outputDirectory: normalizePath(args[2]), + ), ), ); } diff --git a/packages/patrol_gen/lib/src/generators/ios/ios_config.dart b/packages/patrol_gen/lib/src/generators/ios/ios_config.dart new file mode 100644 index 000000000..4f8bf815f --- /dev/null +++ b/packages/patrol_gen/lib/src/generators/ios/ios_config.dart @@ -0,0 +1,10 @@ +import 'package:path/path.dart' as path; + +class IOSConfig { + IOSConfig({ + required this.outputDirectory, + }) : contractsFilename = path.join(outputDirectory, 'contracts.swift'); + + final String outputDirectory; + final String contractsFilename; +} diff --git a/packages/patrol_gen/lib/src/generators/swift_generator.dart b/packages/patrol_gen/lib/src/generators/ios/ios_generator.dart similarity index 50% rename from packages/patrol_gen/lib/src/generators/swift_generator.dart rename to packages/patrol_gen/lib/src/generators/ios/ios_generator.dart index 46d2f29ef..db75a40d1 100644 --- a/packages/patrol_gen/lib/src/generators/swift_generator.dart +++ b/packages/patrol_gen/lib/src/generators/ios/ios_generator.dart @@ -1,15 +1,10 @@ -import 'package:patrol_gen/src/generators/swift_telegraph_generator.dart'; +import 'package:patrol_gen/src/generators/ios/ios_config.dart'; +import 'package:patrol_gen/src/generators/ios/ios_telegraph_generator.dart'; import 'package:patrol_gen/src/schema.dart'; -class SwiftOutputConfig { - const SwiftOutputConfig({required this.path}); - - final String path; -} - -class SwiftGenerator { - String generateContent(Schema schema, SwiftOutputConfig outputConfig) { - final buffer = StringBuffer()..write(_contentPrefix(outputConfig)); +class IOSGenerator { + String generateContent(Schema schema, IOSConfig config) { + final buffer = StringBuffer()..write(_contentPrefix(config)); schema.messages.forEach((e) => buffer.writeln(_createMessage(e))); @@ -25,7 +20,7 @@ class SwiftGenerator { return buffer.toString(); } - String _contentPrefix(SwiftOutputConfig outputConfig) { + String _contentPrefix(IOSConfig config) { return ''' /// // Generated code. Do not modify. @@ -37,7 +32,9 @@ class SwiftGenerator { String _createMessage(Message message) { final fields = message.fields - .map((e) => ' var ${e.name}: ${_transformDartType(e.type)}') + .map((e) => e.isList + ? ' var ${e.name}: [${_transformType(e.type)}]' + : ' var ${e.name}: ${_transformType(e.type)}') .join('\n'); return ''' @@ -48,13 +45,22 @@ $fields } String _createServer(Service service) => - SwiftTelegraphGenerator().generateServer(service); + IOSTelegraphGenerator().generateServer(service); String _createClient(Service service) { return ''; } - String _transformDartType(String type) { - return type; + String _transformType(String type) { + switch (type) { + case 'int': + return 'Int'; + case 'double': + return 'Double'; + case 'bool': + return 'Bool'; + default: + return type; + } } } diff --git a/packages/patrol_gen/lib/src/generators/swift_telegraph_generator.dart b/packages/patrol_gen/lib/src/generators/ios/ios_telegraph_generator.dart similarity index 96% rename from packages/patrol_gen/lib/src/generators/swift_telegraph_generator.dart rename to packages/patrol_gen/lib/src/generators/ios/ios_telegraph_generator.dart index efdfb6306..eb9bd97d9 100644 --- a/packages/patrol_gen/lib/src/generators/swift_telegraph_generator.dart +++ b/packages/patrol_gen/lib/src/generators/ios/ios_telegraph_generator.dart @@ -1,6 +1,6 @@ import 'package:patrol_gen/src/schema.dart'; -class SwiftTelegraphGenerator { +class IOSTelegraphGenerator { String generateServer(Service service) { return ''' ${_generateInterface(service)} diff --git a/packages/patrol_gen/lib/src/patrol_gen.dart b/packages/patrol_gen/lib/src/patrol_gen.dart index 9f2e83fb1..1bf27631e 100644 --- a/packages/patrol_gen/lib/src/patrol_gen.dart +++ b/packages/patrol_gen/lib/src/patrol_gen.dart @@ -1,6 +1,7 @@ import 'package:patrol_gen/src/generators/dart/dart_config.dart'; import 'package:patrol_gen/src/generators/dart/dart_generator.dart'; -import 'package:patrol_gen/src/generators/swift_generator.dart'; +import 'package:patrol_gen/src/generators/ios/ios_config.dart'; +import 'package:patrol_gen/src/generators/ios/ios_generator.dart'; import 'package:patrol_gen/src/resolve_schema.dart'; import 'dart:io'; @@ -8,8 +9,10 @@ class PatrolGenConfig { const PatrolGenConfig({ required this.schemaFilename, required this.dartConfig, + required this.iosConfig, }); + final IOSConfig iosConfig; final DartConfig dartConfig; final String schemaFilename; } @@ -20,13 +23,13 @@ class PatrolGen { final dartContent = DartGenerator().generateContent(schema, config.dartConfig); - final swiftOutputConfig = SwiftOutputConfig(path: 'contracts.swift'); final swiftContent = - SwiftGenerator().generateContent(schema, swiftOutputConfig); + IOSGenerator().generateContent(schema, config.iosConfig); await File(config.dartConfig.contractsFilename) .writeAsString(dartContent, flush: true); - await File(swiftOutputConfig.path).writeAsString(swiftContent, flush: true); + await File(config.iosConfig.contractsFilename) + .writeAsString(swiftContent, flush: true); } } From 25345b7444f11e79019a8755e2114f52c28f9e27 Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Thu, 17 Aug 2023 16:51:16 +0200 Subject: [PATCH 012/110] Add enums to ios output --- .../patrol/ios/Classes/PatrolAppServiceClient.swift | 6 +++--- .../patrol/ios/Classes/PatrolIntegrationTestRunner.h | 4 ++-- .../lib/src/generators/ios/ios_generator.dart | 11 +++++++++++ 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/packages/patrol/ios/Classes/PatrolAppServiceClient.swift b/packages/patrol/ios/Classes/PatrolAppServiceClient.swift index b344b7f79..c7a9fcfa7 100644 --- a/packages/patrol/ios/Classes/PatrolAppServiceClient.swift +++ b/packages/patrol/ios/Classes/PatrolAppServiceClient.swift @@ -3,7 +3,7 @@ import Logging import NIO /// The sole reason for existence of this class is that Swift Protobufs can't be used in Objective-C. -@objc public class RunDartTestResponse: NSObject { +@objc public class RunDartTestResponse2: NSObject { @objc public dynamic let passed: Bool @objc public dynamic let details: String? @@ -44,12 +44,12 @@ import NIO return response.group.groups.map { $0.name } } - @objc public func runDartTest(name: String) async throws -> RunDartTestResponse { + @objc public func runDartTest(name: String) async throws -> RunDartTestResponse2 { NSLog("PatrolAppServiceClient.runDartTest(\(name))") let request = Patrol_RunDartTestRequest.with { $0.name = name } let result = try await client.runDartTest(request) - return RunDartTestResponse( + return RunDartTestResponse2( passed: result.result == .success, details: result.details ) diff --git a/packages/patrol/ios/Classes/PatrolIntegrationTestRunner.h b/packages/patrol/ios/Classes/PatrolIntegrationTestRunner.h index b5a123da6..6e576d993 100644 --- a/packages/patrol/ios/Classes/PatrolIntegrationTestRunner.h +++ b/packages/patrol/ios/Classes/PatrolIntegrationTestRunner.h @@ -73,9 +73,9 @@ IMP implementation = imp_implementationWithBlock(^(id _self) { \ [[[XCUIApplication alloc] init] launch]; \ \ - __block RunDartTestResponse *response = NULL; \ + __block RunDartTestResponse2 *response = NULL; \ [appServiceClient runDartTestWithName:dartTestFile \ - completionHandler:^(RunDartTestResponse *_Nullable r, NSError *_Nullable err) { \ + completionHandler:^(RunDartTestResponse2 *_Nullable r, NSError *_Nullable err) { \ if (err != NULL) { \ NSLog(@"runDartTestWithName(%@): failed, err: %@", dartTestFile, err); \ } \ diff --git a/packages/patrol_gen/lib/src/generators/ios/ios_generator.dart b/packages/patrol_gen/lib/src/generators/ios/ios_generator.dart index db75a40d1..88f68d6ed 100644 --- a/packages/patrol_gen/lib/src/generators/ios/ios_generator.dart +++ b/packages/patrol_gen/lib/src/generators/ios/ios_generator.dart @@ -6,6 +6,7 @@ class IOSGenerator { String generateContent(Schema schema, IOSConfig config) { final buffer = StringBuffer()..write(_contentPrefix(config)); + schema.enums.forEach((e) => buffer.writeln(_createEnum(e))); schema.messages.forEach((e) => buffer.writeln(_createMessage(e))); for (var service in schema.services) { @@ -44,6 +45,16 @@ $fields '''; } + String _createEnum(Enum enumDefinition) { + final cases = enumDefinition.fields.map((e) => ' case ${e}').join('\n'); + + return ''' +enum ${enumDefinition.name}: String, Codable { +$cases +} +'''; + } + String _createServer(Service service) => IOSTelegraphGenerator().generateServer(service); From c6c2bc884cc2ae6211033428cfbbfdd6683f4ed7 Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Thu, 17 Aug 2023 18:08:52 +0200 Subject: [PATCH 013/110] Add telegraph dependency --- packages/patrol/example/ios/Podfile.lock | 14 +++++++++++++- packages/patrol/ios/patrol.podspec | 3 ++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/packages/patrol/example/ios/Podfile.lock b/packages/patrol/example/ios/Podfile.lock index cc9cbd509..d101c544c 100644 --- a/packages/patrol/example/ios/Podfile.lock +++ b/packages/patrol/example/ios/Podfile.lock @@ -9,6 +9,7 @@ PODS: - CNIOHTTPParser (2.40.0) - CNIOLinux (2.40.0) - CNIOWindows (2.40.0) + - CocoaAsyncSocket (7.6.5) - Flutter (1.0.0) - flutter_local_notifications (0.0.1): - Flutter @@ -25,12 +26,14 @@ PODS: - SwiftNIOSSL (< 3.0.0, >= 2.14.0) - SwiftNIOTransportServices (< 2.0.0, >= 1.11.1) - SwiftProtobuf (< 2.0.0, >= 1.19.0) + - HTTPParserC (2.9.4) - integration_test (0.0.1): - Flutter - Logging (1.4.0) - patrol (0.0.1): - Flutter - gRPC-Swift (~> 1.8.0) + - Telegraph (~> 0.30.0) - permission_handler_apple (9.1.1): - Flutter - SwiftNIO (2.40.0): @@ -164,6 +167,9 @@ PODS: - SwiftNIOPosix (< 3, >= 2.32.0) - SwiftNIOTLS (< 3, >= 2.32.0) - SwiftProtobuf (1.20.3) + - Telegraph (0.30.0): + - CocoaAsyncSocket (~> 7.6) + - HTTPParserC (~> 2.9) - webview_flutter_wkwebview (0.0.1): - Flutter @@ -188,7 +194,9 @@ SPEC REPOS: - CNIOHTTPParser - CNIOLinux - CNIOWindows + - CocoaAsyncSocket - gRPC-Swift + - HTTPParserC - Logging - SwiftNIO - SwiftNIOConcurrencyHelpers @@ -204,6 +212,7 @@ SPEC REPOS: - SwiftNIOTLS - SwiftNIOTransportServices - SwiftProtobuf + - Telegraph EXTERNAL SOURCES: Flutter: @@ -233,14 +242,16 @@ SPEC CHECKSUMS: CNIOHTTPParser: 8ce395236fa1d09ac3b4f4bcfba79b849b2ac684 CNIOLinux: 62e3505f50de558c393dc2f273dde71dcce518da CNIOWindows: 3047f2d8165848a3936a0a755fee27c6b5ee479b + CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99 Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 flutter_local_notifications: 0c0b1ae97e741e1521e4c1629a459d04b9aec743 flutter_timezone: ffb07bdad3c6276af8dada0f11978d8a1f8a20bb geolocator_apple: cc556e6844d508c95df1e87e3ea6fa4e58c50401 gRPC-Swift: 74adcaaa62ac5e0a018938840328cb1fdfb09e7b + HTTPParserC: aea14c3d2d4ac5beb3988781daa36dfa62e0d9ef integration_test: 13825b8a9334a850581300559b8839134b124670 Logging: beeb016c9c80cf77042d62e83495816847ef108b - patrol: a7622350c42b3a944962fbfe052d07e3691789e5 + patrol: 23cee8114af27ad57b6c8a068b2a68c8f81018ca permission_handler_apple: e76247795d700c14ea09e3a2d8855d41ee80a2e6 SwiftNIO: 829958aab300642625091f82fc2f49cb7cf4ef24 SwiftNIOConcurrencyHelpers: 697370136789b1074e4535eaae75cbd7f900370e @@ -256,6 +267,7 @@ SPEC CHECKSUMS: SwiftNIOTLS: 598af547490133e9aac52aed0c23c4a90c31dcfc SwiftNIOTransportServices: 0b2b407819d82eb63af558c5396e33c945759503 SwiftProtobuf: b02b5075dcf60c9f5f403000b3b0c202a11b6ae1 + Telegraph: 12576b119324138e4929792af9e5a1085c2ecbc1 webview_flutter_wkwebview: 2e2d318f21a5e036e2c3f26171342e95908bd60a PODFILE CHECKSUM: 0976da911d4a3d1a369deaf59f82a1c7d01a40d5 diff --git a/packages/patrol/ios/patrol.podspec b/packages/patrol/ios/patrol.podspec index 90edb6d8b..f1cf942f2 100644 --- a/packages/patrol/ios/patrol.podspec +++ b/packages/patrol/ios/patrol.podspec @@ -23,7 +23,8 @@ Runs tests that use flutter_test and patrol APIs as native iOS integration tests # Flutter.framework does not contain a i386 slice. s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' } s.swift_version = '5.0' - + + s.dependency 'Telegraph', '~> 0.30.0' s.dependency 'gRPC-Swift', '~> 1.8.0' # This is the last version published on CocoaPods. # Newer ones are only available on SPM. end From 70161a90d20db5fe98f39cbf65fdad85dd2f9a62 Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Fri, 18 Aug 2023 18:22:51 +0200 Subject: [PATCH 014/110] Comment PatrolAppService in contracts.proto --- contracts.proto | 66 +-- .../AutomatorServer/contracts.grpc.swift | 384 ----------------- .../AutomatorServer/contracts.pb.swift | 328 --------------- .../src/native/contracts/contracts.pb.dart | 393 ------------------ .../native/contracts/contracts.pbenum.dart | 35 -- .../native/contracts/contracts.pbgrpc.dart | 69 --- .../native/contracts/contracts.pbjson.dart | 108 ----- schema.dart | 2 +- 8 files changed, 34 insertions(+), 1351 deletions(-) diff --git a/contracts.proto b/contracts.proto index ec95e6c16..bedc36929 100644 --- a/contracts.proto +++ b/contracts.proto @@ -3,39 +3,39 @@ package patrol; option java_package = "pl.leancode.patrol.contracts"; -service PatrolAppService { - rpc listDartTests(Empty) returns (ListDartTestsResponse) {} - rpc runDartTest(RunDartTestRequest) returns (RunDartTestResponse) {} -} - -message ListDartTestsResponse { - DartTestGroup group = 1; -} - -message DartTestGroup { - string name = 1; - repeated DartTestCase tests = 2; - repeated DartTestGroup groups = 3; -} - -message DartTestCase { - string name = 1; -} - -message RunDartTestRequest { - string name = 1; -} - -message RunDartTestResponse { - enum Result { - SUCCESS = 0; - SKIPPED = 1; - FAILURE = 2; - } - - Result result = 1; - optional string details = 2; -} +// service PatrolAppService { +// rpc listDartTests(Empty) returns (ListDartTestsResponse) {} +// rpc runDartTest(RunDartTestRequest) returns (RunDartTestResponse) {} +// } + +// message ListDartTestsResponse { +// DartTestGroup group = 1; +// } + +// message DartTestGroup { +// string name = 1; +// repeated DartTestCase tests = 2; +// repeated DartTestGroup groups = 3; +// } + +// message DartTestCase { +// string name = 1; +// } + +// message RunDartTestRequest { +// string name = 1; +// } + +// message RunDartTestResponse { +// enum Result { +// SUCCESS = 0; +// SKIPPED = 1; +// FAILURE = 2; +// } + +// Result result = 1; +// optional string details = 2; +// } service NativeAutomator { rpc initialize(Empty) returns (Empty) {} diff --git a/packages/patrol/ios/Classes/AutomatorServer/contracts.grpc.swift b/packages/patrol/ios/Classes/AutomatorServer/contracts.grpc.swift index 615148cc5..6b57213fb 100644 --- a/packages/patrol/ios/Classes/AutomatorServer/contracts.grpc.swift +++ b/packages/patrol/ios/Classes/AutomatorServer/contracts.grpc.swift @@ -11,250 +11,6 @@ import NIOConcurrencyHelpers import SwiftProtobuf -/// Usage: instantiate `Patrol_PatrolAppServiceClient`, then call methods of this protocol to make API calls. -internal protocol Patrol_PatrolAppServiceClientProtocol: GRPCClient { - var serviceName: String { get } - var interceptors: Patrol_PatrolAppServiceClientInterceptorFactoryProtocol? { get } - - func listDartTests( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> UnaryCall - - func runDartTest( - _ request: Patrol_RunDartTestRequest, - callOptions: CallOptions? - ) -> UnaryCall -} - -extension Patrol_PatrolAppServiceClientProtocol { - internal var serviceName: String { - return "patrol.PatrolAppService" - } - - /// Unary call to listDartTests - /// - /// - Parameters: - /// - request: Request to send to listDartTests. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func listDartTests( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_PatrolAppServiceClientMetadata.Methods.listDartTests.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makelistDartTestsInterceptors() ?? [] - ) - } - - /// Unary call to runDartTest - /// - /// - Parameters: - /// - request: Request to send to runDartTest. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func runDartTest( - _ request: Patrol_RunDartTestRequest, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_PatrolAppServiceClientMetadata.Methods.runDartTest.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makerunDartTestInterceptors() ?? [] - ) - } -} - -@available(*, deprecated) -extension Patrol_PatrolAppServiceClient: @unchecked Sendable {} - -@available(*, deprecated, renamed: "Patrol_PatrolAppServiceNIOClient") -internal final class Patrol_PatrolAppServiceClient: Patrol_PatrolAppServiceClientProtocol { - private let lock = Lock() - private var _defaultCallOptions: CallOptions - private var _interceptors: Patrol_PatrolAppServiceClientInterceptorFactoryProtocol? - internal let channel: GRPCChannel - internal var defaultCallOptions: CallOptions { - get { self.lock.withLock { return self._defaultCallOptions } } - set { self.lock.withLockVoid { self._defaultCallOptions = newValue } } - } - internal var interceptors: Patrol_PatrolAppServiceClientInterceptorFactoryProtocol? { - get { self.lock.withLock { return self._interceptors } } - set { self.lock.withLockVoid { self._interceptors = newValue } } - } - - /// Creates a client for the patrol.PatrolAppService service. - /// - /// - Parameters: - /// - channel: `GRPCChannel` to the service host. - /// - defaultCallOptions: Options to use for each service call if the user doesn't provide them. - /// - interceptors: A factory providing interceptors for each RPC. - internal init( - channel: GRPCChannel, - defaultCallOptions: CallOptions = CallOptions(), - interceptors: Patrol_PatrolAppServiceClientInterceptorFactoryProtocol? = nil - ) { - self.channel = channel - self._defaultCallOptions = defaultCallOptions - self._interceptors = interceptors - } -} - -internal struct Patrol_PatrolAppServiceNIOClient: Patrol_PatrolAppServiceClientProtocol { - internal var channel: GRPCChannel - internal var defaultCallOptions: CallOptions - internal var interceptors: Patrol_PatrolAppServiceClientInterceptorFactoryProtocol? - - /// Creates a client for the patrol.PatrolAppService service. - /// - /// - Parameters: - /// - channel: `GRPCChannel` to the service host. - /// - defaultCallOptions: Options to use for each service call if the user doesn't provide them. - /// - interceptors: A factory providing interceptors for each RPC. - internal init( - channel: GRPCChannel, - defaultCallOptions: CallOptions = CallOptions(), - interceptors: Patrol_PatrolAppServiceClientInterceptorFactoryProtocol? = nil - ) { - self.channel = channel - self.defaultCallOptions = defaultCallOptions - self.interceptors = interceptors - } -} - -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -internal protocol Patrol_PatrolAppServiceAsyncClientProtocol: GRPCClient { - static var serviceDescriptor: GRPCServiceDescriptor { get } - var interceptors: Patrol_PatrolAppServiceClientInterceptorFactoryProtocol? { get } - - func makeListDartTestsCall( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeRunDartTestCall( - _ request: Patrol_RunDartTestRequest, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall -} - -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -extension Patrol_PatrolAppServiceAsyncClientProtocol { - internal static var serviceDescriptor: GRPCServiceDescriptor { - return Patrol_PatrolAppServiceClientMetadata.serviceDescriptor - } - - internal var interceptors: Patrol_PatrolAppServiceClientInterceptorFactoryProtocol? { - return nil - } - - internal func makeListDartTestsCall( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_PatrolAppServiceClientMetadata.Methods.listDartTests.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makelistDartTestsInterceptors() ?? [] - ) - } - - internal func makeRunDartTestCall( - _ request: Patrol_RunDartTestRequest, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_PatrolAppServiceClientMetadata.Methods.runDartTest.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makerunDartTestInterceptors() ?? [] - ) - } -} - -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -extension Patrol_PatrolAppServiceAsyncClientProtocol { - internal func listDartTests( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) async throws -> Patrol_ListDartTestsResponse { - return try await self.performAsyncUnaryCall( - path: Patrol_PatrolAppServiceClientMetadata.Methods.listDartTests.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makelistDartTestsInterceptors() ?? [] - ) - } - - internal func runDartTest( - _ request: Patrol_RunDartTestRequest, - callOptions: CallOptions? = nil - ) async throws -> Patrol_RunDartTestResponse { - return try await self.performAsyncUnaryCall( - path: Patrol_PatrolAppServiceClientMetadata.Methods.runDartTest.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makerunDartTestInterceptors() ?? [] - ) - } -} - -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -internal struct Patrol_PatrolAppServiceAsyncClient: Patrol_PatrolAppServiceAsyncClientProtocol { - internal var channel: GRPCChannel - internal var defaultCallOptions: CallOptions - internal var interceptors: Patrol_PatrolAppServiceClientInterceptorFactoryProtocol? - - internal init( - channel: GRPCChannel, - defaultCallOptions: CallOptions = CallOptions(), - interceptors: Patrol_PatrolAppServiceClientInterceptorFactoryProtocol? = nil - ) { - self.channel = channel - self.defaultCallOptions = defaultCallOptions - self.interceptors = interceptors - } -} - -internal protocol Patrol_PatrolAppServiceClientInterceptorFactoryProtocol: Sendable { - - /// - Returns: Interceptors to use when invoking 'listDartTests'. - func makelistDartTestsInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'runDartTest'. - func makerunDartTestInterceptors() -> [ClientInterceptor] -} - -internal enum Patrol_PatrolAppServiceClientMetadata { - internal static let serviceDescriptor = GRPCServiceDescriptor( - name: "PatrolAppService", - fullName: "patrol.PatrolAppService", - methods: [ - Patrol_PatrolAppServiceClientMetadata.Methods.listDartTests, - Patrol_PatrolAppServiceClientMetadata.Methods.runDartTest, - ] - ) - - internal enum Methods { - internal static let listDartTests = GRPCMethodDescriptor( - name: "listDartTests", - path: "/patrol.PatrolAppService/listDartTests", - type: GRPCCallType.unary - ) - - internal static let runDartTest = GRPCMethodDescriptor( - name: "runDartTest", - path: "/patrol.PatrolAppService/runDartTest", - type: GRPCCallType.unary - ) - } -} - /// Usage: instantiate `Patrol_NativeAutomatorClient`, then call methods of this protocol to make API calls. internal protocol Patrol_NativeAutomatorClientProtocol: GRPCClient { var serviceName: String { get } @@ -2483,146 +2239,6 @@ internal enum Patrol_NativeAutomatorClientMetadata { } } -/// To build a server, implement a class that conforms to this protocol. -internal protocol Patrol_PatrolAppServiceProvider: CallHandlerProvider { - var interceptors: Patrol_PatrolAppServiceServerInterceptorFactoryProtocol? { get } - - func listDartTests(request: Patrol_Empty, context: StatusOnlyCallContext) -> EventLoopFuture - - func runDartTest(request: Patrol_RunDartTestRequest, context: StatusOnlyCallContext) -> EventLoopFuture -} - -extension Patrol_PatrolAppServiceProvider { - internal var serviceName: Substring { - return Patrol_PatrolAppServiceServerMetadata.serviceDescriptor.fullName[...] - } - - /// Determines, calls and returns the appropriate request handler, depending on the request's method. - /// Returns nil for methods not handled by this service. - internal func handle( - method name: Substring, - context: CallHandlerContext - ) -> GRPCServerHandlerProtocol? { - switch name { - case "listDartTests": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makelistDartTestsInterceptors() ?? [], - userFunction: self.listDartTests(request:context:) - ) - - case "runDartTest": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makerunDartTestInterceptors() ?? [], - userFunction: self.runDartTest(request:context:) - ) - - default: - return nil - } - } -} - -/// To implement a server, implement an object which conforms to this protocol. -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -internal protocol Patrol_PatrolAppServiceAsyncProvider: CallHandlerProvider, Sendable { - static var serviceDescriptor: GRPCServiceDescriptor { get } - var interceptors: Patrol_PatrolAppServiceServerInterceptorFactoryProtocol? { get } - - func listDartTests( - request: Patrol_Empty, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_ListDartTestsResponse - - func runDartTest( - request: Patrol_RunDartTestRequest, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_RunDartTestResponse -} - -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -extension Patrol_PatrolAppServiceAsyncProvider { - internal static var serviceDescriptor: GRPCServiceDescriptor { - return Patrol_PatrolAppServiceServerMetadata.serviceDescriptor - } - - internal var serviceName: Substring { - return Patrol_PatrolAppServiceServerMetadata.serviceDescriptor.fullName[...] - } - - internal var interceptors: Patrol_PatrolAppServiceServerInterceptorFactoryProtocol? { - return nil - } - - internal func handle( - method name: Substring, - context: CallHandlerContext - ) -> GRPCServerHandlerProtocol? { - switch name { - case "listDartTests": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makelistDartTestsInterceptors() ?? [], - wrapping: { try await self.listDartTests(request: $0, context: $1) } - ) - - case "runDartTest": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makerunDartTestInterceptors() ?? [], - wrapping: { try await self.runDartTest(request: $0, context: $1) } - ) - - default: - return nil - } - } -} - -internal protocol Patrol_PatrolAppServiceServerInterceptorFactoryProtocol: Sendable { - - /// - Returns: Interceptors to use when handling 'listDartTests'. - /// Defaults to calling `self.makeInterceptors()`. - func makelistDartTestsInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'runDartTest'. - /// Defaults to calling `self.makeInterceptors()`. - func makerunDartTestInterceptors() -> [ServerInterceptor] -} - -internal enum Patrol_PatrolAppServiceServerMetadata { - internal static let serviceDescriptor = GRPCServiceDescriptor( - name: "PatrolAppService", - fullName: "patrol.PatrolAppService", - methods: [ - Patrol_PatrolAppServiceServerMetadata.Methods.listDartTests, - Patrol_PatrolAppServiceServerMetadata.Methods.runDartTest, - ] - ) - - internal enum Methods { - internal static let listDartTests = GRPCMethodDescriptor( - name: "listDartTests", - path: "/patrol.PatrolAppService/listDartTests", - type: GRPCCallType.unary - ) - - internal static let runDartTest = GRPCMethodDescriptor( - name: "runDartTest", - path: "/patrol.PatrolAppService/runDartTest", - type: GRPCCallType.unary - ) - } -} /// To build a server, implement a class that conforms to this protocol. internal protocol Patrol_NativeAutomatorProvider: CallHandlerProvider { var interceptors: Patrol_NativeAutomatorServerInterceptorFactoryProtocol? { get } diff --git a/packages/patrol/ios/Classes/AutomatorServer/contracts.pb.swift b/packages/patrol/ios/Classes/AutomatorServer/contracts.pb.swift index 3be68b05f..9de608b87 100644 --- a/packages/patrol/ios/Classes/AutomatorServer/contracts.pb.swift +++ b/packages/patrol/ios/Classes/AutomatorServer/contracts.pb.swift @@ -20,134 +20,6 @@ fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAP typealias Version = _2 } -public struct Patrol_ListDartTestsResponse { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var group: Patrol_DartTestGroup { - get {return _group ?? Patrol_DartTestGroup()} - set {_group = newValue} - } - /// Returns true if `group` has been explicitly set. - public var hasGroup: Bool {return self._group != nil} - /// Clears the value of `group`. Subsequent reads from it will return its default value. - public mutating func clearGroup() {self._group = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _group: Patrol_DartTestGroup? = nil -} - -public struct Patrol_DartTestGroup { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var name: String = String() - - public var tests: [Patrol_DartTestCase] = [] - - public var groups: [Patrol_DartTestGroup] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -public struct Patrol_DartTestCase { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var name: String = String() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -public struct Patrol_RunDartTestRequest { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var name: String = String() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -public struct Patrol_RunDartTestResponse { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Patrol_RunDartTestResponse.Result = .success - - public var details: String { - get {return _details ?? String()} - set {_details = newValue} - } - /// Returns true if `details` has been explicitly set. - public var hasDetails: Bool {return self._details != nil} - /// Clears the value of `details`. Subsequent reads from it will return its default value. - public mutating func clearDetails() {self._details = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum { - public typealias RawValue = Int - case success // = 0 - case skipped // = 1 - case failure // = 2 - case UNRECOGNIZED(Int) - - public init() { - self = .success - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .success - case 1: self = .skipped - case 2: self = .failure - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .success: return 0 - case .skipped: return 1 - case .failure: return 2 - case .UNRECOGNIZED(let i): return i - } - } - - } - - public init() {} - - fileprivate var _details: String? = nil -} - -#if swift(>=4.2) - -extension Patrol_RunDartTestResponse.Result: CaseIterable { - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static var allCases: [Patrol_RunDartTestResponse.Result] = [ - .success, - .skipped, - .failure, - ] -} - -#endif // swift(>=4.2) - public struct Patrol_ConfigureRequest { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -779,12 +651,6 @@ public struct Patrol_SubmitTestResultsRequest { } #if swift(>=5.5) && canImport(_Concurrency) -extension Patrol_ListDartTestsResponse: @unchecked Sendable {} -extension Patrol_DartTestGroup: @unchecked Sendable {} -extension Patrol_DartTestCase: @unchecked Sendable {} -extension Patrol_RunDartTestRequest: @unchecked Sendable {} -extension Patrol_RunDartTestResponse: @unchecked Sendable {} -extension Patrol_RunDartTestResponse.Result: @unchecked Sendable {} extension Patrol_ConfigureRequest: @unchecked Sendable {} extension Patrol_OpenAppRequest: @unchecked Sendable {} extension Patrol_TapOnNotificationRequest: @unchecked Sendable {} @@ -817,200 +683,6 @@ extension Patrol_SubmitTestResultsRequest: @unchecked Sendable {} fileprivate let _protobuf_package = "patrol" -extension Patrol_ListDartTestsResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".ListDartTestsResponse" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "group"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._group) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._group { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Patrol_ListDartTestsResponse, rhs: Patrol_ListDartTestsResponse) -> Bool { - if lhs._group != rhs._group {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Patrol_DartTestGroup: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".DartTestGroup" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "name"), - 2: .same(proto: "tests"), - 3: .same(proto: "groups"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.name) }() - case 2: try { try decoder.decodeRepeatedMessageField(value: &self.tests) }() - case 3: try { try decoder.decodeRepeatedMessageField(value: &self.groups) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.name.isEmpty { - try visitor.visitSingularStringField(value: self.name, fieldNumber: 1) - } - if !self.tests.isEmpty { - try visitor.visitRepeatedMessageField(value: self.tests, fieldNumber: 2) - } - if !self.groups.isEmpty { - try visitor.visitRepeatedMessageField(value: self.groups, fieldNumber: 3) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Patrol_DartTestGroup, rhs: Patrol_DartTestGroup) -> Bool { - if lhs.name != rhs.name {return false} - if lhs.tests != rhs.tests {return false} - if lhs.groups != rhs.groups {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Patrol_DartTestCase: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".DartTestCase" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "name"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.name) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.name.isEmpty { - try visitor.visitSingularStringField(value: self.name, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Patrol_DartTestCase, rhs: Patrol_DartTestCase) -> Bool { - if lhs.name != rhs.name {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Patrol_RunDartTestRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".RunDartTestRequest" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "name"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.name) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.name.isEmpty { - try visitor.visitSingularStringField(value: self.name, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Patrol_RunDartTestRequest, rhs: Patrol_RunDartTestRequest) -> Bool { - if lhs.name != rhs.name {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Patrol_RunDartTestResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".RunDartTestResponse" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "result"), - 2: .same(proto: "details"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - case 2: try { try decoder.decodeSingularStringField(value: &self._details) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if self.result != .success { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - try { if let v = self._details { - try visitor.visitSingularStringField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Patrol_RunDartTestResponse, rhs: Patrol_RunDartTestResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs._details != rhs._details {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Patrol_RunDartTestResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "SUCCESS"), - 1: .same(proto: "SKIPPED"), - 2: .same(proto: "FAILURE"), - ] -} - extension Patrol_ConfigureRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { public static let protoMessageName: String = _protobuf_package + ".ConfigureRequest" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ diff --git a/packages/patrol/lib/src/native/contracts/contracts.pb.dart b/packages/patrol/lib/src/native/contracts/contracts.pb.dart index 89e8711e6..582cf52bb 100644 --- a/packages/patrol/lib/src/native/contracts/contracts.pb.dart +++ b/packages/patrol/lib/src/native/contracts/contracts.pb.dart @@ -14,399 +14,6 @@ import 'contracts.pbenum.dart'; export 'contracts.pbenum.dart'; -class ListDartTestsResponse extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'ListDartTestsResponse', - package: const $pb.PackageName( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'patrol'), - createEmptyInstance: create) - ..aOM( - 1, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'group', - subBuilder: DartTestGroup.create) - ..hasRequiredFields = false; - - ListDartTestsResponse._() : super(); - factory ListDartTestsResponse({ - DartTestGroup? group, - }) { - final _result = create(); - if (group != null) { - _result.group = group; - } - return _result; - } - factory ListDartTestsResponse.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - factory ListDartTestsResponse.fromJson($core.String i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromJson(i, r); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - ListDartTestsResponse clone() => - ListDartTestsResponse()..mergeFromMessage(this); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - ListDartTestsResponse copyWith( - void Function(ListDartTestsResponse) updates) => - super.copyWith((message) => updates(message as ListDartTestsResponse)) - as ListDartTestsResponse; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static ListDartTestsResponse create() => ListDartTestsResponse._(); - ListDartTestsResponse createEmptyInstance() => create(); - static $pb.PbList createRepeated() => - $pb.PbList(); - @$core.pragma('dart2js:noInline') - static ListDartTestsResponse getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor(create); - static ListDartTestsResponse? _defaultInstance; - - @$pb.TagNumber(1) - DartTestGroup get group => $_getN(0); - @$pb.TagNumber(1) - set group(DartTestGroup v) { - setField(1, v); - } - - @$pb.TagNumber(1) - $core.bool hasGroup() => $_has(0); - @$pb.TagNumber(1) - void clearGroup() => clearField(1); - @$pb.TagNumber(1) - DartTestGroup ensureGroup() => $_ensure(0); -} - -class DartTestGroup extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'DartTestGroup', - package: const $pb.PackageName( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'patrol'), - createEmptyInstance: create) - ..aOS( - 1, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'name') - ..pc( - 2, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'tests', - $pb.PbFieldType.PM, - subBuilder: DartTestCase.create) - ..pc( - 3, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'groups', - $pb.PbFieldType.PM, - subBuilder: DartTestGroup.create) - ..hasRequiredFields = false; - - DartTestGroup._() : super(); - factory DartTestGroup({ - $core.String? name, - $core.Iterable? tests, - $core.Iterable? groups, - }) { - final _result = create(); - if (name != null) { - _result.name = name; - } - if (tests != null) { - _result.tests.addAll(tests); - } - if (groups != null) { - _result.groups.addAll(groups); - } - return _result; - } - factory DartTestGroup.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - factory DartTestGroup.fromJson($core.String i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromJson(i, r); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - DartTestGroup clone() => DartTestGroup()..mergeFromMessage(this); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - DartTestGroup copyWith(void Function(DartTestGroup) updates) => - super.copyWith((message) => updates(message as DartTestGroup)) - as DartTestGroup; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static DartTestGroup create() => DartTestGroup._(); - DartTestGroup createEmptyInstance() => create(); - static $pb.PbList createRepeated() => - $pb.PbList(); - @$core.pragma('dart2js:noInline') - static DartTestGroup getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor(create); - static DartTestGroup? _defaultInstance; - - @$pb.TagNumber(1) - $core.String get name => $_getSZ(0); - @$pb.TagNumber(1) - set name($core.String v) { - $_setString(0, v); - } - - @$pb.TagNumber(1) - $core.bool hasName() => $_has(0); - @$pb.TagNumber(1) - void clearName() => clearField(1); - - @$pb.TagNumber(2) - $core.List get tests => $_getList(1); - - @$pb.TagNumber(3) - $core.List get groups => $_getList(2); -} - -class DartTestCase extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'DartTestCase', - package: const $pb.PackageName( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'patrol'), - createEmptyInstance: create) - ..aOS( - 1, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'name') - ..hasRequiredFields = false; - - DartTestCase._() : super(); - factory DartTestCase({ - $core.String? name, - }) { - final _result = create(); - if (name != null) { - _result.name = name; - } - return _result; - } - factory DartTestCase.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - factory DartTestCase.fromJson($core.String i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromJson(i, r); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - DartTestCase clone() => DartTestCase()..mergeFromMessage(this); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - DartTestCase copyWith(void Function(DartTestCase) updates) => - super.copyWith((message) => updates(message as DartTestCase)) - as DartTestCase; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static DartTestCase create() => DartTestCase._(); - DartTestCase createEmptyInstance() => create(); - static $pb.PbList createRepeated() => - $pb.PbList(); - @$core.pragma('dart2js:noInline') - static DartTestCase getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor(create); - static DartTestCase? _defaultInstance; - - @$pb.TagNumber(1) - $core.String get name => $_getSZ(0); - @$pb.TagNumber(1) - set name($core.String v) { - $_setString(0, v); - } - - @$pb.TagNumber(1) - $core.bool hasName() => $_has(0); - @$pb.TagNumber(1) - void clearName() => clearField(1); -} - -class RunDartTestRequest extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'RunDartTestRequest', - package: const $pb.PackageName( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'patrol'), - createEmptyInstance: create) - ..aOS( - 1, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'name') - ..hasRequiredFields = false; - - RunDartTestRequest._() : super(); - factory RunDartTestRequest({ - $core.String? name, - }) { - final _result = create(); - if (name != null) { - _result.name = name; - } - return _result; - } - factory RunDartTestRequest.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - factory RunDartTestRequest.fromJson($core.String i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromJson(i, r); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - RunDartTestRequest clone() => RunDartTestRequest()..mergeFromMessage(this); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - RunDartTestRequest copyWith(void Function(RunDartTestRequest) updates) => - super.copyWith((message) => updates(message as RunDartTestRequest)) - as RunDartTestRequest; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static RunDartTestRequest create() => RunDartTestRequest._(); - RunDartTestRequest createEmptyInstance() => create(); - static $pb.PbList createRepeated() => - $pb.PbList(); - @$core.pragma('dart2js:noInline') - static RunDartTestRequest getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor(create); - static RunDartTestRequest? _defaultInstance; - - @$pb.TagNumber(1) - $core.String get name => $_getSZ(0); - @$pb.TagNumber(1) - set name($core.String v) { - $_setString(0, v); - } - - @$pb.TagNumber(1) - $core.bool hasName() => $_has(0); - @$pb.TagNumber(1) - void clearName() => clearField(1); -} - -class RunDartTestResponse extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'RunDartTestResponse', - package: const $pb.PackageName( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'patrol'), - createEmptyInstance: create) - ..e( - 1, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'result', - $pb.PbFieldType.OE, - defaultOrMaker: RunDartTestResponse_Result.SUCCESS, - valueOf: RunDartTestResponse_Result.valueOf, - enumValues: RunDartTestResponse_Result.values) - ..aOS( - 2, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'details') - ..hasRequiredFields = false; - - RunDartTestResponse._() : super(); - factory RunDartTestResponse({ - RunDartTestResponse_Result? result, - $core.String? details, - }) { - final _result = create(); - if (result != null) { - _result.result = result; - } - if (details != null) { - _result.details = details; - } - return _result; - } - factory RunDartTestResponse.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - factory RunDartTestResponse.fromJson($core.String i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromJson(i, r); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - RunDartTestResponse clone() => RunDartTestResponse()..mergeFromMessage(this); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - RunDartTestResponse copyWith(void Function(RunDartTestResponse) updates) => - super.copyWith((message) => updates(message as RunDartTestResponse)) - as RunDartTestResponse; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static RunDartTestResponse create() => RunDartTestResponse._(); - RunDartTestResponse createEmptyInstance() => create(); - static $pb.PbList createRepeated() => - $pb.PbList(); - @$core.pragma('dart2js:noInline') - static RunDartTestResponse getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor(create); - static RunDartTestResponse? _defaultInstance; - - @$pb.TagNumber(1) - RunDartTestResponse_Result get result => $_getN(0); - @$pb.TagNumber(1) - set result(RunDartTestResponse_Result v) { - setField(1, v); - } - - @$pb.TagNumber(1) - $core.bool hasResult() => $_has(0); - @$pb.TagNumber(1) - void clearResult() => clearField(1); - - @$pb.TagNumber(2) - $core.String get details => $_getSZ(1); - @$pb.TagNumber(2) - set details($core.String v) { - $_setString(1, v); - } - - @$pb.TagNumber(2) - $core.bool hasDetails() => $_has(1); - @$pb.TagNumber(2) - void clearDetails() => clearField(2); -} - class ConfigureRequest extends $pb.GeneratedMessage { static final $pb.BuilderInfo _i = $pb.BuilderInfo( const $core.bool.fromEnvironment('protobuf.omit_message_names') diff --git a/packages/patrol/lib/src/native/contracts/contracts.pbenum.dart b/packages/patrol/lib/src/native/contracts/contracts.pbenum.dart index 05170df17..9500cec6e 100644 --- a/packages/patrol/lib/src/native/contracts/contracts.pbenum.dart +++ b/packages/patrol/lib/src/native/contracts/contracts.pbenum.dart @@ -9,41 +9,6 @@ import 'dart:core' as $core; import 'package:protobuf/protobuf.dart' as $pb; -class RunDartTestResponse_Result extends $pb.ProtobufEnum { - static const RunDartTestResponse_Result SUCCESS = - RunDartTestResponse_Result._( - 0, - const $core.bool.fromEnvironment('protobuf.omit_enum_names') - ? '' - : 'SUCCESS'); - static const RunDartTestResponse_Result SKIPPED = - RunDartTestResponse_Result._( - 1, - const $core.bool.fromEnvironment('protobuf.omit_enum_names') - ? '' - : 'SKIPPED'); - static const RunDartTestResponse_Result FAILURE = - RunDartTestResponse_Result._( - 2, - const $core.bool.fromEnvironment('protobuf.omit_enum_names') - ? '' - : 'FAILURE'); - - static const $core.List values = - [ - SUCCESS, - SKIPPED, - FAILURE, - ]; - - static final $core.Map<$core.int, RunDartTestResponse_Result> _byValue = - $pb.ProtobufEnum.initByValue(values); - static RunDartTestResponse_Result? valueOf($core.int value) => - _byValue[value]; - - const RunDartTestResponse_Result._($core.int v, $core.String n) : super(v, n); -} - class HandlePermissionRequest_Code extends $pb.ProtobufEnum { static const HandlePermissionRequest_Code WHILE_USING = HandlePermissionRequest_Code._( diff --git a/packages/patrol/lib/src/native/contracts/contracts.pbgrpc.dart b/packages/patrol/lib/src/native/contracts/contracts.pbgrpc.dart index 390d0f1b8..a5d838ec8 100644 --- a/packages/patrol/lib/src/native/contracts/contracts.pbgrpc.dart +++ b/packages/patrol/lib/src/native/contracts/contracts.pbgrpc.dart @@ -13,75 +13,6 @@ import 'package:grpc/service_api.dart' as $grpc; import 'contracts.pb.dart' as $0; export 'contracts.pb.dart'; -class PatrolAppServiceClient extends $grpc.Client { - static final _$listDartTests = - $grpc.ClientMethod<$0.Empty, $0.ListDartTestsResponse>( - '/patrol.PatrolAppService/listDartTests', - ($0.Empty value) => value.writeToBuffer(), - ($core.List<$core.int> value) => - $0.ListDartTestsResponse.fromBuffer(value)); - static final _$runDartTest = - $grpc.ClientMethod<$0.RunDartTestRequest, $0.RunDartTestResponse>( - '/patrol.PatrolAppService/runDartTest', - ($0.RunDartTestRequest value) => value.writeToBuffer(), - ($core.List<$core.int> value) => - $0.RunDartTestResponse.fromBuffer(value)); - - PatrolAppServiceClient($grpc.ClientChannel channel, - {$grpc.CallOptions? options, - $core.Iterable<$grpc.ClientInterceptor>? interceptors}) - : super(channel, options: options, interceptors: interceptors); - - $grpc.ResponseFuture<$0.ListDartTestsResponse> listDartTests($0.Empty request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$listDartTests, request, options: options); - } - - $grpc.ResponseFuture<$0.RunDartTestResponse> runDartTest( - $0.RunDartTestRequest request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$runDartTest, request, options: options); - } -} - -abstract class PatrolAppServiceBase extends $grpc.Service { - $core.String get $name => 'patrol.PatrolAppService'; - - PatrolAppServiceBase() { - $addMethod($grpc.ServiceMethod<$0.Empty, $0.ListDartTestsResponse>( - 'listDartTests', - listDartTests_Pre, - false, - false, - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value), - ($0.ListDartTestsResponse value) => value.writeToBuffer())); - $addMethod( - $grpc.ServiceMethod<$0.RunDartTestRequest, $0.RunDartTestResponse>( - 'runDartTest', - runDartTest_Pre, - false, - false, - ($core.List<$core.int> value) => - $0.RunDartTestRequest.fromBuffer(value), - ($0.RunDartTestResponse value) => value.writeToBuffer())); - } - - $async.Future<$0.ListDartTestsResponse> listDartTests_Pre( - $grpc.ServiceCall call, $async.Future<$0.Empty> request) async { - return listDartTests(call, await request); - } - - $async.Future<$0.RunDartTestResponse> runDartTest_Pre($grpc.ServiceCall call, - $async.Future<$0.RunDartTestRequest> request) async { - return runDartTest(call, await request); - } - - $async.Future<$0.ListDartTestsResponse> listDartTests( - $grpc.ServiceCall call, $0.Empty request); - $async.Future<$0.RunDartTestResponse> runDartTest( - $grpc.ServiceCall call, $0.RunDartTestRequest request); -} - class NativeAutomatorClient extends $grpc.Client { static final _$initialize = $grpc.ClientMethod<$0.Empty, $0.Empty>( '/patrol.NativeAutomator/initialize', diff --git a/packages/patrol/lib/src/native/contracts/contracts.pbjson.dart b/packages/patrol/lib/src/native/contracts/contracts.pbjson.dart index 3a749a5a4..c5f902f05 100644 --- a/packages/patrol/lib/src/native/contracts/contracts.pbjson.dart +++ b/packages/patrol/lib/src/native/contracts/contracts.pbjson.dart @@ -9,114 +9,6 @@ import 'dart:core' as $core; import 'dart:convert' as $convert; import 'dart:typed_data' as $typed_data; -@$core.Deprecated('Use listDartTestsResponseDescriptor instead') -const ListDartTestsResponse$json = const { - '1': 'ListDartTestsResponse', - '2': const [ - const { - '1': 'group', - '3': 1, - '4': 1, - '5': 11, - '6': '.patrol.DartTestGroup', - '10': 'group' - }, - ], -}; - -/// Descriptor for `ListDartTestsResponse`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List listDartTestsResponseDescriptor = $convert.base64Decode( - 'ChVMaXN0RGFydFRlc3RzUmVzcG9uc2USKwoFZ3JvdXAYASABKAsyFS5wYXRyb2wuRGFydFRlc3RHcm91cFIFZ3JvdXA='); -@$core.Deprecated('Use dartTestGroupDescriptor instead') -const DartTestGroup$json = const { - '1': 'DartTestGroup', - '2': const [ - const {'1': 'name', '3': 1, '4': 1, '5': 9, '10': 'name'}, - const { - '1': 'tests', - '3': 2, - '4': 3, - '5': 11, - '6': '.patrol.DartTestCase', - '10': 'tests' - }, - const { - '1': 'groups', - '3': 3, - '4': 3, - '5': 11, - '6': '.patrol.DartTestGroup', - '10': 'groups' - }, - ], -}; - -/// Descriptor for `DartTestGroup`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List dartTestGroupDescriptor = $convert.base64Decode( - 'Cg1EYXJ0VGVzdEdyb3VwEhIKBG5hbWUYASABKAlSBG5hbWUSKgoFdGVzdHMYAiADKAsyFC5wYXRyb2wuRGFydFRlc3RDYXNlUgV0ZXN0cxItCgZncm91cHMYAyADKAsyFS5wYXRyb2wuRGFydFRlc3RHcm91cFIGZ3JvdXBz'); -@$core.Deprecated('Use dartTestCaseDescriptor instead') -const DartTestCase$json = const { - '1': 'DartTestCase', - '2': const [ - const {'1': 'name', '3': 1, '4': 1, '5': 9, '10': 'name'}, - ], -}; - -/// Descriptor for `DartTestCase`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List dartTestCaseDescriptor = - $convert.base64Decode('CgxEYXJ0VGVzdENhc2USEgoEbmFtZRgBIAEoCVIEbmFtZQ=='); -@$core.Deprecated('Use runDartTestRequestDescriptor instead') -const RunDartTestRequest$json = const { - '1': 'RunDartTestRequest', - '2': const [ - const {'1': 'name', '3': 1, '4': 1, '5': 9, '10': 'name'}, - ], -}; - -/// Descriptor for `RunDartTestRequest`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List runDartTestRequestDescriptor = $convert - .base64Decode('ChJSdW5EYXJ0VGVzdFJlcXVlc3QSEgoEbmFtZRgBIAEoCVIEbmFtZQ=='); -@$core.Deprecated('Use runDartTestResponseDescriptor instead') -const RunDartTestResponse$json = const { - '1': 'RunDartTestResponse', - '2': const [ - const { - '1': 'result', - '3': 1, - '4': 1, - '5': 14, - '6': '.patrol.RunDartTestResponse.Result', - '10': 'result' - }, - const { - '1': 'details', - '3': 2, - '4': 1, - '5': 9, - '9': 0, - '10': 'details', - '17': true - }, - ], - '4': const [RunDartTestResponse_Result$json], - '8': const [ - const {'1': '_details'}, - ], -}; - -@$core.Deprecated('Use runDartTestResponseDescriptor instead') -const RunDartTestResponse_Result$json = const { - '1': 'Result', - '2': const [ - const {'1': 'SUCCESS', '2': 0}, - const {'1': 'SKIPPED', '2': 1}, - const {'1': 'FAILURE', '2': 2}, - ], -}; - -/// Descriptor for `RunDartTestResponse`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List runDartTestResponseDescriptor = $convert.base64Decode( - 'ChNSdW5EYXJ0VGVzdFJlc3BvbnNlEjoKBnJlc3VsdBgBIAEoDjIiLnBhdHJvbC5SdW5EYXJ0VGVzdFJlc3BvbnNlLlJlc3VsdFIGcmVzdWx0Eh0KB2RldGFpbHMYAiABKAlIAFIHZGV0YWlsc4gBASIvCgZSZXN1bHQSCwoHU1VDQ0VTUxAAEgsKB1NLSVBQRUQQARILCgdGQUlMVVJFEAJCCgoIX2RldGFpbHM='); @$core.Deprecated('Use configureRequestDescriptor instead') const ConfigureRequest$json = const { '1': 'ConfigureRequest', diff --git a/schema.dart b/schema.dart index d15044ab4..79bb18cb6 100644 --- a/schema.dart +++ b/schema.dart @@ -5,7 +5,7 @@ class DartTestCase { class DartTestGroup { String? name; List? tests; - List? groups; + late List groups; } class ListDartTestsResponse { From ae36c7f76583e45d7b1cba6e584d6a46ff8fa195 Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Fri, 18 Aug 2023 18:26:29 +0200 Subject: [PATCH 015/110] Add shelf server generator --- packages/patrol/lib/src/common.dart | 7 +- .../lib/src/native/contracts/contracts.dart | 453 ++++++++++++++++++ .../lib/src/native/contracts/contracts.g.dart | 385 +++++++++++++++ .../contracts/patrol_app_service_server.dart | 38 ++ .../lib/src/native/patrol_app_service.dart | 36 +- packages/patrol/pubspec.yaml | 1 + packages/patrol/test/internals_test.dart | 14 +- packages/patrol_cli/lib/src/test_bundler.dart | 2 +- .../lib/src/generators/dart/dart_config.dart | 10 + .../dart/dart_contracts_generator.dart | 75 +++ .../src/generators/dart/dart_generator.dart | 77 +-- .../dart/dart_shelf_server_generator.dart | 100 ++++ .../lib/src/generators/ios/ios_generator.dart | 16 +- .../lib/src/generators/output_file.dart | 6 + packages/patrol_gen/lib/src/patrol_gen.dart | 9 +- 15 files changed, 1126 insertions(+), 103 deletions(-) create mode 100644 packages/patrol/lib/src/native/contracts/contracts.dart create mode 100644 packages/patrol/lib/src/native/contracts/contracts.g.dart create mode 100644 packages/patrol/lib/src/native/contracts/patrol_app_service_server.dart create mode 100644 packages/patrol_gen/lib/src/generators/dart/dart_contracts_generator.dart create mode 100644 packages/patrol_gen/lib/src/generators/dart/dart_shelf_server_generator.dart create mode 100644 packages/patrol_gen/lib/src/generators/output_file.dart diff --git a/packages/patrol/lib/src/common.dart b/packages/patrol/lib/src/common.dart index a981650f8..b714a7080 100644 --- a/packages/patrol/lib/src/common.dart +++ b/packages/patrol/lib/src/common.dart @@ -7,8 +7,7 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:integration_test/integration_test.dart'; import 'package:meta/meta.dart'; import 'package:patrol/src/binding.dart'; -import 'package:patrol/src/native/contracts/contracts.pb.dart'; -import 'package:patrol/src/native/contracts/contracts.pbgrpc.dart'; +import 'package:patrol/src/native/contracts/contracts.dart'; import 'package:patrol/src/native/native.dart'; import 'package:patrol_finders/patrol_finders.dart' as finders; import 'package:test_api/src/backend/group.dart'; @@ -162,11 +161,11 @@ DartTestGroup createDartTestGroup( String prefix = '', }) { final groupName = topLevelGroup.name.replaceFirst(prefix, '').trim(); - final group = DartTestGroup(name: groupName); + final group = DartTestGroup(name: groupName, groups: []); for (final entry in topLevelGroup.entries) { if (entry is Group) { - group.groups.add(DartTestGroup(name: entry.name)); + group.groups.add(DartTestGroup(name: entry.name, groups: [])); } if (entry is Test && entry.name != 'patrol_test_explorer') { diff --git a/packages/patrol/lib/src/native/contracts/contracts.dart b/packages/patrol/lib/src/native/contracts/contracts.dart new file mode 100644 index 000000000..2fa27060b --- /dev/null +++ b/packages/patrol/lib/src/native/contracts/contracts.dart @@ -0,0 +1,453 @@ +// +// Generated code. Do not modify. +// source: schema.dart +// +// ignore_for_file: public_member_api_docs + +import 'package:json_annotation/json_annotation.dart'; + +part 'contracts.g.dart'; + +enum RunDartTestResponseResult { + @JsonValue('success') + success, + @JsonValue('skipped') + skipped, + @JsonValue('failure') + failure +} + +enum HandlePermissionRequestCode { + @JsonValue('whileUsing') + whileUsing, + @JsonValue('onlyThisTime') + onlyThisTime, + @JsonValue('denied') + denied +} + +enum SetLocationAccuracyRequestLocationAccuracy { + @JsonValue('coarse') + coarse, + @JsonValue('fine') + fine +} + +@JsonSerializable() +class DartTestCase { + DartTestCase({ + required this.name, + }); + + factory DartTestCase.fromJson(Map json) => + _$DartTestCaseFromJson(json); + + final String name; + + Map toJson() => _$DartTestCaseToJson(this); +} + +@JsonSerializable() +class DartTestGroup { + DartTestGroup({ + this.name, + this.tests, + required this.groups, + }); + + factory DartTestGroup.fromJson(Map json) => + _$DartTestGroupFromJson(json); + + final String? name; + final List? tests; + final List groups; + + Map toJson() => _$DartTestGroupToJson(this); +} + +@JsonSerializable() +class ListDartTestsResponse { + ListDartTestsResponse({ + required this.group, + }); + + factory ListDartTestsResponse.fromJson(Map json) => + _$ListDartTestsResponseFromJson(json); + + final DartTestGroup group; + + Map toJson() => _$ListDartTestsResponseToJson(this); +} + +@JsonSerializable() +class RunDartTestRequest { + RunDartTestRequest({ + this.name, + }); + + factory RunDartTestRequest.fromJson(Map json) => + _$RunDartTestRequestFromJson(json); + + final String? name; + + Map toJson() => _$RunDartTestRequestToJson(this); +} + +@JsonSerializable() +class RunDartTestResponse { + RunDartTestResponse({ + required this.result, + this.details, + }); + + factory RunDartTestResponse.fromJson(Map json) => + _$RunDartTestResponseFromJson(json); + + final RunDartTestResponseResult result; + final String? details; + + Map toJson() => _$RunDartTestResponseToJson(this); +} + +@JsonSerializable() +class ConfigureRequest { + ConfigureRequest({ + required this.findTimeoutMillis, + }); + + factory ConfigureRequest.fromJson(Map json) => + _$ConfigureRequestFromJson(json); + + final int findTimeoutMillis; + + Map toJson() => _$ConfigureRequestToJson(this); +} + +@JsonSerializable() +class OpenAppRequest { + OpenAppRequest({ + this.appId, + }); + + factory OpenAppRequest.fromJson(Map json) => + _$OpenAppRequestFromJson(json); + + final String? appId; + + Map toJson() => _$OpenAppRequestToJson(this); +} + +@JsonSerializable() +class OpenQuickSettingsRequest { + OpenQuickSettingsRequest(); + + factory OpenQuickSettingsRequest.fromJson(Map json) => + _$OpenQuickSettingsRequestFromJson(json); + + Map toJson() => _$OpenQuickSettingsRequestToJson(this); +} + +@JsonSerializable() +class Selector { + Selector({ + this.text, + this.textStartsWith, + this.textContains, + this.className, + this.contentDescription, + this.contentDescriptionStartsWith, + this.contentDescriptionContains, + this.resourceId, + this.instance, + this.enabled, + this.focused, + this.pkg, + }); + + factory Selector.fromJson(Map json) => + _$SelectorFromJson(json); + + final String? text; + final String? textStartsWith; + final String? textContains; + final String? className; + final String? contentDescription; + final String? contentDescriptionStartsWith; + final String? contentDescriptionContains; + final String? resourceId; + final int? instance; + final bool? enabled; + final bool? focused; + final String? pkg; + + Map toJson() => _$SelectorToJson(this); +} + +@JsonSerializable() +class GetNativeViewsRequest { + GetNativeViewsRequest({ + this.selector, + this.appId, + }); + + factory GetNativeViewsRequest.fromJson(Map json) => + _$GetNativeViewsRequestFromJson(json); + + final Selector? selector; + final String? appId; + + Map toJson() => _$GetNativeViewsRequestToJson(this); +} + +@JsonSerializable() +class NativeView { + NativeView({ + this.className, + this.text, + this.contentDescription, + this.focused, + this.enabled, + this.childCount, + this.resourceName, + this.applicationPackage, + this.children, + }); + + factory NativeView.fromJson(Map json) => + _$NativeViewFromJson(json); + + final String? className; + final String? text; + final String? contentDescription; + final bool? focused; + final bool? enabled; + final int? childCount; + final String? resourceName; + final String? applicationPackage; + final List? children; + + Map toJson() => _$NativeViewToJson(this); +} + +@JsonSerializable() +class GetNativeViewsResponse { + GetNativeViewsResponse({ + this.nativeViews, + }); + + factory GetNativeViewsResponse.fromJson(Map json) => + _$GetNativeViewsResponseFromJson(json); + + final List? nativeViews; + + Map toJson() => _$GetNativeViewsResponseToJson(this); +} + +@JsonSerializable() +class TapRequest { + TapRequest({ + this.selector, + this.appId, + }); + + factory TapRequest.fromJson(Map json) => + _$TapRequestFromJson(json); + + final Selector? selector; + final String? appId; + + Map toJson() => _$TapRequestToJson(this); +} + +@JsonSerializable() +class EnterTextRequest { + EnterTextRequest({ + this.data, + this.appId, + this.index, + this.selector, + this.showKeyboard, + }); + + factory EnterTextRequest.fromJson(Map json) => + _$EnterTextRequestFromJson(json); + + final String? data; + final String? appId; + final int? index; + final Selector? selector; + final bool? showKeyboard; + + Map toJson() => _$EnterTextRequestToJson(this); +} + +@JsonSerializable() +class SwipeRequest { + SwipeRequest({ + this.startX, + this.startY, + this.endX, + this.endY, + this.steps, + this.appId, + }); + + factory SwipeRequest.fromJson(Map json) => + _$SwipeRequestFromJson(json); + + final double? startX; + final double? startY; + final double? endX; + final double? endY; + final int? steps; + final String? appId; + + Map toJson() => _$SwipeRequestToJson(this); +} + +@JsonSerializable() +class WaitUntilVisibleRequest { + WaitUntilVisibleRequest({ + this.selector, + this.appId, + }); + + factory WaitUntilVisibleRequest.fromJson(Map json) => + _$WaitUntilVisibleRequestFromJson(json); + + final Selector? selector; + final String? appId; + + Map toJson() => _$WaitUntilVisibleRequestToJson(this); +} + +@JsonSerializable() +class DarkModeRequest { + DarkModeRequest({ + this.appId, + }); + + factory DarkModeRequest.fromJson(Map json) => + _$DarkModeRequestFromJson(json); + + final String? appId; + + Map toJson() => _$DarkModeRequestToJson(this); +} + +@JsonSerializable() +class Notification { + Notification({ + this.appName, + this.title, + this.content, + this.raw, + }); + + factory Notification.fromJson(Map json) => + _$NotificationFromJson(json); + + final String? appName; + final String? title; + final String? content; + final String? raw; + + Map toJson() => _$NotificationToJson(this); +} + +@JsonSerializable() +class GetNotificationsResponse { + GetNotificationsResponse({ + this.notifications, + }); + + factory GetNotificationsResponse.fromJson(Map json) => + _$GetNotificationsResponseFromJson(json); + + final List? notifications; + + Map toJson() => _$GetNotificationsResponseToJson(this); +} + +@JsonSerializable() +class GetNotificationsRequest { + GetNotificationsRequest(); + + factory GetNotificationsRequest.fromJson(Map json) => + _$GetNotificationsRequestFromJson(json); + + Map toJson() => _$GetNotificationsRequestToJson(this); +} + +@JsonSerializable() +class TapOnNotificationRequest { + TapOnNotificationRequest({ + this.index, + this.selector, + }); + + factory TapOnNotificationRequest.fromJson(Map json) => + _$TapOnNotificationRequestFromJson(json); + + final int? index; + final Selector? selector; + + Map toJson() => _$TapOnNotificationRequestToJson(this); +} + +@JsonSerializable() +class PermissionDialogVisibleResponse { + PermissionDialogVisibleResponse({ + this.visible, + }); + + factory PermissionDialogVisibleResponse.fromJson(Map json) => + _$PermissionDialogVisibleResponseFromJson(json); + + final bool? visible; + + Map toJson() => + _$PermissionDialogVisibleResponseToJson(this); +} + +@JsonSerializable() +class PermissionDialogVisibleRequest { + PermissionDialogVisibleRequest({ + this.timeoutMillis, + }); + + factory PermissionDialogVisibleRequest.fromJson(Map json) => + _$PermissionDialogVisibleRequestFromJson(json); + + final int? timeoutMillis; + + Map toJson() => _$PermissionDialogVisibleRequestToJson(this); +} + +@JsonSerializable() +class HandlePermissionRequest { + HandlePermissionRequest({ + this.code, + }); + + factory HandlePermissionRequest.fromJson(Map json) => + _$HandlePermissionRequestFromJson(json); + + final HandlePermissionRequestCode? code; + + Map toJson() => _$HandlePermissionRequestToJson(this); +} + +@JsonSerializable() +class SetLocationAccuracyRequest { + SetLocationAccuracyRequest({ + this.locationAccuracy, + }); + + factory SetLocationAccuracyRequest.fromJson(Map json) => + _$SetLocationAccuracyRequestFromJson(json); + + final SetLocationAccuracyRequestLocationAccuracy? locationAccuracy; + + Map toJson() => _$SetLocationAccuracyRequestToJson(this); +} diff --git a/packages/patrol/lib/src/native/contracts/contracts.g.dart b/packages/patrol/lib/src/native/contracts/contracts.g.dart new file mode 100644 index 000000000..2a16a99a4 --- /dev/null +++ b/packages/patrol/lib/src/native/contracts/contracts.g.dart @@ -0,0 +1,385 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'contracts.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +DartTestCase _$DartTestCaseFromJson(Map json) => DartTestCase( + name: json['name'] as String, + ); + +Map _$DartTestCaseToJson(DartTestCase instance) => + { + 'name': instance.name, + }; + +DartTestGroup _$DartTestGroupFromJson(Map json) => + DartTestGroup( + name: json['name'] as String?, + tests: (json['tests'] as List?) + ?.map((e) => DartTestCase.fromJson(e as Map)) + .toList(), + groups: (json['groups'] as List) + .map((e) => DartTestGroup.fromJson(e as Map)) + .toList(), + ); + +Map _$DartTestGroupToJson(DartTestGroup instance) => + { + 'name': instance.name, + 'tests': instance.tests, + 'groups': instance.groups, + }; + +ListDartTestsResponse _$ListDartTestsResponseFromJson( + Map json) => + ListDartTestsResponse( + group: DartTestGroup.fromJson(json['group'] as Map), + ); + +Map _$ListDartTestsResponseToJson( + ListDartTestsResponse instance) => + { + 'group': instance.group, + }; + +RunDartTestRequest _$RunDartTestRequestFromJson(Map json) => + RunDartTestRequest( + name: json['name'] as String?, + ); + +Map _$RunDartTestRequestToJson(RunDartTestRequest instance) => + { + 'name': instance.name, + }; + +RunDartTestResponse _$RunDartTestResponseFromJson(Map json) => + RunDartTestResponse( + result: $enumDecode(_$RunDartTestResponseResultEnumMap, json['result']), + details: json['details'] as String?, + ); + +Map _$RunDartTestResponseToJson( + RunDartTestResponse instance) => + { + 'result': _$RunDartTestResponseResultEnumMap[instance.result]!, + 'details': instance.details, + }; + +const _$RunDartTestResponseResultEnumMap = { + RunDartTestResponseResult.success: 'success', + RunDartTestResponseResult.skipped: 'skipped', + RunDartTestResponseResult.failure: 'failure', +}; + +ConfigureRequest _$ConfigureRequestFromJson(Map json) => + ConfigureRequest( + findTimeoutMillis: json['findTimeoutMillis'] as int, + ); + +Map _$ConfigureRequestToJson(ConfigureRequest instance) => + { + 'findTimeoutMillis': instance.findTimeoutMillis, + }; + +OpenAppRequest _$OpenAppRequestFromJson(Map json) => + OpenAppRequest( + appId: json['appId'] as String?, + ); + +Map _$OpenAppRequestToJson(OpenAppRequest instance) => + { + 'appId': instance.appId, + }; + +OpenQuickSettingsRequest _$OpenQuickSettingsRequestFromJson( + Map json) => + OpenQuickSettingsRequest(); + +Map _$OpenQuickSettingsRequestToJson( + OpenQuickSettingsRequest instance) => + {}; + +Selector _$SelectorFromJson(Map json) => Selector( + text: json['text'] as String?, + textStartsWith: json['textStartsWith'] as String?, + textContains: json['textContains'] as String?, + className: json['className'] as String?, + contentDescription: json['contentDescription'] as String?, + contentDescriptionStartsWith: + json['contentDescriptionStartsWith'] as String?, + contentDescriptionContains: json['contentDescriptionContains'] as String?, + resourceId: json['resourceId'] as String?, + instance: json['instance'] as int?, + enabled: json['enabled'] as bool?, + focused: json['focused'] as bool?, + pkg: json['pkg'] as String?, + ); + +Map _$SelectorToJson(Selector instance) => { + 'text': instance.text, + 'textStartsWith': instance.textStartsWith, + 'textContains': instance.textContains, + 'className': instance.className, + 'contentDescription': instance.contentDescription, + 'contentDescriptionStartsWith': instance.contentDescriptionStartsWith, + 'contentDescriptionContains': instance.contentDescriptionContains, + 'resourceId': instance.resourceId, + 'instance': instance.instance, + 'enabled': instance.enabled, + 'focused': instance.focused, + 'pkg': instance.pkg, + }; + +GetNativeViewsRequest _$GetNativeViewsRequestFromJson( + Map json) => + GetNativeViewsRequest( + selector: json['selector'] == null + ? null + : Selector.fromJson(json['selector'] as Map), + appId: json['appId'] as String?, + ); + +Map _$GetNativeViewsRequestToJson( + GetNativeViewsRequest instance) => + { + 'selector': instance.selector, + 'appId': instance.appId, + }; + +NativeView _$NativeViewFromJson(Map json) => NativeView( + className: json['className'] as String?, + text: json['text'] as String?, + contentDescription: json['contentDescription'] as String?, + focused: json['focused'] as bool?, + enabled: json['enabled'] as bool?, + childCount: json['childCount'] as int?, + resourceName: json['resourceName'] as String?, + applicationPackage: json['applicationPackage'] as String?, + children: (json['children'] as List?) + ?.map((e) => NativeView.fromJson(e as Map)) + .toList(), + ); + +Map _$NativeViewToJson(NativeView instance) => + { + 'className': instance.className, + 'text': instance.text, + 'contentDescription': instance.contentDescription, + 'focused': instance.focused, + 'enabled': instance.enabled, + 'childCount': instance.childCount, + 'resourceName': instance.resourceName, + 'applicationPackage': instance.applicationPackage, + 'children': instance.children, + }; + +GetNativeViewsResponse _$GetNativeViewsResponseFromJson( + Map json) => + GetNativeViewsResponse( + nativeViews: (json['nativeViews'] as List?) + ?.map((e) => NativeView.fromJson(e as Map)) + .toList(), + ); + +Map _$GetNativeViewsResponseToJson( + GetNativeViewsResponse instance) => + { + 'nativeViews': instance.nativeViews, + }; + +TapRequest _$TapRequestFromJson(Map json) => TapRequest( + selector: json['selector'] == null + ? null + : Selector.fromJson(json['selector'] as Map), + appId: json['appId'] as String?, + ); + +Map _$TapRequestToJson(TapRequest instance) => + { + 'selector': instance.selector, + 'appId': instance.appId, + }; + +EnterTextRequest _$EnterTextRequestFromJson(Map json) => + EnterTextRequest( + data: json['data'] as String?, + appId: json['appId'] as String?, + index: json['index'] as int?, + selector: json['selector'] == null + ? null + : Selector.fromJson(json['selector'] as Map), + showKeyboard: json['showKeyboard'] as bool?, + ); + +Map _$EnterTextRequestToJson(EnterTextRequest instance) => + { + 'data': instance.data, + 'appId': instance.appId, + 'index': instance.index, + 'selector': instance.selector, + 'showKeyboard': instance.showKeyboard, + }; + +SwipeRequest _$SwipeRequestFromJson(Map json) => SwipeRequest( + startX: (json['startX'] as num?)?.toDouble(), + startY: (json['startY'] as num?)?.toDouble(), + endX: (json['endX'] as num?)?.toDouble(), + endY: (json['endY'] as num?)?.toDouble(), + steps: json['steps'] as int?, + appId: json['appId'] as String?, + ); + +Map _$SwipeRequestToJson(SwipeRequest instance) => + { + 'startX': instance.startX, + 'startY': instance.startY, + 'endX': instance.endX, + 'endY': instance.endY, + 'steps': instance.steps, + 'appId': instance.appId, + }; + +WaitUntilVisibleRequest _$WaitUntilVisibleRequestFromJson( + Map json) => + WaitUntilVisibleRequest( + selector: json['selector'] == null + ? null + : Selector.fromJson(json['selector'] as Map), + appId: json['appId'] as String?, + ); + +Map _$WaitUntilVisibleRequestToJson( + WaitUntilVisibleRequest instance) => + { + 'selector': instance.selector, + 'appId': instance.appId, + }; + +DarkModeRequest _$DarkModeRequestFromJson(Map json) => + DarkModeRequest( + appId: json['appId'] as String?, + ); + +Map _$DarkModeRequestToJson(DarkModeRequest instance) => + { + 'appId': instance.appId, + }; + +Notification _$NotificationFromJson(Map json) => Notification( + appName: json['appName'] as String?, + title: json['title'] as String?, + content: json['content'] as String?, + raw: json['raw'] as String?, + ); + +Map _$NotificationToJson(Notification instance) => + { + 'appName': instance.appName, + 'title': instance.title, + 'content': instance.content, + 'raw': instance.raw, + }; + +GetNotificationsResponse _$GetNotificationsResponseFromJson( + Map json) => + GetNotificationsResponse( + notifications: (json['notifications'] as List?) + ?.map((e) => Notification.fromJson(e as Map)) + .toList(), + ); + +Map _$GetNotificationsResponseToJson( + GetNotificationsResponse instance) => + { + 'notifications': instance.notifications, + }; + +GetNotificationsRequest _$GetNotificationsRequestFromJson( + Map json) => + GetNotificationsRequest(); + +Map _$GetNotificationsRequestToJson( + GetNotificationsRequest instance) => + {}; + +TapOnNotificationRequest _$TapOnNotificationRequestFromJson( + Map json) => + TapOnNotificationRequest( + index: json['index'] as int?, + selector: json['selector'] == null + ? null + : Selector.fromJson(json['selector'] as Map), + ); + +Map _$TapOnNotificationRequestToJson( + TapOnNotificationRequest instance) => + { + 'index': instance.index, + 'selector': instance.selector, + }; + +PermissionDialogVisibleResponse _$PermissionDialogVisibleResponseFromJson( + Map json) => + PermissionDialogVisibleResponse( + visible: json['visible'] as bool?, + ); + +Map _$PermissionDialogVisibleResponseToJson( + PermissionDialogVisibleResponse instance) => + { + 'visible': instance.visible, + }; + +PermissionDialogVisibleRequest _$PermissionDialogVisibleRequestFromJson( + Map json) => + PermissionDialogVisibleRequest( + timeoutMillis: json['timeoutMillis'] as int?, + ); + +Map _$PermissionDialogVisibleRequestToJson( + PermissionDialogVisibleRequest instance) => + { + 'timeoutMillis': instance.timeoutMillis, + }; + +HandlePermissionRequest _$HandlePermissionRequestFromJson( + Map json) => + HandlePermissionRequest( + code: $enumDecodeNullable( + _$HandlePermissionRequestCodeEnumMap, json['code']), + ); + +Map _$HandlePermissionRequestToJson( + HandlePermissionRequest instance) => + { + 'code': _$HandlePermissionRequestCodeEnumMap[instance.code], + }; + +const _$HandlePermissionRequestCodeEnumMap = { + HandlePermissionRequestCode.whileUsing: 'whileUsing', + HandlePermissionRequestCode.onlyThisTime: 'onlyThisTime', + HandlePermissionRequestCode.denied: 'denied', +}; + +SetLocationAccuracyRequest _$SetLocationAccuracyRequestFromJson( + Map json) => + SetLocationAccuracyRequest( + locationAccuracy: $enumDecodeNullable( + _$SetLocationAccuracyRequestLocationAccuracyEnumMap, + json['locationAccuracy']), + ); + +Map _$SetLocationAccuracyRequestToJson( + SetLocationAccuracyRequest instance) => + { + 'locationAccuracy': _$SetLocationAccuracyRequestLocationAccuracyEnumMap[ + instance.locationAccuracy], + }; + +const _$SetLocationAccuracyRequestLocationAccuracyEnumMap = { + SetLocationAccuracyRequestLocationAccuracy.coarse: 'coarse', + SetLocationAccuracyRequestLocationAccuracy.fine: 'fine', +}; diff --git a/packages/patrol/lib/src/native/contracts/patrol_app_service_server.dart b/packages/patrol/lib/src/native/contracts/patrol_app_service_server.dart new file mode 100644 index 000000000..0a13155ae --- /dev/null +++ b/packages/patrol/lib/src/native/contracts/patrol_app_service_server.dart @@ -0,0 +1,38 @@ +// +// Generated code. Do not modify. +// source: schema.dart +// +// ignore_for_file: public_member_api_docs + +import 'dart:async'; +import 'dart:convert'; + +import 'package:shelf/shelf.dart'; + +import 'contracts.dart'; + +abstract class PatrolAppServiceServer { + FutureOr handle(Request request) async { + if ('listDartTests' == request.handlerPath) { + final result = await listDartTests(); + + final body = jsonEncode(result.toJson()); + return Response.ok(body); + } else if ('runDartTest' == request.handlerPath) { + final stringContent = await request.readAsString(utf8); + final json = jsonDecode(stringContent); + final requestObj = + RunDartTestRequest.fromJson(json as Map); + + final result = await runDartTest(requestObj); + + final body = jsonEncode(result.toJson()); + return Response.ok(body); + } + + return null; + } + + Future listDartTests(); + Future runDartTest(RunDartTestRequest request); +} diff --git a/packages/patrol/lib/src/native/patrol_app_service.dart b/packages/patrol/lib/src/native/patrol_app_service.dart index 2e0e7855e..803912d98 100644 --- a/packages/patrol/lib/src/native/patrol_app_service.dart +++ b/packages/patrol/lib/src/native/patrol_app_service.dart @@ -2,10 +2,11 @@ // TODO: Use a logger instead of print import 'dart:async'; -import 'dart:io' as io; -import 'package:grpc/grpc.dart'; -import 'package:patrol/src/native/contracts/contracts.pbgrpc.dart'; +import 'package:patrol/src/native/contracts/contracts.dart'; +import 'package:patrol/src/native/contracts/patrol_app_service_server.dart'; + +import 'package:shelf/shelf_io.dart' as shelf_io; const _port = 8082; @@ -18,12 +19,15 @@ class _TestExecutionResult { /// Starts the gRPC server that runs the [PatrolAppService]. Future runAppService(PatrolAppService service) async { - final services = [service]; - final interceptors = []; - final codecRegistry = CodecRegistry(); + await shelf_io.serve( + (request) async { + final result = await service.handle(request); + return result!; + }, + '0.0.0.0', + _port, + ); - final server = Server(services, interceptors, codecRegistry); - await server.serve(address: io.InternetAddress.anyIPv4, port: _port); print('PatrolAppService started on port $_port'); } @@ -31,7 +35,7 @@ Future runAppService(PatrolAppService service) async { /// /// This is an internal class and you don't want to use it. It's public so that /// the generated code can access it. -class PatrolAppService extends PatrolAppServiceBase { +class PatrolAppService extends PatrolAppServiceServer { /// Creates a new [PatrolAppService]. PatrolAppService({required this.topLevelDartTestGroup}); @@ -113,19 +117,13 @@ class PatrolAppService extends PatrolAppServiceBase { } @override - Future listDartTests( - ServiceCall call, - Empty request, - ) async { + Future listDartTests() async { print('PatrolAppService.listDartTests() called'); return ListDartTestsResponse(group: topLevelDartTestGroup); } @override - Future runDartTest( - ServiceCall call, - RunDartTestRequest request, - ) async { + Future runDartTest(RunDartTestRequest request) async { assert(_testExecutionCompleted.isCompleted == false); // patrolTest() always calls this method. @@ -135,8 +133,8 @@ class PatrolAppService extends PatrolAppServiceBase { final testExecutionResult = await testExecutionCompleted; return RunDartTestResponse( result: testExecutionResult.passed - ? RunDartTestResponse_Result.SUCCESS - : RunDartTestResponse_Result.FAILURE, + ? RunDartTestResponseResult.success + : RunDartTestResponseResult.failure, details: testExecutionResult.details, ); } diff --git a/packages/patrol/pubspec.yaml b/packages/patrol/pubspec.yaml index e1cc6cf54..6f9c4b0af 100644 --- a/packages/patrol/pubspec.yaml +++ b/packages/patrol/pubspec.yaml @@ -25,6 +25,7 @@ dependencies: path: ^1.8.2 patrol_finders: ^1.0.0 protobuf: ^2.1.0 + shelf: ^1.4.1 test_api: '>=0.4.0 <0.7.0' dev_dependencies: diff --git a/packages/patrol/test/internals_test.dart b/packages/patrol/test/internals_test.dart index 271eb2108..6ba104822 100644 --- a/packages/patrol/test/internals_test.dart +++ b/packages/patrol/test/internals_test.dart @@ -1,7 +1,7 @@ // ignore_for_file: invalid_use_of_internal_member, depend_on_referenced_packages, implementation_imports import 'package:flutter_test/flutter_test.dart'; import 'package:patrol/src/common.dart' show createDartTestGroup; -import 'package:patrol/src/native/contracts/contracts.pbgrpc.dart'; +import 'package:patrol/src/native/contracts/contracts.dart'; import 'package:test_api/src/backend/group.dart'; import 'package:test_api/src/backend/invoker.dart'; import 'package:test_api/src/backend/metadata.dart'; @@ -62,9 +62,15 @@ void main() { DartTestGroup( name: '', groups: [ - DartTestGroup(name: 'permissions.permissions_location_test'), - DartTestGroup(name: 'permissions.permissions_many_test'), - DartTestGroup(name: 'example_test'), + DartTestGroup( + name: 'permissions.permissions_location_test', + groups: [], + ), + DartTestGroup( + name: 'permissions.permissions_many_test', + groups: [], + ), + DartTestGroup(name: 'example_test', groups: []), ], ), ); diff --git a/packages/patrol_cli/lib/src/test_bundler.dart b/packages/patrol_cli/lib/src/test_bundler.dart index c4c45ff17..d7b9dd2a1 100644 --- a/packages/patrol_cli/lib/src/test_bundler.dart +++ b/packages/patrol_cli/lib/src/test_bundler.dart @@ -28,7 +28,7 @@ import 'dart:async'; import 'package:flutter_test/flutter_test.dart'; import 'package:patrol/patrol.dart'; -import 'package:patrol/src/native/contracts/contracts.pbgrpc.dart'; +import 'package:patrol/src/native/contracts/contracts.dart'; import 'package:test_api/src/backend/invoker.dart'; // START: GENERATED TEST IMPORTS diff --git a/packages/patrol_gen/lib/src/generators/dart/dart_config.dart b/packages/patrol_gen/lib/src/generators/dart/dart_config.dart index a563d686c..a863fe3af 100644 --- a/packages/patrol_gen/lib/src/generators/dart/dart_config.dart +++ b/packages/patrol_gen/lib/src/generators/dart/dart_config.dart @@ -7,4 +7,14 @@ class DartConfig { final String outputDirectory; final String contractsFilename; + + String serviceFileName(String serviceName) => + path.join(outputDirectory, '${_fileName(serviceName)}_server.dart'); + + String _fileName(String pascalCaseName) { + final beforeCapitalLetter = RegExp(r"(?=[A-Z])"); + + final parts = pascalCaseName.split(beforeCapitalLetter); + return parts.map((e) => e.toLowerCase()).join('_'); + } } diff --git a/packages/patrol_gen/lib/src/generators/dart/dart_contracts_generator.dart b/packages/patrol_gen/lib/src/generators/dart/dart_contracts_generator.dart new file mode 100644 index 000000000..18da0bb12 --- /dev/null +++ b/packages/patrol_gen/lib/src/generators/dart/dart_contracts_generator.dart @@ -0,0 +1,75 @@ +import 'package:dart_style/dart_style.dart'; +import 'package:patrol_gen/src/generators/dart/dart_config.dart'; +import 'package:path/path.dart' as path; +import 'package:patrol_gen/src/generators/output_file.dart'; +import 'package:patrol_gen/src/schema.dart'; + +class DartContractsGenerator { + OutputFile generate(Schema schema, DartConfig config) { + final buffer = StringBuffer()..write(_contentPrefix(config)); + + schema.enums.forEach((e) => buffer.writeln(_createEnum(e))); + schema.messages.forEach((e) => buffer.writeln(_createMessage(e))); + + final content = DartFormatter().format(buffer.toString()); + + return OutputFile(filename: config.contractsFilename, content: content); + } + + String _contentPrefix(DartConfig config) { + return ''' +// +// Generated code. Do not modify. +// source: schema.dart +// +// ignore_for_file: public_member_api_docs + +import 'package:json_annotation/json_annotation.dart'; + +part '${path.basenameWithoutExtension(config.contractsFilename)}.g.dart'; + +'''; + } + + String _createEnum(Enum enumDefinition) { + final fieldsContent = enumDefinition.fields.map((e) { + return ''' +@JsonValue('${e}') +${e}'''; + }).join(',\n'); + + return ''' +enum ${enumDefinition.name} { + $fieldsContent +} +'''; + } + + String? _createMessage(Message message) { + final fieldsContent = message.fields + .map((f) => f.isList + ? 'final List<${f.type}>${f.isOptional ? '?' : ''} ${f.name};' + : 'final ${f.type}${f.isOptional ? '?' : ''} ${f.name};') + .join('\n'); + + var constructorParameters = message.fields + .map((e) => '${e.isOptional ? '' : 'required'} this.${e.name},') + .join(); + + constructorParameters = + message.fields.isEmpty ? '' : '{$constructorParameters}'; + + return ''' +@JsonSerializable() +class ${message.name} { + ${message.name}(${constructorParameters}); + + factory ${message.name}.fromJson(Map json) => _\$${message.name}FromJson(json); + + $fieldsContent + + Map toJson() => _\$${message.name}ToJson(this); +} +'''; + } +} diff --git a/packages/patrol_gen/lib/src/generators/dart/dart_generator.dart b/packages/patrol_gen/lib/src/generators/dart/dart_generator.dart index 96bcffd95..28e9f76f8 100644 --- a/packages/patrol_gen/lib/src/generators/dart/dart_generator.dart +++ b/packages/patrol_gen/lib/src/generators/dart/dart_generator.dart @@ -1,72 +1,23 @@ import 'package:patrol_gen/src/generators/dart/dart_config.dart'; +import 'package:patrol_gen/src/generators/dart/dart_contracts_generator.dart'; +import 'package:patrol_gen/src/generators/dart/dart_shelf_server_generator.dart'; +import 'package:patrol_gen/src/generators/output_file.dart'; import 'package:patrol_gen/src/schema.dart'; -import 'package:path/path.dart' as path; -import 'package:dart_style/dart_style.dart'; class DartGenerator { - String generateContent(Schema schema, DartConfig config) { - final buffer = StringBuffer()..write(_contentPrefix(config)); + List generate(Schema schema, DartConfig config) { + final result = [ + DartContractsGenerator().generate(schema, config), + ]; - schema.enums.forEach((e) => buffer.writeln(_createEnum(e))); - schema.messages.forEach((e) => buffer.writeln(_createMessage(e))); + final serverGenerator = DartShelfServerGenerator(); - return DartFormatter().format(buffer.toString()); - } - - String _contentPrefix(DartConfig config) { - return ''' -// -// Generated code. Do not modify. -// source: schema.dart -// -// ignore_for_file: public_member_api_docs - -import 'package:json_annotation/json_annotation.dart'; + for (var service in schema.services) { + if (service.dart.needsServer) { + result.add(serverGenerator.generate(service, config)); + } + } -part '${path.basenameWithoutExtension(config.contractsFilename)}.g.dart'; - -'''; - } - - String _createEnum(Enum enumDefinition) { - final fieldsContent = enumDefinition.fields.map((e) { - return ''' -@JsonValue('${e}') -${e}'''; - }).join(',\n'); - - return ''' -enum ${enumDefinition.name} { - $fieldsContent -} -'''; - } - - String? _createMessage(Message message) { - final fieldsContent = message.fields - .map((f) => f.isList - ? 'final List<${f.type}>${f.isOptional ? '?' : ''} ${f.name};' - : 'final ${f.type}${f.isOptional ? '?' : ''} ${f.name};') - .join('\n'); - - var constructorParameters = message.fields - .map((e) => '${e.isOptional ? '' : 'required'} this.${e.name},') - .join(); - - constructorParameters = - message.fields.isEmpty ? '' : '{$constructorParameters}'; - - return ''' -@JsonSerializable() -class ${message.name} { - ${message.name}(${constructorParameters}); - - factory ${message.name}.fromJson(Map json) => _\$${message.name}FromJson(json); - - $fieldsContent - - Map toJson() => _\$${message.name}ToJson(this); -} -'''; + return result; } } diff --git a/packages/patrol_gen/lib/src/generators/dart/dart_shelf_server_generator.dart b/packages/patrol_gen/lib/src/generators/dart/dart_shelf_server_generator.dart new file mode 100644 index 000000000..0d6cec61f --- /dev/null +++ b/packages/patrol_gen/lib/src/generators/dart/dart_shelf_server_generator.dart @@ -0,0 +1,100 @@ +import 'package:dart_style/dart_style.dart'; +import 'package:patrol_gen/src/generators/dart/dart_config.dart'; +import 'package:patrol_gen/src/generators/output_file.dart'; +import 'package:patrol_gen/src/schema.dart'; +import 'package:path/path.dart' as path; + +class DartShelfServerGenerator { + OutputFile generate(Service service, DartConfig config) { + final buffer = StringBuffer()..write(_contentPrefix(config)); + + final handlerCalls = _generateHandlerCalls(service); + final handlers = _generateHandlers(service); + + buffer.write(_createClass(service, handlerCalls, handlers)); + + return OutputFile( + filename: config.serviceFileName(service.name), + content: DartFormatter().format(buffer.toString()), + ); + } + + String _contentPrefix(DartConfig config) { + return ''' +// +// Generated code. Do not modify. +// source: schema.dart +// +// ignore_for_file: public_member_api_docs + +import 'dart:async'; +import 'dart:convert'; + +import 'package:shelf/shelf.dart'; + +import '${path.basename(config.contractsFilename)}'; +'''; + } + + String _generateHandlerCalls(Service service) { + return service.endpoints.map((e) { + var requestDeserialization = ''; + var responseSerialization = ''; + + if (e.request != null) { + requestDeserialization = ''' +final stringContent = await request.readAsString(utf8); +final json = jsonDecode(stringContent); +final requestObj = ${e.request!.name}.fromJson(json as Map); +'''; + } + + final handlerCall = e.request != null + ? 'final result = await ${e.name}(requestObj);' + : 'final result = await ${e.name}();'; + + if (e.response != null) { + responseSerialization = ''' +final body = jsonEncode(result.toJson()); +return Response.ok(body);'''; + } + + final elseKeyword = e == service.endpoints.first ? '' : 'else'; + + return ''' +$elseKeyword if ('${e.name}' == request.handlerPath){ + +$requestDeserialization + +$handlerCall + +$responseSerialization +}'''; + }).join('\n'); + } + + String _generateHandlers(Service service) { + return service.endpoints.map((endpoint) { + final result = endpoint.response?.name ?? 'void'; + final request = + endpoint.request != null ? '${endpoint.request!.name} request' : ''; + + return 'Future<$result> ${endpoint.name}($request);'; + }).join('\n'); + } + + String _createClass(Service service, String handlerCalls, String handlers) { + return ''' +abstract class ${service.name}Server { + FutureOr handle(Request request) async { + +$handlerCalls + + return null; + } + +$handlers +} +'''; + } +} diff --git a/packages/patrol_gen/lib/src/generators/ios/ios_generator.dart b/packages/patrol_gen/lib/src/generators/ios/ios_generator.dart index 88f68d6ed..57de3de29 100644 --- a/packages/patrol_gen/lib/src/generators/ios/ios_generator.dart +++ b/packages/patrol_gen/lib/src/generators/ios/ios_generator.dart @@ -9,14 +9,14 @@ class IOSGenerator { schema.enums.forEach((e) => buffer.writeln(_createEnum(e))); schema.messages.forEach((e) => buffer.writeln(_createMessage(e))); - for (var service in schema.services) { - if (service.swift.needsServer) { - buffer.writeln(_createServer(service)); - } - if (service.swift.needsClient) { - buffer.writeln(_createClient(service)); - } - } + // for (var service in schema.services) { + // if (service.swift.needsServer) { + // buffer.writeln(_createServer(service)); + // } + // if (service.swift.needsClient) { + // buffer.writeln(_createClient(service)); + // } + // } return buffer.toString(); } diff --git a/packages/patrol_gen/lib/src/generators/output_file.dart b/packages/patrol_gen/lib/src/generators/output_file.dart new file mode 100644 index 000000000..84d9666c0 --- /dev/null +++ b/packages/patrol_gen/lib/src/generators/output_file.dart @@ -0,0 +1,6 @@ +class OutputFile { + const OutputFile({required this.filename, required this.content}); + + final String filename; + final String content; +} diff --git a/packages/patrol_gen/lib/src/patrol_gen.dart b/packages/patrol_gen/lib/src/patrol_gen.dart index 1bf27631e..2db5f5a8e 100644 --- a/packages/patrol_gen/lib/src/patrol_gen.dart +++ b/packages/patrol_gen/lib/src/patrol_gen.dart @@ -20,14 +20,15 @@ class PatrolGenConfig { class PatrolGen { Future run(PatrolGenConfig config) async { final schema = await resolveSchema(config.schemaFilename); - final dartContent = - DartGenerator().generateContent(schema, config.dartConfig); + final files = DartGenerator().generate(schema, config.dartConfig); final swiftContent = IOSGenerator().generateContent(schema, config.iosConfig); - await File(config.dartConfig.contractsFilename) - .writeAsString(dartContent, flush: true); + for (var outputFile in files) { + await File(outputFile.filename) + .writeAsString(outputFile.content, flush: true); + } await File(config.iosConfig.contractsFilename) .writeAsString(swiftContent, flush: true); From 5a4ec9da76891e277fc933cbfa239f3c83f45d41 Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Fri, 18 Aug 2023 18:39:04 +0200 Subject: [PATCH 016/110] Fix url path --- .../lib/src/native/contracts/patrol_app_service_server.dart | 4 ++-- .../lib/src/generators/dart/dart_shelf_server_generator.dart | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/patrol/lib/src/native/contracts/patrol_app_service_server.dart b/packages/patrol/lib/src/native/contracts/patrol_app_service_server.dart index 0a13155ae..a1ab90f9e 100644 --- a/packages/patrol/lib/src/native/contracts/patrol_app_service_server.dart +++ b/packages/patrol/lib/src/native/contracts/patrol_app_service_server.dart @@ -13,12 +13,12 @@ import 'contracts.dart'; abstract class PatrolAppServiceServer { FutureOr handle(Request request) async { - if ('listDartTests' == request.handlerPath) { + if ('/listDartTests' == request.url.path) { final result = await listDartTests(); final body = jsonEncode(result.toJson()); return Response.ok(body); - } else if ('runDartTest' == request.handlerPath) { + } else if ('/runDartTest' == request.url.path) { final stringContent = await request.readAsString(utf8); final json = jsonDecode(stringContent); final requestObj = diff --git a/packages/patrol_gen/lib/src/generators/dart/dart_shelf_server_generator.dart b/packages/patrol_gen/lib/src/generators/dart/dart_shelf_server_generator.dart index 0d6cec61f..b1f1842bf 100644 --- a/packages/patrol_gen/lib/src/generators/dart/dart_shelf_server_generator.dart +++ b/packages/patrol_gen/lib/src/generators/dart/dart_shelf_server_generator.dart @@ -62,7 +62,7 @@ return Response.ok(body);'''; final elseKeyword = e == service.endpoints.first ? '' : 'else'; return ''' -$elseKeyword if ('${e.name}' == request.handlerPath){ +$elseKeyword if ('/${e.name}' == request.url.path){ $requestDeserialization From 11b6889af56613f86f03779fd8dee6231803859a Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Mon, 21 Aug 2023 11:40:59 +0200 Subject: [PATCH 017/110] Migrate ios generator --- .../lib/src/generators/ios/ios_config.dart | 5 +- .../ios/ios_contracts_generator.dart | 64 +++++++++++++++ .../lib/src/generators/ios/ios_generator.dart | 82 ++++--------------- .../ios/ios_url_session_client_generator.dart | 24 ++++++ packages/patrol_gen/lib/src/patrol_gen.dart | 8 +- .../patrol_gen/lib/src/resolve_schema.dart | 8 +- packages/patrol_gen/lib/src/schema.dart | 4 +- schema.dart | 4 +- 8 files changed, 116 insertions(+), 83 deletions(-) create mode 100644 packages/patrol_gen/lib/src/generators/ios/ios_contracts_generator.dart create mode 100644 packages/patrol_gen/lib/src/generators/ios/ios_url_session_client_generator.dart diff --git a/packages/patrol_gen/lib/src/generators/ios/ios_config.dart b/packages/patrol_gen/lib/src/generators/ios/ios_config.dart index 4f8bf815f..f8d592b6a 100644 --- a/packages/patrol_gen/lib/src/generators/ios/ios_config.dart +++ b/packages/patrol_gen/lib/src/generators/ios/ios_config.dart @@ -3,8 +3,11 @@ import 'package:path/path.dart' as path; class IOSConfig { IOSConfig({ required this.outputDirectory, - }) : contractsFilename = path.join(outputDirectory, 'contracts.swift'); + }) : contractsFilename = path.join(outputDirectory, 'Contracts.swift'); final String outputDirectory; final String contractsFilename; + + String clientFileName(String serviceName) => + path.join(outputDirectory, '${serviceName}Client.swift'); } diff --git a/packages/patrol_gen/lib/src/generators/ios/ios_contracts_generator.dart b/packages/patrol_gen/lib/src/generators/ios/ios_contracts_generator.dart new file mode 100644 index 000000000..4e356a19b --- /dev/null +++ b/packages/patrol_gen/lib/src/generators/ios/ios_contracts_generator.dart @@ -0,0 +1,64 @@ +import 'package:patrol_gen/src/generators/ios/ios_config.dart'; +import 'package:patrol_gen/src/generators/output_file.dart'; +import 'package:patrol_gen/src/schema.dart'; + +class IOSContractsGenerator { + OutputFile generate(Schema schema, IOSConfig config) { + final buffer = StringBuffer()..write(_contentPrefix(config)); + + schema.enums.forEach((e) => buffer.writeln(_createEnum(e))); + schema.messages.forEach((e) => buffer.writeln(_createMessage(e))); + + return OutputFile( + filename: config.contractsFilename, + content: buffer.toString(), + ); + } + + String _contentPrefix(IOSConfig config) { + return ''' +/// +// Generated code. Do not modify. +// source: schema.dart +// + +'''; + } + + String _createMessage(Message message) { + final fields = message.fields + .map((e) => e.isList + ? ' var ${e.name}: [${_transformType(e.type)}]' + : ' var ${e.name}: ${_transformType(e.type)}') + .join('\n'); + + return ''' +struct ${message.name}: Codable { +$fields +} +'''; + } + + String _createEnum(Enum enumDefinition) { + final cases = enumDefinition.fields.map((e) => ' case ${e}').join('\n'); + + return ''' +enum ${enumDefinition.name}: String, Codable { +$cases +} +'''; + } + + String _transformType(String type) { + switch (type) { + case 'int': + return 'Int'; + case 'double': + return 'Double'; + case 'bool': + return 'Bool'; + default: + return type; + } + } +} diff --git a/packages/patrol_gen/lib/src/generators/ios/ios_generator.dart b/packages/patrol_gen/lib/src/generators/ios/ios_generator.dart index 57de3de29..8ffe837de 100644 --- a/packages/patrol_gen/lib/src/generators/ios/ios_generator.dart +++ b/packages/patrol_gen/lib/src/generators/ios/ios_generator.dart @@ -1,77 +1,23 @@ import 'package:patrol_gen/src/generators/ios/ios_config.dart'; -import 'package:patrol_gen/src/generators/ios/ios_telegraph_generator.dart'; +import 'package:patrol_gen/src/generators/ios/ios_contracts_generator.dart'; +import 'package:patrol_gen/src/generators/ios/ios_url_session_client_generator.dart'; +import 'package:patrol_gen/src/generators/output_file.dart'; import 'package:patrol_gen/src/schema.dart'; class IOSGenerator { - String generateContent(Schema schema, IOSConfig config) { - final buffer = StringBuffer()..write(_contentPrefix(config)); + List generate(Schema schema, IOSConfig config) { + final result = [ + IOSContractsGenerator().generate(schema, config), + ]; - schema.enums.forEach((e) => buffer.writeln(_createEnum(e))); - schema.messages.forEach((e) => buffer.writeln(_createMessage(e))); + final clientGenerator = IOSURLSessionClientGenerator(); - // for (var service in schema.services) { - // if (service.swift.needsServer) { - // buffer.writeln(_createServer(service)); - // } - // if (service.swift.needsClient) { - // buffer.writeln(_createClient(service)); - // } - // } - - return buffer.toString(); - } - - String _contentPrefix(IOSConfig config) { - return ''' -/// -// Generated code. Do not modify. -// source: schema.dart -// - -'''; - } - - String _createMessage(Message message) { - final fields = message.fields - .map((e) => e.isList - ? ' var ${e.name}: [${_transformType(e.type)}]' - : ' var ${e.name}: ${_transformType(e.type)}') - .join('\n'); - - return ''' -struct ${message.name}: Codable { -$fields -} -'''; - } - - String _createEnum(Enum enumDefinition) { - final cases = enumDefinition.fields.map((e) => ' case ${e}').join('\n'); - - return ''' -enum ${enumDefinition.name}: String, Codable { -$cases -} -'''; - } - - String _createServer(Service service) => - IOSTelegraphGenerator().generateServer(service); - - String _createClient(Service service) { - return ''; - } - - String _transformType(String type) { - switch (type) { - case 'int': - return 'Int'; - case 'double': - return 'Double'; - case 'bool': - return 'Bool'; - default: - return type; + for (var service in schema.services) { + if (service.ios.needsClient) { + result.add(clientGenerator.generate(service, config)); + } } + + return result; } } diff --git a/packages/patrol_gen/lib/src/generators/ios/ios_url_session_client_generator.dart b/packages/patrol_gen/lib/src/generators/ios/ios_url_session_client_generator.dart new file mode 100644 index 000000000..657882d8f --- /dev/null +++ b/packages/patrol_gen/lib/src/generators/ios/ios_url_session_client_generator.dart @@ -0,0 +1,24 @@ +import 'package:patrol_gen/src/generators/ios/ios_config.dart'; +import 'package:patrol_gen/src/generators/output_file.dart'; +import 'package:patrol_gen/src/schema.dart'; + +class IOSURLSessionClientGenerator { + OutputFile generate(Service service, IOSConfig config) { + final buffer = StringBuffer()..write(_contentPrefix(config)); + + return OutputFile( + filename: config.clientFileName(service.name), + content: buffer.toString(), + ); + } + + String _contentPrefix(IOSConfig config) { + return ''' +/// +// Generated code. Do not modify. +// source: schema.dart +// + +'''; + } +} diff --git a/packages/patrol_gen/lib/src/patrol_gen.dart b/packages/patrol_gen/lib/src/patrol_gen.dart index 2db5f5a8e..c6458e070 100644 --- a/packages/patrol_gen/lib/src/patrol_gen.dart +++ b/packages/patrol_gen/lib/src/patrol_gen.dart @@ -20,17 +20,13 @@ class PatrolGenConfig { class PatrolGen { Future run(PatrolGenConfig config) async { final schema = await resolveSchema(config.schemaFilename); - final files = DartGenerator().generate(schema, config.dartConfig); - final swiftContent = - IOSGenerator().generateContent(schema, config.iosConfig); + final files = DartGenerator().generate(schema, config.dartConfig); + files.addAll(IOSGenerator().generate(schema, config.iosConfig)); for (var outputFile in files) { await File(outputFile.filename) .writeAsString(outputFile.content, flush: true); } - - await File(config.iosConfig.contractsFilename) - .writeAsString(swiftContent, flush: true); } } diff --git a/packages/patrol_gen/lib/src/resolve_schema.dart b/packages/patrol_gen/lib/src/resolve_schema.dart index f73d82638..a47685485 100644 --- a/packages/patrol_gen/lib/src/resolve_schema.dart +++ b/packages/patrol_gen/lib/src/resolve_schema.dart @@ -37,9 +37,9 @@ Service _createService(ClassDeclaration declaration, List messages) { .toSet() ?? {}; - final swiftGenConfig = ServiceGenConfig( - genericTypes.contains('SwiftClient'), - genericTypes.contains('SwiftServer'), + final iosGenConfig = ServiceGenConfig( + genericTypes.contains('IOSClient'), + genericTypes.contains('IOSServer'), ); final dartGenConfig = ServiceGenConfig( @@ -49,7 +49,7 @@ Service _createService(ClassDeclaration declaration, List messages) { return Service( declaration.name.lexeme, - swiftGenConfig, + iosGenConfig, dartGenConfig, declaration.members.whereType().map((method) { final returnType = method.returnType; diff --git a/packages/patrol_gen/lib/src/schema.dart b/packages/patrol_gen/lib/src/schema.dart index 3ab5e2d07..349b08554 100644 --- a/packages/patrol_gen/lib/src/schema.dart +++ b/packages/patrol_gen/lib/src/schema.dart @@ -37,11 +37,11 @@ class ServiceGenConfig { } class Service { - const Service(this.name, this.swift, this.dart, this.endpoints); + const Service(this.name, this.ios, this.dart, this.endpoints); final List endpoints; final String name; - final ServiceGenConfig swift; + final ServiceGenConfig ios; final ServiceGenConfig dart; } diff --git a/schema.dart b/schema.dart index 79bb18cb6..64af7f89b 100644 --- a/schema.dart +++ b/schema.dart @@ -27,7 +27,7 @@ class RunDartTestResponse { String? details; } -abstract class PatrolAppService { +abstract class PatrolAppService { ListDartTestsResponse listDartTests(); RunDartTestResponse runDartTest(RunDartTestRequest request); } @@ -154,7 +154,7 @@ class SetLocationAccuracyRequest { SetLocationAccuracyRequestLocationAccuracy? locationAccuracy; } -abstract class NativeAutomator { +abstract class NativeAutomator { void initialize(); void configure(ConfigureRequest request); From 26d08403c059ef31e4fc7c1ab9c43b2e86ee74dc Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Tue, 22 Aug 2023 11:50:39 +0200 Subject: [PATCH 018/110] Fix schema --- packages/patrol/lib/src/common.dart | 4 +- .../lib/src/native/contracts/contracts.dart | 148 +++++++++--------- .../lib/src/native/contracts/contracts.g.dart | 93 +++++------ packages/patrol/test/internals_test.dart | 9 +- schema.dart | 74 ++++----- 5 files changed, 164 insertions(+), 164 deletions(-) diff --git a/packages/patrol/lib/src/common.dart b/packages/patrol/lib/src/common.dart index b714a7080..7683dd7d3 100644 --- a/packages/patrol/lib/src/common.dart +++ b/packages/patrol/lib/src/common.dart @@ -161,11 +161,11 @@ DartTestGroup createDartTestGroup( String prefix = '', }) { final groupName = topLevelGroup.name.replaceFirst(prefix, '').trim(); - final group = DartTestGroup(name: groupName, groups: []); + final group = DartTestGroup(name: groupName, tests: [], groups: []); for (final entry in topLevelGroup.entries) { if (entry is Group) { - group.groups.add(DartTestGroup(name: entry.name, groups: [])); + group.groups.add(DartTestGroup(name: entry.name, tests: [], groups: [])); } if (entry is Test && entry.name != 'patrol_test_explorer') { diff --git a/packages/patrol/lib/src/native/contracts/contracts.dart b/packages/patrol/lib/src/native/contracts/contracts.dart index 2fa27060b..1b2972886 100644 --- a/packages/patrol/lib/src/native/contracts/contracts.dart +++ b/packages/patrol/lib/src/native/contracts/contracts.dart @@ -50,16 +50,16 @@ class DartTestCase { @JsonSerializable() class DartTestGroup { DartTestGroup({ - this.name, - this.tests, + required this.name, + required this.tests, required this.groups, }); factory DartTestGroup.fromJson(Map json) => _$DartTestGroupFromJson(json); - final String? name; - final List? tests; + final String name; + final List tests; final List groups; Map toJson() => _$DartTestGroupToJson(this); @@ -82,13 +82,13 @@ class ListDartTestsResponse { @JsonSerializable() class RunDartTestRequest { RunDartTestRequest({ - this.name, + required this.name, }); factory RunDartTestRequest.fromJson(Map json) => _$RunDartTestRequestFromJson(json); - final String? name; + final String name; Map toJson() => _$RunDartTestRequestToJson(this); } @@ -126,13 +126,13 @@ class ConfigureRequest { @JsonSerializable() class OpenAppRequest { OpenAppRequest({ - this.appId, + required this.appId, }); factory OpenAppRequest.fromJson(Map json) => _$OpenAppRequestFromJson(json); - final String? appId; + final String appId; Map toJson() => _$OpenAppRequestToJson(this); } @@ -186,15 +186,15 @@ class Selector { @JsonSerializable() class GetNativeViewsRequest { GetNativeViewsRequest({ - this.selector, - this.appId, + required this.selector, + required this.appId, }); factory GetNativeViewsRequest.fromJson(Map json) => _$GetNativeViewsRequestFromJson(json); - final Selector? selector; - final String? appId; + final Selector selector; + final String appId; Map toJson() => _$GetNativeViewsRequestToJson(this); } @@ -202,29 +202,29 @@ class GetNativeViewsRequest { @JsonSerializable() class NativeView { NativeView({ - this.className, - this.text, - this.contentDescription, - this.focused, - this.enabled, - this.childCount, - this.resourceName, - this.applicationPackage, - this.children, + required this.className, + required this.text, + required this.contentDescription, + required this.focused, + required this.enabled, + required this.childCount, + required this.resourceName, + required this.applicationPackage, + required this.children, }); factory NativeView.fromJson(Map json) => _$NativeViewFromJson(json); - final String? className; - final String? text; - final String? contentDescription; - final bool? focused; - final bool? enabled; - final int? childCount; - final String? resourceName; - final String? applicationPackage; - final List? children; + final String className; + final String text; + final String contentDescription; + final bool focused; + final bool enabled; + final int childCount; + final String resourceName; + final String applicationPackage; + final List children; Map toJson() => _$NativeViewToJson(this); } @@ -232,13 +232,13 @@ class NativeView { @JsonSerializable() class GetNativeViewsResponse { GetNativeViewsResponse({ - this.nativeViews, + required this.nativeViews, }); factory GetNativeViewsResponse.fromJson(Map json) => _$GetNativeViewsResponseFromJson(json); - final List? nativeViews; + final List nativeViews; Map toJson() => _$GetNativeViewsResponseToJson(this); } @@ -246,15 +246,15 @@ class GetNativeViewsResponse { @JsonSerializable() class TapRequest { TapRequest({ - this.selector, - this.appId, + required this.selector, + required this.appId, }); factory TapRequest.fromJson(Map json) => _$TapRequestFromJson(json); - final Selector? selector; - final String? appId; + final Selector selector; + final String appId; Map toJson() => _$TapRequestToJson(this); } @@ -262,8 +262,8 @@ class TapRequest { @JsonSerializable() class EnterTextRequest { EnterTextRequest({ - this.data, - this.appId, + required this.data, + required this.appId, this.index, this.selector, this.showKeyboard, @@ -272,8 +272,8 @@ class EnterTextRequest { factory EnterTextRequest.fromJson(Map json) => _$EnterTextRequestFromJson(json); - final String? data; - final String? appId; + final String data; + final String appId; final int? index; final Selector? selector; final bool? showKeyboard; @@ -284,23 +284,23 @@ class EnterTextRequest { @JsonSerializable() class SwipeRequest { SwipeRequest({ - this.startX, - this.startY, - this.endX, - this.endY, - this.steps, - this.appId, + required this.startX, + required this.startY, + required this.endX, + required this.endY, + required this.steps, + required this.appId, }); factory SwipeRequest.fromJson(Map json) => _$SwipeRequestFromJson(json); - final double? startX; - final double? startY; - final double? endX; - final double? endY; - final int? steps; - final String? appId; + final double startX; + final double startY; + final double endX; + final double endY; + final int steps; + final String appId; Map toJson() => _$SwipeRequestToJson(this); } @@ -308,15 +308,15 @@ class SwipeRequest { @JsonSerializable() class WaitUntilVisibleRequest { WaitUntilVisibleRequest({ - this.selector, - this.appId, + required this.selector, + required this.appId, }); factory WaitUntilVisibleRequest.fromJson(Map json) => _$WaitUntilVisibleRequestFromJson(json); - final Selector? selector; - final String? appId; + final Selector selector; + final String appId; Map toJson() => _$WaitUntilVisibleRequestToJson(this); } @@ -324,13 +324,13 @@ class WaitUntilVisibleRequest { @JsonSerializable() class DarkModeRequest { DarkModeRequest({ - this.appId, + required this.appId, }); factory DarkModeRequest.fromJson(Map json) => _$DarkModeRequestFromJson(json); - final String? appId; + final String appId; Map toJson() => _$DarkModeRequestToJson(this); } @@ -339,18 +339,18 @@ class DarkModeRequest { class Notification { Notification({ this.appName, - this.title, - this.content, - this.raw, + required this.title, + required this.content, + required this.raw, }); factory Notification.fromJson(Map json) => _$NotificationFromJson(json); final String? appName; - final String? title; - final String? content; - final String? raw; + final String title; + final String content; + final String raw; Map toJson() => _$NotificationToJson(this); } @@ -358,13 +358,13 @@ class Notification { @JsonSerializable() class GetNotificationsResponse { GetNotificationsResponse({ - this.notifications, + required this.notifications, }); factory GetNotificationsResponse.fromJson(Map json) => _$GetNotificationsResponseFromJson(json); - final List? notifications; + final List notifications; Map toJson() => _$GetNotificationsResponseToJson(this); } @@ -398,13 +398,13 @@ class TapOnNotificationRequest { @JsonSerializable() class PermissionDialogVisibleResponse { PermissionDialogVisibleResponse({ - this.visible, + required this.visible, }); factory PermissionDialogVisibleResponse.fromJson(Map json) => _$PermissionDialogVisibleResponseFromJson(json); - final bool? visible; + final bool visible; Map toJson() => _$PermissionDialogVisibleResponseToJson(this); @@ -413,13 +413,13 @@ class PermissionDialogVisibleResponse { @JsonSerializable() class PermissionDialogVisibleRequest { PermissionDialogVisibleRequest({ - this.timeoutMillis, + required this.timeoutMillis, }); factory PermissionDialogVisibleRequest.fromJson(Map json) => _$PermissionDialogVisibleRequestFromJson(json); - final int? timeoutMillis; + final int timeoutMillis; Map toJson() => _$PermissionDialogVisibleRequestToJson(this); } @@ -427,13 +427,13 @@ class PermissionDialogVisibleRequest { @JsonSerializable() class HandlePermissionRequest { HandlePermissionRequest({ - this.code, + required this.code, }); factory HandlePermissionRequest.fromJson(Map json) => _$HandlePermissionRequestFromJson(json); - final HandlePermissionRequestCode? code; + final HandlePermissionRequestCode code; Map toJson() => _$HandlePermissionRequestToJson(this); } @@ -441,13 +441,13 @@ class HandlePermissionRequest { @JsonSerializable() class SetLocationAccuracyRequest { SetLocationAccuracyRequest({ - this.locationAccuracy, + required this.locationAccuracy, }); factory SetLocationAccuracyRequest.fromJson(Map json) => _$SetLocationAccuracyRequestFromJson(json); - final SetLocationAccuracyRequestLocationAccuracy? locationAccuracy; + final SetLocationAccuracyRequestLocationAccuracy locationAccuracy; Map toJson() => _$SetLocationAccuracyRequestToJson(this); } diff --git a/packages/patrol/lib/src/native/contracts/contracts.g.dart b/packages/patrol/lib/src/native/contracts/contracts.g.dart index 2a16a99a4..ec11a227a 100644 --- a/packages/patrol/lib/src/native/contracts/contracts.g.dart +++ b/packages/patrol/lib/src/native/contracts/contracts.g.dart @@ -17,9 +17,9 @@ Map _$DartTestCaseToJson(DartTestCase instance) => DartTestGroup _$DartTestGroupFromJson(Map json) => DartTestGroup( - name: json['name'] as String?, - tests: (json['tests'] as List?) - ?.map((e) => DartTestCase.fromJson(e as Map)) + name: json['name'] as String, + tests: (json['tests'] as List) + .map((e) => DartTestCase.fromJson(e as Map)) .toList(), groups: (json['groups'] as List) .map((e) => DartTestGroup.fromJson(e as Map)) @@ -47,7 +47,7 @@ Map _$ListDartTestsResponseToJson( RunDartTestRequest _$RunDartTestRequestFromJson(Map json) => RunDartTestRequest( - name: json['name'] as String?, + name: json['name'] as String, ); Map _$RunDartTestRequestToJson(RunDartTestRequest instance) => @@ -86,7 +86,7 @@ Map _$ConfigureRequestToJson(ConfigureRequest instance) => OpenAppRequest _$OpenAppRequestFromJson(Map json) => OpenAppRequest( - appId: json['appId'] as String?, + appId: json['appId'] as String, ); Map _$OpenAppRequestToJson(OpenAppRequest instance) => @@ -136,10 +136,8 @@ Map _$SelectorToJson(Selector instance) => { GetNativeViewsRequest _$GetNativeViewsRequestFromJson( Map json) => GetNativeViewsRequest( - selector: json['selector'] == null - ? null - : Selector.fromJson(json['selector'] as Map), - appId: json['appId'] as String?, + selector: Selector.fromJson(json['selector'] as Map), + appId: json['appId'] as String, ); Map _$GetNativeViewsRequestToJson( @@ -150,16 +148,16 @@ Map _$GetNativeViewsRequestToJson( }; NativeView _$NativeViewFromJson(Map json) => NativeView( - className: json['className'] as String?, - text: json['text'] as String?, - contentDescription: json['contentDescription'] as String?, - focused: json['focused'] as bool?, - enabled: json['enabled'] as bool?, - childCount: json['childCount'] as int?, - resourceName: json['resourceName'] as String?, - applicationPackage: json['applicationPackage'] as String?, - children: (json['children'] as List?) - ?.map((e) => NativeView.fromJson(e as Map)) + className: json['className'] as String, + text: json['text'] as String, + contentDescription: json['contentDescription'] as String, + focused: json['focused'] as bool, + enabled: json['enabled'] as bool, + childCount: json['childCount'] as int, + resourceName: json['resourceName'] as String, + applicationPackage: json['applicationPackage'] as String, + children: (json['children'] as List) + .map((e) => NativeView.fromJson(e as Map)) .toList(), ); @@ -179,8 +177,8 @@ Map _$NativeViewToJson(NativeView instance) => GetNativeViewsResponse _$GetNativeViewsResponseFromJson( Map json) => GetNativeViewsResponse( - nativeViews: (json['nativeViews'] as List?) - ?.map((e) => NativeView.fromJson(e as Map)) + nativeViews: (json['nativeViews'] as List) + .map((e) => NativeView.fromJson(e as Map)) .toList(), ); @@ -191,10 +189,8 @@ Map _$GetNativeViewsResponseToJson( }; TapRequest _$TapRequestFromJson(Map json) => TapRequest( - selector: json['selector'] == null - ? null - : Selector.fromJson(json['selector'] as Map), - appId: json['appId'] as String?, + selector: Selector.fromJson(json['selector'] as Map), + appId: json['appId'] as String, ); Map _$TapRequestToJson(TapRequest instance) => @@ -205,8 +201,8 @@ Map _$TapRequestToJson(TapRequest instance) => EnterTextRequest _$EnterTextRequestFromJson(Map json) => EnterTextRequest( - data: json['data'] as String?, - appId: json['appId'] as String?, + data: json['data'] as String, + appId: json['appId'] as String, index: json['index'] as int?, selector: json['selector'] == null ? null @@ -224,12 +220,12 @@ Map _$EnterTextRequestToJson(EnterTextRequest instance) => }; SwipeRequest _$SwipeRequestFromJson(Map json) => SwipeRequest( - startX: (json['startX'] as num?)?.toDouble(), - startY: (json['startY'] as num?)?.toDouble(), - endX: (json['endX'] as num?)?.toDouble(), - endY: (json['endY'] as num?)?.toDouble(), - steps: json['steps'] as int?, - appId: json['appId'] as String?, + startX: (json['startX'] as num).toDouble(), + startY: (json['startY'] as num).toDouble(), + endX: (json['endX'] as num).toDouble(), + endY: (json['endY'] as num).toDouble(), + steps: json['steps'] as int, + appId: json['appId'] as String, ); Map _$SwipeRequestToJson(SwipeRequest instance) => @@ -245,10 +241,8 @@ Map _$SwipeRequestToJson(SwipeRequest instance) => WaitUntilVisibleRequest _$WaitUntilVisibleRequestFromJson( Map json) => WaitUntilVisibleRequest( - selector: json['selector'] == null - ? null - : Selector.fromJson(json['selector'] as Map), - appId: json['appId'] as String?, + selector: Selector.fromJson(json['selector'] as Map), + appId: json['appId'] as String, ); Map _$WaitUntilVisibleRequestToJson( @@ -260,7 +254,7 @@ Map _$WaitUntilVisibleRequestToJson( DarkModeRequest _$DarkModeRequestFromJson(Map json) => DarkModeRequest( - appId: json['appId'] as String?, + appId: json['appId'] as String, ); Map _$DarkModeRequestToJson(DarkModeRequest instance) => @@ -270,9 +264,9 @@ Map _$DarkModeRequestToJson(DarkModeRequest instance) => Notification _$NotificationFromJson(Map json) => Notification( appName: json['appName'] as String?, - title: json['title'] as String?, - content: json['content'] as String?, - raw: json['raw'] as String?, + title: json['title'] as String, + content: json['content'] as String, + raw: json['raw'] as String, ); Map _$NotificationToJson(Notification instance) => @@ -286,8 +280,8 @@ Map _$NotificationToJson(Notification instance) => GetNotificationsResponse _$GetNotificationsResponseFromJson( Map json) => GetNotificationsResponse( - notifications: (json['notifications'] as List?) - ?.map((e) => Notification.fromJson(e as Map)) + notifications: (json['notifications'] as List) + .map((e) => Notification.fromJson(e as Map)) .toList(), ); @@ -324,7 +318,7 @@ Map _$TapOnNotificationRequestToJson( PermissionDialogVisibleResponse _$PermissionDialogVisibleResponseFromJson( Map json) => PermissionDialogVisibleResponse( - visible: json['visible'] as bool?, + visible: json['visible'] as bool, ); Map _$PermissionDialogVisibleResponseToJson( @@ -336,7 +330,7 @@ Map _$PermissionDialogVisibleResponseToJson( PermissionDialogVisibleRequest _$PermissionDialogVisibleRequestFromJson( Map json) => PermissionDialogVisibleRequest( - timeoutMillis: json['timeoutMillis'] as int?, + timeoutMillis: json['timeoutMillis'] as int, ); Map _$PermissionDialogVisibleRequestToJson( @@ -348,14 +342,13 @@ Map _$PermissionDialogVisibleRequestToJson( HandlePermissionRequest _$HandlePermissionRequestFromJson( Map json) => HandlePermissionRequest( - code: $enumDecodeNullable( - _$HandlePermissionRequestCodeEnumMap, json['code']), + code: $enumDecode(_$HandlePermissionRequestCodeEnumMap, json['code']), ); Map _$HandlePermissionRequestToJson( HandlePermissionRequest instance) => { - 'code': _$HandlePermissionRequestCodeEnumMap[instance.code], + 'code': _$HandlePermissionRequestCodeEnumMap[instance.code]!, }; const _$HandlePermissionRequestCodeEnumMap = { @@ -367,7 +360,7 @@ const _$HandlePermissionRequestCodeEnumMap = { SetLocationAccuracyRequest _$SetLocationAccuracyRequestFromJson( Map json) => SetLocationAccuracyRequest( - locationAccuracy: $enumDecodeNullable( + locationAccuracy: $enumDecode( _$SetLocationAccuracyRequestLocationAccuracyEnumMap, json['locationAccuracy']), ); @@ -376,7 +369,7 @@ Map _$SetLocationAccuracyRequestToJson( SetLocationAccuracyRequest instance) => { 'locationAccuracy': _$SetLocationAccuracyRequestLocationAccuracyEnumMap[ - instance.locationAccuracy], + instance.locationAccuracy]!, }; const _$SetLocationAccuracyRequestLocationAccuracyEnumMap = { diff --git a/packages/patrol/test/internals_test.dart b/packages/patrol/test/internals_test.dart index 6ba104822..599553e7d 100644 --- a/packages/patrol/test/internals_test.dart +++ b/packages/patrol/test/internals_test.dart @@ -61,16 +61,23 @@ void main() { dartTestGroup, DartTestGroup( name: '', + tests: [], groups: [ DartTestGroup( name: 'permissions.permissions_location_test', groups: [], + tests: [], ), DartTestGroup( name: 'permissions.permissions_many_test', groups: [], + tests: [], + ), + DartTestGroup( + name: 'example_test', + groups: [], + tests: [], ), - DartTestGroup(name: 'example_test', groups: []), ], ), ); diff --git a/schema.dart b/schema.dart index 64af7f89b..cbc351392 100644 --- a/schema.dart +++ b/schema.dart @@ -3,8 +3,8 @@ class DartTestCase { } class DartTestGroup { - String? name; - List? tests; + late String name; + late List tests; late List groups; } @@ -19,7 +19,7 @@ enum RunDartTestResponseResult { } class RunDartTestRequest { - String? name; + late String name; } class RunDartTestResponse { @@ -37,7 +37,7 @@ class ConfigureRequest { } class OpenAppRequest { - String? appId; + late String appId; } class OpenQuickSettingsRequest {} @@ -58,66 +58,66 @@ class Selector { } class GetNativeViewsRequest { - Selector? selector; - String? appId; + late Selector selector; + late String appId; } class NativeView { - String? className; - String? text; - String? contentDescription; - bool? focused; - bool? enabled; - int? childCount; - String? resourceName; - String? applicationPackage; - List? children; + late String className; + late String text; + late String contentDescription; + late bool focused; + late bool enabled; + late int childCount; + late String resourceName; + late String applicationPackage; + late List children; } class GetNativeViewsResponse { - List? nativeViews; + late List nativeViews; } class TapRequest { - Selector? selector; - String? appId; + late Selector selector; + late String appId; } class EnterTextRequest { - String? data; - String? appId; + late String data; + late String appId; int? index; Selector? selector; bool? showKeyboard; } class SwipeRequest { - double? startX; - double? startY; - double? endX; - double? endY; - int? steps; - String? appId; + late double startX; + late double startY; + late double endX; + late double endY; + late int steps; + late String appId; } class WaitUntilVisibleRequest { - Selector? selector; - String? appId; + late Selector selector; + late String appId; } class DarkModeRequest { - String? appId; + late String appId; } class Notification { String? appName; - String? title; - String? content; - String? raw; + late String title; + late String content; + late String raw; } class GetNotificationsResponse { - List? notifications; + late List notifications; } class GetNotificationsRequest {} @@ -128,11 +128,11 @@ class TapOnNotificationRequest { } class PermissionDialogVisibleResponse { - bool? visible; + late bool visible; } class PermissionDialogVisibleRequest { - int? timeoutMillis; + late int timeoutMillis; } enum HandlePermissionRequestCode { @@ -142,7 +142,7 @@ enum HandlePermissionRequestCode { } class HandlePermissionRequest { - HandlePermissionRequestCode? code; + late HandlePermissionRequestCode code; } enum SetLocationAccuracyRequestLocationAccuracy { @@ -151,7 +151,7 @@ enum SetLocationAccuracyRequestLocationAccuracy { } class SetLocationAccuracyRequest { - SetLocationAccuracyRequestLocationAccuracy? locationAccuracy; + late SetLocationAccuracyRequestLocationAccuracy locationAccuracy; } abstract class NativeAutomator { From 4a0496a9d418fdbae80a0e3d1daef4d94948bcae Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Tue, 22 Aug 2023 12:05:05 +0200 Subject: [PATCH 019/110] Migrate swift PatrolAppServiceClient --- .../Classes/AutomatorServer/Contracts.swift | 160 ++++++++++++++++++ .../PatrolAppServiceClient.swift | 38 +++++ .../AutomatorServer/PatrolServer.swift | 2 +- ...swift => ObjCPatrolAppServiceClient.swift} | 26 ++- .../ios/Classes/PatrolIntegrationTestRunner.h | 2 +- .../contracts/patrol_app_service_server.dart | 4 +- .../lib/src/native/patrol_app_service.dart | 16 +- .../dart/dart_shelf_server_generator.dart | 2 +- .../ios/ios_contracts_generator.dart | 11 +- .../ios/ios_url_session_client_generator.dart | 58 +++++++ 10 files changed, 288 insertions(+), 31 deletions(-) create mode 100644 packages/patrol/ios/Classes/AutomatorServer/Contracts.swift create mode 100644 packages/patrol/ios/Classes/AutomatorServer/PatrolAppServiceClient.swift rename packages/patrol/ios/Classes/{PatrolAppServiceClient.swift => ObjCPatrolAppServiceClient.swift} (68%) diff --git a/packages/patrol/ios/Classes/AutomatorServer/Contracts.swift b/packages/patrol/ios/Classes/AutomatorServer/Contracts.swift new file mode 100644 index 000000000..0557a883a --- /dev/null +++ b/packages/patrol/ios/Classes/AutomatorServer/Contracts.swift @@ -0,0 +1,160 @@ +/// +// Generated code. Do not modify. +// source: schema.dart +// + +enum RunDartTestResponseResult: String, Codable { + case success + case skipped + case failure +} + +enum HandlePermissionRequestCode: String, Codable { + case whileUsing + case onlyThisTime + case denied +} + +enum SetLocationAccuracyRequestLocationAccuracy: String, Codable { + case coarse + case fine +} + +struct DartTestCase: Codable { + var name: String +} + +struct DartTestGroup: Codable { + var name: String + var tests: [DartTestCase] + var groups: [DartTestGroup] +} + +struct ListDartTestsResponse: Codable { + var group: DartTestGroup +} + +struct RunDartTestRequest: Codable { + var name: String +} + +struct RunDartTestResponse: Codable { + var result: RunDartTestResponseResult + var details: String? +} + +struct ConfigureRequest: Codable { + var findTimeoutMillis: Int +} + +struct OpenAppRequest: Codable { + var appId: String +} + +struct OpenQuickSettingsRequest: Codable { + +} + +struct Selector: Codable { + var text: String? + var textStartsWith: String? + var textContains: String? + var className: String? + var contentDescription: String? + var contentDescriptionStartsWith: String? + var contentDescriptionContains: String? + var resourceId: String? + var instance: Int? + var enabled: Bool? + var focused: Bool? + var pkg: String? +} + +struct GetNativeViewsRequest: Codable { + var selector: Selector + var appId: String +} + +struct NativeView: Codable { + var className: String + var text: String + var contentDescription: String + var focused: Bool + var enabled: Bool + var childCount: Int + var resourceName: String + var applicationPackage: String + var children: [NativeView] +} + +struct GetNativeViewsResponse: Codable { + var nativeViews: [NativeView] +} + +struct TapRequest: Codable { + var selector: Selector + var appId: String +} + +struct EnterTextRequest: Codable { + var data: String + var appId: String + var index: Int? + var selector: Selector? + var showKeyboard: Bool? +} + +struct SwipeRequest: Codable { + var startX: Double + var startY: Double + var endX: Double + var endY: Double + var steps: Int + var appId: String +} + +struct WaitUntilVisibleRequest: Codable { + var selector: Selector + var appId: String +} + +struct DarkModeRequest: Codable { + var appId: String +} + +struct Notification: Codable { + var appName: String? + var title: String + var content: String + var raw: String +} + +struct GetNotificationsResponse: Codable { + var notifications: [Notification] +} + +struct GetNotificationsRequest: Codable { + +} + +struct TapOnNotificationRequest: Codable { + var index: Int? + var selector: Selector? +} + +struct PermissionDialogVisibleResponse: Codable { + var visible: Bool +} + +struct PermissionDialogVisibleRequest: Codable { + var timeoutMillis: Int +} + +struct HandlePermissionRequest: Codable { + var code: HandlePermissionRequestCode +} + +struct SetLocationAccuracyRequest: Codable { + var locationAccuracy: SetLocationAccuracyRequestLocationAccuracy +} + diff --git a/packages/patrol/ios/Classes/AutomatorServer/PatrolAppServiceClient.swift b/packages/patrol/ios/Classes/AutomatorServer/PatrolAppServiceClient.swift new file mode 100644 index 000000000..9875caf57 --- /dev/null +++ b/packages/patrol/ios/Classes/AutomatorServer/PatrolAppServiceClient.swift @@ -0,0 +1,38 @@ +/// +// Generated code. Do not modify. +// source: schema.dart +// + +class PatrolAppServiceClient { + private let port: Int + private let address: String + + init(port: Int, address: String) { + self.port = port + self.address = address + } + + func listDartTests() async throws -> ListDartTestsResponse { + return try await performRequest(commandName: "listDartTests") + } + + func runDartTest(request: RunDartTestRequest) async throws -> RunDartTestResponse { + let body = try JSONEncoder().encode(request) + return try await performRequest(commandName: "runDartTest", body: body) + } + + private func performRequest(commandName: String, body: Data? = nil) async throws -> TResult { + let url = URL(string: "http://\(address):\(port)/\(commandName)")! + + var request = URLRequest(url: url) + request.httpMethod = "POST" + request.httpBody = body + + let (data, response) = try await URLSession.shared.data(for: request) + guard (response as? HTTPURLResponse)?.statusCode == 200 else { + throw PatrolError.internal("Invalid response: \(response) \(data)") + } + + return try JSONDecoder().decode(TResult.self, from: data) + } +} diff --git a/packages/patrol/ios/Classes/AutomatorServer/PatrolServer.swift b/packages/patrol/ios/Classes/AutomatorServer/PatrolServer.swift index c4696d5b6..b8368545c 100644 --- a/packages/patrol/ios/Classes/AutomatorServer/PatrolServer.swift +++ b/packages/patrol/ios/Classes/AutomatorServer/PatrolServer.swift @@ -56,7 +56,7 @@ import NIOPosix host: "0.0.0.0", port: port ).get() - Logger.shared.i("Server started on http://localhost:\(port)") + Logger.shared.i("Server started on http://0.0.0.0:\(port)") try await server.onClose.get() Logger.shared.i("Server stopped") diff --git a/packages/patrol/ios/Classes/PatrolAppServiceClient.swift b/packages/patrol/ios/Classes/ObjCPatrolAppServiceClient.swift similarity index 68% rename from packages/patrol/ios/Classes/PatrolAppServiceClient.swift rename to packages/patrol/ios/Classes/ObjCPatrolAppServiceClient.swift index c7a9fcfa7..7809b671e 100644 --- a/packages/patrol/ios/Classes/PatrolAppServiceClient.swift +++ b/packages/patrol/ios/Classes/ObjCPatrolAppServiceClient.swift @@ -1,6 +1,4 @@ -import GRPC import Logging -import NIO /// The sole reason for existence of this class is that Swift Protobufs can't be used in Objective-C. @objc public class RunDartTestResponse2: NSObject { @@ -18,36 +16,32 @@ import NIO /// The client must do its work off the main thread. Otherwise, a deadlock will quickly appear. /// That's because the main thread is used by methods in ``Automator``, which perform /// various UI actions such as tapping, entering text, etc., and they must be called on the main thread. -@objc public class PatrolAppServiceClient: NSObject { +@objc public class ObjCPatrolAppServiceClient: NSObject { - private let client: Patrol_PatrolAppServiceAsyncClient + private let client: PatrolAppServiceClient /// Construct client for accessing PatrolAppService server using the existing channel. @objc public override init() { let port = 8082 // TODO: Document this value better + NSLog("PatrolAppServiceClient: created, port: \(port)") - let group = MultiThreadedEventLoopGroup(numberOfThreads: 1) - let channel = try! GRPCChannelPool.with( - target: .host("localhost", port: port), - transportSecurity: .plaintext, - eventLoopGroup: group - ) - - client = Patrol_PatrolAppServiceAsyncClient(channel: channel) + + client = PatrolAppServiceClient(port: port, address: "127.0.0.1") } @objc public func listDartTests() async throws -> [String] { NSLog("PatrolAppServiceClient.listDartTests()") - let request = Patrol_Empty() - let response = try await client.listDartTests(request) + + let response = try await client.listDartTests() return response.group.groups.map { $0.name } } @objc public func runDartTest(name: String) async throws -> RunDartTestResponse2 { NSLog("PatrolAppServiceClient.runDartTest(\(name))") - let request = Patrol_RunDartTestRequest.with { $0.name = name } - let result = try await client.runDartTest(request) + + let request = RunDartTestRequest(name: name) + let result = try await client.runDartTest(request: request) return RunDartTestResponse2( passed: result.result == .success, diff --git a/packages/patrol/ios/Classes/PatrolIntegrationTestRunner.h b/packages/patrol/ios/Classes/PatrolIntegrationTestRunner.h index 6e576d993..9c5f54c3f 100644 --- a/packages/patrol/ios/Classes/PatrolIntegrationTestRunner.h +++ b/packages/patrol/ios/Classes/PatrolIntegrationTestRunner.h @@ -23,7 +23,7 @@ }]; \ \ /* Create a client for PatrolAppService, which lets us list and run Dart tests */ \ - __block PatrolAppServiceClient *appServiceClient = [[PatrolAppServiceClient alloc] init]; \ + __block ObjCPatrolAppServiceClient *appServiceClient = [[ObjCPatrolAppServiceClient alloc] init]; \ \ /* Allow the Local Network permission required by Dart Observatory */ \ XCUIApplication *springboard = [[XCUIApplication alloc] initWithBundleIdentifier:@"com.apple.springboard"]; \ diff --git a/packages/patrol/lib/src/native/contracts/patrol_app_service_server.dart b/packages/patrol/lib/src/native/contracts/patrol_app_service_server.dart index a1ab90f9e..72c069b6c 100644 --- a/packages/patrol/lib/src/native/contracts/patrol_app_service_server.dart +++ b/packages/patrol/lib/src/native/contracts/patrol_app_service_server.dart @@ -13,12 +13,12 @@ import 'contracts.dart'; abstract class PatrolAppServiceServer { FutureOr handle(Request request) async { - if ('/listDartTests' == request.url.path) { + if ('listDartTests' == request.url.path) { final result = await listDartTests(); final body = jsonEncode(result.toJson()); return Response.ok(body); - } else if ('/runDartTest' == request.url.path) { + } else if ('runDartTest' == request.url.path) { final stringContent = await request.readAsString(utf8); final json = jsonDecode(stringContent); final requestObj = diff --git a/packages/patrol/lib/src/native/patrol_app_service.dart b/packages/patrol/lib/src/native/patrol_app_service.dart index 803912d98..764692e0d 100644 --- a/packages/patrol/lib/src/native/patrol_app_service.dart +++ b/packages/patrol/lib/src/native/patrol_app_service.dart @@ -2,10 +2,12 @@ // TODO: Use a logger instead of print import 'dart:async'; +import 'dart:io'; import 'package:patrol/src/native/contracts/contracts.dart'; import 'package:patrol/src/native/contracts/patrol_app_service_server.dart'; +import 'package:shelf/shelf.dart' as shelf; import 'package:shelf/shelf_io.dart' as shelf_io; const _port = 8082; @@ -19,12 +21,16 @@ class _TestExecutionResult { /// Starts the gRPC server that runs the [PatrolAppService]. Future runAppService(PatrolAppService service) async { + final pipeline = const shelf.Pipeline() + .addMiddleware(shelf.logRequests()) + .addHandler((request) async { + final result = await service.handle(request); + return result!; + }); + await shelf_io.serve( - (request) async { - final result = await service.handle(request); - return result!; - }, - '0.0.0.0', + pipeline, + InternetAddress.anyIPv4, _port, ); diff --git a/packages/patrol_gen/lib/src/generators/dart/dart_shelf_server_generator.dart b/packages/patrol_gen/lib/src/generators/dart/dart_shelf_server_generator.dart index b1f1842bf..0187a2aef 100644 --- a/packages/patrol_gen/lib/src/generators/dart/dart_shelf_server_generator.dart +++ b/packages/patrol_gen/lib/src/generators/dart/dart_shelf_server_generator.dart @@ -62,7 +62,7 @@ return Response.ok(body);'''; final elseKeyword = e == service.endpoints.first ? '' : 'else'; return ''' -$elseKeyword if ('/${e.name}' == request.url.path){ +$elseKeyword if ('${e.name}' == request.url.path){ $requestDeserialization diff --git a/packages/patrol_gen/lib/src/generators/ios/ios_contracts_generator.dart b/packages/patrol_gen/lib/src/generators/ios/ios_contracts_generator.dart index 4e356a19b..233e66af5 100644 --- a/packages/patrol_gen/lib/src/generators/ios/ios_contracts_generator.dart +++ b/packages/patrol_gen/lib/src/generators/ios/ios_contracts_generator.dart @@ -26,11 +26,12 @@ class IOSContractsGenerator { } String _createMessage(Message message) { - final fields = message.fields - .map((e) => e.isList - ? ' var ${e.name}: [${_transformType(e.type)}]' - : ' var ${e.name}: ${_transformType(e.type)}') - .join('\n'); + final fields = message.fields.map((e) { + final optional = e.isOptional ? '?' : ''; + return e.isList + ? ' var ${e.name}: [${_transformType(e.type)}]$optional' + : ' var ${e.name}: ${_transformType(e.type)}$optional'; + }).join('\n'); return ''' struct ${message.name}: Codable { diff --git a/packages/patrol_gen/lib/src/generators/ios/ios_url_session_client_generator.dart b/packages/patrol_gen/lib/src/generators/ios/ios_url_session_client_generator.dart index 657882d8f..9a4e21d42 100644 --- a/packages/patrol_gen/lib/src/generators/ios/ios_url_session_client_generator.dart +++ b/packages/patrol_gen/lib/src/generators/ios/ios_url_session_client_generator.dart @@ -6,6 +6,8 @@ class IOSURLSessionClientGenerator { OutputFile generate(Service service, IOSConfig config) { final buffer = StringBuffer()..write(_contentPrefix(config)); + buffer.write(_createClass(service)); + return OutputFile( filename: config.clientFileName(service.name), content: buffer.toString(), @@ -21,4 +23,60 @@ class IOSURLSessionClientGenerator { '''; } + + String _createClass(Service service) { + final endpoints = service.endpoints.map(_createEndpoint).join('\n\n'); + + final url = r'http://\(address):\(port)/\(commandName)'; + + final throwException = + r'throw PatrolError.internal("Invalid response: \(response) \(data)")'; + + return ''' +class ${service.name}Client { + private let port: Int + private let address: String + + init(port: Int, address: String) { + self.port = port + self.address = address + } + +$endpoints + + private func performRequest(commandName: String, body: Data? = nil) async throws -> TResult { + let url = URL(string: "$url")! + + var request = URLRequest(url: url) + request.httpMethod = "POST" + request.httpBody = body + + let (data, response) = try await URLSession.shared.data(for: request) + guard (response as? HTTPURLResponse)?.statusCode == 200 else { + $throwException + } + + return try JSONDecoder().decode(TResult.self, from: data) + } +} +'''; + } + + String _createEndpoint(Endpoint endpoint) { + final parameterDef = + endpoint.request != null ? 'request: ${endpoint.request!.name}' : ''; + final returnDef = + endpoint.response != null ? '-> ${endpoint.response!.name}' : ''; + + final bodyCode = endpoint.request != null + ? '\n let body = try JSONEncoder().encode(request)' + : ''; + + final bodyArgument = bodyCode.isNotEmpty ? ', body: body' : ''; + + return ''' + func ${endpoint.name}($parameterDef) async throws $returnDef {$bodyCode + return try await performRequest(commandName: "${endpoint.name}"${bodyArgument}) + }'''; + } } From ab4851f5f7941160c5089b486ed21c9be08d4598 Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Tue, 22 Aug 2023 14:21:03 +0200 Subject: [PATCH 020/110] Print address details --- .../patrol/lib/src/native/patrol_app_service.dart | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/patrol/lib/src/native/patrol_app_service.dart b/packages/patrol/lib/src/native/patrol_app_service.dart index 764692e0d..7e9954ed9 100644 --- a/packages/patrol/lib/src/native/patrol_app_service.dart +++ b/packages/patrol/lib/src/native/patrol_app_service.dart @@ -28,13 +28,13 @@ Future runAppService(PatrolAppService service) async { return result!; }); - await shelf_io.serve( - pipeline, - InternetAddress.anyIPv4, - _port, - ); + final server = await shelf_io.serve(pipeline, InternetAddress.anyIPv4, _port); + + final address = server.address; - print('PatrolAppService started on port $_port'); + print( + 'PatrolAppService started, address: ${address.address}, host: ${address.host}, port: ${server.port}', + ); } /// Implements a stateful gRPC service for querying and executing Dart tests. From f0359cd78f56c89b75b3276233e2ce4af272679e Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Tue, 22 Aug 2023 14:39:47 +0200 Subject: [PATCH 021/110] Improve shelf handler --- .../native/contracts/patrol_app_service_server.dart | 6 +++--- packages/patrol/lib/src/native/patrol_app_service.dart | 5 +---- .../generators/dart/dart_shelf_server_generator.dart | 10 ++++++++-- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/packages/patrol/lib/src/native/contracts/patrol_app_service_server.dart b/packages/patrol/lib/src/native/contracts/patrol_app_service_server.dart index 72c069b6c..dca57118d 100644 --- a/packages/patrol/lib/src/native/contracts/patrol_app_service_server.dart +++ b/packages/patrol/lib/src/native/contracts/patrol_app_service_server.dart @@ -12,7 +12,7 @@ import 'package:shelf/shelf.dart'; import 'contracts.dart'; abstract class PatrolAppServiceServer { - FutureOr handle(Request request) async { + FutureOr handle(Request request) async { if ('listDartTests' == request.url.path) { final result = await listDartTests(); @@ -28,9 +28,9 @@ abstract class PatrolAppServiceServer { final body = jsonEncode(result.toJson()); return Response.ok(body); + } else { + return Response.notFound('Request ${request.url} not found'); } - - return null; } Future listDartTests(); diff --git a/packages/patrol/lib/src/native/patrol_app_service.dart b/packages/patrol/lib/src/native/patrol_app_service.dart index 7e9954ed9..1bb441f28 100644 --- a/packages/patrol/lib/src/native/patrol_app_service.dart +++ b/packages/patrol/lib/src/native/patrol_app_service.dart @@ -23,10 +23,7 @@ class _TestExecutionResult { Future runAppService(PatrolAppService service) async { final pipeline = const shelf.Pipeline() .addMiddleware(shelf.logRequests()) - .addHandler((request) async { - final result = await service.handle(request); - return result!; - }); + .addHandler(service.handle); final server = await shelf_io.serve(pipeline, InternetAddress.anyIPv4, _port); diff --git a/packages/patrol_gen/lib/src/generators/dart/dart_shelf_server_generator.dart b/packages/patrol_gen/lib/src/generators/dart/dart_shelf_server_generator.dart index 0187a2aef..35cb1c7e6 100644 --- a/packages/patrol_gen/lib/src/generators/dart/dart_shelf_server_generator.dart +++ b/packages/patrol_gen/lib/src/generators/dart/dart_shelf_server_generator.dart @@ -84,13 +84,19 @@ $responseSerialization } String _createClass(Service service, String handlerCalls, String handlers) { + var notFoundRespone = + r"return Response.notFound('Request ${request.url} not found');"; + if (service.endpoints.isNotEmpty) { + notFoundRespone = 'else { $notFoundRespone }'; + } + return ''' abstract class ${service.name}Server { - FutureOr handle(Request request) async { + FutureOr handle(Request request) async { $handlerCalls - return null; +$notFoundRespone } $handlers From 63f50a0f80b11d0184f8b118431f42c9ec64516f Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Tue, 22 Aug 2023 15:44:12 +0200 Subject: [PATCH 022/110] Add dart client generation --- .../PatrolAppServiceClient.swift | 8 +- .../contracts/native_automator_client.dart | 305 ++++++++++++++++++ packages/patrol/pubspec.yaml | 1 + .../lib/src/generators/dart/dart_config.dart | 3 + .../src/generators/dart/dart_generator.dart | 5 + .../dart/dart_http_client_generator.dart | 109 +++++++ .../dart/dart_shelf_server_generator.dart | 5 +- .../ios/ios_url_session_client_generator.dart | 6 +- 8 files changed, 433 insertions(+), 9 deletions(-) create mode 100644 packages/patrol/lib/src/native/contracts/native_automator_client.dart create mode 100644 packages/patrol_gen/lib/src/generators/dart/dart_http_client_generator.dart diff --git a/packages/patrol/ios/Classes/AutomatorServer/PatrolAppServiceClient.swift b/packages/patrol/ios/Classes/AutomatorServer/PatrolAppServiceClient.swift index 9875caf57..49d66b770 100644 --- a/packages/patrol/ios/Classes/AutomatorServer/PatrolAppServiceClient.swift +++ b/packages/patrol/ios/Classes/AutomatorServer/PatrolAppServiceClient.swift @@ -13,16 +13,16 @@ class PatrolAppServiceClient { } func listDartTests() async throws -> ListDartTestsResponse { - return try await performRequest(commandName: "listDartTests") + return try await performRequest(requestName: "listDartTests") } func runDartTest(request: RunDartTestRequest) async throws -> RunDartTestResponse { let body = try JSONEncoder().encode(request) - return try await performRequest(commandName: "runDartTest", body: body) + return try await performRequest(requestName: "runDartTest", body: body) } - private func performRequest(commandName: String, body: Data? = nil) async throws -> TResult { - let url = URL(string: "http://\(address):\(port)/\(commandName)")! + private func performRequest(requestName: String, body: Data? = nil) async throws -> TResult { + let url = URL(string: "http://\(address):\(port)/\(requestName)")! var request = URLRequest(url: url) request.httpMethod = "POST" diff --git a/packages/patrol/lib/src/native/contracts/native_automator_client.dart b/packages/patrol/lib/src/native/contracts/native_automator_client.dart new file mode 100644 index 000000000..05063ffcc --- /dev/null +++ b/packages/patrol/lib/src/native/contracts/native_automator_client.dart @@ -0,0 +1,305 @@ +// +// Generated code. Do not modify. +// source: schema.dart +// +// ignore_for_file: public_member_api_docs + +import 'dart:async'; +import 'dart:convert'; + +import 'package:http/http.dart' as http; + +import 'contracts.dart'; + +class NativeAutomatorClientException implements Exception { + NativeAutomatorClientException(this.statusCode, this.responseBody); + + final String responseBody; + final int statusCode; + + @override + String toString() { + return 'Invalid response: $statusCode $responseBody'; + } +} + +class NativeAutomatorClient { + const NativeAutomatorClient( + this._client, + this._apiUri, { + Duration timeout = const Duration(seconds: 30), + }) : _timeout = timeout; + + final Duration _timeout; + final http.Client _client; + final Uri _apiUri; + + Future initialize() { + return _sendRequest( + 'initialize', + ); + } + + Future configure( + ConfigureRequest request, + ) { + return _sendRequest( + 'configure', + request.toJson(), + ); + } + + Future pressHome() { + return _sendRequest( + 'pressHome', + ); + } + + Future pressBack() { + return _sendRequest( + 'pressBack', + ); + } + + Future pressRecentApps() { + return _sendRequest( + 'pressRecentApps', + ); + } + + Future doublePressRecentApps() { + return _sendRequest( + 'doublePressRecentApps', + ); + } + + Future openApp( + OpenAppRequest request, + ) { + return _sendRequest( + 'openApp', + request.toJson(), + ); + } + + Future openQuickSettings( + OpenQuickSettingsRequest request, + ) { + return _sendRequest( + 'openQuickSettings', + request.toJson(), + ); + } + + Future getNativeViews( + GetNativeViewsRequest request, + ) async { + final json = await _sendRequest( + 'getNativeViews', + request.toJson(), + ); + return GetNativeViewsResponse.fromJson(json); + } + + Future tap( + TapRequest request, + ) { + return _sendRequest( + 'tap', + request.toJson(), + ); + } + + Future doubleTap( + TapRequest request, + ) { + return _sendRequest( + 'doubleTap', + request.toJson(), + ); + } + + Future enterText( + EnterTextRequest request, + ) { + return _sendRequest( + 'enterText', + request.toJson(), + ); + } + + Future swipe( + SwipeRequest request, + ) { + return _sendRequest( + 'swipe', + request.toJson(), + ); + } + + Future waitUntilVisible( + WaitUntilVisibleRequest request, + ) { + return _sendRequest( + 'waitUntilVisible', + request.toJson(), + ); + } + + Future enableAirplaneMode() { + return _sendRequest( + 'enableAirplaneMode', + ); + } + + Future disableAirplaneMode() { + return _sendRequest( + 'disableAirplaneMode', + ); + } + + Future enableWiFi() { + return _sendRequest( + 'enableWiFi', + ); + } + + Future disableWiFi() { + return _sendRequest( + 'disableWiFi', + ); + } + + Future enableCellular() { + return _sendRequest( + 'enableCellular', + ); + } + + Future disableCellular() { + return _sendRequest( + 'disableCellular', + ); + } + + Future enableBluetooth() { + return _sendRequest( + 'enableBluetooth', + ); + } + + Future disableBluetooth() { + return _sendRequest( + 'disableBluetooth', + ); + } + + Future enableDarkMode( + DarkModeRequest request, + ) { + return _sendRequest( + 'enableDarkMode', + request.toJson(), + ); + } + + Future disableDarkMode( + DarkModeRequest request, + ) { + return _sendRequest( + 'disableDarkMode', + request.toJson(), + ); + } + + Future openNotifications() { + return _sendRequest( + 'openNotifications', + ); + } + + Future closeNotifications() { + return _sendRequest( + 'closeNotifications', + ); + } + + Future closeHeadsUpNotification() { + return _sendRequest( + 'closeHeadsUpNotification', + ); + } + + Future getNotifications( + GetNotificationsRequest request, + ) async { + final json = await _sendRequest( + 'getNotifications', + request.toJson(), + ); + return GetNotificationsResponse.fromJson(json); + } + + Future tapOnNotification( + TapOnNotificationRequest request, + ) { + return _sendRequest( + 'tapOnNotification', + request.toJson(), + ); + } + + Future isPermissionDialogVisible( + PermissionDialogVisibleRequest request, + ) async { + final json = await _sendRequest( + 'isPermissionDialogVisible', + request.toJson(), + ); + return PermissionDialogVisibleResponse.fromJson(json); + } + + Future handlePermissionDialog( + HandlePermissionRequest request, + ) { + return _sendRequest( + 'handlePermissionDialog', + request.toJson(), + ); + } + + Future setLocationAccuracy( + SetLocationAccuracyRequest request, + ) { + return _sendRequest( + 'setLocationAccuracy', + request.toJson(), + ); + } + + Future debug() { + return _sendRequest( + 'debug', + ); + } + + Future markPatrolAppServiceReady() { + return _sendRequest( + 'markPatrolAppServiceReady', + ); + } + + Future> _sendRequest( + String requestName, [ + Map? request, + ]) async { + final response = await _client + .post(_apiUri.resolve(requestName), body: jsonEncode(request)) + .timeout(_timeout); + + if (response.statusCode != 200) { + throw NativeAutomatorClientException(response.statusCode, response.body); + } + return jsonDecode(response.body) as Map; + } +} diff --git a/packages/patrol/pubspec.yaml b/packages/patrol/pubspec.yaml index 6f9c4b0af..ecd1bd6d1 100644 --- a/packages/patrol/pubspec.yaml +++ b/packages/patrol/pubspec.yaml @@ -18,6 +18,7 @@ dependencies: flutter_test: sdk: flutter grpc: ^3.1.0 + http: ^1.1.0 integration_test: sdk: flutter json_annotation: ^4.8.1 diff --git a/packages/patrol_gen/lib/src/generators/dart/dart_config.dart b/packages/patrol_gen/lib/src/generators/dart/dart_config.dart index a863fe3af..ee9c3d0ed 100644 --- a/packages/patrol_gen/lib/src/generators/dart/dart_config.dart +++ b/packages/patrol_gen/lib/src/generators/dart/dart_config.dart @@ -11,6 +11,9 @@ class DartConfig { String serviceFileName(String serviceName) => path.join(outputDirectory, '${_fileName(serviceName)}_server.dart'); + String clientFileName(String serviceName) => + path.join(outputDirectory, '${_fileName(serviceName)}_client.dart'); + String _fileName(String pascalCaseName) { final beforeCapitalLetter = RegExp(r"(?=[A-Z])"); diff --git a/packages/patrol_gen/lib/src/generators/dart/dart_generator.dart b/packages/patrol_gen/lib/src/generators/dart/dart_generator.dart index 28e9f76f8..f9ad3e6af 100644 --- a/packages/patrol_gen/lib/src/generators/dart/dart_generator.dart +++ b/packages/patrol_gen/lib/src/generators/dart/dart_generator.dart @@ -1,5 +1,6 @@ import 'package:patrol_gen/src/generators/dart/dart_config.dart'; import 'package:patrol_gen/src/generators/dart/dart_contracts_generator.dart'; +import 'package:patrol_gen/src/generators/dart/dart_http_client_generator.dart'; import 'package:patrol_gen/src/generators/dart/dart_shelf_server_generator.dart'; import 'package:patrol_gen/src/generators/output_file.dart'; import 'package:patrol_gen/src/schema.dart'; @@ -11,11 +12,15 @@ class DartGenerator { ]; final serverGenerator = DartShelfServerGenerator(); + final clientGenerator = DartHttpClientGenerator(); for (var service in schema.services) { if (service.dart.needsServer) { result.add(serverGenerator.generate(service, config)); } + if (service.dart.needsClient) { + result.add(clientGenerator.generate(service, config)); + } } return result; diff --git a/packages/patrol_gen/lib/src/generators/dart/dart_http_client_generator.dart b/packages/patrol_gen/lib/src/generators/dart/dart_http_client_generator.dart new file mode 100644 index 000000000..ae41f55b9 --- /dev/null +++ b/packages/patrol_gen/lib/src/generators/dart/dart_http_client_generator.dart @@ -0,0 +1,109 @@ +import 'package:dart_style/dart_style.dart'; +import 'package:patrol_gen/src/generators/dart/dart_config.dart'; +import 'package:patrol_gen/src/generators/output_file.dart'; +import 'package:patrol_gen/src/schema.dart'; +import 'package:path/path.dart' as path; + +class DartHttpClientGenerator { + OutputFile generate(Service service, DartConfig config) { + final buffer = StringBuffer() + ..write(_contentPrefix(config)) + ..write(_generateExceptionClass(service)) + ..write(_generateClientClass(service)); + + return OutputFile( + filename: config.clientFileName(service.name), + content: DartFormatter().format(buffer.toString()), + ); + } + + String _contentPrefix(DartConfig config) { + return ''' +// +// Generated code. Do not modify. +// source: schema.dart +// +// ignore_for_file: public_member_api_docs + +import 'dart:async'; +import 'dart:convert'; + +import 'package:http/http.dart' as http; + +import '${path.basename(config.contractsFilename)}'; +'''; + } + + String _generateClientClass(Service service) { + final endpoints = service.endpoints.map(_createEndpoint).join('\n\n'); + + return ''' +class ${service.name}Client { + const ${service.name}Client( + this._client, + this._apiUri, { + Duration timeout = const Duration(seconds: 30), + }) : _timeout = timeout; + + final Duration _timeout; + final http.Client _client; + final Uri _apiUri; + +$endpoints + + Future> _sendRequest( + String requestName, [ + Map? request, + ]) async { + final response = await _client + .post(_apiUri.resolve(requestName), body: jsonEncode(request)) + .timeout(_timeout); + + if (response.statusCode != 200) { + throw NativeAutomatorClientException(response.statusCode, response.body); + } + return jsonDecode(response.body) as Map; + } +} +'''; + } + + String _createEndpoint(Endpoint endpoint) { + final returnType = endpoint.response?.name ?? 'void'; + final parameter = + endpoint.request != null ? '${endpoint.request!.name} request,' : ''; + final jsonRequest = endpoint.request != null ? 'request.toJson(),' : ''; + final asyncKeyword = endpoint.response != null ? ' async ' : ''; + + final sendRequest = endpoint.response != null + ? ''' +final json = await _sendRequest('${endpoint.name}', ${jsonRequest}); +return ${endpoint.response!.name}.fromJson(json); +''' + : ''' +return _sendRequest('${endpoint.name}', ${jsonRequest});'''; + + return ''' +Future<$returnType> ${endpoint.name}($parameter) $asyncKeyword { + $sendRequest +} +'''; + } + + String _generateExceptionClass(Service service) { + final toStringMethod = r'''@override + String toString() { + return 'Invalid response: $statusCode $responseBody'; + }'''; + + return ''' +class ${service.name}ClientException implements Exception { + ${service.name}ClientException(this.statusCode, this.responseBody); + + final String responseBody; + final int statusCode; + + $toStringMethod +}'''; + } +} diff --git a/packages/patrol_gen/lib/src/generators/dart/dart_shelf_server_generator.dart b/packages/patrol_gen/lib/src/generators/dart/dart_shelf_server_generator.dart index 35cb1c7e6..721e4179f 100644 --- a/packages/patrol_gen/lib/src/generators/dart/dart_shelf_server_generator.dart +++ b/packages/patrol_gen/lib/src/generators/dart/dart_shelf_server_generator.dart @@ -11,7 +11,7 @@ class DartShelfServerGenerator { final handlerCalls = _generateHandlerCalls(service); final handlers = _generateHandlers(service); - buffer.write(_createClass(service, handlerCalls, handlers)); + buffer.write(_createServerClass(service, handlerCalls, handlers)); return OutputFile( filename: config.serviceFileName(service.name), @@ -83,7 +83,8 @@ $responseSerialization }).join('\n'); } - String _createClass(Service service, String handlerCalls, String handlers) { + String _createServerClass( + Service service, String handlerCalls, String handlers) { var notFoundRespone = r"return Response.notFound('Request ${request.url} not found');"; if (service.endpoints.isNotEmpty) { diff --git a/packages/patrol_gen/lib/src/generators/ios/ios_url_session_client_generator.dart b/packages/patrol_gen/lib/src/generators/ios/ios_url_session_client_generator.dart index 9a4e21d42..44f374ae5 100644 --- a/packages/patrol_gen/lib/src/generators/ios/ios_url_session_client_generator.dart +++ b/packages/patrol_gen/lib/src/generators/ios/ios_url_session_client_generator.dart @@ -27,7 +27,7 @@ class IOSURLSessionClientGenerator { String _createClass(Service service) { final endpoints = service.endpoints.map(_createEndpoint).join('\n\n'); - final url = r'http://\(address):\(port)/\(commandName)'; + final url = r'http://\(address):\(port)/\(requestName)'; final throwException = r'throw PatrolError.internal("Invalid response: \(response) \(data)")'; @@ -44,7 +44,7 @@ class ${service.name}Client { $endpoints - private func performRequest(commandName: String, body: Data? = nil) async throws -> TResult { + private func performRequest(requestName: String, body: Data? = nil) async throws -> TResult { let url = URL(string: "$url")! var request = URLRequest(url: url) @@ -76,7 +76,7 @@ $endpoints return ''' func ${endpoint.name}($parameterDef) async throws $returnDef {$bodyCode - return try await performRequest(commandName: "${endpoint.name}"${bodyArgument}) + return try await performRequest(requestName: "${endpoint.name}"${bodyArgument}) }'''; } } From fe25e8e895f91a55622fce67cb673f4ed051d397 Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Tue, 22 Aug 2023 16:13:55 +0200 Subject: [PATCH 023/110] Get rid of grpc on the dart side --- contracts.proto | 364 +-- .../Classes/AutomatorServer/Contracts.swift | 1 - .../lib/src/native/contracts/contracts.dart | 2 - .../lib/src/native/contracts/contracts.g.dart | 2 - .../src/native/contracts/contracts.pb.dart | 2240 ----------------- .../native/contracts/contracts.pbenum.dart | 77 - .../native/contracts/contracts.pbgrpc.dart | 847 ------- .../native/contracts/contracts.pbjson.dart | 544 ---- packages/patrol/lib/src/native/native.dart | 3 +- .../lib/src/native/native_automator.dart | 112 +- packages/patrol/pubspec.yaml | 2 - schema.dart | 1 - 12 files changed, 216 insertions(+), 3979 deletions(-) delete mode 100644 packages/patrol/lib/src/native/contracts/contracts.pb.dart delete mode 100644 packages/patrol/lib/src/native/contracts/contracts.pbenum.dart delete mode 100644 packages/patrol/lib/src/native/contracts/contracts.pbgrpc.dart delete mode 100644 packages/patrol/lib/src/native/contracts/contracts.pbjson.dart diff --git a/contracts.proto b/contracts.proto index bedc36929..7d65f2f81 100644 --- a/contracts.proto +++ b/contracts.proto @@ -37,185 +37,185 @@ option java_package = "pl.leancode.patrol.contracts"; // optional string details = 2; // } -service NativeAutomator { - rpc initialize(Empty) returns (Empty) {} - rpc configure(ConfigureRequest) returns (Empty) {} - - // general - rpc pressHome(Empty) returns (Empty) {} - rpc pressBack(Empty) returns (Empty) {} - rpc pressRecentApps(Empty) returns (Empty) {} - rpc doublePressRecentApps(Empty) returns (Empty) {} - rpc openApp(OpenAppRequest) returns (Empty) {} - rpc openQuickSettings(OpenQuickSettingsRequest) returns (Empty) {} - - // general UI interaction - rpc getNativeViews(GetNativeViewsRequest) returns (GetNativeViewsResponse) {} - rpc tap(TapRequest) returns (Empty) {} - rpc doubleTap(TapRequest) returns (Empty) {} - rpc enterText(EnterTextRequest) returns (Empty) {} - rpc swipe(SwipeRequest) returns (Empty) {} - rpc waitUntilVisible(WaitUntilVisibleRequest) returns (Empty) {} - - // services - rpc enableAirplaneMode(Empty) returns (Empty) {} - rpc disableAirplaneMode(Empty) returns (Empty) {} - rpc enableWiFi(Empty) returns (Empty) {} - rpc disableWiFi(Empty) returns (Empty) {} - rpc enableCellular(Empty) returns (Empty) {} - rpc disableCellular(Empty) returns (Empty) {} - rpc enableBluetooth(Empty) returns (Empty) {} - rpc disableBluetooth(Empty) returns (Empty) {} - rpc enableDarkMode(DarkModeRequest) returns (Empty) {} - rpc disableDarkMode(DarkModeRequest) returns (Empty) {} - - // notifications - rpc openNotifications(Empty) returns (Empty) {} - rpc closeNotifications(Empty) returns (Empty) {} - rpc closeHeadsUpNotification(Empty) returns (Empty) {} - rpc getNotifications(GetNotificationsRequest) returns (GetNotificationsResponse) {} - rpc tapOnNotification(TapOnNotificationRequest) returns (Empty) {} - - // permissions - rpc isPermissionDialogVisible(PermissionDialogVisibleRequest) returns (PermissionDialogVisibleResponse) {} - rpc handlePermissionDialog(HandlePermissionRequest) returns (Empty) {} - rpc setLocationAccuracy(SetLocationAccuracyRequest) returns (Empty) {} - - // other - rpc debug(Empty) returns (Empty) {} - - // TODO(bartekpacia): Move this RPC into a new PatrolNativeTestService service because it doesn't fit here - rpc markPatrolAppServiceReady(Empty) returns (Empty) {} -} - -message ConfigureRequest { - uint64 findTimeoutMillis = 1; -} - -message OpenAppRequest { string appId = 1; } - -message TapOnNotificationRequest { - oneof findBy { - uint32 index = 1; - Selector selector = 2; - } -} - -// We're defining our own Empty instead of using google.protobuf.Empty because -// the Dart plugin can't easily generate it. -// -// See: -// * https://github.com/google/protobuf.dart/issues/170 -message Empty {} - -message OpenQuickSettingsRequest {} - -message DarkModeRequest { string appId = 1; } - -message GetNativeViewsRequest { - Selector selector = 1; - string appId = 2; -} -message GetNativeViewsResponse { repeated NativeView nativeViews = 2;} - -message GetNotificationsRequest {} -message GetNotificationsResponse { repeated Notification notifications = 2; } - -message TapRequest { - Selector selector = 1; - string appId = 2; -} - -message EnterTextRequest { - string data = 1; - string appId = 2; - oneof findBy { - uint32 index = 3; - Selector selector = 4; - } - - bool showKeyboard = 5; -} - -message SwipeRequest { - float startX = 1; - float startY = 2; - float endX = 3; - float endY = 4; - uint32 steps = 5; - string appId = 6; -} - -message WaitUntilVisibleRequest { - Selector selector = 1; - string appId = 2; -} - -message HandlePermissionRequest { - Code code = 1; - - enum Code { - WHILE_USING = 0; - ONLY_THIS_TIME = 1; - DENIED = 2; - } -} - -message SetLocationAccuracyRequest { - LocationAccuracy locationAccuracy = 1; - - enum LocationAccuracy { - COARSE = 0; - FINE = 1; - } -} - -message PermissionDialogVisibleRequest { - uint64 timeoutMillis = 1; -} - -message PermissionDialogVisibleResponse { - bool visible = 1; -} - -message Selector { - optional string text = 1; - optional string textStartsWith = 2; - optional string textContains = 3; - optional string className = 4; - optional string contentDescription = 5; - optional string contentDescriptionStartsWith = 6; - optional string contentDescriptionContains = 7; - optional string resourceId = 8; - optional uint32 instance = 9; - optional bool enabled = 10; - optional bool focused = 11; - optional string pkg = 12; -} - -// Represents a native UI control. -// -// On Android, this is `android.view.View`. -message NativeView { - string className = 1; - string text = 2; - string contentDescription = 3; - bool focused = 4; - bool enabled = 5; - int32 childCount = 6; - string resourceName = 7; - string applicationPackage = 8; - repeated NativeView children = 9; -} - -// Represents a notification visible in the notification shade. -message Notification { - optional string appName = 1; - string title = 2; - string content = 3; - string raw = 4; -} - -message SubmitTestResultsRequest { - map results = 1; -} +// service NativeAutomator { +// rpc initialize(Empty) returns (Empty) {} +// rpc configure(ConfigureRequest) returns (Empty) {} + +// // general +// rpc pressHome(Empty) returns (Empty) {} +// rpc pressBack(Empty) returns (Empty) {} +// rpc pressRecentApps(Empty) returns (Empty) {} +// rpc doublePressRecentApps(Empty) returns (Empty) {} +// rpc openApp(OpenAppRequest) returns (Empty) {} +// rpc openQuickSettings(OpenQuickSettingsRequest) returns (Empty) {} + +// // general UI interaction +// rpc getNativeViews(GetNativeViewsRequest) returns (GetNativeViewsResponse) {} +// rpc tap(TapRequest) returns (Empty) {} +// rpc doubleTap(TapRequest) returns (Empty) {} +// rpc enterText(EnterTextRequest) returns (Empty) {} +// rpc swipe(SwipeRequest) returns (Empty) {} +// rpc waitUntilVisible(WaitUntilVisibleRequest) returns (Empty) {} + +// // services +// rpc enableAirplaneMode(Empty) returns (Empty) {} +// rpc disableAirplaneMode(Empty) returns (Empty) {} +// rpc enableWiFi(Empty) returns (Empty) {} +// rpc disableWiFi(Empty) returns (Empty) {} +// rpc enableCellular(Empty) returns (Empty) {} +// rpc disableCellular(Empty) returns (Empty) {} +// rpc enableBluetooth(Empty) returns (Empty) {} +// rpc disableBluetooth(Empty) returns (Empty) {} +// rpc enableDarkMode(DarkModeRequest) returns (Empty) {} +// rpc disableDarkMode(DarkModeRequest) returns (Empty) {} + +// // notifications +// rpc openNotifications(Empty) returns (Empty) {} +// rpc closeNotifications(Empty) returns (Empty) {} +// rpc closeHeadsUpNotification(Empty) returns (Empty) {} +// rpc getNotifications(GetNotificationsRequest) returns (GetNotificationsResponse) {} +// rpc tapOnNotification(TapOnNotificationRequest) returns (Empty) {} + +// // permissions +// rpc isPermissionDialogVisible(PermissionDialogVisibleRequest) returns (PermissionDialogVisibleResponse) {} +// rpc handlePermissionDialog(HandlePermissionRequest) returns (Empty) {} +// rpc setLocationAccuracy(SetLocationAccuracyRequest) returns (Empty) {} + +// // other +// rpc debug(Empty) returns (Empty) {} + +// // TODO(bartekpacia): Move this RPC into a new PatrolNativeTestService service because it doesn't fit here +// rpc markPatrolAppServiceReady(Empty) returns (Empty) {} +// } + +// message ConfigureRequest { +// uint64 findTimeoutMillis = 1; +// } + +// message OpenAppRequest { string appId = 1; } + +// message TapOnNotificationRequest { +// oneof findBy { +// uint32 index = 1; +// Selector selector = 2; +// } +// } + +// // We're defining our own Empty instead of using google.protobuf.Empty because +// // the Dart plugin can't easily generate it. +// // +// // See: +// // * https://github.com/google/protobuf.dart/issues/170 +// message Empty {} + +// message OpenQuickSettingsRequest {} + +// message DarkModeRequest { string appId = 1; } + +// message GetNativeViewsRequest { +// Selector selector = 1; +// string appId = 2; +// } +// message GetNativeViewsResponse { repeated NativeView nativeViews = 2;} + +// message GetNotificationsRequest {} +// message GetNotificationsResponse { repeated Notification notifications = 2; } + +// message TapRequest { +// Selector selector = 1; +// string appId = 2; +// } + +// message EnterTextRequest { +// string data = 1; +// string appId = 2; +// oneof findBy { +// uint32 index = 3; +// Selector selector = 4; +// } + +// bool showKeyboard = 5; +// } + +// message SwipeRequest { +// float startX = 1; +// float startY = 2; +// float endX = 3; +// float endY = 4; +// uint32 steps = 5; +// string appId = 6; +// } + +// message WaitUntilVisibleRequest { +// Selector selector = 1; +// string appId = 2; +// } + +// message HandlePermissionRequest { +// Code code = 1; + +// enum Code { +// WHILE_USING = 0; +// ONLY_THIS_TIME = 1; +// DENIED = 2; +// } +// } + +// message SetLocationAccuracyRequest { +// LocationAccuracy locationAccuracy = 1; + +// enum LocationAccuracy { +// COARSE = 0; +// FINE = 1; +// } +// } + +// message PermissionDialogVisibleRequest { +// uint64 timeoutMillis = 1; +// } + +// message PermissionDialogVisibleResponse { +// bool visible = 1; +// } + +// message Selector { +// optional string text = 1; +// optional string textStartsWith = 2; +// optional string textContains = 3; +// optional string className = 4; +// optional string contentDescription = 5; +// optional string contentDescriptionStartsWith = 6; +// optional string contentDescriptionContains = 7; +// optional string resourceId = 8; +// optional uint32 instance = 9; +// optional bool enabled = 10; +// optional bool focused = 11; +// optional string pkg = 12; +// } + +// // Represents a native UI control. +// // +// // On Android, this is `android.view.View`. +// message NativeView { +// string className = 1; +// string text = 2; +// string contentDescription = 3; +// bool focused = 4; +// bool enabled = 5; +// int32 childCount = 6; +// string resourceName = 7; +// string applicationPackage = 8; +// repeated NativeView children = 9; +// } + +// // Represents a notification visible in the notification shade. +// message Notification { +// optional string appName = 1; +// string title = 2; +// string content = 3; +// string raw = 4; +// } + +// message SubmitTestResultsRequest { +// map results = 1; +// } diff --git a/packages/patrol/ios/Classes/AutomatorServer/Contracts.swift b/packages/patrol/ios/Classes/AutomatorServer/Contracts.swift index 0557a883a..95aff74f8 100644 --- a/packages/patrol/ios/Classes/AutomatorServer/Contracts.swift +++ b/packages/patrol/ios/Classes/AutomatorServer/Contracts.swift @@ -110,7 +110,6 @@ struct SwipeRequest: Codable { var endX: Double var endY: Double var steps: Int - var appId: String } struct WaitUntilVisibleRequest: Codable { diff --git a/packages/patrol/lib/src/native/contracts/contracts.dart b/packages/patrol/lib/src/native/contracts/contracts.dart index 1b2972886..7f36b024f 100644 --- a/packages/patrol/lib/src/native/contracts/contracts.dart +++ b/packages/patrol/lib/src/native/contracts/contracts.dart @@ -289,7 +289,6 @@ class SwipeRequest { required this.endX, required this.endY, required this.steps, - required this.appId, }); factory SwipeRequest.fromJson(Map json) => @@ -300,7 +299,6 @@ class SwipeRequest { final double endX; final double endY; final int steps; - final String appId; Map toJson() => _$SwipeRequestToJson(this); } diff --git a/packages/patrol/lib/src/native/contracts/contracts.g.dart b/packages/patrol/lib/src/native/contracts/contracts.g.dart index ec11a227a..053d7dbfd 100644 --- a/packages/patrol/lib/src/native/contracts/contracts.g.dart +++ b/packages/patrol/lib/src/native/contracts/contracts.g.dart @@ -225,7 +225,6 @@ SwipeRequest _$SwipeRequestFromJson(Map json) => SwipeRequest( endX: (json['endX'] as num).toDouble(), endY: (json['endY'] as num).toDouble(), steps: json['steps'] as int, - appId: json['appId'] as String, ); Map _$SwipeRequestToJson(SwipeRequest instance) => @@ -235,7 +234,6 @@ Map _$SwipeRequestToJson(SwipeRequest instance) => 'endX': instance.endX, 'endY': instance.endY, 'steps': instance.steps, - 'appId': instance.appId, }; WaitUntilVisibleRequest _$WaitUntilVisibleRequestFromJson( diff --git a/packages/patrol/lib/src/native/contracts/contracts.pb.dart b/packages/patrol/lib/src/native/contracts/contracts.pb.dart deleted file mode 100644 index 582cf52bb..000000000 --- a/packages/patrol/lib/src/native/contracts/contracts.pb.dart +++ /dev/null @@ -1,2240 +0,0 @@ -/// -// Generated code. Do not modify. -// source: contracts.proto -// -// @dart = 2.12 -// ignore_for_file: annotate_overrides,camel_case_types,constant_identifier_names,directives_ordering,library_prefixes,non_constant_identifier_names,prefer_final_fields,return_of_invalid_type,unnecessary_const,unnecessary_import,unnecessary_this,unused_import,unused_shown_name - -import 'dart:core' as $core; - -import 'package:fixnum/fixnum.dart' as $fixnum; -import 'package:protobuf/protobuf.dart' as $pb; - -import 'contracts.pbenum.dart'; - -export 'contracts.pbenum.dart'; - -class ConfigureRequest extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'ConfigureRequest', - package: const $pb.PackageName( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'patrol'), - createEmptyInstance: create) - ..a<$fixnum.Int64>( - 1, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'findTimeoutMillis', - $pb.PbFieldType.OU6, - protoName: 'findTimeoutMillis', - defaultOrMaker: $fixnum.Int64.ZERO) - ..hasRequiredFields = false; - - ConfigureRequest._() : super(); - factory ConfigureRequest({ - $fixnum.Int64? findTimeoutMillis, - }) { - final _result = create(); - if (findTimeoutMillis != null) { - _result.findTimeoutMillis = findTimeoutMillis; - } - return _result; - } - factory ConfigureRequest.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - factory ConfigureRequest.fromJson($core.String i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromJson(i, r); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - ConfigureRequest clone() => ConfigureRequest()..mergeFromMessage(this); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - ConfigureRequest copyWith(void Function(ConfigureRequest) updates) => - super.copyWith((message) => updates(message as ConfigureRequest)) - as ConfigureRequest; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static ConfigureRequest create() => ConfigureRequest._(); - ConfigureRequest createEmptyInstance() => create(); - static $pb.PbList createRepeated() => - $pb.PbList(); - @$core.pragma('dart2js:noInline') - static ConfigureRequest getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor(create); - static ConfigureRequest? _defaultInstance; - - @$pb.TagNumber(1) - $fixnum.Int64 get findTimeoutMillis => $_getI64(0); - @$pb.TagNumber(1) - set findTimeoutMillis($fixnum.Int64 v) { - $_setInt64(0, v); - } - - @$pb.TagNumber(1) - $core.bool hasFindTimeoutMillis() => $_has(0); - @$pb.TagNumber(1) - void clearFindTimeoutMillis() => clearField(1); -} - -class OpenAppRequest extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'OpenAppRequest', - package: const $pb.PackageName( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'patrol'), - createEmptyInstance: create) - ..aOS( - 1, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'appId', - protoName: 'appId') - ..hasRequiredFields = false; - - OpenAppRequest._() : super(); - factory OpenAppRequest({ - $core.String? appId, - }) { - final _result = create(); - if (appId != null) { - _result.appId = appId; - } - return _result; - } - factory OpenAppRequest.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - factory OpenAppRequest.fromJson($core.String i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromJson(i, r); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - OpenAppRequest clone() => OpenAppRequest()..mergeFromMessage(this); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - OpenAppRequest copyWith(void Function(OpenAppRequest) updates) => - super.copyWith((message) => updates(message as OpenAppRequest)) - as OpenAppRequest; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static OpenAppRequest create() => OpenAppRequest._(); - OpenAppRequest createEmptyInstance() => create(); - static $pb.PbList createRepeated() => - $pb.PbList(); - @$core.pragma('dart2js:noInline') - static OpenAppRequest getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor(create); - static OpenAppRequest? _defaultInstance; - - @$pb.TagNumber(1) - $core.String get appId => $_getSZ(0); - @$pb.TagNumber(1) - set appId($core.String v) { - $_setString(0, v); - } - - @$pb.TagNumber(1) - $core.bool hasAppId() => $_has(0); - @$pb.TagNumber(1) - void clearAppId() => clearField(1); -} - -enum TapOnNotificationRequest_FindBy { index_, selector, notSet } - -class TapOnNotificationRequest extends $pb.GeneratedMessage { - static const $core.Map<$core.int, TapOnNotificationRequest_FindBy> - _TapOnNotificationRequest_FindByByTag = { - 1: TapOnNotificationRequest_FindBy.index_, - 2: TapOnNotificationRequest_FindBy.selector, - 0: TapOnNotificationRequest_FindBy.notSet - }; - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'TapOnNotificationRequest', - package: const $pb.PackageName( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'patrol'), - createEmptyInstance: create) - ..oo(0, [1, 2]) - ..a<$core.int>( - 1, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'index', - $pb.PbFieldType.OU3) - ..aOM( - 2, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'selector', - subBuilder: Selector.create) - ..hasRequiredFields = false; - - TapOnNotificationRequest._() : super(); - factory TapOnNotificationRequest({ - $core.int? index, - Selector? selector, - }) { - final _result = create(); - if (index != null) { - _result.index = index; - } - if (selector != null) { - _result.selector = selector; - } - return _result; - } - factory TapOnNotificationRequest.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - factory TapOnNotificationRequest.fromJson($core.String i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromJson(i, r); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - TapOnNotificationRequest clone() => - TapOnNotificationRequest()..mergeFromMessage(this); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - TapOnNotificationRequest copyWith( - void Function(TapOnNotificationRequest) updates) => - super.copyWith((message) => updates(message as TapOnNotificationRequest)) - as TapOnNotificationRequest; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static TapOnNotificationRequest create() => TapOnNotificationRequest._(); - TapOnNotificationRequest createEmptyInstance() => create(); - static $pb.PbList createRepeated() => - $pb.PbList(); - @$core.pragma('dart2js:noInline') - static TapOnNotificationRequest getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor(create); - static TapOnNotificationRequest? _defaultInstance; - - TapOnNotificationRequest_FindBy whichFindBy() => - _TapOnNotificationRequest_FindByByTag[$_whichOneof(0)]!; - void clearFindBy() => clearField($_whichOneof(0)); - - @$pb.TagNumber(1) - $core.int get index => $_getIZ(0); - @$pb.TagNumber(1) - set index($core.int v) { - $_setUnsignedInt32(0, v); - } - - @$pb.TagNumber(1) - $core.bool hasIndex() => $_has(0); - @$pb.TagNumber(1) - void clearIndex() => clearField(1); - - @$pb.TagNumber(2) - Selector get selector => $_getN(1); - @$pb.TagNumber(2) - set selector(Selector v) { - setField(2, v); - } - - @$pb.TagNumber(2) - $core.bool hasSelector() => $_has(1); - @$pb.TagNumber(2) - void clearSelector() => clearField(2); - @$pb.TagNumber(2) - Selector ensureSelector() => $_ensure(1); -} - -class Empty extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'Empty', - package: const $pb.PackageName( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'patrol'), - createEmptyInstance: create) - ..hasRequiredFields = false; - - Empty._() : super(); - factory Empty() => create(); - factory Empty.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - factory Empty.fromJson($core.String i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromJson(i, r); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - Empty clone() => Empty()..mergeFromMessage(this); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - Empty copyWith(void Function(Empty) updates) => - super.copyWith((message) => updates(message as Empty)) - as Empty; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static Empty create() => Empty._(); - Empty createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static Empty getDefault() => - _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static Empty? _defaultInstance; -} - -class OpenQuickSettingsRequest extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'OpenQuickSettingsRequest', - package: const $pb.PackageName( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'patrol'), - createEmptyInstance: create) - ..hasRequiredFields = false; - - OpenQuickSettingsRequest._() : super(); - factory OpenQuickSettingsRequest() => create(); - factory OpenQuickSettingsRequest.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - factory OpenQuickSettingsRequest.fromJson($core.String i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromJson(i, r); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - OpenQuickSettingsRequest clone() => - OpenQuickSettingsRequest()..mergeFromMessage(this); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - OpenQuickSettingsRequest copyWith( - void Function(OpenQuickSettingsRequest) updates) => - super.copyWith((message) => updates(message as OpenQuickSettingsRequest)) - as OpenQuickSettingsRequest; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static OpenQuickSettingsRequest create() => OpenQuickSettingsRequest._(); - OpenQuickSettingsRequest createEmptyInstance() => create(); - static $pb.PbList createRepeated() => - $pb.PbList(); - @$core.pragma('dart2js:noInline') - static OpenQuickSettingsRequest getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor(create); - static OpenQuickSettingsRequest? _defaultInstance; -} - -class DarkModeRequest extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'DarkModeRequest', - package: const $pb.PackageName( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'patrol'), - createEmptyInstance: create) - ..aOS( - 1, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'appId', - protoName: 'appId') - ..hasRequiredFields = false; - - DarkModeRequest._() : super(); - factory DarkModeRequest({ - $core.String? appId, - }) { - final _result = create(); - if (appId != null) { - _result.appId = appId; - } - return _result; - } - factory DarkModeRequest.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - factory DarkModeRequest.fromJson($core.String i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromJson(i, r); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - DarkModeRequest clone() => DarkModeRequest()..mergeFromMessage(this); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - DarkModeRequest copyWith(void Function(DarkModeRequest) updates) => - super.copyWith((message) => updates(message as DarkModeRequest)) - as DarkModeRequest; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static DarkModeRequest create() => DarkModeRequest._(); - DarkModeRequest createEmptyInstance() => create(); - static $pb.PbList createRepeated() => - $pb.PbList(); - @$core.pragma('dart2js:noInline') - static DarkModeRequest getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor(create); - static DarkModeRequest? _defaultInstance; - - @$pb.TagNumber(1) - $core.String get appId => $_getSZ(0); - @$pb.TagNumber(1) - set appId($core.String v) { - $_setString(0, v); - } - - @$pb.TagNumber(1) - $core.bool hasAppId() => $_has(0); - @$pb.TagNumber(1) - void clearAppId() => clearField(1); -} - -class GetNativeViewsRequest extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'GetNativeViewsRequest', - package: const $pb.PackageName( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'patrol'), - createEmptyInstance: create) - ..aOM( - 1, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'selector', - subBuilder: Selector.create) - ..aOS( - 2, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'appId', - protoName: 'appId') - ..hasRequiredFields = false; - - GetNativeViewsRequest._() : super(); - factory GetNativeViewsRequest({ - Selector? selector, - $core.String? appId, - }) { - final _result = create(); - if (selector != null) { - _result.selector = selector; - } - if (appId != null) { - _result.appId = appId; - } - return _result; - } - factory GetNativeViewsRequest.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - factory GetNativeViewsRequest.fromJson($core.String i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromJson(i, r); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - GetNativeViewsRequest clone() => - GetNativeViewsRequest()..mergeFromMessage(this); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - GetNativeViewsRequest copyWith( - void Function(GetNativeViewsRequest) updates) => - super.copyWith((message) => updates(message as GetNativeViewsRequest)) - as GetNativeViewsRequest; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static GetNativeViewsRequest create() => GetNativeViewsRequest._(); - GetNativeViewsRequest createEmptyInstance() => create(); - static $pb.PbList createRepeated() => - $pb.PbList(); - @$core.pragma('dart2js:noInline') - static GetNativeViewsRequest getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor(create); - static GetNativeViewsRequest? _defaultInstance; - - @$pb.TagNumber(1) - Selector get selector => $_getN(0); - @$pb.TagNumber(1) - set selector(Selector v) { - setField(1, v); - } - - @$pb.TagNumber(1) - $core.bool hasSelector() => $_has(0); - @$pb.TagNumber(1) - void clearSelector() => clearField(1); - @$pb.TagNumber(1) - Selector ensureSelector() => $_ensure(0); - - @$pb.TagNumber(2) - $core.String get appId => $_getSZ(1); - @$pb.TagNumber(2) - set appId($core.String v) { - $_setString(1, v); - } - - @$pb.TagNumber(2) - $core.bool hasAppId() => $_has(1); - @$pb.TagNumber(2) - void clearAppId() => clearField(2); -} - -class GetNativeViewsResponse extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'GetNativeViewsResponse', - package: const $pb.PackageName( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'patrol'), - createEmptyInstance: create) - ..pc( - 2, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'nativeViews', - $pb.PbFieldType.PM, - protoName: 'nativeViews', - subBuilder: NativeView.create) - ..hasRequiredFields = false; - - GetNativeViewsResponse._() : super(); - factory GetNativeViewsResponse({ - $core.Iterable? nativeViews, - }) { - final _result = create(); - if (nativeViews != null) { - _result.nativeViews.addAll(nativeViews); - } - return _result; - } - factory GetNativeViewsResponse.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - factory GetNativeViewsResponse.fromJson($core.String i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromJson(i, r); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - GetNativeViewsResponse clone() => - GetNativeViewsResponse()..mergeFromMessage(this); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - GetNativeViewsResponse copyWith( - void Function(GetNativeViewsResponse) updates) => - super.copyWith((message) => updates(message as GetNativeViewsResponse)) - as GetNativeViewsResponse; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static GetNativeViewsResponse create() => GetNativeViewsResponse._(); - GetNativeViewsResponse createEmptyInstance() => create(); - static $pb.PbList createRepeated() => - $pb.PbList(); - @$core.pragma('dart2js:noInline') - static GetNativeViewsResponse getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor(create); - static GetNativeViewsResponse? _defaultInstance; - - @$pb.TagNumber(2) - $core.List get nativeViews => $_getList(0); -} - -class GetNotificationsRequest extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'GetNotificationsRequest', - package: const $pb.PackageName( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'patrol'), - createEmptyInstance: create) - ..hasRequiredFields = false; - - GetNotificationsRequest._() : super(); - factory GetNotificationsRequest() => create(); - factory GetNotificationsRequest.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - factory GetNotificationsRequest.fromJson($core.String i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromJson(i, r); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - GetNotificationsRequest clone() => - GetNotificationsRequest()..mergeFromMessage(this); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - GetNotificationsRequest copyWith( - void Function(GetNotificationsRequest) updates) => - super.copyWith((message) => updates(message as GetNotificationsRequest)) - as GetNotificationsRequest; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static GetNotificationsRequest create() => GetNotificationsRequest._(); - GetNotificationsRequest createEmptyInstance() => create(); - static $pb.PbList createRepeated() => - $pb.PbList(); - @$core.pragma('dart2js:noInline') - static GetNotificationsRequest getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor(create); - static GetNotificationsRequest? _defaultInstance; -} - -class GetNotificationsResponse extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'GetNotificationsResponse', - package: const $pb.PackageName( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'patrol'), - createEmptyInstance: create) - ..pc( - 2, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'notifications', - $pb.PbFieldType.PM, - subBuilder: Notification.create) - ..hasRequiredFields = false; - - GetNotificationsResponse._() : super(); - factory GetNotificationsResponse({ - $core.Iterable? notifications, - }) { - final _result = create(); - if (notifications != null) { - _result.notifications.addAll(notifications); - } - return _result; - } - factory GetNotificationsResponse.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - factory GetNotificationsResponse.fromJson($core.String i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromJson(i, r); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - GetNotificationsResponse clone() => - GetNotificationsResponse()..mergeFromMessage(this); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - GetNotificationsResponse copyWith( - void Function(GetNotificationsResponse) updates) => - super.copyWith((message) => updates(message as GetNotificationsResponse)) - as GetNotificationsResponse; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static GetNotificationsResponse create() => GetNotificationsResponse._(); - GetNotificationsResponse createEmptyInstance() => create(); - static $pb.PbList createRepeated() => - $pb.PbList(); - @$core.pragma('dart2js:noInline') - static GetNotificationsResponse getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor(create); - static GetNotificationsResponse? _defaultInstance; - - @$pb.TagNumber(2) - $core.List get notifications => $_getList(0); -} - -class TapRequest extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'TapRequest', - package: const $pb.PackageName( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'patrol'), - createEmptyInstance: create) - ..aOM( - 1, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'selector', - subBuilder: Selector.create) - ..aOS( - 2, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'appId', - protoName: 'appId') - ..hasRequiredFields = false; - - TapRequest._() : super(); - factory TapRequest({ - Selector? selector, - $core.String? appId, - }) { - final _result = create(); - if (selector != null) { - _result.selector = selector; - } - if (appId != null) { - _result.appId = appId; - } - return _result; - } - factory TapRequest.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - factory TapRequest.fromJson($core.String i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromJson(i, r); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - TapRequest clone() => TapRequest()..mergeFromMessage(this); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - TapRequest copyWith(void Function(TapRequest) updates) => - super.copyWith((message) => updates(message as TapRequest)) - as TapRequest; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static TapRequest create() => TapRequest._(); - TapRequest createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static TapRequest getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor(create); - static TapRequest? _defaultInstance; - - @$pb.TagNumber(1) - Selector get selector => $_getN(0); - @$pb.TagNumber(1) - set selector(Selector v) { - setField(1, v); - } - - @$pb.TagNumber(1) - $core.bool hasSelector() => $_has(0); - @$pb.TagNumber(1) - void clearSelector() => clearField(1); - @$pb.TagNumber(1) - Selector ensureSelector() => $_ensure(0); - - @$pb.TagNumber(2) - $core.String get appId => $_getSZ(1); - @$pb.TagNumber(2) - set appId($core.String v) { - $_setString(1, v); - } - - @$pb.TagNumber(2) - $core.bool hasAppId() => $_has(1); - @$pb.TagNumber(2) - void clearAppId() => clearField(2); -} - -enum EnterTextRequest_FindBy { index_, selector, notSet } - -class EnterTextRequest extends $pb.GeneratedMessage { - static const $core.Map<$core.int, EnterTextRequest_FindBy> - _EnterTextRequest_FindByByTag = { - 3: EnterTextRequest_FindBy.index_, - 4: EnterTextRequest_FindBy.selector, - 0: EnterTextRequest_FindBy.notSet - }; - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'EnterTextRequest', - package: const $pb.PackageName( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'patrol'), - createEmptyInstance: create) - ..oo(0, [3, 4]) - ..aOS( - 1, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'data') - ..aOS( - 2, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'appId', - protoName: 'appId') - ..a<$core.int>( - 3, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'index', - $pb.PbFieldType.OU3) - ..aOM( - 4, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'selector', - subBuilder: Selector.create) - ..aOB( - 5, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'showKeyboard', - protoName: 'showKeyboard') - ..hasRequiredFields = false; - - EnterTextRequest._() : super(); - factory EnterTextRequest({ - $core.String? data, - $core.String? appId, - $core.int? index, - Selector? selector, - $core.bool? showKeyboard, - }) { - final _result = create(); - if (data != null) { - _result.data = data; - } - if (appId != null) { - _result.appId = appId; - } - if (index != null) { - _result.index = index; - } - if (selector != null) { - _result.selector = selector; - } - if (showKeyboard != null) { - _result.showKeyboard = showKeyboard; - } - return _result; - } - factory EnterTextRequest.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - factory EnterTextRequest.fromJson($core.String i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromJson(i, r); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - EnterTextRequest clone() => EnterTextRequest()..mergeFromMessage(this); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - EnterTextRequest copyWith(void Function(EnterTextRequest) updates) => - super.copyWith((message) => updates(message as EnterTextRequest)) - as EnterTextRequest; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static EnterTextRequest create() => EnterTextRequest._(); - EnterTextRequest createEmptyInstance() => create(); - static $pb.PbList createRepeated() => - $pb.PbList(); - @$core.pragma('dart2js:noInline') - static EnterTextRequest getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor(create); - static EnterTextRequest? _defaultInstance; - - EnterTextRequest_FindBy whichFindBy() => - _EnterTextRequest_FindByByTag[$_whichOneof(0)]!; - void clearFindBy() => clearField($_whichOneof(0)); - - @$pb.TagNumber(1) - $core.String get data => $_getSZ(0); - @$pb.TagNumber(1) - set data($core.String v) { - $_setString(0, v); - } - - @$pb.TagNumber(1) - $core.bool hasData() => $_has(0); - @$pb.TagNumber(1) - void clearData() => clearField(1); - - @$pb.TagNumber(2) - $core.String get appId => $_getSZ(1); - @$pb.TagNumber(2) - set appId($core.String v) { - $_setString(1, v); - } - - @$pb.TagNumber(2) - $core.bool hasAppId() => $_has(1); - @$pb.TagNumber(2) - void clearAppId() => clearField(2); - - @$pb.TagNumber(3) - $core.int get index => $_getIZ(2); - @$pb.TagNumber(3) - set index($core.int v) { - $_setUnsignedInt32(2, v); - } - - @$pb.TagNumber(3) - $core.bool hasIndex() => $_has(2); - @$pb.TagNumber(3) - void clearIndex() => clearField(3); - - @$pb.TagNumber(4) - Selector get selector => $_getN(3); - @$pb.TagNumber(4) - set selector(Selector v) { - setField(4, v); - } - - @$pb.TagNumber(4) - $core.bool hasSelector() => $_has(3); - @$pb.TagNumber(4) - void clearSelector() => clearField(4); - @$pb.TagNumber(4) - Selector ensureSelector() => $_ensure(3); - - @$pb.TagNumber(5) - $core.bool get showKeyboard => $_getBF(4); - @$pb.TagNumber(5) - set showKeyboard($core.bool v) { - $_setBool(4, v); - } - - @$pb.TagNumber(5) - $core.bool hasShowKeyboard() => $_has(4); - @$pb.TagNumber(5) - void clearShowKeyboard() => clearField(5); -} - -class SwipeRequest extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'SwipeRequest', - package: const $pb.PackageName( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'patrol'), - createEmptyInstance: create) - ..a<$core.double>( - 1, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'startX', - $pb.PbFieldType.OF, - protoName: 'startX') - ..a<$core.double>( - 2, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'startY', - $pb.PbFieldType.OF, - protoName: 'startY') - ..a<$core.double>( - 3, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'endX', - $pb.PbFieldType.OF, - protoName: 'endX') - ..a<$core.double>( - 4, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'endY', - $pb.PbFieldType.OF, - protoName: 'endY') - ..a<$core.int>( - 5, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'steps', - $pb.PbFieldType.OU3) - ..aOS( - 6, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'appId', - protoName: 'appId') - ..hasRequiredFields = false; - - SwipeRequest._() : super(); - factory SwipeRequest({ - $core.double? startX, - $core.double? startY, - $core.double? endX, - $core.double? endY, - $core.int? steps, - $core.String? appId, - }) { - final _result = create(); - if (startX != null) { - _result.startX = startX; - } - if (startY != null) { - _result.startY = startY; - } - if (endX != null) { - _result.endX = endX; - } - if (endY != null) { - _result.endY = endY; - } - if (steps != null) { - _result.steps = steps; - } - if (appId != null) { - _result.appId = appId; - } - return _result; - } - factory SwipeRequest.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - factory SwipeRequest.fromJson($core.String i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromJson(i, r); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - SwipeRequest clone() => SwipeRequest()..mergeFromMessage(this); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - SwipeRequest copyWith(void Function(SwipeRequest) updates) => - super.copyWith((message) => updates(message as SwipeRequest)) - as SwipeRequest; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static SwipeRequest create() => SwipeRequest._(); - SwipeRequest createEmptyInstance() => create(); - static $pb.PbList createRepeated() => - $pb.PbList(); - @$core.pragma('dart2js:noInline') - static SwipeRequest getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor(create); - static SwipeRequest? _defaultInstance; - - @$pb.TagNumber(1) - $core.double get startX => $_getN(0); - @$pb.TagNumber(1) - set startX($core.double v) { - $_setFloat(0, v); - } - - @$pb.TagNumber(1) - $core.bool hasStartX() => $_has(0); - @$pb.TagNumber(1) - void clearStartX() => clearField(1); - - @$pb.TagNumber(2) - $core.double get startY => $_getN(1); - @$pb.TagNumber(2) - set startY($core.double v) { - $_setFloat(1, v); - } - - @$pb.TagNumber(2) - $core.bool hasStartY() => $_has(1); - @$pb.TagNumber(2) - void clearStartY() => clearField(2); - - @$pb.TagNumber(3) - $core.double get endX => $_getN(2); - @$pb.TagNumber(3) - set endX($core.double v) { - $_setFloat(2, v); - } - - @$pb.TagNumber(3) - $core.bool hasEndX() => $_has(2); - @$pb.TagNumber(3) - void clearEndX() => clearField(3); - - @$pb.TagNumber(4) - $core.double get endY => $_getN(3); - @$pb.TagNumber(4) - set endY($core.double v) { - $_setFloat(3, v); - } - - @$pb.TagNumber(4) - $core.bool hasEndY() => $_has(3); - @$pb.TagNumber(4) - void clearEndY() => clearField(4); - - @$pb.TagNumber(5) - $core.int get steps => $_getIZ(4); - @$pb.TagNumber(5) - set steps($core.int v) { - $_setUnsignedInt32(4, v); - } - - @$pb.TagNumber(5) - $core.bool hasSteps() => $_has(4); - @$pb.TagNumber(5) - void clearSteps() => clearField(5); - - @$pb.TagNumber(6) - $core.String get appId => $_getSZ(5); - @$pb.TagNumber(6) - set appId($core.String v) { - $_setString(5, v); - } - - @$pb.TagNumber(6) - $core.bool hasAppId() => $_has(5); - @$pb.TagNumber(6) - void clearAppId() => clearField(6); -} - -class WaitUntilVisibleRequest extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'WaitUntilVisibleRequest', - package: const $pb.PackageName( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'patrol'), - createEmptyInstance: create) - ..aOM( - 1, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'selector', - subBuilder: Selector.create) - ..aOS( - 2, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'appId', - protoName: 'appId') - ..hasRequiredFields = false; - - WaitUntilVisibleRequest._() : super(); - factory WaitUntilVisibleRequest({ - Selector? selector, - $core.String? appId, - }) { - final _result = create(); - if (selector != null) { - _result.selector = selector; - } - if (appId != null) { - _result.appId = appId; - } - return _result; - } - factory WaitUntilVisibleRequest.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - factory WaitUntilVisibleRequest.fromJson($core.String i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromJson(i, r); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - WaitUntilVisibleRequest clone() => - WaitUntilVisibleRequest()..mergeFromMessage(this); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - WaitUntilVisibleRequest copyWith( - void Function(WaitUntilVisibleRequest) updates) => - super.copyWith((message) => updates(message as WaitUntilVisibleRequest)) - as WaitUntilVisibleRequest; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static WaitUntilVisibleRequest create() => WaitUntilVisibleRequest._(); - WaitUntilVisibleRequest createEmptyInstance() => create(); - static $pb.PbList createRepeated() => - $pb.PbList(); - @$core.pragma('dart2js:noInline') - static WaitUntilVisibleRequest getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor(create); - static WaitUntilVisibleRequest? _defaultInstance; - - @$pb.TagNumber(1) - Selector get selector => $_getN(0); - @$pb.TagNumber(1) - set selector(Selector v) { - setField(1, v); - } - - @$pb.TagNumber(1) - $core.bool hasSelector() => $_has(0); - @$pb.TagNumber(1) - void clearSelector() => clearField(1); - @$pb.TagNumber(1) - Selector ensureSelector() => $_ensure(0); - - @$pb.TagNumber(2) - $core.String get appId => $_getSZ(1); - @$pb.TagNumber(2) - set appId($core.String v) { - $_setString(1, v); - } - - @$pb.TagNumber(2) - $core.bool hasAppId() => $_has(1); - @$pb.TagNumber(2) - void clearAppId() => clearField(2); -} - -class HandlePermissionRequest extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'HandlePermissionRequest', - package: const $pb.PackageName( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'patrol'), - createEmptyInstance: create) - ..e( - 1, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'code', - $pb.PbFieldType.OE, - defaultOrMaker: HandlePermissionRequest_Code.WHILE_USING, - valueOf: HandlePermissionRequest_Code.valueOf, - enumValues: HandlePermissionRequest_Code.values) - ..hasRequiredFields = false; - - HandlePermissionRequest._() : super(); - factory HandlePermissionRequest({ - HandlePermissionRequest_Code? code, - }) { - final _result = create(); - if (code != null) { - _result.code = code; - } - return _result; - } - factory HandlePermissionRequest.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - factory HandlePermissionRequest.fromJson($core.String i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromJson(i, r); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - HandlePermissionRequest clone() => - HandlePermissionRequest()..mergeFromMessage(this); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - HandlePermissionRequest copyWith( - void Function(HandlePermissionRequest) updates) => - super.copyWith((message) => updates(message as HandlePermissionRequest)) - as HandlePermissionRequest; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static HandlePermissionRequest create() => HandlePermissionRequest._(); - HandlePermissionRequest createEmptyInstance() => create(); - static $pb.PbList createRepeated() => - $pb.PbList(); - @$core.pragma('dart2js:noInline') - static HandlePermissionRequest getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor(create); - static HandlePermissionRequest? _defaultInstance; - - @$pb.TagNumber(1) - HandlePermissionRequest_Code get code => $_getN(0); - @$pb.TagNumber(1) - set code(HandlePermissionRequest_Code v) { - setField(1, v); - } - - @$pb.TagNumber(1) - $core.bool hasCode() => $_has(0); - @$pb.TagNumber(1) - void clearCode() => clearField(1); -} - -class SetLocationAccuracyRequest extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'SetLocationAccuracyRequest', - package: const $pb.PackageName( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'patrol'), - createEmptyInstance: create) - ..e( - 1, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'locationAccuracy', - $pb.PbFieldType.OE, - protoName: 'locationAccuracy', - defaultOrMaker: SetLocationAccuracyRequest_LocationAccuracy.COARSE, - valueOf: SetLocationAccuracyRequest_LocationAccuracy.valueOf, - enumValues: SetLocationAccuracyRequest_LocationAccuracy.values) - ..hasRequiredFields = false; - - SetLocationAccuracyRequest._() : super(); - factory SetLocationAccuracyRequest({ - SetLocationAccuracyRequest_LocationAccuracy? locationAccuracy, - }) { - final _result = create(); - if (locationAccuracy != null) { - _result.locationAccuracy = locationAccuracy; - } - return _result; - } - factory SetLocationAccuracyRequest.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - factory SetLocationAccuracyRequest.fromJson($core.String i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromJson(i, r); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - SetLocationAccuracyRequest clone() => - SetLocationAccuracyRequest()..mergeFromMessage(this); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - SetLocationAccuracyRequest copyWith( - void Function(SetLocationAccuracyRequest) updates) => - super.copyWith( - (message) => updates(message as SetLocationAccuracyRequest)) - as SetLocationAccuracyRequest; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static SetLocationAccuracyRequest create() => SetLocationAccuracyRequest._(); - SetLocationAccuracyRequest createEmptyInstance() => create(); - static $pb.PbList createRepeated() => - $pb.PbList(); - @$core.pragma('dart2js:noInline') - static SetLocationAccuracyRequest getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor(create); - static SetLocationAccuracyRequest? _defaultInstance; - - @$pb.TagNumber(1) - SetLocationAccuracyRequest_LocationAccuracy get locationAccuracy => $_getN(0); - @$pb.TagNumber(1) - set locationAccuracy(SetLocationAccuracyRequest_LocationAccuracy v) { - setField(1, v); - } - - @$pb.TagNumber(1) - $core.bool hasLocationAccuracy() => $_has(0); - @$pb.TagNumber(1) - void clearLocationAccuracy() => clearField(1); -} - -class PermissionDialogVisibleRequest extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'PermissionDialogVisibleRequest', - package: const $pb.PackageName( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'patrol'), - createEmptyInstance: create) - ..a<$fixnum.Int64>( - 1, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'timeoutMillis', - $pb.PbFieldType.OU6, - protoName: 'timeoutMillis', - defaultOrMaker: $fixnum.Int64.ZERO) - ..hasRequiredFields = false; - - PermissionDialogVisibleRequest._() : super(); - factory PermissionDialogVisibleRequest({ - $fixnum.Int64? timeoutMillis, - }) { - final _result = create(); - if (timeoutMillis != null) { - _result.timeoutMillis = timeoutMillis; - } - return _result; - } - factory PermissionDialogVisibleRequest.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - factory PermissionDialogVisibleRequest.fromJson($core.String i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromJson(i, r); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - PermissionDialogVisibleRequest clone() => - PermissionDialogVisibleRequest()..mergeFromMessage(this); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - PermissionDialogVisibleRequest copyWith( - void Function(PermissionDialogVisibleRequest) updates) => - super.copyWith( - (message) => updates(message as PermissionDialogVisibleRequest)) - as PermissionDialogVisibleRequest; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static PermissionDialogVisibleRequest create() => - PermissionDialogVisibleRequest._(); - PermissionDialogVisibleRequest createEmptyInstance() => create(); - static $pb.PbList createRepeated() => - $pb.PbList(); - @$core.pragma('dart2js:noInline') - static PermissionDialogVisibleRequest getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor(create); - static PermissionDialogVisibleRequest? _defaultInstance; - - @$pb.TagNumber(1) - $fixnum.Int64 get timeoutMillis => $_getI64(0); - @$pb.TagNumber(1) - set timeoutMillis($fixnum.Int64 v) { - $_setInt64(0, v); - } - - @$pb.TagNumber(1) - $core.bool hasTimeoutMillis() => $_has(0); - @$pb.TagNumber(1) - void clearTimeoutMillis() => clearField(1); -} - -class PermissionDialogVisibleResponse extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'PermissionDialogVisibleResponse', - package: const $pb.PackageName( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'patrol'), - createEmptyInstance: create) - ..aOB( - 1, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'visible') - ..hasRequiredFields = false; - - PermissionDialogVisibleResponse._() : super(); - factory PermissionDialogVisibleResponse({ - $core.bool? visible, - }) { - final _result = create(); - if (visible != null) { - _result.visible = visible; - } - return _result; - } - factory PermissionDialogVisibleResponse.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - factory PermissionDialogVisibleResponse.fromJson($core.String i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromJson(i, r); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - PermissionDialogVisibleResponse clone() => - PermissionDialogVisibleResponse()..mergeFromMessage(this); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - PermissionDialogVisibleResponse copyWith( - void Function(PermissionDialogVisibleResponse) updates) => - super.copyWith( - (message) => updates(message as PermissionDialogVisibleResponse)) - as PermissionDialogVisibleResponse; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static PermissionDialogVisibleResponse create() => - PermissionDialogVisibleResponse._(); - PermissionDialogVisibleResponse createEmptyInstance() => create(); - static $pb.PbList createRepeated() => - $pb.PbList(); - @$core.pragma('dart2js:noInline') - static PermissionDialogVisibleResponse getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor( - create); - static PermissionDialogVisibleResponse? _defaultInstance; - - @$pb.TagNumber(1) - $core.bool get visible => $_getBF(0); - @$pb.TagNumber(1) - set visible($core.bool v) { - $_setBool(0, v); - } - - @$pb.TagNumber(1) - $core.bool hasVisible() => $_has(0); - @$pb.TagNumber(1) - void clearVisible() => clearField(1); -} - -class Selector extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'Selector', - package: const $pb.PackageName( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'patrol'), - createEmptyInstance: create) - ..aOS( - 1, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'text') - ..aOS( - 2, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'textStartsWith', - protoName: 'textStartsWith') - ..aOS( - 3, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'textContains', - protoName: 'textContains') - ..aOS( - 4, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'className', - protoName: 'className') - ..aOS( - 5, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'contentDescription', - protoName: 'contentDescription') - ..aOS( - 6, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'contentDescriptionStartsWith', - protoName: 'contentDescriptionStartsWith') - ..aOS( - 7, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'contentDescriptionContains', - protoName: 'contentDescriptionContains') - ..aOS( - 8, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'resourceId', - protoName: 'resourceId') - ..a<$core.int>( - 9, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'instance', - $pb.PbFieldType.OU3) - ..aOB( - 10, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'enabled') - ..aOB( - 11, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'focused') - ..aOS( - 12, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'pkg') - ..hasRequiredFields = false; - - Selector._() : super(); - factory Selector({ - $core.String? text, - $core.String? textStartsWith, - $core.String? textContains, - $core.String? className, - $core.String? contentDescription, - $core.String? contentDescriptionStartsWith, - $core.String? contentDescriptionContains, - $core.String? resourceId, - $core.int? instance, - $core.bool? enabled, - $core.bool? focused, - $core.String? pkg, - }) { - final _result = create(); - if (text != null) { - _result.text = text; - } - if (textStartsWith != null) { - _result.textStartsWith = textStartsWith; - } - if (textContains != null) { - _result.textContains = textContains; - } - if (className != null) { - _result.className = className; - } - if (contentDescription != null) { - _result.contentDescription = contentDescription; - } - if (contentDescriptionStartsWith != null) { - _result.contentDescriptionStartsWith = contentDescriptionStartsWith; - } - if (contentDescriptionContains != null) { - _result.contentDescriptionContains = contentDescriptionContains; - } - if (resourceId != null) { - _result.resourceId = resourceId; - } - if (instance != null) { - _result.instance = instance; - } - if (enabled != null) { - _result.enabled = enabled; - } - if (focused != null) { - _result.focused = focused; - } - if (pkg != null) { - _result.pkg = pkg; - } - return _result; - } - factory Selector.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - factory Selector.fromJson($core.String i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromJson(i, r); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - Selector clone() => Selector()..mergeFromMessage(this); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - Selector copyWith(void Function(Selector) updates) => - super.copyWith((message) => updates(message as Selector)) - as Selector; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static Selector create() => Selector._(); - Selector createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static Selector getDefault() => - _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static Selector? _defaultInstance; - - @$pb.TagNumber(1) - $core.String get text => $_getSZ(0); - @$pb.TagNumber(1) - set text($core.String v) { - $_setString(0, v); - } - - @$pb.TagNumber(1) - $core.bool hasText() => $_has(0); - @$pb.TagNumber(1) - void clearText() => clearField(1); - - @$pb.TagNumber(2) - $core.String get textStartsWith => $_getSZ(1); - @$pb.TagNumber(2) - set textStartsWith($core.String v) { - $_setString(1, v); - } - - @$pb.TagNumber(2) - $core.bool hasTextStartsWith() => $_has(1); - @$pb.TagNumber(2) - void clearTextStartsWith() => clearField(2); - - @$pb.TagNumber(3) - $core.String get textContains => $_getSZ(2); - @$pb.TagNumber(3) - set textContains($core.String v) { - $_setString(2, v); - } - - @$pb.TagNumber(3) - $core.bool hasTextContains() => $_has(2); - @$pb.TagNumber(3) - void clearTextContains() => clearField(3); - - @$pb.TagNumber(4) - $core.String get className => $_getSZ(3); - @$pb.TagNumber(4) - set className($core.String v) { - $_setString(3, v); - } - - @$pb.TagNumber(4) - $core.bool hasClassName() => $_has(3); - @$pb.TagNumber(4) - void clearClassName() => clearField(4); - - @$pb.TagNumber(5) - $core.String get contentDescription => $_getSZ(4); - @$pb.TagNumber(5) - set contentDescription($core.String v) { - $_setString(4, v); - } - - @$pb.TagNumber(5) - $core.bool hasContentDescription() => $_has(4); - @$pb.TagNumber(5) - void clearContentDescription() => clearField(5); - - @$pb.TagNumber(6) - $core.String get contentDescriptionStartsWith => $_getSZ(5); - @$pb.TagNumber(6) - set contentDescriptionStartsWith($core.String v) { - $_setString(5, v); - } - - @$pb.TagNumber(6) - $core.bool hasContentDescriptionStartsWith() => $_has(5); - @$pb.TagNumber(6) - void clearContentDescriptionStartsWith() => clearField(6); - - @$pb.TagNumber(7) - $core.String get contentDescriptionContains => $_getSZ(6); - @$pb.TagNumber(7) - set contentDescriptionContains($core.String v) { - $_setString(6, v); - } - - @$pb.TagNumber(7) - $core.bool hasContentDescriptionContains() => $_has(6); - @$pb.TagNumber(7) - void clearContentDescriptionContains() => clearField(7); - - @$pb.TagNumber(8) - $core.String get resourceId => $_getSZ(7); - @$pb.TagNumber(8) - set resourceId($core.String v) { - $_setString(7, v); - } - - @$pb.TagNumber(8) - $core.bool hasResourceId() => $_has(7); - @$pb.TagNumber(8) - void clearResourceId() => clearField(8); - - @$pb.TagNumber(9) - $core.int get instance => $_getIZ(8); - @$pb.TagNumber(9) - set instance($core.int v) { - $_setUnsignedInt32(8, v); - } - - @$pb.TagNumber(9) - $core.bool hasInstance() => $_has(8); - @$pb.TagNumber(9) - void clearInstance() => clearField(9); - - @$pb.TagNumber(10) - $core.bool get enabled => $_getBF(9); - @$pb.TagNumber(10) - set enabled($core.bool v) { - $_setBool(9, v); - } - - @$pb.TagNumber(10) - $core.bool hasEnabled() => $_has(9); - @$pb.TagNumber(10) - void clearEnabled() => clearField(10); - - @$pb.TagNumber(11) - $core.bool get focused => $_getBF(10); - @$pb.TagNumber(11) - set focused($core.bool v) { - $_setBool(10, v); - } - - @$pb.TagNumber(11) - $core.bool hasFocused() => $_has(10); - @$pb.TagNumber(11) - void clearFocused() => clearField(11); - - @$pb.TagNumber(12) - $core.String get pkg => $_getSZ(11); - @$pb.TagNumber(12) - set pkg($core.String v) { - $_setString(11, v); - } - - @$pb.TagNumber(12) - $core.bool hasPkg() => $_has(11); - @$pb.TagNumber(12) - void clearPkg() => clearField(12); -} - -class NativeView extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'NativeView', - package: const $pb.PackageName( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'patrol'), - createEmptyInstance: create) - ..aOS( - 1, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'className', - protoName: 'className') - ..aOS( - 2, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'text') - ..aOS( - 3, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'contentDescription', - protoName: 'contentDescription') - ..aOB( - 4, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'focused') - ..aOB( - 5, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'enabled') - ..a<$core.int>( - 6, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'childCount', - $pb.PbFieldType.O3, - protoName: 'childCount') - ..aOS( - 7, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'resourceName', - protoName: 'resourceName') - ..aOS( - 8, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'applicationPackage', - protoName: 'applicationPackage') - ..pc( - 9, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'children', - $pb.PbFieldType.PM, - subBuilder: NativeView.create) - ..hasRequiredFields = false; - - NativeView._() : super(); - factory NativeView({ - $core.String? className, - $core.String? text, - $core.String? contentDescription, - $core.bool? focused, - $core.bool? enabled, - $core.int? childCount, - $core.String? resourceName, - $core.String? applicationPackage, - $core.Iterable? children, - }) { - final _result = create(); - if (className != null) { - _result.className = className; - } - if (text != null) { - _result.text = text; - } - if (contentDescription != null) { - _result.contentDescription = contentDescription; - } - if (focused != null) { - _result.focused = focused; - } - if (enabled != null) { - _result.enabled = enabled; - } - if (childCount != null) { - _result.childCount = childCount; - } - if (resourceName != null) { - _result.resourceName = resourceName; - } - if (applicationPackage != null) { - _result.applicationPackage = applicationPackage; - } - if (children != null) { - _result.children.addAll(children); - } - return _result; - } - factory NativeView.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - factory NativeView.fromJson($core.String i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromJson(i, r); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - NativeView clone() => NativeView()..mergeFromMessage(this); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - NativeView copyWith(void Function(NativeView) updates) => - super.copyWith((message) => updates(message as NativeView)) - as NativeView; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static NativeView create() => NativeView._(); - NativeView createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static NativeView getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor(create); - static NativeView? _defaultInstance; - - @$pb.TagNumber(1) - $core.String get className => $_getSZ(0); - @$pb.TagNumber(1) - set className($core.String v) { - $_setString(0, v); - } - - @$pb.TagNumber(1) - $core.bool hasClassName() => $_has(0); - @$pb.TagNumber(1) - void clearClassName() => clearField(1); - - @$pb.TagNumber(2) - $core.String get text => $_getSZ(1); - @$pb.TagNumber(2) - set text($core.String v) { - $_setString(1, v); - } - - @$pb.TagNumber(2) - $core.bool hasText() => $_has(1); - @$pb.TagNumber(2) - void clearText() => clearField(2); - - @$pb.TagNumber(3) - $core.String get contentDescription => $_getSZ(2); - @$pb.TagNumber(3) - set contentDescription($core.String v) { - $_setString(2, v); - } - - @$pb.TagNumber(3) - $core.bool hasContentDescription() => $_has(2); - @$pb.TagNumber(3) - void clearContentDescription() => clearField(3); - - @$pb.TagNumber(4) - $core.bool get focused => $_getBF(3); - @$pb.TagNumber(4) - set focused($core.bool v) { - $_setBool(3, v); - } - - @$pb.TagNumber(4) - $core.bool hasFocused() => $_has(3); - @$pb.TagNumber(4) - void clearFocused() => clearField(4); - - @$pb.TagNumber(5) - $core.bool get enabled => $_getBF(4); - @$pb.TagNumber(5) - set enabled($core.bool v) { - $_setBool(4, v); - } - - @$pb.TagNumber(5) - $core.bool hasEnabled() => $_has(4); - @$pb.TagNumber(5) - void clearEnabled() => clearField(5); - - @$pb.TagNumber(6) - $core.int get childCount => $_getIZ(5); - @$pb.TagNumber(6) - set childCount($core.int v) { - $_setSignedInt32(5, v); - } - - @$pb.TagNumber(6) - $core.bool hasChildCount() => $_has(5); - @$pb.TagNumber(6) - void clearChildCount() => clearField(6); - - @$pb.TagNumber(7) - $core.String get resourceName => $_getSZ(6); - @$pb.TagNumber(7) - set resourceName($core.String v) { - $_setString(6, v); - } - - @$pb.TagNumber(7) - $core.bool hasResourceName() => $_has(6); - @$pb.TagNumber(7) - void clearResourceName() => clearField(7); - - @$pb.TagNumber(8) - $core.String get applicationPackage => $_getSZ(7); - @$pb.TagNumber(8) - set applicationPackage($core.String v) { - $_setString(7, v); - } - - @$pb.TagNumber(8) - $core.bool hasApplicationPackage() => $_has(7); - @$pb.TagNumber(8) - void clearApplicationPackage() => clearField(8); - - @$pb.TagNumber(9) - $core.List get children => $_getList(8); -} - -class Notification extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'Notification', - package: const $pb.PackageName( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'patrol'), - createEmptyInstance: create) - ..aOS( - 1, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'appName', - protoName: 'appName') - ..aOS( - 2, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'title') - ..aOS( - 3, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'content') - ..aOS( - 4, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'raw') - ..hasRequiredFields = false; - - Notification._() : super(); - factory Notification({ - $core.String? appName, - $core.String? title, - $core.String? content, - $core.String? raw, - }) { - final _result = create(); - if (appName != null) { - _result.appName = appName; - } - if (title != null) { - _result.title = title; - } - if (content != null) { - _result.content = content; - } - if (raw != null) { - _result.raw = raw; - } - return _result; - } - factory Notification.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - factory Notification.fromJson($core.String i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromJson(i, r); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - Notification clone() => Notification()..mergeFromMessage(this); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - Notification copyWith(void Function(Notification) updates) => - super.copyWith((message) => updates(message as Notification)) - as Notification; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static Notification create() => Notification._(); - Notification createEmptyInstance() => create(); - static $pb.PbList createRepeated() => - $pb.PbList(); - @$core.pragma('dart2js:noInline') - static Notification getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor(create); - static Notification? _defaultInstance; - - @$pb.TagNumber(1) - $core.String get appName => $_getSZ(0); - @$pb.TagNumber(1) - set appName($core.String v) { - $_setString(0, v); - } - - @$pb.TagNumber(1) - $core.bool hasAppName() => $_has(0); - @$pb.TagNumber(1) - void clearAppName() => clearField(1); - - @$pb.TagNumber(2) - $core.String get title => $_getSZ(1); - @$pb.TagNumber(2) - set title($core.String v) { - $_setString(1, v); - } - - @$pb.TagNumber(2) - $core.bool hasTitle() => $_has(1); - @$pb.TagNumber(2) - void clearTitle() => clearField(2); - - @$pb.TagNumber(3) - $core.String get content => $_getSZ(2); - @$pb.TagNumber(3) - set content($core.String v) { - $_setString(2, v); - } - - @$pb.TagNumber(3) - $core.bool hasContent() => $_has(2); - @$pb.TagNumber(3) - void clearContent() => clearField(3); - - @$pb.TagNumber(4) - $core.String get raw => $_getSZ(3); - @$pb.TagNumber(4) - set raw($core.String v) { - $_setString(3, v); - } - - @$pb.TagNumber(4) - $core.bool hasRaw() => $_has(3); - @$pb.TagNumber(4) - void clearRaw() => clearField(4); -} - -class SubmitTestResultsRequest extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'SubmitTestResultsRequest', - package: const $pb.PackageName( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'patrol'), - createEmptyInstance: create) - ..m<$core.String, $core.String>( - 1, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'results', - entryClassName: 'SubmitTestResultsRequest.ResultsEntry', - keyFieldType: $pb.PbFieldType.OS, - valueFieldType: $pb.PbFieldType.OS, - packageName: const $pb.PackageName('patrol')) - ..hasRequiredFields = false; - - SubmitTestResultsRequest._() : super(); - factory SubmitTestResultsRequest({ - $core.Map<$core.String, $core.String>? results, - }) { - final _result = create(); - if (results != null) { - _result.results.addAll(results); - } - return _result; - } - factory SubmitTestResultsRequest.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - factory SubmitTestResultsRequest.fromJson($core.String i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromJson(i, r); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - SubmitTestResultsRequest clone() => - SubmitTestResultsRequest()..mergeFromMessage(this); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - SubmitTestResultsRequest copyWith( - void Function(SubmitTestResultsRequest) updates) => - super.copyWith((message) => updates(message as SubmitTestResultsRequest)) - as SubmitTestResultsRequest; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static SubmitTestResultsRequest create() => SubmitTestResultsRequest._(); - SubmitTestResultsRequest createEmptyInstance() => create(); - static $pb.PbList createRepeated() => - $pb.PbList(); - @$core.pragma('dart2js:noInline') - static SubmitTestResultsRequest getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor(create); - static SubmitTestResultsRequest? _defaultInstance; - - @$pb.TagNumber(1) - $core.Map<$core.String, $core.String> get results => $_getMap(0); -} diff --git a/packages/patrol/lib/src/native/contracts/contracts.pbenum.dart b/packages/patrol/lib/src/native/contracts/contracts.pbenum.dart deleted file mode 100644 index 9500cec6e..000000000 --- a/packages/patrol/lib/src/native/contracts/contracts.pbenum.dart +++ /dev/null @@ -1,77 +0,0 @@ -/// -// Generated code. Do not modify. -// source: contracts.proto -// -// @dart = 2.12 -// ignore_for_file: annotate_overrides,camel_case_types,constant_identifier_names,directives_ordering,library_prefixes,non_constant_identifier_names,prefer_final_fields,return_of_invalid_type,unnecessary_const,unnecessary_import,unnecessary_this,unused_import,unused_shown_name - -// ignore_for_file: UNDEFINED_SHOWN_NAME -import 'dart:core' as $core; -import 'package:protobuf/protobuf.dart' as $pb; - -class HandlePermissionRequest_Code extends $pb.ProtobufEnum { - static const HandlePermissionRequest_Code WHILE_USING = - HandlePermissionRequest_Code._( - 0, - const $core.bool.fromEnvironment('protobuf.omit_enum_names') - ? '' - : 'WHILE_USING'); - static const HandlePermissionRequest_Code ONLY_THIS_TIME = - HandlePermissionRequest_Code._( - 1, - const $core.bool.fromEnvironment('protobuf.omit_enum_names') - ? '' - : 'ONLY_THIS_TIME'); - static const HandlePermissionRequest_Code DENIED = - HandlePermissionRequest_Code._( - 2, - const $core.bool.fromEnvironment('protobuf.omit_enum_names') - ? '' - : 'DENIED'); - - static const $core.List values = - [ - WHILE_USING, - ONLY_THIS_TIME, - DENIED, - ]; - - static final $core.Map<$core.int, HandlePermissionRequest_Code> _byValue = - $pb.ProtobufEnum.initByValue(values); - static HandlePermissionRequest_Code? valueOf($core.int value) => - _byValue[value]; - - const HandlePermissionRequest_Code._($core.int v, $core.String n) - : super(v, n); -} - -class SetLocationAccuracyRequest_LocationAccuracy extends $pb.ProtobufEnum { - static const SetLocationAccuracyRequest_LocationAccuracy COARSE = - SetLocationAccuracyRequest_LocationAccuracy._( - 0, - const $core.bool.fromEnvironment('protobuf.omit_enum_names') - ? '' - : 'COARSE'); - static const SetLocationAccuracyRequest_LocationAccuracy FINE = - SetLocationAccuracyRequest_LocationAccuracy._( - 1, - const $core.bool.fromEnvironment('protobuf.omit_enum_names') - ? '' - : 'FINE'); - - static const $core.List values = - [ - COARSE, - FINE, - ]; - - static final $core.Map<$core.int, SetLocationAccuracyRequest_LocationAccuracy> - _byValue = $pb.ProtobufEnum.initByValue(values); - static SetLocationAccuracyRequest_LocationAccuracy? valueOf( - $core.int value) => - _byValue[value]; - - const SetLocationAccuracyRequest_LocationAccuracy._( - $core.int v, $core.String n) - : super(v, n); -} diff --git a/packages/patrol/lib/src/native/contracts/contracts.pbgrpc.dart b/packages/patrol/lib/src/native/contracts/contracts.pbgrpc.dart deleted file mode 100644 index a5d838ec8..000000000 --- a/packages/patrol/lib/src/native/contracts/contracts.pbgrpc.dart +++ /dev/null @@ -1,847 +0,0 @@ -/// -// Generated code. Do not modify. -// source: contracts.proto -// -// @dart = 2.12 -// ignore_for_file: annotate_overrides,camel_case_types,constant_identifier_names,directives_ordering,library_prefixes,non_constant_identifier_names,prefer_final_fields,return_of_invalid_type,unnecessary_const,unnecessary_import,unnecessary_this,unused_import,unused_shown_name - -import 'dart:async' as $async; - -import 'dart:core' as $core; - -import 'package:grpc/service_api.dart' as $grpc; -import 'contracts.pb.dart' as $0; -export 'contracts.pb.dart'; - -class NativeAutomatorClient extends $grpc.Client { - static final _$initialize = $grpc.ClientMethod<$0.Empty, $0.Empty>( - '/patrol.NativeAutomator/initialize', - ($0.Empty value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value)); - static final _$configure = $grpc.ClientMethod<$0.ConfigureRequest, $0.Empty>( - '/patrol.NativeAutomator/configure', - ($0.ConfigureRequest value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value)); - static final _$pressHome = $grpc.ClientMethod<$0.Empty, $0.Empty>( - '/patrol.NativeAutomator/pressHome', - ($0.Empty value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value)); - static final _$pressBack = $grpc.ClientMethod<$0.Empty, $0.Empty>( - '/patrol.NativeAutomator/pressBack', - ($0.Empty value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value)); - static final _$pressRecentApps = $grpc.ClientMethod<$0.Empty, $0.Empty>( - '/patrol.NativeAutomator/pressRecentApps', - ($0.Empty value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value)); - static final _$doublePressRecentApps = $grpc.ClientMethod<$0.Empty, $0.Empty>( - '/patrol.NativeAutomator/doublePressRecentApps', - ($0.Empty value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value)); - static final _$openApp = $grpc.ClientMethod<$0.OpenAppRequest, $0.Empty>( - '/patrol.NativeAutomator/openApp', - ($0.OpenAppRequest value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value)); - static final _$openQuickSettings = - $grpc.ClientMethod<$0.OpenQuickSettingsRequest, $0.Empty>( - '/patrol.NativeAutomator/openQuickSettings', - ($0.OpenQuickSettingsRequest value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value)); - static final _$getNativeViews = - $grpc.ClientMethod<$0.GetNativeViewsRequest, $0.GetNativeViewsResponse>( - '/patrol.NativeAutomator/getNativeViews', - ($0.GetNativeViewsRequest value) => value.writeToBuffer(), - ($core.List<$core.int> value) => - $0.GetNativeViewsResponse.fromBuffer(value)); - static final _$tap = $grpc.ClientMethod<$0.TapRequest, $0.Empty>( - '/patrol.NativeAutomator/tap', - ($0.TapRequest value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value)); - static final _$doubleTap = $grpc.ClientMethod<$0.TapRequest, $0.Empty>( - '/patrol.NativeAutomator/doubleTap', - ($0.TapRequest value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value)); - static final _$enterText = $grpc.ClientMethod<$0.EnterTextRequest, $0.Empty>( - '/patrol.NativeAutomator/enterText', - ($0.EnterTextRequest value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value)); - static final _$swipe = $grpc.ClientMethod<$0.SwipeRequest, $0.Empty>( - '/patrol.NativeAutomator/swipe', - ($0.SwipeRequest value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value)); - static final _$waitUntilVisible = - $grpc.ClientMethod<$0.WaitUntilVisibleRequest, $0.Empty>( - '/patrol.NativeAutomator/waitUntilVisible', - ($0.WaitUntilVisibleRequest value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value)); - static final _$enableAirplaneMode = $grpc.ClientMethod<$0.Empty, $0.Empty>( - '/patrol.NativeAutomator/enableAirplaneMode', - ($0.Empty value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value)); - static final _$disableAirplaneMode = $grpc.ClientMethod<$0.Empty, $0.Empty>( - '/patrol.NativeAutomator/disableAirplaneMode', - ($0.Empty value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value)); - static final _$enableWiFi = $grpc.ClientMethod<$0.Empty, $0.Empty>( - '/patrol.NativeAutomator/enableWiFi', - ($0.Empty value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value)); - static final _$disableWiFi = $grpc.ClientMethod<$0.Empty, $0.Empty>( - '/patrol.NativeAutomator/disableWiFi', - ($0.Empty value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value)); - static final _$enableCellular = $grpc.ClientMethod<$0.Empty, $0.Empty>( - '/patrol.NativeAutomator/enableCellular', - ($0.Empty value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value)); - static final _$disableCellular = $grpc.ClientMethod<$0.Empty, $0.Empty>( - '/patrol.NativeAutomator/disableCellular', - ($0.Empty value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value)); - static final _$enableBluetooth = $grpc.ClientMethod<$0.Empty, $0.Empty>( - '/patrol.NativeAutomator/enableBluetooth', - ($0.Empty value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value)); - static final _$disableBluetooth = $grpc.ClientMethod<$0.Empty, $0.Empty>( - '/patrol.NativeAutomator/disableBluetooth', - ($0.Empty value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value)); - static final _$enableDarkMode = - $grpc.ClientMethod<$0.DarkModeRequest, $0.Empty>( - '/patrol.NativeAutomator/enableDarkMode', - ($0.DarkModeRequest value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value)); - static final _$disableDarkMode = - $grpc.ClientMethod<$0.DarkModeRequest, $0.Empty>( - '/patrol.NativeAutomator/disableDarkMode', - ($0.DarkModeRequest value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value)); - static final _$openNotifications = $grpc.ClientMethod<$0.Empty, $0.Empty>( - '/patrol.NativeAutomator/openNotifications', - ($0.Empty value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value)); - static final _$closeNotifications = $grpc.ClientMethod<$0.Empty, $0.Empty>( - '/patrol.NativeAutomator/closeNotifications', - ($0.Empty value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value)); - static final _$closeHeadsUpNotification = - $grpc.ClientMethod<$0.Empty, $0.Empty>( - '/patrol.NativeAutomator/closeHeadsUpNotification', - ($0.Empty value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value)); - static final _$getNotifications = $grpc.ClientMethod< - $0.GetNotificationsRequest, $0.GetNotificationsResponse>( - '/patrol.NativeAutomator/getNotifications', - ($0.GetNotificationsRequest value) => value.writeToBuffer(), - ($core.List<$core.int> value) => - $0.GetNotificationsResponse.fromBuffer(value)); - static final _$tapOnNotification = - $grpc.ClientMethod<$0.TapOnNotificationRequest, $0.Empty>( - '/patrol.NativeAutomator/tapOnNotification', - ($0.TapOnNotificationRequest value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value)); - static final _$isPermissionDialogVisible = $grpc.ClientMethod< - $0.PermissionDialogVisibleRequest, - $0.PermissionDialogVisibleResponse>( - '/patrol.NativeAutomator/isPermissionDialogVisible', - ($0.PermissionDialogVisibleRequest value) => value.writeToBuffer(), - ($core.List<$core.int> value) => - $0.PermissionDialogVisibleResponse.fromBuffer(value)); - static final _$handlePermissionDialog = - $grpc.ClientMethod<$0.HandlePermissionRequest, $0.Empty>( - '/patrol.NativeAutomator/handlePermissionDialog', - ($0.HandlePermissionRequest value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value)); - static final _$setLocationAccuracy = - $grpc.ClientMethod<$0.SetLocationAccuracyRequest, $0.Empty>( - '/patrol.NativeAutomator/setLocationAccuracy', - ($0.SetLocationAccuracyRequest value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value)); - static final _$debug = $grpc.ClientMethod<$0.Empty, $0.Empty>( - '/patrol.NativeAutomator/debug', - ($0.Empty value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value)); - static final _$markPatrolAppServiceReady = - $grpc.ClientMethod<$0.Empty, $0.Empty>( - '/patrol.NativeAutomator/markPatrolAppServiceReady', - ($0.Empty value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value)); - - NativeAutomatorClient($grpc.ClientChannel channel, - {$grpc.CallOptions? options, - $core.Iterable<$grpc.ClientInterceptor>? interceptors}) - : super(channel, options: options, interceptors: interceptors); - - $grpc.ResponseFuture<$0.Empty> initialize($0.Empty request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$initialize, request, options: options); - } - - $grpc.ResponseFuture<$0.Empty> configure($0.ConfigureRequest request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$configure, request, options: options); - } - - $grpc.ResponseFuture<$0.Empty> pressHome($0.Empty request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$pressHome, request, options: options); - } - - $grpc.ResponseFuture<$0.Empty> pressBack($0.Empty request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$pressBack, request, options: options); - } - - $grpc.ResponseFuture<$0.Empty> pressRecentApps($0.Empty request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$pressRecentApps, request, options: options); - } - - $grpc.ResponseFuture<$0.Empty> doublePressRecentApps($0.Empty request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$doublePressRecentApps, request, options: options); - } - - $grpc.ResponseFuture<$0.Empty> openApp($0.OpenAppRequest request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$openApp, request, options: options); - } - - $grpc.ResponseFuture<$0.Empty> openQuickSettings( - $0.OpenQuickSettingsRequest request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$openQuickSettings, request, options: options); - } - - $grpc.ResponseFuture<$0.GetNativeViewsResponse> getNativeViews( - $0.GetNativeViewsRequest request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$getNativeViews, request, options: options); - } - - $grpc.ResponseFuture<$0.Empty> tap($0.TapRequest request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$tap, request, options: options); - } - - $grpc.ResponseFuture<$0.Empty> doubleTap($0.TapRequest request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$doubleTap, request, options: options); - } - - $grpc.ResponseFuture<$0.Empty> enterText($0.EnterTextRequest request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$enterText, request, options: options); - } - - $grpc.ResponseFuture<$0.Empty> swipe($0.SwipeRequest request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$swipe, request, options: options); - } - - $grpc.ResponseFuture<$0.Empty> waitUntilVisible( - $0.WaitUntilVisibleRequest request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$waitUntilVisible, request, options: options); - } - - $grpc.ResponseFuture<$0.Empty> enableAirplaneMode($0.Empty request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$enableAirplaneMode, request, options: options); - } - - $grpc.ResponseFuture<$0.Empty> disableAirplaneMode($0.Empty request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$disableAirplaneMode, request, options: options); - } - - $grpc.ResponseFuture<$0.Empty> enableWiFi($0.Empty request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$enableWiFi, request, options: options); - } - - $grpc.ResponseFuture<$0.Empty> disableWiFi($0.Empty request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$disableWiFi, request, options: options); - } - - $grpc.ResponseFuture<$0.Empty> enableCellular($0.Empty request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$enableCellular, request, options: options); - } - - $grpc.ResponseFuture<$0.Empty> disableCellular($0.Empty request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$disableCellular, request, options: options); - } - - $grpc.ResponseFuture<$0.Empty> enableBluetooth($0.Empty request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$enableBluetooth, request, options: options); - } - - $grpc.ResponseFuture<$0.Empty> disableBluetooth($0.Empty request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$disableBluetooth, request, options: options); - } - - $grpc.ResponseFuture<$0.Empty> enableDarkMode($0.DarkModeRequest request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$enableDarkMode, request, options: options); - } - - $grpc.ResponseFuture<$0.Empty> disableDarkMode($0.DarkModeRequest request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$disableDarkMode, request, options: options); - } - - $grpc.ResponseFuture<$0.Empty> openNotifications($0.Empty request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$openNotifications, request, options: options); - } - - $grpc.ResponseFuture<$0.Empty> closeNotifications($0.Empty request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$closeNotifications, request, options: options); - } - - $grpc.ResponseFuture<$0.Empty> closeHeadsUpNotification($0.Empty request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$closeHeadsUpNotification, request, - options: options); - } - - $grpc.ResponseFuture<$0.GetNotificationsResponse> getNotifications( - $0.GetNotificationsRequest request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$getNotifications, request, options: options); - } - - $grpc.ResponseFuture<$0.Empty> tapOnNotification( - $0.TapOnNotificationRequest request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$tapOnNotification, request, options: options); - } - - $grpc.ResponseFuture<$0.PermissionDialogVisibleResponse> - isPermissionDialogVisible($0.PermissionDialogVisibleRequest request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$isPermissionDialogVisible, request, - options: options); - } - - $grpc.ResponseFuture<$0.Empty> handlePermissionDialog( - $0.HandlePermissionRequest request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$handlePermissionDialog, request, - options: options); - } - - $grpc.ResponseFuture<$0.Empty> setLocationAccuracy( - $0.SetLocationAccuracyRequest request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$setLocationAccuracy, request, options: options); - } - - $grpc.ResponseFuture<$0.Empty> debug($0.Empty request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$debug, request, options: options); - } - - $grpc.ResponseFuture<$0.Empty> markPatrolAppServiceReady($0.Empty request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$markPatrolAppServiceReady, request, - options: options); - } -} - -abstract class NativeAutomatorServiceBase extends $grpc.Service { - $core.String get $name => 'patrol.NativeAutomator'; - - NativeAutomatorServiceBase() { - $addMethod($grpc.ServiceMethod<$0.Empty, $0.Empty>( - 'initialize', - initialize_Pre, - false, - false, - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value), - ($0.Empty value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.ConfigureRequest, $0.Empty>( - 'configure', - configure_Pre, - false, - false, - ($core.List<$core.int> value) => $0.ConfigureRequest.fromBuffer(value), - ($0.Empty value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.Empty, $0.Empty>( - 'pressHome', - pressHome_Pre, - false, - false, - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value), - ($0.Empty value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.Empty, $0.Empty>( - 'pressBack', - pressBack_Pre, - false, - false, - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value), - ($0.Empty value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.Empty, $0.Empty>( - 'pressRecentApps', - pressRecentApps_Pre, - false, - false, - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value), - ($0.Empty value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.Empty, $0.Empty>( - 'doublePressRecentApps', - doublePressRecentApps_Pre, - false, - false, - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value), - ($0.Empty value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.OpenAppRequest, $0.Empty>( - 'openApp', - openApp_Pre, - false, - false, - ($core.List<$core.int> value) => $0.OpenAppRequest.fromBuffer(value), - ($0.Empty value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.OpenQuickSettingsRequest, $0.Empty>( - 'openQuickSettings', - openQuickSettings_Pre, - false, - false, - ($core.List<$core.int> value) => - $0.OpenQuickSettingsRequest.fromBuffer(value), - ($0.Empty value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.GetNativeViewsRequest, - $0.GetNativeViewsResponse>( - 'getNativeViews', - getNativeViews_Pre, - false, - false, - ($core.List<$core.int> value) => - $0.GetNativeViewsRequest.fromBuffer(value), - ($0.GetNativeViewsResponse value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.TapRequest, $0.Empty>( - 'tap', - tap_Pre, - false, - false, - ($core.List<$core.int> value) => $0.TapRequest.fromBuffer(value), - ($0.Empty value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.TapRequest, $0.Empty>( - 'doubleTap', - doubleTap_Pre, - false, - false, - ($core.List<$core.int> value) => $0.TapRequest.fromBuffer(value), - ($0.Empty value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.EnterTextRequest, $0.Empty>( - 'enterText', - enterText_Pre, - false, - false, - ($core.List<$core.int> value) => $0.EnterTextRequest.fromBuffer(value), - ($0.Empty value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.SwipeRequest, $0.Empty>( - 'swipe', - swipe_Pre, - false, - false, - ($core.List<$core.int> value) => $0.SwipeRequest.fromBuffer(value), - ($0.Empty value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.WaitUntilVisibleRequest, $0.Empty>( - 'waitUntilVisible', - waitUntilVisible_Pre, - false, - false, - ($core.List<$core.int> value) => - $0.WaitUntilVisibleRequest.fromBuffer(value), - ($0.Empty value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.Empty, $0.Empty>( - 'enableAirplaneMode', - enableAirplaneMode_Pre, - false, - false, - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value), - ($0.Empty value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.Empty, $0.Empty>( - 'disableAirplaneMode', - disableAirplaneMode_Pre, - false, - false, - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value), - ($0.Empty value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.Empty, $0.Empty>( - 'enableWiFi', - enableWiFi_Pre, - false, - false, - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value), - ($0.Empty value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.Empty, $0.Empty>( - 'disableWiFi', - disableWiFi_Pre, - false, - false, - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value), - ($0.Empty value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.Empty, $0.Empty>( - 'enableCellular', - enableCellular_Pre, - false, - false, - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value), - ($0.Empty value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.Empty, $0.Empty>( - 'disableCellular', - disableCellular_Pre, - false, - false, - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value), - ($0.Empty value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.Empty, $0.Empty>( - 'enableBluetooth', - enableBluetooth_Pre, - false, - false, - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value), - ($0.Empty value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.Empty, $0.Empty>( - 'disableBluetooth', - disableBluetooth_Pre, - false, - false, - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value), - ($0.Empty value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.DarkModeRequest, $0.Empty>( - 'enableDarkMode', - enableDarkMode_Pre, - false, - false, - ($core.List<$core.int> value) => $0.DarkModeRequest.fromBuffer(value), - ($0.Empty value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.DarkModeRequest, $0.Empty>( - 'disableDarkMode', - disableDarkMode_Pre, - false, - false, - ($core.List<$core.int> value) => $0.DarkModeRequest.fromBuffer(value), - ($0.Empty value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.Empty, $0.Empty>( - 'openNotifications', - openNotifications_Pre, - false, - false, - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value), - ($0.Empty value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.Empty, $0.Empty>( - 'closeNotifications', - closeNotifications_Pre, - false, - false, - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value), - ($0.Empty value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.Empty, $0.Empty>( - 'closeHeadsUpNotification', - closeHeadsUpNotification_Pre, - false, - false, - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value), - ($0.Empty value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.GetNotificationsRequest, - $0.GetNotificationsResponse>( - 'getNotifications', - getNotifications_Pre, - false, - false, - ($core.List<$core.int> value) => - $0.GetNotificationsRequest.fromBuffer(value), - ($0.GetNotificationsResponse value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.TapOnNotificationRequest, $0.Empty>( - 'tapOnNotification', - tapOnNotification_Pre, - false, - false, - ($core.List<$core.int> value) => - $0.TapOnNotificationRequest.fromBuffer(value), - ($0.Empty value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.PermissionDialogVisibleRequest, - $0.PermissionDialogVisibleResponse>( - 'isPermissionDialogVisible', - isPermissionDialogVisible_Pre, - false, - false, - ($core.List<$core.int> value) => - $0.PermissionDialogVisibleRequest.fromBuffer(value), - ($0.PermissionDialogVisibleResponse value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.HandlePermissionRequest, $0.Empty>( - 'handlePermissionDialog', - handlePermissionDialog_Pre, - false, - false, - ($core.List<$core.int> value) => - $0.HandlePermissionRequest.fromBuffer(value), - ($0.Empty value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.SetLocationAccuracyRequest, $0.Empty>( - 'setLocationAccuracy', - setLocationAccuracy_Pre, - false, - false, - ($core.List<$core.int> value) => - $0.SetLocationAccuracyRequest.fromBuffer(value), - ($0.Empty value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.Empty, $0.Empty>( - 'debug', - debug_Pre, - false, - false, - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value), - ($0.Empty value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.Empty, $0.Empty>( - 'markPatrolAppServiceReady', - markPatrolAppServiceReady_Pre, - false, - false, - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value), - ($0.Empty value) => value.writeToBuffer())); - } - - $async.Future<$0.Empty> initialize_Pre( - $grpc.ServiceCall call, $async.Future<$0.Empty> request) async { - return initialize(call, await request); - } - - $async.Future<$0.Empty> configure_Pre($grpc.ServiceCall call, - $async.Future<$0.ConfigureRequest> request) async { - return configure(call, await request); - } - - $async.Future<$0.Empty> pressHome_Pre( - $grpc.ServiceCall call, $async.Future<$0.Empty> request) async { - return pressHome(call, await request); - } - - $async.Future<$0.Empty> pressBack_Pre( - $grpc.ServiceCall call, $async.Future<$0.Empty> request) async { - return pressBack(call, await request); - } - - $async.Future<$0.Empty> pressRecentApps_Pre( - $grpc.ServiceCall call, $async.Future<$0.Empty> request) async { - return pressRecentApps(call, await request); - } - - $async.Future<$0.Empty> doublePressRecentApps_Pre( - $grpc.ServiceCall call, $async.Future<$0.Empty> request) async { - return doublePressRecentApps(call, await request); - } - - $async.Future<$0.Empty> openApp_Pre( - $grpc.ServiceCall call, $async.Future<$0.OpenAppRequest> request) async { - return openApp(call, await request); - } - - $async.Future<$0.Empty> openQuickSettings_Pre($grpc.ServiceCall call, - $async.Future<$0.OpenQuickSettingsRequest> request) async { - return openQuickSettings(call, await request); - } - - $async.Future<$0.GetNativeViewsResponse> getNativeViews_Pre( - $grpc.ServiceCall call, - $async.Future<$0.GetNativeViewsRequest> request) async { - return getNativeViews(call, await request); - } - - $async.Future<$0.Empty> tap_Pre( - $grpc.ServiceCall call, $async.Future<$0.TapRequest> request) async { - return tap(call, await request); - } - - $async.Future<$0.Empty> doubleTap_Pre( - $grpc.ServiceCall call, $async.Future<$0.TapRequest> request) async { - return doubleTap(call, await request); - } - - $async.Future<$0.Empty> enterText_Pre($grpc.ServiceCall call, - $async.Future<$0.EnterTextRequest> request) async { - return enterText(call, await request); - } - - $async.Future<$0.Empty> swipe_Pre( - $grpc.ServiceCall call, $async.Future<$0.SwipeRequest> request) async { - return swipe(call, await request); - } - - $async.Future<$0.Empty> waitUntilVisible_Pre($grpc.ServiceCall call, - $async.Future<$0.WaitUntilVisibleRequest> request) async { - return waitUntilVisible(call, await request); - } - - $async.Future<$0.Empty> enableAirplaneMode_Pre( - $grpc.ServiceCall call, $async.Future<$0.Empty> request) async { - return enableAirplaneMode(call, await request); - } - - $async.Future<$0.Empty> disableAirplaneMode_Pre( - $grpc.ServiceCall call, $async.Future<$0.Empty> request) async { - return disableAirplaneMode(call, await request); - } - - $async.Future<$0.Empty> enableWiFi_Pre( - $grpc.ServiceCall call, $async.Future<$0.Empty> request) async { - return enableWiFi(call, await request); - } - - $async.Future<$0.Empty> disableWiFi_Pre( - $grpc.ServiceCall call, $async.Future<$0.Empty> request) async { - return disableWiFi(call, await request); - } - - $async.Future<$0.Empty> enableCellular_Pre( - $grpc.ServiceCall call, $async.Future<$0.Empty> request) async { - return enableCellular(call, await request); - } - - $async.Future<$0.Empty> disableCellular_Pre( - $grpc.ServiceCall call, $async.Future<$0.Empty> request) async { - return disableCellular(call, await request); - } - - $async.Future<$0.Empty> enableBluetooth_Pre( - $grpc.ServiceCall call, $async.Future<$0.Empty> request) async { - return enableBluetooth(call, await request); - } - - $async.Future<$0.Empty> disableBluetooth_Pre( - $grpc.ServiceCall call, $async.Future<$0.Empty> request) async { - return disableBluetooth(call, await request); - } - - $async.Future<$0.Empty> enableDarkMode_Pre( - $grpc.ServiceCall call, $async.Future<$0.DarkModeRequest> request) async { - return enableDarkMode(call, await request); - } - - $async.Future<$0.Empty> disableDarkMode_Pre( - $grpc.ServiceCall call, $async.Future<$0.DarkModeRequest> request) async { - return disableDarkMode(call, await request); - } - - $async.Future<$0.Empty> openNotifications_Pre( - $grpc.ServiceCall call, $async.Future<$0.Empty> request) async { - return openNotifications(call, await request); - } - - $async.Future<$0.Empty> closeNotifications_Pre( - $grpc.ServiceCall call, $async.Future<$0.Empty> request) async { - return closeNotifications(call, await request); - } - - $async.Future<$0.Empty> closeHeadsUpNotification_Pre( - $grpc.ServiceCall call, $async.Future<$0.Empty> request) async { - return closeHeadsUpNotification(call, await request); - } - - $async.Future<$0.GetNotificationsResponse> getNotifications_Pre( - $grpc.ServiceCall call, - $async.Future<$0.GetNotificationsRequest> request) async { - return getNotifications(call, await request); - } - - $async.Future<$0.Empty> tapOnNotification_Pre($grpc.ServiceCall call, - $async.Future<$0.TapOnNotificationRequest> request) async { - return tapOnNotification(call, await request); - } - - $async.Future<$0.PermissionDialogVisibleResponse> - isPermissionDialogVisible_Pre($grpc.ServiceCall call, - $async.Future<$0.PermissionDialogVisibleRequest> request) async { - return isPermissionDialogVisible(call, await request); - } - - $async.Future<$0.Empty> handlePermissionDialog_Pre($grpc.ServiceCall call, - $async.Future<$0.HandlePermissionRequest> request) async { - return handlePermissionDialog(call, await request); - } - - $async.Future<$0.Empty> setLocationAccuracy_Pre($grpc.ServiceCall call, - $async.Future<$0.SetLocationAccuracyRequest> request) async { - return setLocationAccuracy(call, await request); - } - - $async.Future<$0.Empty> debug_Pre( - $grpc.ServiceCall call, $async.Future<$0.Empty> request) async { - return debug(call, await request); - } - - $async.Future<$0.Empty> markPatrolAppServiceReady_Pre( - $grpc.ServiceCall call, $async.Future<$0.Empty> request) async { - return markPatrolAppServiceReady(call, await request); - } - - $async.Future<$0.Empty> initialize($grpc.ServiceCall call, $0.Empty request); - $async.Future<$0.Empty> configure( - $grpc.ServiceCall call, $0.ConfigureRequest request); - $async.Future<$0.Empty> pressHome($grpc.ServiceCall call, $0.Empty request); - $async.Future<$0.Empty> pressBack($grpc.ServiceCall call, $0.Empty request); - $async.Future<$0.Empty> pressRecentApps( - $grpc.ServiceCall call, $0.Empty request); - $async.Future<$0.Empty> doublePressRecentApps( - $grpc.ServiceCall call, $0.Empty request); - $async.Future<$0.Empty> openApp( - $grpc.ServiceCall call, $0.OpenAppRequest request); - $async.Future<$0.Empty> openQuickSettings( - $grpc.ServiceCall call, $0.OpenQuickSettingsRequest request); - $async.Future<$0.GetNativeViewsResponse> getNativeViews( - $grpc.ServiceCall call, $0.GetNativeViewsRequest request); - $async.Future<$0.Empty> tap($grpc.ServiceCall call, $0.TapRequest request); - $async.Future<$0.Empty> doubleTap( - $grpc.ServiceCall call, $0.TapRequest request); - $async.Future<$0.Empty> enterText( - $grpc.ServiceCall call, $0.EnterTextRequest request); - $async.Future<$0.Empty> swipe( - $grpc.ServiceCall call, $0.SwipeRequest request); - $async.Future<$0.Empty> waitUntilVisible( - $grpc.ServiceCall call, $0.WaitUntilVisibleRequest request); - $async.Future<$0.Empty> enableAirplaneMode( - $grpc.ServiceCall call, $0.Empty request); - $async.Future<$0.Empty> disableAirplaneMode( - $grpc.ServiceCall call, $0.Empty request); - $async.Future<$0.Empty> enableWiFi($grpc.ServiceCall call, $0.Empty request); - $async.Future<$0.Empty> disableWiFi($grpc.ServiceCall call, $0.Empty request); - $async.Future<$0.Empty> enableCellular( - $grpc.ServiceCall call, $0.Empty request); - $async.Future<$0.Empty> disableCellular( - $grpc.ServiceCall call, $0.Empty request); - $async.Future<$0.Empty> enableBluetooth( - $grpc.ServiceCall call, $0.Empty request); - $async.Future<$0.Empty> disableBluetooth( - $grpc.ServiceCall call, $0.Empty request); - $async.Future<$0.Empty> enableDarkMode( - $grpc.ServiceCall call, $0.DarkModeRequest request); - $async.Future<$0.Empty> disableDarkMode( - $grpc.ServiceCall call, $0.DarkModeRequest request); - $async.Future<$0.Empty> openNotifications( - $grpc.ServiceCall call, $0.Empty request); - $async.Future<$0.Empty> closeNotifications( - $grpc.ServiceCall call, $0.Empty request); - $async.Future<$0.Empty> closeHeadsUpNotification( - $grpc.ServiceCall call, $0.Empty request); - $async.Future<$0.GetNotificationsResponse> getNotifications( - $grpc.ServiceCall call, $0.GetNotificationsRequest request); - $async.Future<$0.Empty> tapOnNotification( - $grpc.ServiceCall call, $0.TapOnNotificationRequest request); - $async.Future<$0.PermissionDialogVisibleResponse> isPermissionDialogVisible( - $grpc.ServiceCall call, $0.PermissionDialogVisibleRequest request); - $async.Future<$0.Empty> handlePermissionDialog( - $grpc.ServiceCall call, $0.HandlePermissionRequest request); - $async.Future<$0.Empty> setLocationAccuracy( - $grpc.ServiceCall call, $0.SetLocationAccuracyRequest request); - $async.Future<$0.Empty> debug($grpc.ServiceCall call, $0.Empty request); - $async.Future<$0.Empty> markPatrolAppServiceReady( - $grpc.ServiceCall call, $0.Empty request); -} diff --git a/packages/patrol/lib/src/native/contracts/contracts.pbjson.dart b/packages/patrol/lib/src/native/contracts/contracts.pbjson.dart deleted file mode 100644 index c5f902f05..000000000 --- a/packages/patrol/lib/src/native/contracts/contracts.pbjson.dart +++ /dev/null @@ -1,544 +0,0 @@ -/// -// Generated code. Do not modify. -// source: contracts.proto -// -// @dart = 2.12 -// ignore_for_file: annotate_overrides,camel_case_types,constant_identifier_names,deprecated_member_use_from_same_package,directives_ordering,library_prefixes,non_constant_identifier_names,prefer_final_fields,return_of_invalid_type,unnecessary_const,unnecessary_import,unnecessary_this,unused_import,unused_shown_name - -import 'dart:core' as $core; -import 'dart:convert' as $convert; -import 'dart:typed_data' as $typed_data; - -@$core.Deprecated('Use configureRequestDescriptor instead') -const ConfigureRequest$json = const { - '1': 'ConfigureRequest', - '2': const [ - const { - '1': 'findTimeoutMillis', - '3': 1, - '4': 1, - '5': 4, - '10': 'findTimeoutMillis' - }, - ], -}; - -/// Descriptor for `ConfigureRequest`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List configureRequestDescriptor = $convert.base64Decode( - 'ChBDb25maWd1cmVSZXF1ZXN0EiwKEWZpbmRUaW1lb3V0TWlsbGlzGAEgASgEUhFmaW5kVGltZW91dE1pbGxpcw=='); -@$core.Deprecated('Use openAppRequestDescriptor instead') -const OpenAppRequest$json = const { - '1': 'OpenAppRequest', - '2': const [ - const {'1': 'appId', '3': 1, '4': 1, '5': 9, '10': 'appId'}, - ], -}; - -/// Descriptor for `OpenAppRequest`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List openAppRequestDescriptor = $convert - .base64Decode('Cg5PcGVuQXBwUmVxdWVzdBIUCgVhcHBJZBgBIAEoCVIFYXBwSWQ='); -@$core.Deprecated('Use tapOnNotificationRequestDescriptor instead') -const TapOnNotificationRequest$json = const { - '1': 'TapOnNotificationRequest', - '2': const [ - const {'1': 'index', '3': 1, '4': 1, '5': 13, '9': 0, '10': 'index'}, - const { - '1': 'selector', - '3': 2, - '4': 1, - '5': 11, - '6': '.patrol.Selector', - '9': 0, - '10': 'selector' - }, - ], - '8': const [ - const {'1': 'findBy'}, - ], -}; - -/// Descriptor for `TapOnNotificationRequest`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List tapOnNotificationRequestDescriptor = - $convert.base64Decode( - 'ChhUYXBPbk5vdGlmaWNhdGlvblJlcXVlc3QSFgoFaW5kZXgYASABKA1IAFIFaW5kZXgSLgoIc2VsZWN0b3IYAiABKAsyEC5wYXRyb2wuU2VsZWN0b3JIAFIIc2VsZWN0b3JCCAoGZmluZEJ5'); -@$core.Deprecated('Use emptyDescriptor instead') -const Empty$json = const { - '1': 'Empty', -}; - -/// Descriptor for `Empty`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List emptyDescriptor = - $convert.base64Decode('CgVFbXB0eQ=='); -@$core.Deprecated('Use openQuickSettingsRequestDescriptor instead') -const OpenQuickSettingsRequest$json = const { - '1': 'OpenQuickSettingsRequest', -}; - -/// Descriptor for `OpenQuickSettingsRequest`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List openQuickSettingsRequestDescriptor = - $convert.base64Decode('ChhPcGVuUXVpY2tTZXR0aW5nc1JlcXVlc3Q='); -@$core.Deprecated('Use darkModeRequestDescriptor instead') -const DarkModeRequest$json = const { - '1': 'DarkModeRequest', - '2': const [ - const {'1': 'appId', '3': 1, '4': 1, '5': 9, '10': 'appId'}, - ], -}; - -/// Descriptor for `DarkModeRequest`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List darkModeRequestDescriptor = $convert - .base64Decode('Cg9EYXJrTW9kZVJlcXVlc3QSFAoFYXBwSWQYASABKAlSBWFwcElk'); -@$core.Deprecated('Use getNativeViewsRequestDescriptor instead') -const GetNativeViewsRequest$json = const { - '1': 'GetNativeViewsRequest', - '2': const [ - const { - '1': 'selector', - '3': 1, - '4': 1, - '5': 11, - '6': '.patrol.Selector', - '10': 'selector' - }, - const {'1': 'appId', '3': 2, '4': 1, '5': 9, '10': 'appId'}, - ], -}; - -/// Descriptor for `GetNativeViewsRequest`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List getNativeViewsRequestDescriptor = $convert.base64Decode( - 'ChVHZXROYXRpdmVWaWV3c1JlcXVlc3QSLAoIc2VsZWN0b3IYASABKAsyEC5wYXRyb2wuU2VsZWN0b3JSCHNlbGVjdG9yEhQKBWFwcElkGAIgASgJUgVhcHBJZA=='); -@$core.Deprecated('Use getNativeViewsResponseDescriptor instead') -const GetNativeViewsResponse$json = const { - '1': 'GetNativeViewsResponse', - '2': const [ - const { - '1': 'nativeViews', - '3': 2, - '4': 3, - '5': 11, - '6': '.patrol.NativeView', - '10': 'nativeViews' - }, - ], -}; - -/// Descriptor for `GetNativeViewsResponse`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List getNativeViewsResponseDescriptor = - $convert.base64Decode( - 'ChZHZXROYXRpdmVWaWV3c1Jlc3BvbnNlEjQKC25hdGl2ZVZpZXdzGAIgAygLMhIucGF0cm9sLk5hdGl2ZVZpZXdSC25hdGl2ZVZpZXdz'); -@$core.Deprecated('Use getNotificationsRequestDescriptor instead') -const GetNotificationsRequest$json = const { - '1': 'GetNotificationsRequest', -}; - -/// Descriptor for `GetNotificationsRequest`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List getNotificationsRequestDescriptor = - $convert.base64Decode('ChdHZXROb3RpZmljYXRpb25zUmVxdWVzdA=='); -@$core.Deprecated('Use getNotificationsResponseDescriptor instead') -const GetNotificationsResponse$json = const { - '1': 'GetNotificationsResponse', - '2': const [ - const { - '1': 'notifications', - '3': 2, - '4': 3, - '5': 11, - '6': '.patrol.Notification', - '10': 'notifications' - }, - ], -}; - -/// Descriptor for `GetNotificationsResponse`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List getNotificationsResponseDescriptor = - $convert.base64Decode( - 'ChhHZXROb3RpZmljYXRpb25zUmVzcG9uc2USOgoNbm90aWZpY2F0aW9ucxgCIAMoCzIULnBhdHJvbC5Ob3RpZmljYXRpb25SDW5vdGlmaWNhdGlvbnM='); -@$core.Deprecated('Use tapRequestDescriptor instead') -const TapRequest$json = const { - '1': 'TapRequest', - '2': const [ - const { - '1': 'selector', - '3': 1, - '4': 1, - '5': 11, - '6': '.patrol.Selector', - '10': 'selector' - }, - const {'1': 'appId', '3': 2, '4': 1, '5': 9, '10': 'appId'}, - ], -}; - -/// Descriptor for `TapRequest`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List tapRequestDescriptor = $convert.base64Decode( - 'CgpUYXBSZXF1ZXN0EiwKCHNlbGVjdG9yGAEgASgLMhAucGF0cm9sLlNlbGVjdG9yUghzZWxlY3RvchIUCgVhcHBJZBgCIAEoCVIFYXBwSWQ='); -@$core.Deprecated('Use enterTextRequestDescriptor instead') -const EnterTextRequest$json = const { - '1': 'EnterTextRequest', - '2': const [ - const {'1': 'data', '3': 1, '4': 1, '5': 9, '10': 'data'}, - const {'1': 'appId', '3': 2, '4': 1, '5': 9, '10': 'appId'}, - const {'1': 'index', '3': 3, '4': 1, '5': 13, '9': 0, '10': 'index'}, - const { - '1': 'selector', - '3': 4, - '4': 1, - '5': 11, - '6': '.patrol.Selector', - '9': 0, - '10': 'selector' - }, - const {'1': 'showKeyboard', '3': 5, '4': 1, '5': 8, '10': 'showKeyboard'}, - ], - '8': const [ - const {'1': 'findBy'}, - ], -}; - -/// Descriptor for `EnterTextRequest`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List enterTextRequestDescriptor = $convert.base64Decode( - 'ChBFbnRlclRleHRSZXF1ZXN0EhIKBGRhdGEYASABKAlSBGRhdGESFAoFYXBwSWQYAiABKAlSBWFwcElkEhYKBWluZGV4GAMgASgNSABSBWluZGV4Ei4KCHNlbGVjdG9yGAQgASgLMhAucGF0cm9sLlNlbGVjdG9ySABSCHNlbGVjdG9yEiIKDHNob3dLZXlib2FyZBgFIAEoCFIMc2hvd0tleWJvYXJkQggKBmZpbmRCeQ=='); -@$core.Deprecated('Use swipeRequestDescriptor instead') -const SwipeRequest$json = const { - '1': 'SwipeRequest', - '2': const [ - const {'1': 'startX', '3': 1, '4': 1, '5': 2, '10': 'startX'}, - const {'1': 'startY', '3': 2, '4': 1, '5': 2, '10': 'startY'}, - const {'1': 'endX', '3': 3, '4': 1, '5': 2, '10': 'endX'}, - const {'1': 'endY', '3': 4, '4': 1, '5': 2, '10': 'endY'}, - const {'1': 'steps', '3': 5, '4': 1, '5': 13, '10': 'steps'}, - const {'1': 'appId', '3': 6, '4': 1, '5': 9, '10': 'appId'}, - ], -}; - -/// Descriptor for `SwipeRequest`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List swipeRequestDescriptor = $convert.base64Decode( - 'CgxTd2lwZVJlcXVlc3QSFgoGc3RhcnRYGAEgASgCUgZzdGFydFgSFgoGc3RhcnRZGAIgASgCUgZzdGFydFkSEgoEZW5kWBgDIAEoAlIEZW5kWBISCgRlbmRZGAQgASgCUgRlbmRZEhQKBXN0ZXBzGAUgASgNUgVzdGVwcxIUCgVhcHBJZBgGIAEoCVIFYXBwSWQ='); -@$core.Deprecated('Use waitUntilVisibleRequestDescriptor instead') -const WaitUntilVisibleRequest$json = const { - '1': 'WaitUntilVisibleRequest', - '2': const [ - const { - '1': 'selector', - '3': 1, - '4': 1, - '5': 11, - '6': '.patrol.Selector', - '10': 'selector' - }, - const {'1': 'appId', '3': 2, '4': 1, '5': 9, '10': 'appId'}, - ], -}; - -/// Descriptor for `WaitUntilVisibleRequest`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List waitUntilVisibleRequestDescriptor = - $convert.base64Decode( - 'ChdXYWl0VW50aWxWaXNpYmxlUmVxdWVzdBIsCghzZWxlY3RvchgBIAEoCzIQLnBhdHJvbC5TZWxlY3RvclIIc2VsZWN0b3ISFAoFYXBwSWQYAiABKAlSBWFwcElk'); -@$core.Deprecated('Use handlePermissionRequestDescriptor instead') -const HandlePermissionRequest$json = const { - '1': 'HandlePermissionRequest', - '2': const [ - const { - '1': 'code', - '3': 1, - '4': 1, - '5': 14, - '6': '.patrol.HandlePermissionRequest.Code', - '10': 'code' - }, - ], - '4': const [HandlePermissionRequest_Code$json], -}; - -@$core.Deprecated('Use handlePermissionRequestDescriptor instead') -const HandlePermissionRequest_Code$json = const { - '1': 'Code', - '2': const [ - const {'1': 'WHILE_USING', '2': 0}, - const {'1': 'ONLY_THIS_TIME', '2': 1}, - const {'1': 'DENIED', '2': 2}, - ], -}; - -/// Descriptor for `HandlePermissionRequest`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List handlePermissionRequestDescriptor = - $convert.base64Decode( - 'ChdIYW5kbGVQZXJtaXNzaW9uUmVxdWVzdBI4CgRjb2RlGAEgASgOMiQucGF0cm9sLkhhbmRsZVBlcm1pc3Npb25SZXF1ZXN0LkNvZGVSBGNvZGUiNwoEQ29kZRIPCgtXSElMRV9VU0lORxAAEhIKDk9OTFlfVEhJU19USU1FEAESCgoGREVOSUVEEAI='); -@$core.Deprecated('Use setLocationAccuracyRequestDescriptor instead') -const SetLocationAccuracyRequest$json = const { - '1': 'SetLocationAccuracyRequest', - '2': const [ - const { - '1': 'locationAccuracy', - '3': 1, - '4': 1, - '5': 14, - '6': '.patrol.SetLocationAccuracyRequest.LocationAccuracy', - '10': 'locationAccuracy' - }, - ], - '4': const [SetLocationAccuracyRequest_LocationAccuracy$json], -}; - -@$core.Deprecated('Use setLocationAccuracyRequestDescriptor instead') -const SetLocationAccuracyRequest_LocationAccuracy$json = const { - '1': 'LocationAccuracy', - '2': const [ - const {'1': 'COARSE', '2': 0}, - const {'1': 'FINE', '2': 1}, - ], -}; - -/// Descriptor for `SetLocationAccuracyRequest`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List setLocationAccuracyRequestDescriptor = - $convert.base64Decode( - 'ChpTZXRMb2NhdGlvbkFjY3VyYWN5UmVxdWVzdBJfChBsb2NhdGlvbkFjY3VyYWN5GAEgASgOMjMucGF0cm9sLlNldExvY2F0aW9uQWNjdXJhY3lSZXF1ZXN0LkxvY2F0aW9uQWNjdXJhY3lSEGxvY2F0aW9uQWNjdXJhY3kiKAoQTG9jYXRpb25BY2N1cmFjeRIKCgZDT0FSU0UQABIICgRGSU5FEAE='); -@$core.Deprecated('Use permissionDialogVisibleRequestDescriptor instead') -const PermissionDialogVisibleRequest$json = const { - '1': 'PermissionDialogVisibleRequest', - '2': const [ - const {'1': 'timeoutMillis', '3': 1, '4': 1, '5': 4, '10': 'timeoutMillis'}, - ], -}; - -/// Descriptor for `PermissionDialogVisibleRequest`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List permissionDialogVisibleRequestDescriptor = - $convert.base64Decode( - 'Ch5QZXJtaXNzaW9uRGlhbG9nVmlzaWJsZVJlcXVlc3QSJAoNdGltZW91dE1pbGxpcxgBIAEoBFINdGltZW91dE1pbGxpcw=='); -@$core.Deprecated('Use permissionDialogVisibleResponseDescriptor instead') -const PermissionDialogVisibleResponse$json = const { - '1': 'PermissionDialogVisibleResponse', - '2': const [ - const {'1': 'visible', '3': 1, '4': 1, '5': 8, '10': 'visible'}, - ], -}; - -/// Descriptor for `PermissionDialogVisibleResponse`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List permissionDialogVisibleResponseDescriptor = - $convert.base64Decode( - 'Ch9QZXJtaXNzaW9uRGlhbG9nVmlzaWJsZVJlc3BvbnNlEhgKB3Zpc2libGUYASABKAhSB3Zpc2libGU='); -@$core.Deprecated('Use selectorDescriptor instead') -const Selector$json = const { - '1': 'Selector', - '2': const [ - const { - '1': 'text', - '3': 1, - '4': 1, - '5': 9, - '9': 0, - '10': 'text', - '17': true - }, - const { - '1': 'textStartsWith', - '3': 2, - '4': 1, - '5': 9, - '9': 1, - '10': 'textStartsWith', - '17': true - }, - const { - '1': 'textContains', - '3': 3, - '4': 1, - '5': 9, - '9': 2, - '10': 'textContains', - '17': true - }, - const { - '1': 'className', - '3': 4, - '4': 1, - '5': 9, - '9': 3, - '10': 'className', - '17': true - }, - const { - '1': 'contentDescription', - '3': 5, - '4': 1, - '5': 9, - '9': 4, - '10': 'contentDescription', - '17': true - }, - const { - '1': 'contentDescriptionStartsWith', - '3': 6, - '4': 1, - '5': 9, - '9': 5, - '10': 'contentDescriptionStartsWith', - '17': true - }, - const { - '1': 'contentDescriptionContains', - '3': 7, - '4': 1, - '5': 9, - '9': 6, - '10': 'contentDescriptionContains', - '17': true - }, - const { - '1': 'resourceId', - '3': 8, - '4': 1, - '5': 9, - '9': 7, - '10': 'resourceId', - '17': true - }, - const { - '1': 'instance', - '3': 9, - '4': 1, - '5': 13, - '9': 8, - '10': 'instance', - '17': true - }, - const { - '1': 'enabled', - '3': 10, - '4': 1, - '5': 8, - '9': 9, - '10': 'enabled', - '17': true - }, - const { - '1': 'focused', - '3': 11, - '4': 1, - '5': 8, - '9': 10, - '10': 'focused', - '17': true - }, - const { - '1': 'pkg', - '3': 12, - '4': 1, - '5': 9, - '9': 11, - '10': 'pkg', - '17': true - }, - ], - '8': const [ - const {'1': '_text'}, - const {'1': '_textStartsWith'}, - const {'1': '_textContains'}, - const {'1': '_className'}, - const {'1': '_contentDescription'}, - const {'1': '_contentDescriptionStartsWith'}, - const {'1': '_contentDescriptionContains'}, - const {'1': '_resourceId'}, - const {'1': '_instance'}, - const {'1': '_enabled'}, - const {'1': '_focused'}, - const {'1': '_pkg'}, - ], -}; - -/// Descriptor for `Selector`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List selectorDescriptor = $convert.base64Decode( - 'CghTZWxlY3RvchIXCgR0ZXh0GAEgASgJSABSBHRleHSIAQESKwoOdGV4dFN0YXJ0c1dpdGgYAiABKAlIAVIOdGV4dFN0YXJ0c1dpdGiIAQESJwoMdGV4dENvbnRhaW5zGAMgASgJSAJSDHRleHRDb250YWluc4gBARIhCgljbGFzc05hbWUYBCABKAlIA1IJY2xhc3NOYW1liAEBEjMKEmNvbnRlbnREZXNjcmlwdGlvbhgFIAEoCUgEUhJjb250ZW50RGVzY3JpcHRpb26IAQESRwocY29udGVudERlc2NyaXB0aW9uU3RhcnRzV2l0aBgGIAEoCUgFUhxjb250ZW50RGVzY3JpcHRpb25TdGFydHNXaXRoiAEBEkMKGmNvbnRlbnREZXNjcmlwdGlvbkNvbnRhaW5zGAcgASgJSAZSGmNvbnRlbnREZXNjcmlwdGlvbkNvbnRhaW5ziAEBEiMKCnJlc291cmNlSWQYCCABKAlIB1IKcmVzb3VyY2VJZIgBARIfCghpbnN0YW5jZRgJIAEoDUgIUghpbnN0YW5jZYgBARIdCgdlbmFibGVkGAogASgISAlSB2VuYWJsZWSIAQESHQoHZm9jdXNlZBgLIAEoCEgKUgdmb2N1c2VkiAEBEhUKA3BrZxgMIAEoCUgLUgNwa2eIAQFCBwoFX3RleHRCEQoPX3RleHRTdGFydHNXaXRoQg8KDV90ZXh0Q29udGFpbnNCDAoKX2NsYXNzTmFtZUIVChNfY29udGVudERlc2NyaXB0aW9uQh8KHV9jb250ZW50RGVzY3JpcHRpb25TdGFydHNXaXRoQh0KG19jb250ZW50RGVzY3JpcHRpb25Db250YWluc0INCgtfcmVzb3VyY2VJZEILCglfaW5zdGFuY2VCCgoIX2VuYWJsZWRCCgoIX2ZvY3VzZWRCBgoEX3BrZw=='); -@$core.Deprecated('Use nativeViewDescriptor instead') -const NativeView$json = const { - '1': 'NativeView', - '2': const [ - const {'1': 'className', '3': 1, '4': 1, '5': 9, '10': 'className'}, - const {'1': 'text', '3': 2, '4': 1, '5': 9, '10': 'text'}, - const { - '1': 'contentDescription', - '3': 3, - '4': 1, - '5': 9, - '10': 'contentDescription' - }, - const {'1': 'focused', '3': 4, '4': 1, '5': 8, '10': 'focused'}, - const {'1': 'enabled', '3': 5, '4': 1, '5': 8, '10': 'enabled'}, - const {'1': 'childCount', '3': 6, '4': 1, '5': 5, '10': 'childCount'}, - const {'1': 'resourceName', '3': 7, '4': 1, '5': 9, '10': 'resourceName'}, - const { - '1': 'applicationPackage', - '3': 8, - '4': 1, - '5': 9, - '10': 'applicationPackage' - }, - const { - '1': 'children', - '3': 9, - '4': 3, - '5': 11, - '6': '.patrol.NativeView', - '10': 'children' - }, - ], -}; - -/// Descriptor for `NativeView`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List nativeViewDescriptor = $convert.base64Decode( - 'CgpOYXRpdmVWaWV3EhwKCWNsYXNzTmFtZRgBIAEoCVIJY2xhc3NOYW1lEhIKBHRleHQYAiABKAlSBHRleHQSLgoSY29udGVudERlc2NyaXB0aW9uGAMgASgJUhJjb250ZW50RGVzY3JpcHRpb24SGAoHZm9jdXNlZBgEIAEoCFIHZm9jdXNlZBIYCgdlbmFibGVkGAUgASgIUgdlbmFibGVkEh4KCmNoaWxkQ291bnQYBiABKAVSCmNoaWxkQ291bnQSIgoMcmVzb3VyY2VOYW1lGAcgASgJUgxyZXNvdXJjZU5hbWUSLgoSYXBwbGljYXRpb25QYWNrYWdlGAggASgJUhJhcHBsaWNhdGlvblBhY2thZ2USLgoIY2hpbGRyZW4YCSADKAsyEi5wYXRyb2wuTmF0aXZlVmlld1IIY2hpbGRyZW4='); -@$core.Deprecated('Use notificationDescriptor instead') -const Notification$json = const { - '1': 'Notification', - '2': const [ - const { - '1': 'appName', - '3': 1, - '4': 1, - '5': 9, - '9': 0, - '10': 'appName', - '17': true - }, - const {'1': 'title', '3': 2, '4': 1, '5': 9, '10': 'title'}, - const {'1': 'content', '3': 3, '4': 1, '5': 9, '10': 'content'}, - const {'1': 'raw', '3': 4, '4': 1, '5': 9, '10': 'raw'}, - ], - '8': const [ - const {'1': '_appName'}, - ], -}; - -/// Descriptor for `Notification`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List notificationDescriptor = $convert.base64Decode( - 'CgxOb3RpZmljYXRpb24SHQoHYXBwTmFtZRgBIAEoCUgAUgdhcHBOYW1liAEBEhQKBXRpdGxlGAIgASgJUgV0aXRsZRIYCgdjb250ZW50GAMgASgJUgdjb250ZW50EhAKA3JhdxgEIAEoCVIDcmF3QgoKCF9hcHBOYW1l'); -@$core.Deprecated('Use submitTestResultsRequestDescriptor instead') -const SubmitTestResultsRequest$json = const { - '1': 'SubmitTestResultsRequest', - '2': const [ - const { - '1': 'results', - '3': 1, - '4': 3, - '5': 11, - '6': '.patrol.SubmitTestResultsRequest.ResultsEntry', - '10': 'results' - }, - ], - '3': const [SubmitTestResultsRequest_ResultsEntry$json], -}; - -@$core.Deprecated('Use submitTestResultsRequestDescriptor instead') -const SubmitTestResultsRequest_ResultsEntry$json = const { - '1': 'ResultsEntry', - '2': const [ - const {'1': 'key', '3': 1, '4': 1, '5': 9, '10': 'key'}, - const {'1': 'value', '3': 2, '4': 1, '5': 9, '10': 'value'}, - ], - '7': const {'7': true}, -}; - -/// Descriptor for `SubmitTestResultsRequest`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List submitTestResultsRequestDescriptor = - $convert.base64Decode( - 'ChhTdWJtaXRUZXN0UmVzdWx0c1JlcXVlc3QSRwoHcmVzdWx0cxgBIAMoCzItLnBhdHJvbC5TdWJtaXRUZXN0UmVzdWx0c1JlcXVlc3QuUmVzdWx0c0VudHJ5UgdyZXN1bHRzGjoKDFJlc3VsdHNFbnRyeRIQCgNrZXkYASABKAlSA2tleRIUCgV2YWx1ZRgCIAEoCVIFdmFsdWU6AjgB'); diff --git a/packages/patrol/lib/src/native/native.dart b/packages/patrol/lib/src/native/native.dart index d88a1ed4f..39c38b38d 100644 --- a/packages/patrol/lib/src/native/native.dart +++ b/packages/patrol/lib/src/native/native.dart @@ -1,4 +1,3 @@ -export 'contracts/contracts.pbgrpc.dart' - show NativeView, Notification, Selector; +export 'contracts/contracts.dart' show NativeView, Notification, Selector; export 'native_automator.dart'; export 'patrol_app_service.dart'; diff --git a/packages/patrol/lib/src/native/native_automator.dart b/packages/patrol/lib/src/native/native_automator.dart index a6d533e5d..9c331b4dc 100644 --- a/packages/patrol/lib/src/native/native_automator.dart +++ b/packages/patrol/lib/src/native/native_automator.dart @@ -1,12 +1,12 @@ import 'dart:io' as io; -import 'package:fixnum/fixnum.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:grpc/grpc.dart'; +import 'package:http/http.dart' as http; import 'package:integration_test/integration_test.dart'; import 'package:meta/meta.dart'; import 'package:patrol/src/binding.dart'; -import 'package:patrol/src/native/contracts/contracts.pbgrpc.dart'; +import 'package:patrol/src/native/contracts/contracts.dart'; +import 'package:patrol/src/native/contracts/native_automator_client.dart'; /// Thrown when a native action fails. class PatrolActionException implements Exception { @@ -194,17 +194,10 @@ class NativeAutomator { // _config.logger('Android package name: ${_config.packageName}'); // _config.logger('iOS bundle identifier: ${_config.bundleId}'); - final channel = ClientChannel( - _config.host, - port: int.parse(_config.port), - options: const ChannelOptions( - credentials: ChannelCredentials.insecure(), - ), - ); - _client = NativeAutomatorClient( - channel, - options: CallOptions(timeout: _config.connectionTimeout), + http.Client(), + Uri.http('${_config.host}:${_config.port}'), + timeout: _config.connectionTimeout, ); } @@ -229,10 +222,10 @@ class NativeAutomator { final result = await request(); _config.logger('$name() succeeded'); return result; - } on GrpcError catch (err) { + } on NativeAutomatorClientException catch (err) { _config.logger('$name() failed'); - final log = 'GrpcError: ' - '$name() failed with code ${err.codeName} (${err.message})'; + final log = 'NativeAutomatorClientException: ' + '$name() failed with $err'; throw PatrolActionException(log); } catch (err) { _config.logger('$name() failed'); @@ -250,10 +243,7 @@ class NativeAutomator { /// See also: /// * https://github.com/flutter/flutter/issues/129231 Future initialize() async { - await _wrapRequest( - 'initialize', - () => _client.initialize(Empty()), - ); + await _wrapRequest('initialize', _client.initialize); } /// Configures the native automator. @@ -269,7 +259,7 @@ class NativeAutomator { 'configure', () => _client.configure( ConfigureRequest( - findTimeoutMillis: Int64(_config.findTimeout.inMilliseconds), + findTimeoutMillis: _config.findTimeout.inMilliseconds, ), ), ); @@ -299,7 +289,7 @@ class NativeAutomator { /// * , /// which is used on Android. Future pressBack() async { - await _wrapRequest('pressBack', () => _client.pressBack(Empty())); + await _wrapRequest('pressBack', _client.pressBack); } /// Presses the home button. @@ -311,7 +301,7 @@ class NativeAutomator { /// * , /// which is used on iOS Future pressHome() async { - await _wrapRequest('pressHome', () => _client.pressHome(Empty())); + await _wrapRequest('pressHome', _client.pressHome); } /// Opens the app specified by [appId]. If [appId] is null, then the app under @@ -331,18 +321,12 @@ class NativeAutomator { /// * , /// which is used on Android Future pressRecentApps() async { - await _wrapRequest( - 'pressRecentApps', - () => _client.pressRecentApps(Empty()), - ); + await _wrapRequest('pressRecentApps', _client.pressRecentApps); } /// Double presses the recent apps button. Future pressDoubleRecentApps() async { - await _wrapRequest( - 'pressDoubleRecentApps', - () => _client.doublePressRecentApps(Empty()), - ); + await _wrapRequest('pressDoubleRecentApps', _client.doublePressRecentApps); } /// Opens the notification shade. @@ -351,20 +335,14 @@ class NativeAutomator { /// * , /// which is used on Android Future openNotifications() async { - await _wrapRequest( - 'openNotifications', - () => _client.openNotifications(Empty()), - ); + await _wrapRequest('openNotifications', _client.openNotifications); } /// Closes the notification shade. /// /// It must be visible, otherwise the behavior is undefined. Future closeNotifications() async { - await _wrapRequest( - 'closeNotifications', - () => _client.closeNotifications(Empty()), - ); + await _wrapRequest('closeNotifications', _client.closeNotifications); } /// Opens the quick settings shade on Android and Control Center on iOS. @@ -416,7 +394,7 @@ class NativeAutomator { Future closeHeadsUpNotification() async { await _wrapRequest( 'closeHeadsUpNotification', - () => _client.closeHeadsUpNotification(Empty()), + _client.closeHeadsUpNotification, ); } @@ -475,66 +453,42 @@ class NativeAutomator { /// Enables airplane mode. Future enableAirplaneMode() async { - await _wrapRequest( - 'enableAirplaneMode', - () => _client.enableAirplaneMode(Empty()), - ); + await _wrapRequest('enableAirplaneMode', _client.enableAirplaneMode); } /// Enables airplane mode. Future disableAirplaneMode() async { - await _wrapRequest( - 'disableAirplaneMode', - () => _client.disableAirplaneMode(Empty()), - ); + await _wrapRequest('disableAirplaneMode', _client.disableAirplaneMode); } /// Enables cellular (aka mobile data connection). Future enableCellular() async { - await _wrapRequest( - 'enableCellular', - () => _client.enableCellular(Empty()), - ); + await _wrapRequest('enableCellular', _client.enableCellular); } /// Disables cellular (aka mobile data connection). Future disableCellular() { - return _wrapRequest( - 'disableCellular', - () => _client.disableCellular(Empty()), - ); + return _wrapRequest('disableCellular', _client.disableCellular); } /// Enables Wi-Fi. Future enableWifi() async { - await _wrapRequest( - 'enableWifi', - () => _client.enableWiFi(Empty()), - ); + await _wrapRequest('enableWifi', _client.enableWiFi); } /// Disables Wi-Fi. Future disableWifi() async { - await _wrapRequest( - 'disableWifi', - () => _client.disableWiFi(Empty()), - ); + await _wrapRequest('disableWifi', _client.disableWiFi); } /// Enables bluetooth. Future enableBluetooth() async { - await _wrapRequest( - 'enableBluetooth', - () => _client.enableBluetooth(Empty()), - ); + await _wrapRequest('enableBluetooth', _client.enableBluetooth); } /// Disables bluetooth. Future disableBluetooth() async { - await _wrapRequest( - 'disableBluetooth', - () => _client.disableBluetooth(Empty()), - ); + await _wrapRequest('disableBluetooth', _client.disableBluetooth); } /// Taps on the native view specified by [selector]. @@ -701,7 +655,7 @@ class NativeAutomator { 'isPermissionDialogVisible', () => _client.isPermissionDialogVisible( PermissionDialogVisibleRequest( - timeoutMillis: Int64(timeout.inMilliseconds), + timeoutMillis: timeout.inMilliseconds, ), ), ); @@ -726,7 +680,7 @@ class NativeAutomator { await _wrapRequest( 'grantPermissionWhenInUse', () => _client.handlePermissionDialog( - HandlePermissionRequest(code: HandlePermissionRequest_Code.WHILE_USING), + HandlePermissionRequest(code: HandlePermissionRequestCode.whileUsing), ), ); } @@ -752,7 +706,7 @@ class NativeAutomator { 'grantPermissionOnlyThisTime', () => _client.handlePermissionDialog( HandlePermissionRequest( - code: HandlePermissionRequest_Code.ONLY_THIS_TIME, + code: HandlePermissionRequestCode.onlyThisTime, ), ), ); @@ -775,7 +729,7 @@ class NativeAutomator { await _wrapRequest( 'denyPermission', () => _client.handlePermissionDialog( - HandlePermissionRequest(code: HandlePermissionRequest_Code.DENIED), + HandlePermissionRequest(code: HandlePermissionRequestCode.denied), ), ); } @@ -789,7 +743,7 @@ class NativeAutomator { 'selectCoarseLocation', () => _client.setLocationAccuracy( SetLocationAccuracyRequest( - locationAccuracy: SetLocationAccuracyRequest_LocationAccuracy.COARSE, + locationAccuracy: SetLocationAccuracyRequestLocationAccuracy.coarse, ), ), ); @@ -804,7 +758,7 @@ class NativeAutomator { 'selectFineLocation', () => _client.setLocationAccuracy( SetLocationAccuracyRequest( - locationAccuracy: SetLocationAccuracyRequest_LocationAccuracy.FINE, + locationAccuracy: SetLocationAccuracyRequestLocationAccuracy.fine, ), ), ); @@ -816,7 +770,7 @@ class NativeAutomator { Future markPatrolAppServiceReady() async { await _wrapRequest( 'markPatrolAppServiceReady', - () => _client.markPatrolAppServiceReady(Empty()), + _client.markPatrolAppServiceReady, ); } } diff --git a/packages/patrol/pubspec.yaml b/packages/patrol/pubspec.yaml index ecd1bd6d1..1d34fc8e5 100644 --- a/packages/patrol/pubspec.yaml +++ b/packages/patrol/pubspec.yaml @@ -17,7 +17,6 @@ dependencies: sdk: flutter flutter_test: sdk: flutter - grpc: ^3.1.0 http: ^1.1.0 integration_test: sdk: flutter @@ -25,7 +24,6 @@ dependencies: meta: ^1.7.0 path: ^1.8.2 patrol_finders: ^1.0.0 - protobuf: ^2.1.0 shelf: ^1.4.1 test_api: '>=0.4.0 <0.7.0' diff --git a/schema.dart b/schema.dart index cbc351392..bf6110af3 100644 --- a/schema.dart +++ b/schema.dart @@ -97,7 +97,6 @@ class SwipeRequest { late double endX; late double endY; late int steps; - late String appId; } class WaitUntilVisibleRequest { From a2b671a131d3bb1b19bbb016f20477cf07b4c2bd Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Tue, 22 Aug 2023 16:24:34 +0200 Subject: [PATCH 024/110] Migrate telegraph generator api to new style --- .../NativeAutomatorServer.swift | 5 +++++ .../lib/src/generators/ios/ios_config.dart | 2 ++ .../lib/src/generators/ios/ios_generator.dart | 5 +++++ ...rt => ios_telegraph_server_generator.dart} | 21 +++++++++++++++---- 4 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 packages/patrol/ios/Classes/AutomatorServer/NativeAutomatorServer.swift rename packages/patrol_gen/lib/src/generators/ios/{ios_telegraph_generator.dart => ios_telegraph_server_generator.dart} (59%) diff --git a/packages/patrol/ios/Classes/AutomatorServer/NativeAutomatorServer.swift b/packages/patrol/ios/Classes/AutomatorServer/NativeAutomatorServer.swift new file mode 100644 index 000000000..c9492ea2b --- /dev/null +++ b/packages/patrol/ios/Classes/AutomatorServer/NativeAutomatorServer.swift @@ -0,0 +1,5 @@ +/// +// Generated code. Do not modify. +// source: schema.dart +// + diff --git a/packages/patrol_gen/lib/src/generators/ios/ios_config.dart b/packages/patrol_gen/lib/src/generators/ios/ios_config.dart index f8d592b6a..79c7f2c17 100644 --- a/packages/patrol_gen/lib/src/generators/ios/ios_config.dart +++ b/packages/patrol_gen/lib/src/generators/ios/ios_config.dart @@ -10,4 +10,6 @@ class IOSConfig { String clientFileName(String serviceName) => path.join(outputDirectory, '${serviceName}Client.swift'); + String serverFileName(String serviceName) => + path.join(outputDirectory, '${serviceName}Server.swift'); } diff --git a/packages/patrol_gen/lib/src/generators/ios/ios_generator.dart b/packages/patrol_gen/lib/src/generators/ios/ios_generator.dart index 8ffe837de..49e758b95 100644 --- a/packages/patrol_gen/lib/src/generators/ios/ios_generator.dart +++ b/packages/patrol_gen/lib/src/generators/ios/ios_generator.dart @@ -1,5 +1,6 @@ import 'package:patrol_gen/src/generators/ios/ios_config.dart'; import 'package:patrol_gen/src/generators/ios/ios_contracts_generator.dart'; +import 'package:patrol_gen/src/generators/ios/ios_telegraph_server_generator.dart'; import 'package:patrol_gen/src/generators/ios/ios_url_session_client_generator.dart'; import 'package:patrol_gen/src/generators/output_file.dart'; import 'package:patrol_gen/src/schema.dart'; @@ -10,9 +11,13 @@ class IOSGenerator { IOSContractsGenerator().generate(schema, config), ]; + final serverGenerator = IOSTelegraphServerGenerator(); final clientGenerator = IOSURLSessionClientGenerator(); for (var service in schema.services) { + if (service.ios.needsServer) { + result.add(serverGenerator.generate(service, config)); + } if (service.ios.needsClient) { result.add(clientGenerator.generate(service, config)); } diff --git a/packages/patrol_gen/lib/src/generators/ios/ios_telegraph_generator.dart b/packages/patrol_gen/lib/src/generators/ios/ios_telegraph_server_generator.dart similarity index 59% rename from packages/patrol_gen/lib/src/generators/ios/ios_telegraph_generator.dart rename to packages/patrol_gen/lib/src/generators/ios/ios_telegraph_server_generator.dart index eb9bd97d9..3c366d5e6 100644 --- a/packages/patrol_gen/lib/src/generators/ios/ios_telegraph_generator.dart +++ b/packages/patrol_gen/lib/src/generators/ios/ios_telegraph_server_generator.dart @@ -1,11 +1,24 @@ +import 'package:patrol_gen/src/generators/ios/ios_config.dart'; +import 'package:patrol_gen/src/generators/output_file.dart'; import 'package:patrol_gen/src/schema.dart'; -class IOSTelegraphGenerator { - String generateServer(Service service) { +class IOSTelegraphServerGenerator { + OutputFile generate(Service service, IOSConfig config) { + final buffer = StringBuffer()..write(_contentPrefix(config)); + + return OutputFile( + filename: config.serverFileName(service.name), + content: buffer.toString(), + ); + } + + String _contentPrefix(IOSConfig config) { return ''' -${_generateInterface(service)} +/// +// Generated code. Do not modify. +// source: schema.dart +// -${_generateSetUpRoutes(service)} '''; } From 9cc9c5d658403ace70db51a66aa4e743d975087b Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Wed, 23 Aug 2023 12:25:56 +0200 Subject: [PATCH 025/110] Remove grpc, migrate to new contracts --- packages/patrol/example/ios/Podfile.lock | 204 +- .../Classes/AutomatorServer/Automator.swift | 44 +- .../AutomatorServer/AutomatorServer.swift | 631 ++- .../ios/Classes/AutomatorServer/Errors.swift | 17 +- .../AutomatorServer/contracts.grpc.swift | 3547 ----------------- .../AutomatorServer/contracts.pb.swift | 1648 -------- .../Classes/ObjCPatrolAppServiceClient.swift | 2 - .../ios/Classes/SwiftPatrolPlugin.swift | 1 - packages/patrol/ios/patrol.podspec | 4 +- .../ios/ios_telegraph_server_generator.dart | 23 +- 10 files changed, 291 insertions(+), 5830 deletions(-) delete mode 100644 packages/patrol/ios/Classes/AutomatorServer/contracts.grpc.swift delete mode 100644 packages/patrol/ios/Classes/AutomatorServer/contracts.pb.swift diff --git a/packages/patrol/example/ios/Podfile.lock b/packages/patrol/example/ios/Podfile.lock index d101c544c..79b1ff61b 100644 --- a/packages/patrol/example/ios/Podfile.lock +++ b/packages/patrol/example/ios/Podfile.lock @@ -1,14 +1,4 @@ PODS: - - _NIODataStructures (2.40.0) - - CGRPCZlib (1.8.0) - - CNIOAtomics (2.40.0) - - CNIOBoringSSL (2.19.0) - - CNIOBoringSSLShims (2.19.0): - - CNIOBoringSSL (= 2.19.0) - - CNIODarwin (2.40.0) - - CNIOHTTPParser (2.40.0) - - CNIOLinux (2.40.0) - - CNIOWindows (2.40.0) - CocoaAsyncSocket (7.6.5) - Flutter (1.0.0) - flutter_local_notifications (0.0.1): @@ -17,156 +7,14 @@ PODS: - Flutter - geolocator_apple (1.2.0): - Flutter - - gRPC-Swift (1.8.0): - - CGRPCZlib (= 1.8.0) - - Logging (< 2.0.0, >= 1.4.0) - - SwiftNIO (< 3.0.0, >= 2.32.0) - - SwiftNIOExtras (< 2.0.0, >= 1.4.0) - - SwiftNIOHTTP2 (< 2.0.0, >= 1.22.0) - - SwiftNIOSSL (< 3.0.0, >= 2.14.0) - - SwiftNIOTransportServices (< 2.0.0, >= 1.11.1) - - SwiftProtobuf (< 2.0.0, >= 1.19.0) - HTTPParserC (2.9.4) - integration_test (0.0.1): - Flutter - - Logging (1.4.0) - patrol (0.0.1): - Flutter - - gRPC-Swift (~> 1.8.0) - Telegraph (~> 0.30.0) - permission_handler_apple (9.1.1): - Flutter - - SwiftNIO (2.40.0): - - _NIODataStructures (= 2.40.0) - - CNIOAtomics (= 2.40.0) - - CNIODarwin (= 2.40.0) - - CNIOLinux (= 2.40.0) - - CNIOWindows (= 2.40.0) - - SwiftNIOConcurrencyHelpers (= 2.40.0) - - SwiftNIOCore (= 2.40.0) - - SwiftNIOEmbedded (= 2.40.0) - - SwiftNIOPosix (= 2.40.0) - - SwiftNIOConcurrencyHelpers (2.40.0): - - CNIOAtomics (= 2.40.0) - - SwiftNIOCore (2.40.0): - - CNIOAtomics (= 2.40.0) - - CNIOLinux (= 2.40.0) - - SwiftNIOConcurrencyHelpers (= 2.40.0) - - SwiftNIOEmbedded (2.40.0): - - _NIODataStructures (= 2.40.0) - - CNIOAtomics (= 2.40.0) - - CNIOLinux (= 2.40.0) - - SwiftNIOConcurrencyHelpers (= 2.40.0) - - SwiftNIOCore (= 2.40.0) - - SwiftNIOExtras (1.11.0): - - _NIODataStructures (< 3, >= 2.32.0) - - CNIOAtomics (< 3, >= 2.32.0) - - CNIODarwin (< 3, >= 2.32.0) - - CNIOLinux (< 3, >= 2.32.0) - - CNIOWindows (< 3, >= 2.32.0) - - SwiftNIO (< 3, >= 2.32.0) - - SwiftNIOConcurrencyHelpers (< 3, >= 2.32.0) - - SwiftNIOCore (< 3, >= 2.32.0) - - SwiftNIOEmbedded (< 3, >= 2.32.0) - - SwiftNIOPosix (< 3, >= 2.32.0) - - SwiftNIOFoundationCompat (2.40.0): - - _NIODataStructures (= 2.40.0) - - CNIOAtomics (= 2.40.0) - - CNIODarwin (= 2.40.0) - - CNIOLinux (= 2.40.0) - - CNIOWindows (= 2.40.0) - - SwiftNIO (= 2.40.0) - - SwiftNIOConcurrencyHelpers (= 2.40.0) - - SwiftNIOCore (= 2.40.0) - - SwiftNIOEmbedded (= 2.40.0) - - SwiftNIOPosix (= 2.40.0) - - SwiftNIOHPACK (1.22.0): - - _NIODataStructures (< 3, >= 2.35.0) - - CNIOAtomics (< 3, >= 2.35.0) - - CNIODarwin (< 3, >= 2.35.0) - - CNIOHTTPParser (< 3, >= 2.35.0) - - CNIOLinux (< 3, >= 2.35.0) - - CNIOWindows (< 3, >= 2.35.0) - - SwiftNIO (< 3, >= 2.35.0) - - SwiftNIOConcurrencyHelpers (< 3, >= 2.35.0) - - SwiftNIOCore (< 3, >= 2.35.0) - - SwiftNIOEmbedded (< 3, >= 2.35.0) - - SwiftNIOHTTP1 (< 3, >= 2.35.0) - - SwiftNIOPosix (< 3, >= 2.35.0) - - SwiftNIOHTTP1 (2.40.0): - - _NIODataStructures (= 2.40.0) - - CNIOAtomics (= 2.40.0) - - CNIODarwin (= 2.40.0) - - CNIOHTTPParser (= 2.40.0) - - CNIOLinux (= 2.40.0) - - CNIOWindows (= 2.40.0) - - SwiftNIO (= 2.40.0) - - SwiftNIOConcurrencyHelpers (= 2.40.0) - - SwiftNIOCore (= 2.40.0) - - SwiftNIOEmbedded (= 2.40.0) - - SwiftNIOPosix (= 2.40.0) - - SwiftNIOHTTP2 (1.22.0): - - _NIODataStructures (< 3, >= 2.35.0) - - CNIOAtomics (< 3, >= 2.35.0) - - CNIODarwin (< 3, >= 2.35.0) - - CNIOHTTPParser (< 3, >= 2.35.0) - - CNIOLinux (< 3, >= 2.35.0) - - CNIOWindows (< 3, >= 2.35.0) - - SwiftNIO (< 3, >= 2.35.0) - - SwiftNIOConcurrencyHelpers (< 3, >= 2.35.0) - - SwiftNIOCore (< 3, >= 2.35.0) - - SwiftNIOEmbedded (< 3, >= 2.35.0) - - SwiftNIOHPACK (= 1.22.0) - - SwiftNIOHTTP1 (< 3, >= 2.35.0) - - SwiftNIOPosix (< 3, >= 2.35.0) - - SwiftNIOTLS (< 3, >= 2.35.0) - - SwiftNIOPosix (2.40.0): - - _NIODataStructures (= 2.40.0) - - CNIOAtomics (= 2.40.0) - - CNIODarwin (= 2.40.0) - - CNIOLinux (= 2.40.0) - - CNIOWindows (= 2.40.0) - - SwiftNIOConcurrencyHelpers (= 2.40.0) - - SwiftNIOCore (= 2.40.0) - - SwiftNIOSSL (2.19.0): - - _NIODataStructures (< 3, >= 2.32.0) - - CNIOAtomics (< 3, >= 2.32.0) - - CNIOBoringSSL (= 2.19.0) - - CNIOBoringSSLShims (= 2.19.0) - - CNIODarwin (< 3, >= 2.32.0) - - CNIOLinux (< 3, >= 2.32.0) - - CNIOWindows (< 3, >= 2.32.0) - - SwiftNIO (< 3, >= 2.32.0) - - SwiftNIOConcurrencyHelpers (< 3, >= 2.32.0) - - SwiftNIOCore (< 3, >= 2.32.0) - - SwiftNIOEmbedded (< 3, >= 2.32.0) - - SwiftNIOPosix (< 3, >= 2.32.0) - - SwiftNIOTLS (< 3, >= 2.32.0) - - SwiftNIOTLS (2.40.0): - - _NIODataStructures (= 2.40.0) - - CNIOAtomics (= 2.40.0) - - CNIODarwin (= 2.40.0) - - CNIOLinux (= 2.40.0) - - CNIOWindows (= 2.40.0) - - SwiftNIO (= 2.40.0) - - SwiftNIOConcurrencyHelpers (= 2.40.0) - - SwiftNIOCore (= 2.40.0) - - SwiftNIOEmbedded (= 2.40.0) - - SwiftNIOPosix (= 2.40.0) - - SwiftNIOTransportServices (1.12.0): - - _NIODataStructures (< 3, >= 2.32.0) - - CNIOAtomics (< 3, >= 2.32.0) - - CNIODarwin (< 3, >= 2.32.0) - - CNIOLinux (< 3, >= 2.32.0) - - CNIOWindows (< 3, >= 2.32.0) - - SwiftNIO (< 3, >= 2.32.0) - - SwiftNIOConcurrencyHelpers (< 3, >= 2.32.0) - - SwiftNIOCore (< 3, >= 2.32.0) - - SwiftNIOEmbedded (< 3, >= 2.32.0) - - SwiftNIOFoundationCompat (< 3, >= 2.32.0) - - SwiftNIOPosix (< 3, >= 2.32.0) - - SwiftNIOTLS (< 3, >= 2.32.0) - - SwiftProtobuf (1.20.3) - Telegraph (0.30.0): - CocoaAsyncSocket (~> 7.6) - HTTPParserC (~> 2.9) @@ -185,33 +33,8 @@ DEPENDENCIES: SPEC REPOS: trunk: - - _NIODataStructures - - CGRPCZlib - - CNIOAtomics - - CNIOBoringSSL - - CNIOBoringSSLShims - - CNIODarwin - - CNIOHTTPParser - - CNIOLinux - - CNIOWindows - CocoaAsyncSocket - - gRPC-Swift - HTTPParserC - - Logging - - SwiftNIO - - SwiftNIOConcurrencyHelpers - - SwiftNIOCore - - SwiftNIOEmbedded - - SwiftNIOExtras - - SwiftNIOFoundationCompat - - SwiftNIOHPACK - - SwiftNIOHTTP1 - - SwiftNIOHTTP2 - - SwiftNIOPosix - - SwiftNIOSSL - - SwiftNIOTLS - - SwiftNIOTransportServices - - SwiftProtobuf - Telegraph EXTERNAL SOURCES: @@ -233,40 +56,15 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/webview_flutter_wkwebview/ios" SPEC CHECKSUMS: - _NIODataStructures: 3d45d8e70a1d17a15b1dc59d102c63dbc0525ffd - CGRPCZlib: 298dd3237ba4bd7b3eed109e7080ff3324b7d9c9 - CNIOAtomics: 8edf08644e5e6fa0f021c239be9e8beb1cd9ef18 - CNIOBoringSSL: 2c9c96c2e95f15e83fb8d26b9738d939cc39ae33 - CNIOBoringSSLShims: c5c9346e7bbd1040f4f8793a35441dda7487539a - CNIODarwin: 93850990d29f2626b05306c6c9309f9be0d74c2f - CNIOHTTPParser: 8ce395236fa1d09ac3b4f4bcfba79b849b2ac684 - CNIOLinux: 62e3505f50de558c393dc2f273dde71dcce518da - CNIOWindows: 3047f2d8165848a3936a0a755fee27c6b5ee479b CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99 Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 flutter_local_notifications: 0c0b1ae97e741e1521e4c1629a459d04b9aec743 flutter_timezone: ffb07bdad3c6276af8dada0f11978d8a1f8a20bb geolocator_apple: cc556e6844d508c95df1e87e3ea6fa4e58c50401 - gRPC-Swift: 74adcaaa62ac5e0a018938840328cb1fdfb09e7b HTTPParserC: aea14c3d2d4ac5beb3988781daa36dfa62e0d9ef integration_test: 13825b8a9334a850581300559b8839134b124670 - Logging: beeb016c9c80cf77042d62e83495816847ef108b - patrol: 23cee8114af27ad57b6c8a068b2a68c8f81018ca + patrol: 0966206ac7e717e0ee4d9b6b4e86c8aab62acbfc permission_handler_apple: e76247795d700c14ea09e3a2d8855d41ee80a2e6 - SwiftNIO: 829958aab300642625091f82fc2f49cb7cf4ef24 - SwiftNIOConcurrencyHelpers: 697370136789b1074e4535eaae75cbd7f900370e - SwiftNIOCore: 473fdfe746534d7aa25766916459eeaf6f92ef49 - SwiftNIOEmbedded: ffcb5147db67d9686c8366b7f8427b36132f2c8a - SwiftNIOExtras: 481f74d6bf0b0ef699905ed66439cb019c4975c9 - SwiftNIOFoundationCompat: b9cdbea4806e4a12e9f66d9696fa3b98c4c3232b - SwiftNIOHPACK: e7d3ff5bd671528adfb11cd4e0c84ddfdc3c4453 - SwiftNIOHTTP1: ef56706550a1dc135ea69d65215b9941e643c23b - SwiftNIOHTTP2: cc81d7a6ba70d2ddc5376f471904b27ef5d2b7b8 - SwiftNIOPosix: b49af4bdbecaadfadd5c93dfe28594d6722b75e4 - SwiftNIOSSL: d153c5a6fc5b2301b0519b4c4d037a9414212da6 - SwiftNIOTLS: 598af547490133e9aac52aed0c23c4a90c31dcfc - SwiftNIOTransportServices: 0b2b407819d82eb63af558c5396e33c945759503 - SwiftProtobuf: b02b5075dcf60c9f5f403000b3b0c202a11b6ae1 Telegraph: 12576b119324138e4929792af9e5a1085c2ecbc1 webview_flutter_wkwebview: 2e2d318f21a5e036e2c3f26171342e95908bd60a diff --git a/packages/patrol/ios/Classes/AutomatorServer/Automator.swift b/packages/patrol/ios/Classes/AutomatorServer/Automator.swift index a84331286..7e12d8b8e 100644 --- a/packages/patrol/ios/Classes/AutomatorServer/Automator.swift +++ b/packages/patrol/ios/Classes/AutomatorServer/Automator.swift @@ -363,7 +363,7 @@ func getNativeViews( byText text: String, inApp bundleId: String - ) async throws -> [Patrol_NativeView] { + ) async throws -> [NativeView] { try await runAction("getting native views matching \(text)") { let app = try self.getApp(withBundleId: bundleId) @@ -379,7 +379,7 @@ let elements = query.allElementsBoundByIndex let views = elements.map { xcuielement in - return Patrol_NativeView.fromXCUIElement(xcuielement, bundleId) + return NativeView.fromXCUIElement(xcuielement, bundleId) } return views @@ -424,17 +424,15 @@ try await Task.sleep(nanoseconds: UInt64(1 * Double(NSEC_PER_SEC))) } - func getNotifications() async throws -> [Patrol_Notification] { - var notifications = [Patrol_Notification]() + func getNotifications() async throws -> [Notification] { + var notifications = [Notification]() await runAction("getting notifications") { let cells = self.springboard.buttons.matching(identifier: "NotificationCell") .allElementsBoundByIndex for (i, cell) in cells.enumerated() { - let notification = Patrol_Notification.with { Logger.shared.i("found notification at index \(i) with label \(format: cell.label)") - $0.raw = cell.label - } - notifications.append(notification) + let notification = Notification(title: String(), content: String(), raw: cell.label) + notifications.append(notification) } } @@ -795,23 +793,21 @@ } } - extension Patrol_NativeView { - static func fromXCUIElement(_ xcuielement: XCUIElement, _ bundleId: String) -> Patrol_NativeView + extension NativeView { + static func fromXCUIElement(_ xcuielement: XCUIElement, _ bundleId: String) -> NativeView { - return Patrol_NativeView.with { - $0.text = xcuielement.label - if xcuielement.accessibilityLabel != nil { - $0.contentDescription = xcuielement.accessibilityLabel! - } - $0.resourceName = xcuielement.identifier - $0.enabled = xcuielement.isEnabled - $0.focused = xcuielement.hasFocus - $0.className = String(xcuielement.elementType.rawValue) // TODO: Provide mapping for names - $0.applicationPackage = bundleId - $0.children = xcuielement.children(matching: .any).allElementsBoundByIndex.map { child in - return Patrol_NativeView.fromXCUIElement(child, bundleId) - } - } + return NativeView( + className: String(xcuielement.elementType.rawValue), // TODO: Provide mapping for names + text: xcuielement.label, + contentDescription: xcuielement.accessibilityLabel ?? String(), + focused: xcuielement.hasFocus, + enabled: xcuielement.isEnabled, + childCount: 0, //TODO nullable? + resourceName: xcuielement.identifier, + applicationPackage: bundleId, + children: xcuielement.children(matching: .any).allElementsBoundByIndex.map { child in + return NativeView.fromXCUIElement(child, bundleId) + }) } } diff --git a/packages/patrol/ios/Classes/AutomatorServer/AutomatorServer.swift b/packages/patrol/ios/Classes/AutomatorServer/AutomatorServer.swift index 2f7127cd5..ab575c88a 100644 --- a/packages/patrol/ios/Classes/AutomatorServer/AutomatorServer.swift +++ b/packages/patrol/ios/Classes/AutomatorServer/AutomatorServer.swift @@ -1,442 +1,303 @@ #if PATROL_ENABLED - import Foundation - import GRPC +import Foundation - typealias Empty = Patrol_Empty - typealias DefaultResponse = Patrol_Empty - - final class AutomatorServer: Patrol_NativeAutomatorAsyncProvider { +final class AutomatorServer: NativeAutomatorClient { private let automator: Automator - + private let onAppReady: (Bool) -> Void - + init(automator: Automator, onAppReady: @escaping (Bool) -> Void) { - self.automator = automator - self.onAppReady = onAppReady - } - - func initialize( - request: Empty, - context: GRPCAsyncServerCallContext - ) async throws -> Empty { - return DefaultResponse() + self.automator = automator + self.onAppReady = onAppReady } - - func configure( - request: Patrol_ConfigureRequest, - context: GRPCAsyncServerCallContext - ) async throws -> Empty { - automator.configure(timeout: TimeInterval(request.findTimeoutMillis / 1000)) - return DefaultResponse() + + func initialize() async throws {} + + func configure(request: ConfigureRequest) async throws { + automator.configure(timeout: TimeInterval(request.findTimeoutMillis / 1000)) } - + // MARK: General - - func pressHome( - request: Empty, - context: GRPCAsyncServerCallContext - ) async throws -> DefaultResponse { - return try await runCatching { - try await automator.pressHome() - return DefaultResponse() - } + + func pressHome() async throws { + return try await runCatching { + try await automator.pressHome() + } } - - func pressBack( - request: Empty, - context: GRPCAsyncServerCallContext - ) async throws -> DefaultResponse { - return try await runCatching { - throw PatrolError.methodNotImplemented("pressBack") - } - } - func pressRecentApps( - request: Empty, - context: GRPCAsyncServerCallContext - ) async throws -> DefaultResponse { - return try await runCatching { - try await automator.openAppSwitcher() - return DefaultResponse() - } + + func pressBack() async throws { + return try await runCatching { + throw PatrolError.methodNotImplemented("pressBack") + } } - - func doublePressRecentApps( - request: Empty, - context: GRPCAsyncServerCallContext - ) async throws -> DefaultResponse { - return try await runCatching { - throw PatrolError.methodNotImplemented("doublePressRecentApps") - } + + func pressRecentApps() async throws { + return try await runCatching { + try await automator.openAppSwitcher() + } } - - func openApp( - request: Patrol_OpenAppRequest, - context: GRPCAsyncServerCallContext - ) async throws -> DefaultResponse { - return try await runCatching { - try await automator.openApp(request.appID) - return DefaultResponse() - } + + func doublePressRecentApps() async throws { + return try await runCatching { + throw PatrolError.methodNotImplemented("doublePressRecentApps") + } } - - func openQuickSettings( - request: Patrol_OpenQuickSettingsRequest, - context: GRPCAsyncServerCallContext - ) async throws -> DefaultResponse { - return try await runCatching { - try await automator.openControlCenter() - return DefaultResponse() - } + + func openApp(request: OpenAppRequest) async throws { + return try await runCatching { + try await automator.openApp(request.appId) + } } - + + func openQuickSettings(request: OpenQuickSettingsRequest) async throws { + return try await runCatching { + try await automator.openControlCenter() + } + } + // MARK: General UI interaction - + func getNativeViews( - request: Patrol_GetNativeViewsRequest, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_GetNativeViewsResponse { - return try await runCatching { - let nativeViews = try await automator.getNativeViews( - byText: request.selector.text, - inApp: request.appID - ) - - return Patrol_GetNativeViewsResponse.with { - $0.nativeViews = nativeViews + request: GetNativeViewsRequest + ) async throws -> GetNativeViewsResponse { + return try await runCatching { + let nativeViews = try await automator.getNativeViews( + byText: request.selector.text, + inApp: request.appId + ) + + return GetNativeViewsResponse.with { + $0.nativeViews = nativeViews + } } - } } - - func tap( - request: Patrol_TapRequest, - context: GRPCAsyncServerCallContext - ) async throws -> DefaultResponse { - return try await runCatching { - try await automator.tap( - onText: request.selector.text, - inApp: request.appID, - atIndex: Int(request.selector.instance) - ) - return DefaultResponse() - } + + func tap(request: TapRequest) async throws { + return try await runCatching { + try await automator.tap( + onText: request.selector.text ?? String(), + inApp: request.appId, + atIndex: request.selector.instance ?? 0 + ) + } } - - func doubleTap( - request: Patrol_TapRequest, - context: GRPCAsyncServerCallContext - ) async throws -> DefaultResponse { - return try await runCatching { - try await automator.doubleTap( - onText: request.selector.text, - inApp: request.appID - ) - return DefaultResponse() - } + + func doubleTap(request: TapRequest) async throws { + return try await runCatching { + try await automator.doubleTap( + onText: request.selector.text ?? String(), + inApp: request.appId + ) + } } - - func enterText( - request: Patrol_EnterTextRequest, - context: GRPCAsyncServerCallContext - ) async throws -> DefaultResponse { - return try await runCatching { - switch request.findBy { - case .index(let index): - try await automator.enterText( - request.data, - byIndex: Int(index), - inApp: request.appID - ) - case .selector(let selector): - try await automator.enterText( - request.data, - byText: selector.text, - atIndex: Int(selector.instance), - inApp: request.appID - ) - default: - throw PatrolError.internal("enterText(): neither index nor selector are set") + + func enterText(request: EnterTextRequest) async throws { + return try await runCatching { + if let index = request.index { + try await automator.enterText( + request.data, + byIndex: Int(index), + inApp: request.appId + ) + } else if let selector = request.selector { + try await automator.enterText( + request.data, + byText: selector.text ?? String(), + atIndex: selector.instance ?? 0, + inApp: request.appId + ) + } else { + throw PatrolError.internal("enterText(): neither index nor selector are set") + } } - - return DefaultResponse() - } } - - func swipe( - request: Patrol_SwipeRequest, - context: GRPCAsyncServerCallContext - ) async throws -> DefaultResponse { - return try await runCatching { - throw PatrolError.methodNotImplemented("swipe") - } + + func swipe(request: SwipeRequest) async throws { + return try await runCatching { + throw PatrolError.methodNotImplemented("swipe") + } } - - func waitUntilVisible( - request: Patrol_WaitUntilVisibleRequest, - context: GRPCAsyncServerCallContext - ) async throws -> DefaultResponse { - return try await runCatching { - try await automator.waitUntilVisible( - onText: request.selector.text, - inApp: request.appID - ) - return DefaultResponse() - } + + func waitUntilVisible(request: WaitUntilVisibleRequest) async throws { + return try await runCatching { + try await automator.waitUntilVisible( + onText: request.selector.text ?? String(), + inApp: request.appId + ) + } } - + // MARK: Services - - func enableAirplaneMode( - request: Empty, - context: GRPCAsyncServerCallContext - ) async throws -> DefaultResponse { - return try await runCatching { - try await automator.enableAirplaneMode() - return DefaultResponse() - } + + func enableAirplaneMode() async throws { + return try await runCatching { + try await automator.enableAirplaneMode() + } } - - func disableAirplaneMode( - request: Empty, - context: GRPCAsyncServerCallContext - ) async throws -> DefaultResponse { - return try await runCatching { - try await automator.disableAirplaneMode() - return DefaultResponse() - } + + func disableAirplaneMode() async throws { + return try await runCatching { + try await automator.disableAirplaneMode() + } } - - func enableWiFi( - request: Empty, - context: GRPCAsyncServerCallContext - ) async throws -> DefaultResponse { - return try await runCatching { - try await automator.enableWiFi() - return DefaultResponse() - } + + func enableWiFi() async throws { + return try await runCatching { + try await automator.enableWiFi() + } } - - func disableWiFi( - request: Empty, - context: GRPCAsyncServerCallContext - ) async throws -> DefaultResponse { - return try await runCatching { - try await automator.disableWiFi() - return DefaultResponse() - } + + func disableWiFi() async throws { + return try await runCatching { + try await automator.disableWiFi() + } } - - func enableCellular( - request: Empty, - context: GRPCAsyncServerCallContext - ) async throws -> DefaultResponse { - return try await runCatching { - try await automator.enableCellular() - return DefaultResponse() - } + + func enableCellular() async throws { + return try await runCatching { + try await automator.enableCellular() + } } - - func disableCellular( - request: Empty, - context: GRPCAsyncServerCallContext - ) async throws -> DefaultResponse { - return try await runCatching { - try await automator.disableCellular() - return DefaultResponse() - } + + func disableCellular() async throws { + return try await runCatching { + try await automator.disableCellular() + } } - - func enableBluetooth( - request: Empty, - context: GRPCAsyncServerCallContext - ) async throws -> DefaultResponse { - return try await runCatching { - try await automator.enableBluetooth() - return DefaultResponse() - } + + func enableBluetooth() async throws { + return try await runCatching { + try await automator.enableBluetooth() + } } - - func disableBluetooth( - request: Empty, - context: GRPCAsyncServerCallContext - ) async throws -> DefaultResponse { - return try await runCatching { - try await automator.disableBluetooth() - return DefaultResponse() - } + + func disableBluetooth() async throws { + return try await runCatching { + try await automator.disableBluetooth() + } } - - func enableDarkMode( - request: Patrol_DarkModeRequest, - context: GRPCAsyncServerCallContext - ) async throws -> DefaultResponse { - return try await runCatching { - try await automator.enableDarkMode(request.appID) - return DefaultResponse() - } + + func enableDarkMode(request: DarkModeRequest) async throws { + return try await runCatching { + try await automator.enableDarkMode(request.appId) + } } - - func disableDarkMode( - request: Patrol_DarkModeRequest, - context: GRPCAsyncServerCallContext - ) async throws -> DefaultResponse { - return try await runCatching { - try await automator.disableDarkMode(request.appID) - return DefaultResponse() - } + + func disableDarkMode(request: DarkModeRequest) async throws { + return try await runCatching { + try await automator.disableDarkMode(request.appId) + } } - + // MARK: Notifications - - func openNotifications( - request: Empty, - context: GRPCAsyncServerCallContext - ) async throws -> DefaultResponse { - return try await runCatching { - try await automator.openNotifications() - return DefaultResponse() - } + + func openNotifications() async throws { + return try await runCatching { + try await automator.openNotifications() + } } - - func closeNotifications( - request: Empty, - context: GRPCAsyncServerCallContext - ) async throws -> DefaultResponse { - return try await runCatching { - try await automator.closeNotifications() - return DefaultResponse() - } + + func closeNotifications() async throws { + return try await runCatching { + try await automator.closeNotifications() + } } - - func closeHeadsUpNotification( - request: Empty, - context: GRPCAsyncServerCallContext - ) async throws -> DefaultResponse { - return try await runCatching { - try await automator.closeHeadsUpNotification() - return DefaultResponse() - } + + func closeHeadsUpNotification() async throws { + return try await runCatching { + try await automator.closeHeadsUpNotification() + } } - + func getNotifications( - request: Patrol_GetNotificationsRequest, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_GetNotificationsResponse { - return try await runCatching { - let notifications = try await automator.getNotifications() - return Patrol_GetNotificationsResponse.with { - $0.notifications = notifications + request: GetNotificationsRequest + ) async throws -> GetNotificationsResponse { + return try await runCatching { + let notifications = try await automator.getNotifications() + return GetNotificationsResponse.with { + $0.notifications = notifications + } } - } } - - func tapOnNotification( - request: Patrol_TapOnNotificationRequest, - context: GRPCAsyncServerCallContext - ) async throws -> DefaultResponse { - return try await runCatching { - switch request.findBy { - case .index(let index): - try await automator.tapOnNotification( - byIndex: Int(index) - ) - case .selector(let selector): - try await automator.tapOnNotification( - bySubstring: selector.textContains - ) - default: - throw PatrolError.internal("tapOnNotification(): neither index nor selector are set") + + func tapOnNotification(request: TapOnNotificationRequest) async throws { + return try await runCatching { + if let index = request.index { + try await automator.tapOnNotification( + byIndex: index + ) + } else if let selector = request.selector { + try await automator.tapOnNotification( + bySubstring: selector.textContains ?? String() + ) + } else { + throw PatrolError.internal("tapOnNotification(): neither index nor selector are set") + } } - - return DefaultResponse() - } } - + // MARK: Permissions - + func isPermissionDialogVisible( - request: Patrol_PermissionDialogVisibleRequest, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_PermissionDialogVisibleResponse { - return try await runCatching { - let visible = await automator.isPermissionDialogVisible( - timeout: TimeInterval(request.timeoutMillis / 1000) - ) - - return Patrol_PermissionDialogVisibleResponse.with { - $0.visible = visible + request: PermissionDialogVisibleRequest + ) async throws -> PermissionDialogVisibleResponse { + return try await runCatching { + let visible = await automator.isPermissionDialogVisible( + timeout: TimeInterval(request.timeoutMillis / 1000) + ) + + return PermissionDialogVisibleResponse(visible: visible) + } - } } - - func handlePermissionDialog( - request: Patrol_HandlePermissionRequest, - context: GRPCAsyncServerCallContext - ) async throws -> DefaultResponse { - return try await runCatching { - switch request.code { - case .whileUsing: - try await automator.allowPermissionWhileUsingApp() - case .onlyThisTime: - try await automator.allowPermissionOnce() - case .denied: - try await automator.denyPermission() - case .UNRECOGNIZED: - throw PatrolError.internal("handlePermissionDialog(): bad permission code") + + func handlePermissionDialog(request: HandlePermissionRequest) async throws { + return try await runCatching { + switch request.code { + case .whileUsing: + try await automator.allowPermissionWhileUsingApp() + case .onlyThisTime: + try await automator.allowPermissionOnce() + case .denied: + try await automator.denyPermission() + } } - - return DefaultResponse() - } } - - func setLocationAccuracy( - request: Patrol_SetLocationAccuracyRequest, - context: GRPCAsyncServerCallContext - ) async throws -> DefaultResponse { - return try await runCatching { - switch request.locationAccuracy { - case .coarse: - try await automator.selectCoarseLocation() - case .fine: - try await automator.selectFineLocation() - case .UNRECOGNIZED: - throw PatrolError.internal("unrecognized location accuracy") + + func setLocationAccuracy(request: SetLocationAccuracyRequest) async throws { + return try await runCatching { + switch request.locationAccuracy { + case .coarse: + try await automator.selectCoarseLocation() + case .fine: + try await automator.selectFineLocation() + } } - - return DefaultResponse() - } } - - func debug( - request: Empty, - context: GRPCAsyncServerCallContext - ) async throws -> DefaultResponse { - return try await runCatching { - try await automator.debug() - return DefaultResponse() - } + + func debug() async throws { + return try await runCatching { + try await automator.debug() + } } - + private func runCatching(_ block: () async throws -> T) async throws -> T { - // TODO: Use an interceptor (like on Android) - // See: https://github.com/grpc/grpc-swift/issues/1148 - do { - return try await block() - } catch let err as PatrolError { - Logger.shared.e(err.description) - throw err - } catch let err { - throw PatrolError.unknown(err) - } + // TODO: Use an interceptor (like on Android) + // See: https://github.com/grpc/grpc-swift/issues/1148 + do { + return try await block() + } catch let err as PatrolError { + Logger.shared.e(err.description) + throw err + } catch let err { + throw PatrolError.unknown(err) + } } - - func markPatrolAppServiceReady( - request: Patrol_Empty, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_Empty { - onAppReady(true) - return Empty() - } - } + + func markPatrolAppServiceReady() async throws { + onAppReady(true) + } +} #endif diff --git a/packages/patrol/ios/Classes/AutomatorServer/Errors.swift b/packages/patrol/ios/Classes/AutomatorServer/Errors.swift index e4b2ef7e7..e75ac9978 100644 --- a/packages/patrol/ios/Classes/AutomatorServer/Errors.swift +++ b/packages/patrol/ios/Classes/AutomatorServer/Errors.swift @@ -1,5 +1,3 @@ -import GRPC - enum PatrolError: Error { case viewNotExists(_ elementDescription: String) case appNotInstalled(_ bundleId: String) @@ -8,7 +6,7 @@ enum PatrolError: Error { case unknown(_ error: Error) } -extension PatrolError: CustomStringConvertible, GRPCStatusTransformable { +extension PatrolError: CustomStringConvertible { var description: String { switch self { case .viewNotExists(let elementDescription): @@ -23,19 +21,6 @@ extension PatrolError: CustomStringConvertible, GRPCStatusTransformable { return "\(err)" } } - - func makeGRPCStatus() -> GRPC.GRPCStatus { - switch self { - case .viewNotExists, .appNotInstalled: - return GRPCStatus(code: .notFound, message: self.description) - case .methodNotImplemented: - return GRPCStatus(code: .unimplemented, message: self.description) - case .internal: - return GRPCStatus(code: .internalError, message: self.description) - case .unknown(let err): - return GRPCStatus(code: .unknown, message: "unknown error: \(err)") - } - } } extension String.StringInterpolation { diff --git a/packages/patrol/ios/Classes/AutomatorServer/contracts.grpc.swift b/packages/patrol/ios/Classes/AutomatorServer/contracts.grpc.swift deleted file mode 100644 index 6b57213fb..000000000 --- a/packages/patrol/ios/Classes/AutomatorServer/contracts.grpc.swift +++ /dev/null @@ -1,3547 +0,0 @@ -// -// DO NOT EDIT. -// swift-format-ignore-file -// -// Generated by the protocol buffer compiler. -// Source: contracts.proto -// -import GRPC -import NIO -import NIOConcurrencyHelpers -import SwiftProtobuf - - -/// Usage: instantiate `Patrol_NativeAutomatorClient`, then call methods of this protocol to make API calls. -internal protocol Patrol_NativeAutomatorClientProtocol: GRPCClient { - var serviceName: String { get } - var interceptors: Patrol_NativeAutomatorClientInterceptorFactoryProtocol? { get } - - func initialize( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> UnaryCall - - func configure( - _ request: Patrol_ConfigureRequest, - callOptions: CallOptions? - ) -> UnaryCall - - func pressHome( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> UnaryCall - - func pressBack( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> UnaryCall - - func pressRecentApps( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> UnaryCall - - func doublePressRecentApps( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> UnaryCall - - func openApp( - _ request: Patrol_OpenAppRequest, - callOptions: CallOptions? - ) -> UnaryCall - - func openQuickSettings( - _ request: Patrol_OpenQuickSettingsRequest, - callOptions: CallOptions? - ) -> UnaryCall - - func getNativeViews( - _ request: Patrol_GetNativeViewsRequest, - callOptions: CallOptions? - ) -> UnaryCall - - func tap( - _ request: Patrol_TapRequest, - callOptions: CallOptions? - ) -> UnaryCall - - func doubleTap( - _ request: Patrol_TapRequest, - callOptions: CallOptions? - ) -> UnaryCall - - func enterText( - _ request: Patrol_EnterTextRequest, - callOptions: CallOptions? - ) -> UnaryCall - - func swipe( - _ request: Patrol_SwipeRequest, - callOptions: CallOptions? - ) -> UnaryCall - - func waitUntilVisible( - _ request: Patrol_WaitUntilVisibleRequest, - callOptions: CallOptions? - ) -> UnaryCall - - func enableAirplaneMode( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> UnaryCall - - func disableAirplaneMode( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> UnaryCall - - func enableWiFi( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> UnaryCall - - func disableWiFi( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> UnaryCall - - func enableCellular( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> UnaryCall - - func disableCellular( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> UnaryCall - - func enableBluetooth( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> UnaryCall - - func disableBluetooth( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> UnaryCall - - func enableDarkMode( - _ request: Patrol_DarkModeRequest, - callOptions: CallOptions? - ) -> UnaryCall - - func disableDarkMode( - _ request: Patrol_DarkModeRequest, - callOptions: CallOptions? - ) -> UnaryCall - - func openNotifications( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> UnaryCall - - func closeNotifications( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> UnaryCall - - func closeHeadsUpNotification( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> UnaryCall - - func getNotifications( - _ request: Patrol_GetNotificationsRequest, - callOptions: CallOptions? - ) -> UnaryCall - - func tapOnNotification( - _ request: Patrol_TapOnNotificationRequest, - callOptions: CallOptions? - ) -> UnaryCall - - func isPermissionDialogVisible( - _ request: Patrol_PermissionDialogVisibleRequest, - callOptions: CallOptions? - ) -> UnaryCall - - func handlePermissionDialog( - _ request: Patrol_HandlePermissionRequest, - callOptions: CallOptions? - ) -> UnaryCall - - func setLocationAccuracy( - _ request: Patrol_SetLocationAccuracyRequest, - callOptions: CallOptions? - ) -> UnaryCall - - func debug( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> UnaryCall - - func markPatrolAppServiceReady( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> UnaryCall -} - -extension Patrol_NativeAutomatorClientProtocol { - internal var serviceName: String { - return "patrol.NativeAutomator" - } - - /// Unary call to initialize - /// - /// - Parameters: - /// - request: Request to send to initialize. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func initialize( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.initialize.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeinitializeInterceptors() ?? [] - ) - } - - /// Unary call to configure - /// - /// - Parameters: - /// - request: Request to send to configure. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func configure( - _ request: Patrol_ConfigureRequest, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.configure.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeconfigureInterceptors() ?? [] - ) - } - - /// general - /// - /// - Parameters: - /// - request: Request to send to pressHome. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func pressHome( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.pressHome.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makepressHomeInterceptors() ?? [] - ) - } - - /// Unary call to pressBack - /// - /// - Parameters: - /// - request: Request to send to pressBack. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func pressBack( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.pressBack.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makepressBackInterceptors() ?? [] - ) - } - - /// Unary call to pressRecentApps - /// - /// - Parameters: - /// - request: Request to send to pressRecentApps. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func pressRecentApps( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.pressRecentApps.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makepressRecentAppsInterceptors() ?? [] - ) - } - - /// Unary call to doublePressRecentApps - /// - /// - Parameters: - /// - request: Request to send to doublePressRecentApps. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func doublePressRecentApps( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.doublePressRecentApps.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedoublePressRecentAppsInterceptors() ?? [] - ) - } - - /// Unary call to openApp - /// - /// - Parameters: - /// - request: Request to send to openApp. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func openApp( - _ request: Patrol_OpenAppRequest, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.openApp.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeopenAppInterceptors() ?? [] - ) - } - - /// Unary call to openQuickSettings - /// - /// - Parameters: - /// - request: Request to send to openQuickSettings. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func openQuickSettings( - _ request: Patrol_OpenQuickSettingsRequest, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.openQuickSettings.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeopenQuickSettingsInterceptors() ?? [] - ) - } - - /// general UI interaction - /// - /// - Parameters: - /// - request: Request to send to getNativeViews. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func getNativeViews( - _ request: Patrol_GetNativeViewsRequest, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.getNativeViews.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makegetNativeViewsInterceptors() ?? [] - ) - } - - /// Unary call to tap - /// - /// - Parameters: - /// - request: Request to send to tap. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func tap( - _ request: Patrol_TapRequest, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.tap.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.maketapInterceptors() ?? [] - ) - } - - /// Unary call to doubleTap - /// - /// - Parameters: - /// - request: Request to send to doubleTap. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func doubleTap( - _ request: Patrol_TapRequest, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.doubleTap.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedoubleTapInterceptors() ?? [] - ) - } - - /// Unary call to enterText - /// - /// - Parameters: - /// - request: Request to send to enterText. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func enterText( - _ request: Patrol_EnterTextRequest, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.enterText.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeenterTextInterceptors() ?? [] - ) - } - - /// Unary call to swipe - /// - /// - Parameters: - /// - request: Request to send to swipe. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func swipe( - _ request: Patrol_SwipeRequest, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.swipe.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeswipeInterceptors() ?? [] - ) - } - - /// Unary call to waitUntilVisible - /// - /// - Parameters: - /// - request: Request to send to waitUntilVisible. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func waitUntilVisible( - _ request: Patrol_WaitUntilVisibleRequest, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.waitUntilVisible.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makewaitUntilVisibleInterceptors() ?? [] - ) - } - - /// services - /// - /// - Parameters: - /// - request: Request to send to enableAirplaneMode. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func enableAirplaneMode( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.enableAirplaneMode.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeenableAirplaneModeInterceptors() ?? [] - ) - } - - /// Unary call to disableAirplaneMode - /// - /// - Parameters: - /// - request: Request to send to disableAirplaneMode. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func disableAirplaneMode( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.disableAirplaneMode.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedisableAirplaneModeInterceptors() ?? [] - ) - } - - /// Unary call to enableWiFi - /// - /// - Parameters: - /// - request: Request to send to enableWiFi. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func enableWiFi( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.enableWiFi.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeenableWiFiInterceptors() ?? [] - ) - } - - /// Unary call to disableWiFi - /// - /// - Parameters: - /// - request: Request to send to disableWiFi. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func disableWiFi( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.disableWiFi.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedisableWiFiInterceptors() ?? [] - ) - } - - /// Unary call to enableCellular - /// - /// - Parameters: - /// - request: Request to send to enableCellular. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func enableCellular( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.enableCellular.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeenableCellularInterceptors() ?? [] - ) - } - - /// Unary call to disableCellular - /// - /// - Parameters: - /// - request: Request to send to disableCellular. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func disableCellular( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.disableCellular.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedisableCellularInterceptors() ?? [] - ) - } - - /// Unary call to enableBluetooth - /// - /// - Parameters: - /// - request: Request to send to enableBluetooth. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func enableBluetooth( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.enableBluetooth.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeenableBluetoothInterceptors() ?? [] - ) - } - - /// Unary call to disableBluetooth - /// - /// - Parameters: - /// - request: Request to send to disableBluetooth. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func disableBluetooth( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.disableBluetooth.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedisableBluetoothInterceptors() ?? [] - ) - } - - /// Unary call to enableDarkMode - /// - /// - Parameters: - /// - request: Request to send to enableDarkMode. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func enableDarkMode( - _ request: Patrol_DarkModeRequest, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.enableDarkMode.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeenableDarkModeInterceptors() ?? [] - ) - } - - /// Unary call to disableDarkMode - /// - /// - Parameters: - /// - request: Request to send to disableDarkMode. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func disableDarkMode( - _ request: Patrol_DarkModeRequest, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.disableDarkMode.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedisableDarkModeInterceptors() ?? [] - ) - } - - /// notifications - /// - /// - Parameters: - /// - request: Request to send to openNotifications. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func openNotifications( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.openNotifications.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeopenNotificationsInterceptors() ?? [] - ) - } - - /// Unary call to closeNotifications - /// - /// - Parameters: - /// - request: Request to send to closeNotifications. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func closeNotifications( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.closeNotifications.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makecloseNotificationsInterceptors() ?? [] - ) - } - - /// Unary call to closeHeadsUpNotification - /// - /// - Parameters: - /// - request: Request to send to closeHeadsUpNotification. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func closeHeadsUpNotification( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.closeHeadsUpNotification.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makecloseHeadsUpNotificationInterceptors() ?? [] - ) - } - - /// Unary call to getNotifications - /// - /// - Parameters: - /// - request: Request to send to getNotifications. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func getNotifications( - _ request: Patrol_GetNotificationsRequest, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.getNotifications.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makegetNotificationsInterceptors() ?? [] - ) - } - - /// Unary call to tapOnNotification - /// - /// - Parameters: - /// - request: Request to send to tapOnNotification. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func tapOnNotification( - _ request: Patrol_TapOnNotificationRequest, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.tapOnNotification.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.maketapOnNotificationInterceptors() ?? [] - ) - } - - /// permissions - /// - /// - Parameters: - /// - request: Request to send to isPermissionDialogVisible. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func isPermissionDialogVisible( - _ request: Patrol_PermissionDialogVisibleRequest, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.isPermissionDialogVisible.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeisPermissionDialogVisibleInterceptors() ?? [] - ) - } - - /// Unary call to handlePermissionDialog - /// - /// - Parameters: - /// - request: Request to send to handlePermissionDialog. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func handlePermissionDialog( - _ request: Patrol_HandlePermissionRequest, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.handlePermissionDialog.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makehandlePermissionDialogInterceptors() ?? [] - ) - } - - /// Unary call to setLocationAccuracy - /// - /// - Parameters: - /// - request: Request to send to setLocationAccuracy. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func setLocationAccuracy( - _ request: Patrol_SetLocationAccuracyRequest, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.setLocationAccuracy.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makesetLocationAccuracyInterceptors() ?? [] - ) - } - - /// other - /// - /// - Parameters: - /// - request: Request to send to debug. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func debug( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.debug.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedebugInterceptors() ?? [] - ) - } - - /// TODO(bartekpacia): Move this RPC into a new PatrolNativeTestService service because it doesn't fit here - /// - /// - Parameters: - /// - request: Request to send to markPatrolAppServiceReady. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func markPatrolAppServiceReady( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.markPatrolAppServiceReady.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makemarkPatrolAppServiceReadyInterceptors() ?? [] - ) - } -} - -@available(*, deprecated) -extension Patrol_NativeAutomatorClient: @unchecked Sendable {} - -@available(*, deprecated, renamed: "Patrol_NativeAutomatorNIOClient") -internal final class Patrol_NativeAutomatorClient: Patrol_NativeAutomatorClientProtocol { - private let lock = Lock() - private var _defaultCallOptions: CallOptions - private var _interceptors: Patrol_NativeAutomatorClientInterceptorFactoryProtocol? - internal let channel: GRPCChannel - internal var defaultCallOptions: CallOptions { - get { self.lock.withLock { return self._defaultCallOptions } } - set { self.lock.withLockVoid { self._defaultCallOptions = newValue } } - } - internal var interceptors: Patrol_NativeAutomatorClientInterceptorFactoryProtocol? { - get { self.lock.withLock { return self._interceptors } } - set { self.lock.withLockVoid { self._interceptors = newValue } } - } - - /// Creates a client for the patrol.NativeAutomator service. - /// - /// - Parameters: - /// - channel: `GRPCChannel` to the service host. - /// - defaultCallOptions: Options to use for each service call if the user doesn't provide them. - /// - interceptors: A factory providing interceptors for each RPC. - internal init( - channel: GRPCChannel, - defaultCallOptions: CallOptions = CallOptions(), - interceptors: Patrol_NativeAutomatorClientInterceptorFactoryProtocol? = nil - ) { - self.channel = channel - self._defaultCallOptions = defaultCallOptions - self._interceptors = interceptors - } -} - -internal struct Patrol_NativeAutomatorNIOClient: Patrol_NativeAutomatorClientProtocol { - internal var channel: GRPCChannel - internal var defaultCallOptions: CallOptions - internal var interceptors: Patrol_NativeAutomatorClientInterceptorFactoryProtocol? - - /// Creates a client for the patrol.NativeAutomator service. - /// - /// - Parameters: - /// - channel: `GRPCChannel` to the service host. - /// - defaultCallOptions: Options to use for each service call if the user doesn't provide them. - /// - interceptors: A factory providing interceptors for each RPC. - internal init( - channel: GRPCChannel, - defaultCallOptions: CallOptions = CallOptions(), - interceptors: Patrol_NativeAutomatorClientInterceptorFactoryProtocol? = nil - ) { - self.channel = channel - self.defaultCallOptions = defaultCallOptions - self.interceptors = interceptors - } -} - -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -internal protocol Patrol_NativeAutomatorAsyncClientProtocol: GRPCClient { - static var serviceDescriptor: GRPCServiceDescriptor { get } - var interceptors: Patrol_NativeAutomatorClientInterceptorFactoryProtocol? { get } - - func makeInitializeCall( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeConfigureCall( - _ request: Patrol_ConfigureRequest, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makePressHomeCall( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makePressBackCall( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makePressRecentAppsCall( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeDoublePressRecentAppsCall( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeOpenAppCall( - _ request: Patrol_OpenAppRequest, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeOpenQuickSettingsCall( - _ request: Patrol_OpenQuickSettingsRequest, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeGetNativeViewsCall( - _ request: Patrol_GetNativeViewsRequest, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeTapCall( - _ request: Patrol_TapRequest, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeDoubleTapCall( - _ request: Patrol_TapRequest, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeEnterTextCall( - _ request: Patrol_EnterTextRequest, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeSwipeCall( - _ request: Patrol_SwipeRequest, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeWaitUntilVisibleCall( - _ request: Patrol_WaitUntilVisibleRequest, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeEnableAirplaneModeCall( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeDisableAirplaneModeCall( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeEnableWiFiCall( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeDisableWiFiCall( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeEnableCellularCall( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeDisableCellularCall( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeEnableBluetoothCall( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeDisableBluetoothCall( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeEnableDarkModeCall( - _ request: Patrol_DarkModeRequest, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeDisableDarkModeCall( - _ request: Patrol_DarkModeRequest, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeOpenNotificationsCall( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeCloseNotificationsCall( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeCloseHeadsUpNotificationCall( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeGetNotificationsCall( - _ request: Patrol_GetNotificationsRequest, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeTapOnNotificationCall( - _ request: Patrol_TapOnNotificationRequest, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeIsPermissionDialogVisibleCall( - _ request: Patrol_PermissionDialogVisibleRequest, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeHandlePermissionDialogCall( - _ request: Patrol_HandlePermissionRequest, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeSetLocationAccuracyCall( - _ request: Patrol_SetLocationAccuracyRequest, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeDebugCall( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeMarkPatrolAppServiceReadyCall( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall -} - -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -extension Patrol_NativeAutomatorAsyncClientProtocol { - internal static var serviceDescriptor: GRPCServiceDescriptor { - return Patrol_NativeAutomatorClientMetadata.serviceDescriptor - } - - internal var interceptors: Patrol_NativeAutomatorClientInterceptorFactoryProtocol? { - return nil - } - - internal func makeInitializeCall( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.initialize.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeinitializeInterceptors() ?? [] - ) - } - - internal func makeConfigureCall( - _ request: Patrol_ConfigureRequest, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.configure.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeconfigureInterceptors() ?? [] - ) - } - - internal func makePressHomeCall( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.pressHome.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makepressHomeInterceptors() ?? [] - ) - } - - internal func makePressBackCall( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.pressBack.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makepressBackInterceptors() ?? [] - ) - } - - internal func makePressRecentAppsCall( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.pressRecentApps.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makepressRecentAppsInterceptors() ?? [] - ) - } - - internal func makeDoublePressRecentAppsCall( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.doublePressRecentApps.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedoublePressRecentAppsInterceptors() ?? [] - ) - } - - internal func makeOpenAppCall( - _ request: Patrol_OpenAppRequest, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.openApp.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeopenAppInterceptors() ?? [] - ) - } - - internal func makeOpenQuickSettingsCall( - _ request: Patrol_OpenQuickSettingsRequest, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.openQuickSettings.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeopenQuickSettingsInterceptors() ?? [] - ) - } - - internal func makeGetNativeViewsCall( - _ request: Patrol_GetNativeViewsRequest, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.getNativeViews.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makegetNativeViewsInterceptors() ?? [] - ) - } - - internal func makeTapCall( - _ request: Patrol_TapRequest, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.tap.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.maketapInterceptors() ?? [] - ) - } - - internal func makeDoubleTapCall( - _ request: Patrol_TapRequest, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.doubleTap.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedoubleTapInterceptors() ?? [] - ) - } - - internal func makeEnterTextCall( - _ request: Patrol_EnterTextRequest, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.enterText.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeenterTextInterceptors() ?? [] - ) - } - - internal func makeSwipeCall( - _ request: Patrol_SwipeRequest, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.swipe.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeswipeInterceptors() ?? [] - ) - } - - internal func makeWaitUntilVisibleCall( - _ request: Patrol_WaitUntilVisibleRequest, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.waitUntilVisible.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makewaitUntilVisibleInterceptors() ?? [] - ) - } - - internal func makeEnableAirplaneModeCall( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.enableAirplaneMode.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeenableAirplaneModeInterceptors() ?? [] - ) - } - - internal func makeDisableAirplaneModeCall( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.disableAirplaneMode.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedisableAirplaneModeInterceptors() ?? [] - ) - } - - internal func makeEnableWiFiCall( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.enableWiFi.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeenableWiFiInterceptors() ?? [] - ) - } - - internal func makeDisableWiFiCall( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.disableWiFi.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedisableWiFiInterceptors() ?? [] - ) - } - - internal func makeEnableCellularCall( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.enableCellular.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeenableCellularInterceptors() ?? [] - ) - } - - internal func makeDisableCellularCall( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.disableCellular.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedisableCellularInterceptors() ?? [] - ) - } - - internal func makeEnableBluetoothCall( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.enableBluetooth.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeenableBluetoothInterceptors() ?? [] - ) - } - - internal func makeDisableBluetoothCall( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.disableBluetooth.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedisableBluetoothInterceptors() ?? [] - ) - } - - internal func makeEnableDarkModeCall( - _ request: Patrol_DarkModeRequest, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.enableDarkMode.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeenableDarkModeInterceptors() ?? [] - ) - } - - internal func makeDisableDarkModeCall( - _ request: Patrol_DarkModeRequest, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.disableDarkMode.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedisableDarkModeInterceptors() ?? [] - ) - } - - internal func makeOpenNotificationsCall( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.openNotifications.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeopenNotificationsInterceptors() ?? [] - ) - } - - internal func makeCloseNotificationsCall( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.closeNotifications.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makecloseNotificationsInterceptors() ?? [] - ) - } - - internal func makeCloseHeadsUpNotificationCall( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.closeHeadsUpNotification.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makecloseHeadsUpNotificationInterceptors() ?? [] - ) - } - - internal func makeGetNotificationsCall( - _ request: Patrol_GetNotificationsRequest, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.getNotifications.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makegetNotificationsInterceptors() ?? [] - ) - } - - internal func makeTapOnNotificationCall( - _ request: Patrol_TapOnNotificationRequest, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.tapOnNotification.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.maketapOnNotificationInterceptors() ?? [] - ) - } - - internal func makeIsPermissionDialogVisibleCall( - _ request: Patrol_PermissionDialogVisibleRequest, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.isPermissionDialogVisible.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeisPermissionDialogVisibleInterceptors() ?? [] - ) - } - - internal func makeHandlePermissionDialogCall( - _ request: Patrol_HandlePermissionRequest, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.handlePermissionDialog.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makehandlePermissionDialogInterceptors() ?? [] - ) - } - - internal func makeSetLocationAccuracyCall( - _ request: Patrol_SetLocationAccuracyRequest, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.setLocationAccuracy.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makesetLocationAccuracyInterceptors() ?? [] - ) - } - - internal func makeDebugCall( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.debug.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedebugInterceptors() ?? [] - ) - } - - internal func makeMarkPatrolAppServiceReadyCall( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.markPatrolAppServiceReady.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makemarkPatrolAppServiceReadyInterceptors() ?? [] - ) - } -} - -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -extension Patrol_NativeAutomatorAsyncClientProtocol { - internal func initialize( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) async throws -> Patrol_Empty { - return try await self.performAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.initialize.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeinitializeInterceptors() ?? [] - ) - } - - internal func configure( - _ request: Patrol_ConfigureRequest, - callOptions: CallOptions? = nil - ) async throws -> Patrol_Empty { - return try await self.performAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.configure.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeconfigureInterceptors() ?? [] - ) - } - - internal func pressHome( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) async throws -> Patrol_Empty { - return try await self.performAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.pressHome.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makepressHomeInterceptors() ?? [] - ) - } - - internal func pressBack( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) async throws -> Patrol_Empty { - return try await self.performAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.pressBack.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makepressBackInterceptors() ?? [] - ) - } - - internal func pressRecentApps( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) async throws -> Patrol_Empty { - return try await self.performAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.pressRecentApps.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makepressRecentAppsInterceptors() ?? [] - ) - } - - internal func doublePressRecentApps( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) async throws -> Patrol_Empty { - return try await self.performAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.doublePressRecentApps.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedoublePressRecentAppsInterceptors() ?? [] - ) - } - - internal func openApp( - _ request: Patrol_OpenAppRequest, - callOptions: CallOptions? = nil - ) async throws -> Patrol_Empty { - return try await self.performAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.openApp.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeopenAppInterceptors() ?? [] - ) - } - - internal func openQuickSettings( - _ request: Patrol_OpenQuickSettingsRequest, - callOptions: CallOptions? = nil - ) async throws -> Patrol_Empty { - return try await self.performAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.openQuickSettings.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeopenQuickSettingsInterceptors() ?? [] - ) - } - - internal func getNativeViews( - _ request: Patrol_GetNativeViewsRequest, - callOptions: CallOptions? = nil - ) async throws -> Patrol_GetNativeViewsResponse { - return try await self.performAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.getNativeViews.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makegetNativeViewsInterceptors() ?? [] - ) - } - - internal func tap( - _ request: Patrol_TapRequest, - callOptions: CallOptions? = nil - ) async throws -> Patrol_Empty { - return try await self.performAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.tap.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.maketapInterceptors() ?? [] - ) - } - - internal func doubleTap( - _ request: Patrol_TapRequest, - callOptions: CallOptions? = nil - ) async throws -> Patrol_Empty { - return try await self.performAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.doubleTap.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedoubleTapInterceptors() ?? [] - ) - } - - internal func enterText( - _ request: Patrol_EnterTextRequest, - callOptions: CallOptions? = nil - ) async throws -> Patrol_Empty { - return try await self.performAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.enterText.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeenterTextInterceptors() ?? [] - ) - } - - internal func swipe( - _ request: Patrol_SwipeRequest, - callOptions: CallOptions? = nil - ) async throws -> Patrol_Empty { - return try await self.performAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.swipe.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeswipeInterceptors() ?? [] - ) - } - - internal func waitUntilVisible( - _ request: Patrol_WaitUntilVisibleRequest, - callOptions: CallOptions? = nil - ) async throws -> Patrol_Empty { - return try await self.performAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.waitUntilVisible.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makewaitUntilVisibleInterceptors() ?? [] - ) - } - - internal func enableAirplaneMode( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) async throws -> Patrol_Empty { - return try await self.performAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.enableAirplaneMode.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeenableAirplaneModeInterceptors() ?? [] - ) - } - - internal func disableAirplaneMode( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) async throws -> Patrol_Empty { - return try await self.performAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.disableAirplaneMode.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedisableAirplaneModeInterceptors() ?? [] - ) - } - - internal func enableWiFi( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) async throws -> Patrol_Empty { - return try await self.performAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.enableWiFi.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeenableWiFiInterceptors() ?? [] - ) - } - - internal func disableWiFi( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) async throws -> Patrol_Empty { - return try await self.performAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.disableWiFi.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedisableWiFiInterceptors() ?? [] - ) - } - - internal func enableCellular( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) async throws -> Patrol_Empty { - return try await self.performAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.enableCellular.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeenableCellularInterceptors() ?? [] - ) - } - - internal func disableCellular( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) async throws -> Patrol_Empty { - return try await self.performAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.disableCellular.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedisableCellularInterceptors() ?? [] - ) - } - - internal func enableBluetooth( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) async throws -> Patrol_Empty { - return try await self.performAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.enableBluetooth.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeenableBluetoothInterceptors() ?? [] - ) - } - - internal func disableBluetooth( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) async throws -> Patrol_Empty { - return try await self.performAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.disableBluetooth.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedisableBluetoothInterceptors() ?? [] - ) - } - - internal func enableDarkMode( - _ request: Patrol_DarkModeRequest, - callOptions: CallOptions? = nil - ) async throws -> Patrol_Empty { - return try await self.performAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.enableDarkMode.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeenableDarkModeInterceptors() ?? [] - ) - } - - internal func disableDarkMode( - _ request: Patrol_DarkModeRequest, - callOptions: CallOptions? = nil - ) async throws -> Patrol_Empty { - return try await self.performAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.disableDarkMode.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedisableDarkModeInterceptors() ?? [] - ) - } - - internal func openNotifications( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) async throws -> Patrol_Empty { - return try await self.performAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.openNotifications.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeopenNotificationsInterceptors() ?? [] - ) - } - - internal func closeNotifications( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) async throws -> Patrol_Empty { - return try await self.performAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.closeNotifications.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makecloseNotificationsInterceptors() ?? [] - ) - } - - internal func closeHeadsUpNotification( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) async throws -> Patrol_Empty { - return try await self.performAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.closeHeadsUpNotification.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makecloseHeadsUpNotificationInterceptors() ?? [] - ) - } - - internal func getNotifications( - _ request: Patrol_GetNotificationsRequest, - callOptions: CallOptions? = nil - ) async throws -> Patrol_GetNotificationsResponse { - return try await self.performAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.getNotifications.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makegetNotificationsInterceptors() ?? [] - ) - } - - internal func tapOnNotification( - _ request: Patrol_TapOnNotificationRequest, - callOptions: CallOptions? = nil - ) async throws -> Patrol_Empty { - return try await self.performAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.tapOnNotification.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.maketapOnNotificationInterceptors() ?? [] - ) - } - - internal func isPermissionDialogVisible( - _ request: Patrol_PermissionDialogVisibleRequest, - callOptions: CallOptions? = nil - ) async throws -> Patrol_PermissionDialogVisibleResponse { - return try await self.performAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.isPermissionDialogVisible.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeisPermissionDialogVisibleInterceptors() ?? [] - ) - } - - internal func handlePermissionDialog( - _ request: Patrol_HandlePermissionRequest, - callOptions: CallOptions? = nil - ) async throws -> Patrol_Empty { - return try await self.performAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.handlePermissionDialog.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makehandlePermissionDialogInterceptors() ?? [] - ) - } - - internal func setLocationAccuracy( - _ request: Patrol_SetLocationAccuracyRequest, - callOptions: CallOptions? = nil - ) async throws -> Patrol_Empty { - return try await self.performAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.setLocationAccuracy.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makesetLocationAccuracyInterceptors() ?? [] - ) - } - - internal func debug( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) async throws -> Patrol_Empty { - return try await self.performAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.debug.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedebugInterceptors() ?? [] - ) - } - - internal func markPatrolAppServiceReady( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) async throws -> Patrol_Empty { - return try await self.performAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.markPatrolAppServiceReady.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makemarkPatrolAppServiceReadyInterceptors() ?? [] - ) - } -} - -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -internal struct Patrol_NativeAutomatorAsyncClient: Patrol_NativeAutomatorAsyncClientProtocol { - internal var channel: GRPCChannel - internal var defaultCallOptions: CallOptions - internal var interceptors: Patrol_NativeAutomatorClientInterceptorFactoryProtocol? - - internal init( - channel: GRPCChannel, - defaultCallOptions: CallOptions = CallOptions(), - interceptors: Patrol_NativeAutomatorClientInterceptorFactoryProtocol? = nil - ) { - self.channel = channel - self.defaultCallOptions = defaultCallOptions - self.interceptors = interceptors - } -} - -internal protocol Patrol_NativeAutomatorClientInterceptorFactoryProtocol: Sendable { - - /// - Returns: Interceptors to use when invoking 'initialize'. - func makeinitializeInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'configure'. - func makeconfigureInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'pressHome'. - func makepressHomeInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'pressBack'. - func makepressBackInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'pressRecentApps'. - func makepressRecentAppsInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'doublePressRecentApps'. - func makedoublePressRecentAppsInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'openApp'. - func makeopenAppInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'openQuickSettings'. - func makeopenQuickSettingsInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'getNativeViews'. - func makegetNativeViewsInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'tap'. - func maketapInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'doubleTap'. - func makedoubleTapInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'enterText'. - func makeenterTextInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'swipe'. - func makeswipeInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'waitUntilVisible'. - func makewaitUntilVisibleInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'enableAirplaneMode'. - func makeenableAirplaneModeInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'disableAirplaneMode'. - func makedisableAirplaneModeInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'enableWiFi'. - func makeenableWiFiInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'disableWiFi'. - func makedisableWiFiInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'enableCellular'. - func makeenableCellularInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'disableCellular'. - func makedisableCellularInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'enableBluetooth'. - func makeenableBluetoothInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'disableBluetooth'. - func makedisableBluetoothInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'enableDarkMode'. - func makeenableDarkModeInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'disableDarkMode'. - func makedisableDarkModeInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'openNotifications'. - func makeopenNotificationsInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'closeNotifications'. - func makecloseNotificationsInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'closeHeadsUpNotification'. - func makecloseHeadsUpNotificationInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'getNotifications'. - func makegetNotificationsInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'tapOnNotification'. - func maketapOnNotificationInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'isPermissionDialogVisible'. - func makeisPermissionDialogVisibleInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'handlePermissionDialog'. - func makehandlePermissionDialogInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'setLocationAccuracy'. - func makesetLocationAccuracyInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'debug'. - func makedebugInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'markPatrolAppServiceReady'. - func makemarkPatrolAppServiceReadyInterceptors() -> [ClientInterceptor] -} - -internal enum Patrol_NativeAutomatorClientMetadata { - internal static let serviceDescriptor = GRPCServiceDescriptor( - name: "NativeAutomator", - fullName: "patrol.NativeAutomator", - methods: [ - Patrol_NativeAutomatorClientMetadata.Methods.initialize, - Patrol_NativeAutomatorClientMetadata.Methods.configure, - Patrol_NativeAutomatorClientMetadata.Methods.pressHome, - Patrol_NativeAutomatorClientMetadata.Methods.pressBack, - Patrol_NativeAutomatorClientMetadata.Methods.pressRecentApps, - Patrol_NativeAutomatorClientMetadata.Methods.doublePressRecentApps, - Patrol_NativeAutomatorClientMetadata.Methods.openApp, - Patrol_NativeAutomatorClientMetadata.Methods.openQuickSettings, - Patrol_NativeAutomatorClientMetadata.Methods.getNativeViews, - Patrol_NativeAutomatorClientMetadata.Methods.tap, - Patrol_NativeAutomatorClientMetadata.Methods.doubleTap, - Patrol_NativeAutomatorClientMetadata.Methods.enterText, - Patrol_NativeAutomatorClientMetadata.Methods.swipe, - Patrol_NativeAutomatorClientMetadata.Methods.waitUntilVisible, - Patrol_NativeAutomatorClientMetadata.Methods.enableAirplaneMode, - Patrol_NativeAutomatorClientMetadata.Methods.disableAirplaneMode, - Patrol_NativeAutomatorClientMetadata.Methods.enableWiFi, - Patrol_NativeAutomatorClientMetadata.Methods.disableWiFi, - Patrol_NativeAutomatorClientMetadata.Methods.enableCellular, - Patrol_NativeAutomatorClientMetadata.Methods.disableCellular, - Patrol_NativeAutomatorClientMetadata.Methods.enableBluetooth, - Patrol_NativeAutomatorClientMetadata.Methods.disableBluetooth, - Patrol_NativeAutomatorClientMetadata.Methods.enableDarkMode, - Patrol_NativeAutomatorClientMetadata.Methods.disableDarkMode, - Patrol_NativeAutomatorClientMetadata.Methods.openNotifications, - Patrol_NativeAutomatorClientMetadata.Methods.closeNotifications, - Patrol_NativeAutomatorClientMetadata.Methods.closeHeadsUpNotification, - Patrol_NativeAutomatorClientMetadata.Methods.getNotifications, - Patrol_NativeAutomatorClientMetadata.Methods.tapOnNotification, - Patrol_NativeAutomatorClientMetadata.Methods.isPermissionDialogVisible, - Patrol_NativeAutomatorClientMetadata.Methods.handlePermissionDialog, - Patrol_NativeAutomatorClientMetadata.Methods.setLocationAccuracy, - Patrol_NativeAutomatorClientMetadata.Methods.debug, - Patrol_NativeAutomatorClientMetadata.Methods.markPatrolAppServiceReady, - ] - ) - - internal enum Methods { - internal static let initialize = GRPCMethodDescriptor( - name: "initialize", - path: "/patrol.NativeAutomator/initialize", - type: GRPCCallType.unary - ) - - internal static let configure = GRPCMethodDescriptor( - name: "configure", - path: "/patrol.NativeAutomator/configure", - type: GRPCCallType.unary - ) - - internal static let pressHome = GRPCMethodDescriptor( - name: "pressHome", - path: "/patrol.NativeAutomator/pressHome", - type: GRPCCallType.unary - ) - - internal static let pressBack = GRPCMethodDescriptor( - name: "pressBack", - path: "/patrol.NativeAutomator/pressBack", - type: GRPCCallType.unary - ) - - internal static let pressRecentApps = GRPCMethodDescriptor( - name: "pressRecentApps", - path: "/patrol.NativeAutomator/pressRecentApps", - type: GRPCCallType.unary - ) - - internal static let doublePressRecentApps = GRPCMethodDescriptor( - name: "doublePressRecentApps", - path: "/patrol.NativeAutomator/doublePressRecentApps", - type: GRPCCallType.unary - ) - - internal static let openApp = GRPCMethodDescriptor( - name: "openApp", - path: "/patrol.NativeAutomator/openApp", - type: GRPCCallType.unary - ) - - internal static let openQuickSettings = GRPCMethodDescriptor( - name: "openQuickSettings", - path: "/patrol.NativeAutomator/openQuickSettings", - type: GRPCCallType.unary - ) - - internal static let getNativeViews = GRPCMethodDescriptor( - name: "getNativeViews", - path: "/patrol.NativeAutomator/getNativeViews", - type: GRPCCallType.unary - ) - - internal static let tap = GRPCMethodDescriptor( - name: "tap", - path: "/patrol.NativeAutomator/tap", - type: GRPCCallType.unary - ) - - internal static let doubleTap = GRPCMethodDescriptor( - name: "doubleTap", - path: "/patrol.NativeAutomator/doubleTap", - type: GRPCCallType.unary - ) - - internal static let enterText = GRPCMethodDescriptor( - name: "enterText", - path: "/patrol.NativeAutomator/enterText", - type: GRPCCallType.unary - ) - - internal static let swipe = GRPCMethodDescriptor( - name: "swipe", - path: "/patrol.NativeAutomator/swipe", - type: GRPCCallType.unary - ) - - internal static let waitUntilVisible = GRPCMethodDescriptor( - name: "waitUntilVisible", - path: "/patrol.NativeAutomator/waitUntilVisible", - type: GRPCCallType.unary - ) - - internal static let enableAirplaneMode = GRPCMethodDescriptor( - name: "enableAirplaneMode", - path: "/patrol.NativeAutomator/enableAirplaneMode", - type: GRPCCallType.unary - ) - - internal static let disableAirplaneMode = GRPCMethodDescriptor( - name: "disableAirplaneMode", - path: "/patrol.NativeAutomator/disableAirplaneMode", - type: GRPCCallType.unary - ) - - internal static let enableWiFi = GRPCMethodDescriptor( - name: "enableWiFi", - path: "/patrol.NativeAutomator/enableWiFi", - type: GRPCCallType.unary - ) - - internal static let disableWiFi = GRPCMethodDescriptor( - name: "disableWiFi", - path: "/patrol.NativeAutomator/disableWiFi", - type: GRPCCallType.unary - ) - - internal static let enableCellular = GRPCMethodDescriptor( - name: "enableCellular", - path: "/patrol.NativeAutomator/enableCellular", - type: GRPCCallType.unary - ) - - internal static let disableCellular = GRPCMethodDescriptor( - name: "disableCellular", - path: "/patrol.NativeAutomator/disableCellular", - type: GRPCCallType.unary - ) - - internal static let enableBluetooth = GRPCMethodDescriptor( - name: "enableBluetooth", - path: "/patrol.NativeAutomator/enableBluetooth", - type: GRPCCallType.unary - ) - - internal static let disableBluetooth = GRPCMethodDescriptor( - name: "disableBluetooth", - path: "/patrol.NativeAutomator/disableBluetooth", - type: GRPCCallType.unary - ) - - internal static let enableDarkMode = GRPCMethodDescriptor( - name: "enableDarkMode", - path: "/patrol.NativeAutomator/enableDarkMode", - type: GRPCCallType.unary - ) - - internal static let disableDarkMode = GRPCMethodDescriptor( - name: "disableDarkMode", - path: "/patrol.NativeAutomator/disableDarkMode", - type: GRPCCallType.unary - ) - - internal static let openNotifications = GRPCMethodDescriptor( - name: "openNotifications", - path: "/patrol.NativeAutomator/openNotifications", - type: GRPCCallType.unary - ) - - internal static let closeNotifications = GRPCMethodDescriptor( - name: "closeNotifications", - path: "/patrol.NativeAutomator/closeNotifications", - type: GRPCCallType.unary - ) - - internal static let closeHeadsUpNotification = GRPCMethodDescriptor( - name: "closeHeadsUpNotification", - path: "/patrol.NativeAutomator/closeHeadsUpNotification", - type: GRPCCallType.unary - ) - - internal static let getNotifications = GRPCMethodDescriptor( - name: "getNotifications", - path: "/patrol.NativeAutomator/getNotifications", - type: GRPCCallType.unary - ) - - internal static let tapOnNotification = GRPCMethodDescriptor( - name: "tapOnNotification", - path: "/patrol.NativeAutomator/tapOnNotification", - type: GRPCCallType.unary - ) - - internal static let isPermissionDialogVisible = GRPCMethodDescriptor( - name: "isPermissionDialogVisible", - path: "/patrol.NativeAutomator/isPermissionDialogVisible", - type: GRPCCallType.unary - ) - - internal static let handlePermissionDialog = GRPCMethodDescriptor( - name: "handlePermissionDialog", - path: "/patrol.NativeAutomator/handlePermissionDialog", - type: GRPCCallType.unary - ) - - internal static let setLocationAccuracy = GRPCMethodDescriptor( - name: "setLocationAccuracy", - path: "/patrol.NativeAutomator/setLocationAccuracy", - type: GRPCCallType.unary - ) - - internal static let debug = GRPCMethodDescriptor( - name: "debug", - path: "/patrol.NativeAutomator/debug", - type: GRPCCallType.unary - ) - - internal static let markPatrolAppServiceReady = GRPCMethodDescriptor( - name: "markPatrolAppServiceReady", - path: "/patrol.NativeAutomator/markPatrolAppServiceReady", - type: GRPCCallType.unary - ) - } -} - -/// To build a server, implement a class that conforms to this protocol. -internal protocol Patrol_NativeAutomatorProvider: CallHandlerProvider { - var interceptors: Patrol_NativeAutomatorServerInterceptorFactoryProtocol? { get } - - func initialize(request: Patrol_Empty, context: StatusOnlyCallContext) -> EventLoopFuture - - func configure(request: Patrol_ConfigureRequest, context: StatusOnlyCallContext) -> EventLoopFuture - - /// general - func pressHome(request: Patrol_Empty, context: StatusOnlyCallContext) -> EventLoopFuture - - func pressBack(request: Patrol_Empty, context: StatusOnlyCallContext) -> EventLoopFuture - - func pressRecentApps(request: Patrol_Empty, context: StatusOnlyCallContext) -> EventLoopFuture - - func doublePressRecentApps(request: Patrol_Empty, context: StatusOnlyCallContext) -> EventLoopFuture - - func openApp(request: Patrol_OpenAppRequest, context: StatusOnlyCallContext) -> EventLoopFuture - - func openQuickSettings(request: Patrol_OpenQuickSettingsRequest, context: StatusOnlyCallContext) -> EventLoopFuture - - /// general UI interaction - func getNativeViews(request: Patrol_GetNativeViewsRequest, context: StatusOnlyCallContext) -> EventLoopFuture - - func tap(request: Patrol_TapRequest, context: StatusOnlyCallContext) -> EventLoopFuture - - func doubleTap(request: Patrol_TapRequest, context: StatusOnlyCallContext) -> EventLoopFuture - - func enterText(request: Patrol_EnterTextRequest, context: StatusOnlyCallContext) -> EventLoopFuture - - func swipe(request: Patrol_SwipeRequest, context: StatusOnlyCallContext) -> EventLoopFuture - - func waitUntilVisible(request: Patrol_WaitUntilVisibleRequest, context: StatusOnlyCallContext) -> EventLoopFuture - - /// services - func enableAirplaneMode(request: Patrol_Empty, context: StatusOnlyCallContext) -> EventLoopFuture - - func disableAirplaneMode(request: Patrol_Empty, context: StatusOnlyCallContext) -> EventLoopFuture - - func enableWiFi(request: Patrol_Empty, context: StatusOnlyCallContext) -> EventLoopFuture - - func disableWiFi(request: Patrol_Empty, context: StatusOnlyCallContext) -> EventLoopFuture - - func enableCellular(request: Patrol_Empty, context: StatusOnlyCallContext) -> EventLoopFuture - - func disableCellular(request: Patrol_Empty, context: StatusOnlyCallContext) -> EventLoopFuture - - func enableBluetooth(request: Patrol_Empty, context: StatusOnlyCallContext) -> EventLoopFuture - - func disableBluetooth(request: Patrol_Empty, context: StatusOnlyCallContext) -> EventLoopFuture - - func enableDarkMode(request: Patrol_DarkModeRequest, context: StatusOnlyCallContext) -> EventLoopFuture - - func disableDarkMode(request: Patrol_DarkModeRequest, context: StatusOnlyCallContext) -> EventLoopFuture - - /// notifications - func openNotifications(request: Patrol_Empty, context: StatusOnlyCallContext) -> EventLoopFuture - - func closeNotifications(request: Patrol_Empty, context: StatusOnlyCallContext) -> EventLoopFuture - - func closeHeadsUpNotification(request: Patrol_Empty, context: StatusOnlyCallContext) -> EventLoopFuture - - func getNotifications(request: Patrol_GetNotificationsRequest, context: StatusOnlyCallContext) -> EventLoopFuture - - func tapOnNotification(request: Patrol_TapOnNotificationRequest, context: StatusOnlyCallContext) -> EventLoopFuture - - /// permissions - func isPermissionDialogVisible(request: Patrol_PermissionDialogVisibleRequest, context: StatusOnlyCallContext) -> EventLoopFuture - - func handlePermissionDialog(request: Patrol_HandlePermissionRequest, context: StatusOnlyCallContext) -> EventLoopFuture - - func setLocationAccuracy(request: Patrol_SetLocationAccuracyRequest, context: StatusOnlyCallContext) -> EventLoopFuture - - /// other - func debug(request: Patrol_Empty, context: StatusOnlyCallContext) -> EventLoopFuture - - /// TODO(bartekpacia): Move this RPC into a new PatrolNativeTestService service because it doesn't fit here - func markPatrolAppServiceReady(request: Patrol_Empty, context: StatusOnlyCallContext) -> EventLoopFuture -} - -extension Patrol_NativeAutomatorProvider { - internal var serviceName: Substring { - return Patrol_NativeAutomatorServerMetadata.serviceDescriptor.fullName[...] - } - - /// Determines, calls and returns the appropriate request handler, depending on the request's method. - /// Returns nil for methods not handled by this service. - internal func handle( - method name: Substring, - context: CallHandlerContext - ) -> GRPCServerHandlerProtocol? { - switch name { - case "initialize": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeinitializeInterceptors() ?? [], - userFunction: self.initialize(request:context:) - ) - - case "configure": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeconfigureInterceptors() ?? [], - userFunction: self.configure(request:context:) - ) - - case "pressHome": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makepressHomeInterceptors() ?? [], - userFunction: self.pressHome(request:context:) - ) - - case "pressBack": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makepressBackInterceptors() ?? [], - userFunction: self.pressBack(request:context:) - ) - - case "pressRecentApps": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makepressRecentAppsInterceptors() ?? [], - userFunction: self.pressRecentApps(request:context:) - ) - - case "doublePressRecentApps": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makedoublePressRecentAppsInterceptors() ?? [], - userFunction: self.doublePressRecentApps(request:context:) - ) - - case "openApp": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeopenAppInterceptors() ?? [], - userFunction: self.openApp(request:context:) - ) - - case "openQuickSettings": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeopenQuickSettingsInterceptors() ?? [], - userFunction: self.openQuickSettings(request:context:) - ) - - case "getNativeViews": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makegetNativeViewsInterceptors() ?? [], - userFunction: self.getNativeViews(request:context:) - ) - - case "tap": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.maketapInterceptors() ?? [], - userFunction: self.tap(request:context:) - ) - - case "doubleTap": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makedoubleTapInterceptors() ?? [], - userFunction: self.doubleTap(request:context:) - ) - - case "enterText": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeenterTextInterceptors() ?? [], - userFunction: self.enterText(request:context:) - ) - - case "swipe": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeswipeInterceptors() ?? [], - userFunction: self.swipe(request:context:) - ) - - case "waitUntilVisible": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makewaitUntilVisibleInterceptors() ?? [], - userFunction: self.waitUntilVisible(request:context:) - ) - - case "enableAirplaneMode": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeenableAirplaneModeInterceptors() ?? [], - userFunction: self.enableAirplaneMode(request:context:) - ) - - case "disableAirplaneMode": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makedisableAirplaneModeInterceptors() ?? [], - userFunction: self.disableAirplaneMode(request:context:) - ) - - case "enableWiFi": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeenableWiFiInterceptors() ?? [], - userFunction: self.enableWiFi(request:context:) - ) - - case "disableWiFi": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makedisableWiFiInterceptors() ?? [], - userFunction: self.disableWiFi(request:context:) - ) - - case "enableCellular": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeenableCellularInterceptors() ?? [], - userFunction: self.enableCellular(request:context:) - ) - - case "disableCellular": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makedisableCellularInterceptors() ?? [], - userFunction: self.disableCellular(request:context:) - ) - - case "enableBluetooth": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeenableBluetoothInterceptors() ?? [], - userFunction: self.enableBluetooth(request:context:) - ) - - case "disableBluetooth": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makedisableBluetoothInterceptors() ?? [], - userFunction: self.disableBluetooth(request:context:) - ) - - case "enableDarkMode": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeenableDarkModeInterceptors() ?? [], - userFunction: self.enableDarkMode(request:context:) - ) - - case "disableDarkMode": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makedisableDarkModeInterceptors() ?? [], - userFunction: self.disableDarkMode(request:context:) - ) - - case "openNotifications": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeopenNotificationsInterceptors() ?? [], - userFunction: self.openNotifications(request:context:) - ) - - case "closeNotifications": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makecloseNotificationsInterceptors() ?? [], - userFunction: self.closeNotifications(request:context:) - ) - - case "closeHeadsUpNotification": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makecloseHeadsUpNotificationInterceptors() ?? [], - userFunction: self.closeHeadsUpNotification(request:context:) - ) - - case "getNotifications": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makegetNotificationsInterceptors() ?? [], - userFunction: self.getNotifications(request:context:) - ) - - case "tapOnNotification": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.maketapOnNotificationInterceptors() ?? [], - userFunction: self.tapOnNotification(request:context:) - ) - - case "isPermissionDialogVisible": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeisPermissionDialogVisibleInterceptors() ?? [], - userFunction: self.isPermissionDialogVisible(request:context:) - ) - - case "handlePermissionDialog": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makehandlePermissionDialogInterceptors() ?? [], - userFunction: self.handlePermissionDialog(request:context:) - ) - - case "setLocationAccuracy": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makesetLocationAccuracyInterceptors() ?? [], - userFunction: self.setLocationAccuracy(request:context:) - ) - - case "debug": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makedebugInterceptors() ?? [], - userFunction: self.debug(request:context:) - ) - - case "markPatrolAppServiceReady": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makemarkPatrolAppServiceReadyInterceptors() ?? [], - userFunction: self.markPatrolAppServiceReady(request:context:) - ) - - default: - return nil - } - } -} - -/// To implement a server, implement an object which conforms to this protocol. -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -internal protocol Patrol_NativeAutomatorAsyncProvider: CallHandlerProvider, Sendable { - static var serviceDescriptor: GRPCServiceDescriptor { get } - var interceptors: Patrol_NativeAutomatorServerInterceptorFactoryProtocol? { get } - - func initialize( - request: Patrol_Empty, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_Empty - - func configure( - request: Patrol_ConfigureRequest, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_Empty - - /// general - func pressHome( - request: Patrol_Empty, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_Empty - - func pressBack( - request: Patrol_Empty, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_Empty - - func pressRecentApps( - request: Patrol_Empty, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_Empty - - func doublePressRecentApps( - request: Patrol_Empty, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_Empty - - func openApp( - request: Patrol_OpenAppRequest, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_Empty - - func openQuickSettings( - request: Patrol_OpenQuickSettingsRequest, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_Empty - - /// general UI interaction - func getNativeViews( - request: Patrol_GetNativeViewsRequest, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_GetNativeViewsResponse - - func tap( - request: Patrol_TapRequest, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_Empty - - func doubleTap( - request: Patrol_TapRequest, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_Empty - - func enterText( - request: Patrol_EnterTextRequest, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_Empty - - func swipe( - request: Patrol_SwipeRequest, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_Empty - - func waitUntilVisible( - request: Patrol_WaitUntilVisibleRequest, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_Empty - - /// services - func enableAirplaneMode( - request: Patrol_Empty, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_Empty - - func disableAirplaneMode( - request: Patrol_Empty, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_Empty - - func enableWiFi( - request: Patrol_Empty, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_Empty - - func disableWiFi( - request: Patrol_Empty, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_Empty - - func enableCellular( - request: Patrol_Empty, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_Empty - - func disableCellular( - request: Patrol_Empty, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_Empty - - func enableBluetooth( - request: Patrol_Empty, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_Empty - - func disableBluetooth( - request: Patrol_Empty, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_Empty - - func enableDarkMode( - request: Patrol_DarkModeRequest, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_Empty - - func disableDarkMode( - request: Patrol_DarkModeRequest, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_Empty - - /// notifications - func openNotifications( - request: Patrol_Empty, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_Empty - - func closeNotifications( - request: Patrol_Empty, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_Empty - - func closeHeadsUpNotification( - request: Patrol_Empty, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_Empty - - func getNotifications( - request: Patrol_GetNotificationsRequest, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_GetNotificationsResponse - - func tapOnNotification( - request: Patrol_TapOnNotificationRequest, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_Empty - - /// permissions - func isPermissionDialogVisible( - request: Patrol_PermissionDialogVisibleRequest, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_PermissionDialogVisibleResponse - - func handlePermissionDialog( - request: Patrol_HandlePermissionRequest, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_Empty - - func setLocationAccuracy( - request: Patrol_SetLocationAccuracyRequest, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_Empty - - /// other - func debug( - request: Patrol_Empty, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_Empty - - /// TODO(bartekpacia): Move this RPC into a new PatrolNativeTestService service because it doesn't fit here - func markPatrolAppServiceReady( - request: Patrol_Empty, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_Empty -} - -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -extension Patrol_NativeAutomatorAsyncProvider { - internal static var serviceDescriptor: GRPCServiceDescriptor { - return Patrol_NativeAutomatorServerMetadata.serviceDescriptor - } - - internal var serviceName: Substring { - return Patrol_NativeAutomatorServerMetadata.serviceDescriptor.fullName[...] - } - - internal var interceptors: Patrol_NativeAutomatorServerInterceptorFactoryProtocol? { - return nil - } - - internal func handle( - method name: Substring, - context: CallHandlerContext - ) -> GRPCServerHandlerProtocol? { - switch name { - case "initialize": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeinitializeInterceptors() ?? [], - wrapping: { try await self.initialize(request: $0, context: $1) } - ) - - case "configure": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeconfigureInterceptors() ?? [], - wrapping: { try await self.configure(request: $0, context: $1) } - ) - - case "pressHome": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makepressHomeInterceptors() ?? [], - wrapping: { try await self.pressHome(request: $0, context: $1) } - ) - - case "pressBack": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makepressBackInterceptors() ?? [], - wrapping: { try await self.pressBack(request: $0, context: $1) } - ) - - case "pressRecentApps": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makepressRecentAppsInterceptors() ?? [], - wrapping: { try await self.pressRecentApps(request: $0, context: $1) } - ) - - case "doublePressRecentApps": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makedoublePressRecentAppsInterceptors() ?? [], - wrapping: { try await self.doublePressRecentApps(request: $0, context: $1) } - ) - - case "openApp": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeopenAppInterceptors() ?? [], - wrapping: { try await self.openApp(request: $0, context: $1) } - ) - - case "openQuickSettings": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeopenQuickSettingsInterceptors() ?? [], - wrapping: { try await self.openQuickSettings(request: $0, context: $1) } - ) - - case "getNativeViews": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makegetNativeViewsInterceptors() ?? [], - wrapping: { try await self.getNativeViews(request: $0, context: $1) } - ) - - case "tap": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.maketapInterceptors() ?? [], - wrapping: { try await self.tap(request: $0, context: $1) } - ) - - case "doubleTap": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makedoubleTapInterceptors() ?? [], - wrapping: { try await self.doubleTap(request: $0, context: $1) } - ) - - case "enterText": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeenterTextInterceptors() ?? [], - wrapping: { try await self.enterText(request: $0, context: $1) } - ) - - case "swipe": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeswipeInterceptors() ?? [], - wrapping: { try await self.swipe(request: $0, context: $1) } - ) - - case "waitUntilVisible": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makewaitUntilVisibleInterceptors() ?? [], - wrapping: { try await self.waitUntilVisible(request: $0, context: $1) } - ) - - case "enableAirplaneMode": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeenableAirplaneModeInterceptors() ?? [], - wrapping: { try await self.enableAirplaneMode(request: $0, context: $1) } - ) - - case "disableAirplaneMode": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makedisableAirplaneModeInterceptors() ?? [], - wrapping: { try await self.disableAirplaneMode(request: $0, context: $1) } - ) - - case "enableWiFi": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeenableWiFiInterceptors() ?? [], - wrapping: { try await self.enableWiFi(request: $0, context: $1) } - ) - - case "disableWiFi": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makedisableWiFiInterceptors() ?? [], - wrapping: { try await self.disableWiFi(request: $0, context: $1) } - ) - - case "enableCellular": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeenableCellularInterceptors() ?? [], - wrapping: { try await self.enableCellular(request: $0, context: $1) } - ) - - case "disableCellular": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makedisableCellularInterceptors() ?? [], - wrapping: { try await self.disableCellular(request: $0, context: $1) } - ) - - case "enableBluetooth": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeenableBluetoothInterceptors() ?? [], - wrapping: { try await self.enableBluetooth(request: $0, context: $1) } - ) - - case "disableBluetooth": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makedisableBluetoothInterceptors() ?? [], - wrapping: { try await self.disableBluetooth(request: $0, context: $1) } - ) - - case "enableDarkMode": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeenableDarkModeInterceptors() ?? [], - wrapping: { try await self.enableDarkMode(request: $0, context: $1) } - ) - - case "disableDarkMode": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makedisableDarkModeInterceptors() ?? [], - wrapping: { try await self.disableDarkMode(request: $0, context: $1) } - ) - - case "openNotifications": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeopenNotificationsInterceptors() ?? [], - wrapping: { try await self.openNotifications(request: $0, context: $1) } - ) - - case "closeNotifications": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makecloseNotificationsInterceptors() ?? [], - wrapping: { try await self.closeNotifications(request: $0, context: $1) } - ) - - case "closeHeadsUpNotification": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makecloseHeadsUpNotificationInterceptors() ?? [], - wrapping: { try await self.closeHeadsUpNotification(request: $0, context: $1) } - ) - - case "getNotifications": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makegetNotificationsInterceptors() ?? [], - wrapping: { try await self.getNotifications(request: $0, context: $1) } - ) - - case "tapOnNotification": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.maketapOnNotificationInterceptors() ?? [], - wrapping: { try await self.tapOnNotification(request: $0, context: $1) } - ) - - case "isPermissionDialogVisible": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeisPermissionDialogVisibleInterceptors() ?? [], - wrapping: { try await self.isPermissionDialogVisible(request: $0, context: $1) } - ) - - case "handlePermissionDialog": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makehandlePermissionDialogInterceptors() ?? [], - wrapping: { try await self.handlePermissionDialog(request: $0, context: $1) } - ) - - case "setLocationAccuracy": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makesetLocationAccuracyInterceptors() ?? [], - wrapping: { try await self.setLocationAccuracy(request: $0, context: $1) } - ) - - case "debug": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makedebugInterceptors() ?? [], - wrapping: { try await self.debug(request: $0, context: $1) } - ) - - case "markPatrolAppServiceReady": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makemarkPatrolAppServiceReadyInterceptors() ?? [], - wrapping: { try await self.markPatrolAppServiceReady(request: $0, context: $1) } - ) - - default: - return nil - } - } -} - -internal protocol Patrol_NativeAutomatorServerInterceptorFactoryProtocol: Sendable { - - /// - Returns: Interceptors to use when handling 'initialize'. - /// Defaults to calling `self.makeInterceptors()`. - func makeinitializeInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'configure'. - /// Defaults to calling `self.makeInterceptors()`. - func makeconfigureInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'pressHome'. - /// Defaults to calling `self.makeInterceptors()`. - func makepressHomeInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'pressBack'. - /// Defaults to calling `self.makeInterceptors()`. - func makepressBackInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'pressRecentApps'. - /// Defaults to calling `self.makeInterceptors()`. - func makepressRecentAppsInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'doublePressRecentApps'. - /// Defaults to calling `self.makeInterceptors()`. - func makedoublePressRecentAppsInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'openApp'. - /// Defaults to calling `self.makeInterceptors()`. - func makeopenAppInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'openQuickSettings'. - /// Defaults to calling `self.makeInterceptors()`. - func makeopenQuickSettingsInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'getNativeViews'. - /// Defaults to calling `self.makeInterceptors()`. - func makegetNativeViewsInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'tap'. - /// Defaults to calling `self.makeInterceptors()`. - func maketapInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'doubleTap'. - /// Defaults to calling `self.makeInterceptors()`. - func makedoubleTapInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'enterText'. - /// Defaults to calling `self.makeInterceptors()`. - func makeenterTextInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'swipe'. - /// Defaults to calling `self.makeInterceptors()`. - func makeswipeInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'waitUntilVisible'. - /// Defaults to calling `self.makeInterceptors()`. - func makewaitUntilVisibleInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'enableAirplaneMode'. - /// Defaults to calling `self.makeInterceptors()`. - func makeenableAirplaneModeInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'disableAirplaneMode'. - /// Defaults to calling `self.makeInterceptors()`. - func makedisableAirplaneModeInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'enableWiFi'. - /// Defaults to calling `self.makeInterceptors()`. - func makeenableWiFiInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'disableWiFi'. - /// Defaults to calling `self.makeInterceptors()`. - func makedisableWiFiInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'enableCellular'. - /// Defaults to calling `self.makeInterceptors()`. - func makeenableCellularInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'disableCellular'. - /// Defaults to calling `self.makeInterceptors()`. - func makedisableCellularInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'enableBluetooth'. - /// Defaults to calling `self.makeInterceptors()`. - func makeenableBluetoothInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'disableBluetooth'. - /// Defaults to calling `self.makeInterceptors()`. - func makedisableBluetoothInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'enableDarkMode'. - /// Defaults to calling `self.makeInterceptors()`. - func makeenableDarkModeInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'disableDarkMode'. - /// Defaults to calling `self.makeInterceptors()`. - func makedisableDarkModeInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'openNotifications'. - /// Defaults to calling `self.makeInterceptors()`. - func makeopenNotificationsInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'closeNotifications'. - /// Defaults to calling `self.makeInterceptors()`. - func makecloseNotificationsInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'closeHeadsUpNotification'. - /// Defaults to calling `self.makeInterceptors()`. - func makecloseHeadsUpNotificationInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'getNotifications'. - /// Defaults to calling `self.makeInterceptors()`. - func makegetNotificationsInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'tapOnNotification'. - /// Defaults to calling `self.makeInterceptors()`. - func maketapOnNotificationInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'isPermissionDialogVisible'. - /// Defaults to calling `self.makeInterceptors()`. - func makeisPermissionDialogVisibleInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'handlePermissionDialog'. - /// Defaults to calling `self.makeInterceptors()`. - func makehandlePermissionDialogInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'setLocationAccuracy'. - /// Defaults to calling `self.makeInterceptors()`. - func makesetLocationAccuracyInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'debug'. - /// Defaults to calling `self.makeInterceptors()`. - func makedebugInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'markPatrolAppServiceReady'. - /// Defaults to calling `self.makeInterceptors()`. - func makemarkPatrolAppServiceReadyInterceptors() -> [ServerInterceptor] -} - -internal enum Patrol_NativeAutomatorServerMetadata { - internal static let serviceDescriptor = GRPCServiceDescriptor( - name: "NativeAutomator", - fullName: "patrol.NativeAutomator", - methods: [ - Patrol_NativeAutomatorServerMetadata.Methods.initialize, - Patrol_NativeAutomatorServerMetadata.Methods.configure, - Patrol_NativeAutomatorServerMetadata.Methods.pressHome, - Patrol_NativeAutomatorServerMetadata.Methods.pressBack, - Patrol_NativeAutomatorServerMetadata.Methods.pressRecentApps, - Patrol_NativeAutomatorServerMetadata.Methods.doublePressRecentApps, - Patrol_NativeAutomatorServerMetadata.Methods.openApp, - Patrol_NativeAutomatorServerMetadata.Methods.openQuickSettings, - Patrol_NativeAutomatorServerMetadata.Methods.getNativeViews, - Patrol_NativeAutomatorServerMetadata.Methods.tap, - Patrol_NativeAutomatorServerMetadata.Methods.doubleTap, - Patrol_NativeAutomatorServerMetadata.Methods.enterText, - Patrol_NativeAutomatorServerMetadata.Methods.swipe, - Patrol_NativeAutomatorServerMetadata.Methods.waitUntilVisible, - Patrol_NativeAutomatorServerMetadata.Methods.enableAirplaneMode, - Patrol_NativeAutomatorServerMetadata.Methods.disableAirplaneMode, - Patrol_NativeAutomatorServerMetadata.Methods.enableWiFi, - Patrol_NativeAutomatorServerMetadata.Methods.disableWiFi, - Patrol_NativeAutomatorServerMetadata.Methods.enableCellular, - Patrol_NativeAutomatorServerMetadata.Methods.disableCellular, - Patrol_NativeAutomatorServerMetadata.Methods.enableBluetooth, - Patrol_NativeAutomatorServerMetadata.Methods.disableBluetooth, - Patrol_NativeAutomatorServerMetadata.Methods.enableDarkMode, - Patrol_NativeAutomatorServerMetadata.Methods.disableDarkMode, - Patrol_NativeAutomatorServerMetadata.Methods.openNotifications, - Patrol_NativeAutomatorServerMetadata.Methods.closeNotifications, - Patrol_NativeAutomatorServerMetadata.Methods.closeHeadsUpNotification, - Patrol_NativeAutomatorServerMetadata.Methods.getNotifications, - Patrol_NativeAutomatorServerMetadata.Methods.tapOnNotification, - Patrol_NativeAutomatorServerMetadata.Methods.isPermissionDialogVisible, - Patrol_NativeAutomatorServerMetadata.Methods.handlePermissionDialog, - Patrol_NativeAutomatorServerMetadata.Methods.setLocationAccuracy, - Patrol_NativeAutomatorServerMetadata.Methods.debug, - Patrol_NativeAutomatorServerMetadata.Methods.markPatrolAppServiceReady, - ] - ) - - internal enum Methods { - internal static let initialize = GRPCMethodDescriptor( - name: "initialize", - path: "/patrol.NativeAutomator/initialize", - type: GRPCCallType.unary - ) - - internal static let configure = GRPCMethodDescriptor( - name: "configure", - path: "/patrol.NativeAutomator/configure", - type: GRPCCallType.unary - ) - - internal static let pressHome = GRPCMethodDescriptor( - name: "pressHome", - path: "/patrol.NativeAutomator/pressHome", - type: GRPCCallType.unary - ) - - internal static let pressBack = GRPCMethodDescriptor( - name: "pressBack", - path: "/patrol.NativeAutomator/pressBack", - type: GRPCCallType.unary - ) - - internal static let pressRecentApps = GRPCMethodDescriptor( - name: "pressRecentApps", - path: "/patrol.NativeAutomator/pressRecentApps", - type: GRPCCallType.unary - ) - - internal static let doublePressRecentApps = GRPCMethodDescriptor( - name: "doublePressRecentApps", - path: "/patrol.NativeAutomator/doublePressRecentApps", - type: GRPCCallType.unary - ) - - internal static let openApp = GRPCMethodDescriptor( - name: "openApp", - path: "/patrol.NativeAutomator/openApp", - type: GRPCCallType.unary - ) - - internal static let openQuickSettings = GRPCMethodDescriptor( - name: "openQuickSettings", - path: "/patrol.NativeAutomator/openQuickSettings", - type: GRPCCallType.unary - ) - - internal static let getNativeViews = GRPCMethodDescriptor( - name: "getNativeViews", - path: "/patrol.NativeAutomator/getNativeViews", - type: GRPCCallType.unary - ) - - internal static let tap = GRPCMethodDescriptor( - name: "tap", - path: "/patrol.NativeAutomator/tap", - type: GRPCCallType.unary - ) - - internal static let doubleTap = GRPCMethodDescriptor( - name: "doubleTap", - path: "/patrol.NativeAutomator/doubleTap", - type: GRPCCallType.unary - ) - - internal static let enterText = GRPCMethodDescriptor( - name: "enterText", - path: "/patrol.NativeAutomator/enterText", - type: GRPCCallType.unary - ) - - internal static let swipe = GRPCMethodDescriptor( - name: "swipe", - path: "/patrol.NativeAutomator/swipe", - type: GRPCCallType.unary - ) - - internal static let waitUntilVisible = GRPCMethodDescriptor( - name: "waitUntilVisible", - path: "/patrol.NativeAutomator/waitUntilVisible", - type: GRPCCallType.unary - ) - - internal static let enableAirplaneMode = GRPCMethodDescriptor( - name: "enableAirplaneMode", - path: "/patrol.NativeAutomator/enableAirplaneMode", - type: GRPCCallType.unary - ) - - internal static let disableAirplaneMode = GRPCMethodDescriptor( - name: "disableAirplaneMode", - path: "/patrol.NativeAutomator/disableAirplaneMode", - type: GRPCCallType.unary - ) - - internal static let enableWiFi = GRPCMethodDescriptor( - name: "enableWiFi", - path: "/patrol.NativeAutomator/enableWiFi", - type: GRPCCallType.unary - ) - - internal static let disableWiFi = GRPCMethodDescriptor( - name: "disableWiFi", - path: "/patrol.NativeAutomator/disableWiFi", - type: GRPCCallType.unary - ) - - internal static let enableCellular = GRPCMethodDescriptor( - name: "enableCellular", - path: "/patrol.NativeAutomator/enableCellular", - type: GRPCCallType.unary - ) - - internal static let disableCellular = GRPCMethodDescriptor( - name: "disableCellular", - path: "/patrol.NativeAutomator/disableCellular", - type: GRPCCallType.unary - ) - - internal static let enableBluetooth = GRPCMethodDescriptor( - name: "enableBluetooth", - path: "/patrol.NativeAutomator/enableBluetooth", - type: GRPCCallType.unary - ) - - internal static let disableBluetooth = GRPCMethodDescriptor( - name: "disableBluetooth", - path: "/patrol.NativeAutomator/disableBluetooth", - type: GRPCCallType.unary - ) - - internal static let enableDarkMode = GRPCMethodDescriptor( - name: "enableDarkMode", - path: "/patrol.NativeAutomator/enableDarkMode", - type: GRPCCallType.unary - ) - - internal static let disableDarkMode = GRPCMethodDescriptor( - name: "disableDarkMode", - path: "/patrol.NativeAutomator/disableDarkMode", - type: GRPCCallType.unary - ) - - internal static let openNotifications = GRPCMethodDescriptor( - name: "openNotifications", - path: "/patrol.NativeAutomator/openNotifications", - type: GRPCCallType.unary - ) - - internal static let closeNotifications = GRPCMethodDescriptor( - name: "closeNotifications", - path: "/patrol.NativeAutomator/closeNotifications", - type: GRPCCallType.unary - ) - - internal static let closeHeadsUpNotification = GRPCMethodDescriptor( - name: "closeHeadsUpNotification", - path: "/patrol.NativeAutomator/closeHeadsUpNotification", - type: GRPCCallType.unary - ) - - internal static let getNotifications = GRPCMethodDescriptor( - name: "getNotifications", - path: "/patrol.NativeAutomator/getNotifications", - type: GRPCCallType.unary - ) - - internal static let tapOnNotification = GRPCMethodDescriptor( - name: "tapOnNotification", - path: "/patrol.NativeAutomator/tapOnNotification", - type: GRPCCallType.unary - ) - - internal static let isPermissionDialogVisible = GRPCMethodDescriptor( - name: "isPermissionDialogVisible", - path: "/patrol.NativeAutomator/isPermissionDialogVisible", - type: GRPCCallType.unary - ) - - internal static let handlePermissionDialog = GRPCMethodDescriptor( - name: "handlePermissionDialog", - path: "/patrol.NativeAutomator/handlePermissionDialog", - type: GRPCCallType.unary - ) - - internal static let setLocationAccuracy = GRPCMethodDescriptor( - name: "setLocationAccuracy", - path: "/patrol.NativeAutomator/setLocationAccuracy", - type: GRPCCallType.unary - ) - - internal static let debug = GRPCMethodDescriptor( - name: "debug", - path: "/patrol.NativeAutomator/debug", - type: GRPCCallType.unary - ) - - internal static let markPatrolAppServiceReady = GRPCMethodDescriptor( - name: "markPatrolAppServiceReady", - path: "/patrol.NativeAutomator/markPatrolAppServiceReady", - type: GRPCCallType.unary - ) - } -} diff --git a/packages/patrol/ios/Classes/AutomatorServer/contracts.pb.swift b/packages/patrol/ios/Classes/AutomatorServer/contracts.pb.swift deleted file mode 100644 index 9de608b87..000000000 --- a/packages/patrol/ios/Classes/AutomatorServer/contracts.pb.swift +++ /dev/null @@ -1,1648 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: contracts.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -import Foundation -import SwiftProtobuf - -// If the compiler emits an error on this type, it is because this file -// was generated by a version of the `protoc` Swift plug-in that is -// incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API -// that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { - struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} - typealias Version = _2 -} - -public struct Patrol_ConfigureRequest { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var findTimeoutMillis: UInt64 = 0 - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -public struct Patrol_OpenAppRequest { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var appID: String = String() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -public struct Patrol_TapOnNotificationRequest { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var findBy: Patrol_TapOnNotificationRequest.OneOf_FindBy? = nil - - public var index: UInt32 { - get { - if case .index(let v)? = findBy {return v} - return 0 - } - set {findBy = .index(newValue)} - } - - public var selector: Patrol_Selector { - get { - if case .selector(let v)? = findBy {return v} - return Patrol_Selector() - } - set {findBy = .selector(newValue)} - } - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum OneOf_FindBy: Equatable { - case index(UInt32) - case selector(Patrol_Selector) - - #if !swift(>=4.1) - public static func ==(lhs: Patrol_TapOnNotificationRequest.OneOf_FindBy, rhs: Patrol_TapOnNotificationRequest.OneOf_FindBy) -> Bool { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch (lhs, rhs) { - case (.index, .index): return { - guard case .index(let l) = lhs, case .index(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.selector, .selector): return { - guard case .selector(let l) = lhs, case .selector(let r) = rhs else { preconditionFailure() } - return l == r - }() - default: return false - } - } - #endif - } - - public init() {} -} - -/// We're defining our own Empty instead of using google.protobuf.Empty because -/// the Dart plugin can't easily generate it. -/// -/// See: -/// * https://github.com/google/protobuf.dart/issues/170 -public struct Patrol_Empty { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -public struct Patrol_OpenQuickSettingsRequest { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -public struct Patrol_DarkModeRequest { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var appID: String = String() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -public struct Patrol_GetNativeViewsRequest { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var selector: Patrol_Selector { - get {return _selector ?? Patrol_Selector()} - set {_selector = newValue} - } - /// Returns true if `selector` has been explicitly set. - public var hasSelector: Bool {return self._selector != nil} - /// Clears the value of `selector`. Subsequent reads from it will return its default value. - public mutating func clearSelector() {self._selector = nil} - - public var appID: String = String() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _selector: Patrol_Selector? = nil -} - -public struct Patrol_GetNativeViewsResponse { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var nativeViews: [Patrol_NativeView] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -public struct Patrol_GetNotificationsRequest { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -public struct Patrol_GetNotificationsResponse { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var notifications: [Patrol_Notification] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -public struct Patrol_TapRequest { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var selector: Patrol_Selector { - get {return _selector ?? Patrol_Selector()} - set {_selector = newValue} - } - /// Returns true if `selector` has been explicitly set. - public var hasSelector: Bool {return self._selector != nil} - /// Clears the value of `selector`. Subsequent reads from it will return its default value. - public mutating func clearSelector() {self._selector = nil} - - public var appID: String = String() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _selector: Patrol_Selector? = nil -} - -public struct Patrol_EnterTextRequest { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var data: String = String() - - public var appID: String = String() - - public var findBy: Patrol_EnterTextRequest.OneOf_FindBy? = nil - - public var index: UInt32 { - get { - if case .index(let v)? = findBy {return v} - return 0 - } - set {findBy = .index(newValue)} - } - - public var selector: Patrol_Selector { - get { - if case .selector(let v)? = findBy {return v} - return Patrol_Selector() - } - set {findBy = .selector(newValue)} - } - - public var showKeyboard: Bool = false - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum OneOf_FindBy: Equatable { - case index(UInt32) - case selector(Patrol_Selector) - - #if !swift(>=4.1) - public static func ==(lhs: Patrol_EnterTextRequest.OneOf_FindBy, rhs: Patrol_EnterTextRequest.OneOf_FindBy) -> Bool { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch (lhs, rhs) { - case (.index, .index): return { - guard case .index(let l) = lhs, case .index(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.selector, .selector): return { - guard case .selector(let l) = lhs, case .selector(let r) = rhs else { preconditionFailure() } - return l == r - }() - default: return false - } - } - #endif - } - - public init() {} -} - -public struct Patrol_SwipeRequest { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var startX: Float = 0 - - public var startY: Float = 0 - - public var endX: Float = 0 - - public var endY: Float = 0 - - public var steps: UInt32 = 0 - - public var appID: String = String() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -public struct Patrol_WaitUntilVisibleRequest { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var selector: Patrol_Selector { - get {return _selector ?? Patrol_Selector()} - set {_selector = newValue} - } - /// Returns true if `selector` has been explicitly set. - public var hasSelector: Bool {return self._selector != nil} - /// Clears the value of `selector`. Subsequent reads from it will return its default value. - public mutating func clearSelector() {self._selector = nil} - - public var appID: String = String() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _selector: Patrol_Selector? = nil -} - -public struct Patrol_HandlePermissionRequest { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var code: Patrol_HandlePermissionRequest.Code = .whileUsing - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Code: SwiftProtobuf.Enum { - public typealias RawValue = Int - case whileUsing // = 0 - case onlyThisTime // = 1 - case denied // = 2 - case UNRECOGNIZED(Int) - - public init() { - self = .whileUsing - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .whileUsing - case 1: self = .onlyThisTime - case 2: self = .denied - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .whileUsing: return 0 - case .onlyThisTime: return 1 - case .denied: return 2 - case .UNRECOGNIZED(let i): return i - } - } - - } - - public init() {} -} - -#if swift(>=4.2) - -extension Patrol_HandlePermissionRequest.Code: CaseIterable { - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static var allCases: [Patrol_HandlePermissionRequest.Code] = [ - .whileUsing, - .onlyThisTime, - .denied, - ] -} - -#endif // swift(>=4.2) - -public struct Patrol_SetLocationAccuracyRequest { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var locationAccuracy: Patrol_SetLocationAccuracyRequest.LocationAccuracy = .coarse - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum LocationAccuracy: SwiftProtobuf.Enum { - public typealias RawValue = Int - case coarse // = 0 - case fine // = 1 - case UNRECOGNIZED(Int) - - public init() { - self = .coarse - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .coarse - case 1: self = .fine - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .coarse: return 0 - case .fine: return 1 - case .UNRECOGNIZED(let i): return i - } - } - - } - - public init() {} -} - -#if swift(>=4.2) - -extension Patrol_SetLocationAccuracyRequest.LocationAccuracy: CaseIterable { - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static var allCases: [Patrol_SetLocationAccuracyRequest.LocationAccuracy] = [ - .coarse, - .fine, - ] -} - -#endif // swift(>=4.2) - -public struct Patrol_PermissionDialogVisibleRequest { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var timeoutMillis: UInt64 = 0 - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -public struct Patrol_PermissionDialogVisibleResponse { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var visible: Bool = false - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -public struct Patrol_Selector { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var text: String { - get {return _text ?? String()} - set {_text = newValue} - } - /// Returns true if `text` has been explicitly set. - public var hasText: Bool {return self._text != nil} - /// Clears the value of `text`. Subsequent reads from it will return its default value. - public mutating func clearText() {self._text = nil} - - public var textStartsWith: String { - get {return _textStartsWith ?? String()} - set {_textStartsWith = newValue} - } - /// Returns true if `textStartsWith` has been explicitly set. - public var hasTextStartsWith: Bool {return self._textStartsWith != nil} - /// Clears the value of `textStartsWith`. Subsequent reads from it will return its default value. - public mutating func clearTextStartsWith() {self._textStartsWith = nil} - - public var textContains: String { - get {return _textContains ?? String()} - set {_textContains = newValue} - } - /// Returns true if `textContains` has been explicitly set. - public var hasTextContains: Bool {return self._textContains != nil} - /// Clears the value of `textContains`. Subsequent reads from it will return its default value. - public mutating func clearTextContains() {self._textContains = nil} - - public var className: String { - get {return _className ?? String()} - set {_className = newValue} - } - /// Returns true if `className` has been explicitly set. - public var hasClassName: Bool {return self._className != nil} - /// Clears the value of `className`. Subsequent reads from it will return its default value. - public mutating func clearClassName() {self._className = nil} - - public var contentDescription: String { - get {return _contentDescription ?? String()} - set {_contentDescription = newValue} - } - /// Returns true if `contentDescription` has been explicitly set. - public var hasContentDescription: Bool {return self._contentDescription != nil} - /// Clears the value of `contentDescription`. Subsequent reads from it will return its default value. - public mutating func clearContentDescription() {self._contentDescription = nil} - - public var contentDescriptionStartsWith: String { - get {return _contentDescriptionStartsWith ?? String()} - set {_contentDescriptionStartsWith = newValue} - } - /// Returns true if `contentDescriptionStartsWith` has been explicitly set. - public var hasContentDescriptionStartsWith: Bool {return self._contentDescriptionStartsWith != nil} - /// Clears the value of `contentDescriptionStartsWith`. Subsequent reads from it will return its default value. - public mutating func clearContentDescriptionStartsWith() {self._contentDescriptionStartsWith = nil} - - public var contentDescriptionContains: String { - get {return _contentDescriptionContains ?? String()} - set {_contentDescriptionContains = newValue} - } - /// Returns true if `contentDescriptionContains` has been explicitly set. - public var hasContentDescriptionContains: Bool {return self._contentDescriptionContains != nil} - /// Clears the value of `contentDescriptionContains`. Subsequent reads from it will return its default value. - public mutating func clearContentDescriptionContains() {self._contentDescriptionContains = nil} - - public var resourceID: String { - get {return _resourceID ?? String()} - set {_resourceID = newValue} - } - /// Returns true if `resourceID` has been explicitly set. - public var hasResourceID: Bool {return self._resourceID != nil} - /// Clears the value of `resourceID`. Subsequent reads from it will return its default value. - public mutating func clearResourceID() {self._resourceID = nil} - - public var instance: UInt32 { - get {return _instance ?? 0} - set {_instance = newValue} - } - /// Returns true if `instance` has been explicitly set. - public var hasInstance: Bool {return self._instance != nil} - /// Clears the value of `instance`. Subsequent reads from it will return its default value. - public mutating func clearInstance() {self._instance = nil} - - public var enabled: Bool { - get {return _enabled ?? false} - set {_enabled = newValue} - } - /// Returns true if `enabled` has been explicitly set. - public var hasEnabled: Bool {return self._enabled != nil} - /// Clears the value of `enabled`. Subsequent reads from it will return its default value. - public mutating func clearEnabled() {self._enabled = nil} - - public var focused: Bool { - get {return _focused ?? false} - set {_focused = newValue} - } - /// Returns true if `focused` has been explicitly set. - public var hasFocused: Bool {return self._focused != nil} - /// Clears the value of `focused`. Subsequent reads from it will return its default value. - public mutating func clearFocused() {self._focused = nil} - - public var pkg: String { - get {return _pkg ?? String()} - set {_pkg = newValue} - } - /// Returns true if `pkg` has been explicitly set. - public var hasPkg: Bool {return self._pkg != nil} - /// Clears the value of `pkg`. Subsequent reads from it will return its default value. - public mutating func clearPkg() {self._pkg = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _text: String? = nil - fileprivate var _textStartsWith: String? = nil - fileprivate var _textContains: String? = nil - fileprivate var _className: String? = nil - fileprivate var _contentDescription: String? = nil - fileprivate var _contentDescriptionStartsWith: String? = nil - fileprivate var _contentDescriptionContains: String? = nil - fileprivate var _resourceID: String? = nil - fileprivate var _instance: UInt32? = nil - fileprivate var _enabled: Bool? = nil - fileprivate var _focused: Bool? = nil - fileprivate var _pkg: String? = nil -} - -/// Represents a native UI control. -/// -/// On Android, this is `android.view.View`. -public struct Patrol_NativeView { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var className: String = String() - - public var text: String = String() - - public var contentDescription: String = String() - - public var focused: Bool = false - - public var enabled: Bool = false - - public var childCount: Int32 = 0 - - public var resourceName: String = String() - - public var applicationPackage: String = String() - - public var children: [Patrol_NativeView] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -/// Represents a notification visible in the notification shade. -public struct Patrol_Notification { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var appName: String { - get {return _appName ?? String()} - set {_appName = newValue} - } - /// Returns true if `appName` has been explicitly set. - public var hasAppName: Bool {return self._appName != nil} - /// Clears the value of `appName`. Subsequent reads from it will return its default value. - public mutating func clearAppName() {self._appName = nil} - - public var title: String = String() - - public var content: String = String() - - public var raw: String = String() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _appName: String? = nil -} - -public struct Patrol_SubmitTestResultsRequest { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var results: Dictionary = [:] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -#if swift(>=5.5) && canImport(_Concurrency) -extension Patrol_ConfigureRequest: @unchecked Sendable {} -extension Patrol_OpenAppRequest: @unchecked Sendable {} -extension Patrol_TapOnNotificationRequest: @unchecked Sendable {} -extension Patrol_TapOnNotificationRequest.OneOf_FindBy: @unchecked Sendable {} -extension Patrol_Empty: @unchecked Sendable {} -extension Patrol_OpenQuickSettingsRequest: @unchecked Sendable {} -extension Patrol_DarkModeRequest: @unchecked Sendable {} -extension Patrol_GetNativeViewsRequest: @unchecked Sendable {} -extension Patrol_GetNativeViewsResponse: @unchecked Sendable {} -extension Patrol_GetNotificationsRequest: @unchecked Sendable {} -extension Patrol_GetNotificationsResponse: @unchecked Sendable {} -extension Patrol_TapRequest: @unchecked Sendable {} -extension Patrol_EnterTextRequest: @unchecked Sendable {} -extension Patrol_EnterTextRequest.OneOf_FindBy: @unchecked Sendable {} -extension Patrol_SwipeRequest: @unchecked Sendable {} -extension Patrol_WaitUntilVisibleRequest: @unchecked Sendable {} -extension Patrol_HandlePermissionRequest: @unchecked Sendable {} -extension Patrol_HandlePermissionRequest.Code: @unchecked Sendable {} -extension Patrol_SetLocationAccuracyRequest: @unchecked Sendable {} -extension Patrol_SetLocationAccuracyRequest.LocationAccuracy: @unchecked Sendable {} -extension Patrol_PermissionDialogVisibleRequest: @unchecked Sendable {} -extension Patrol_PermissionDialogVisibleResponse: @unchecked Sendable {} -extension Patrol_Selector: @unchecked Sendable {} -extension Patrol_NativeView: @unchecked Sendable {} -extension Patrol_Notification: @unchecked Sendable {} -extension Patrol_SubmitTestResultsRequest: @unchecked Sendable {} -#endif // swift(>=5.5) && canImport(_Concurrency) - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -fileprivate let _protobuf_package = "patrol" - -extension Patrol_ConfigureRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".ConfigureRequest" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "findTimeoutMillis"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularUInt64Field(value: &self.findTimeoutMillis) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.findTimeoutMillis != 0 { - try visitor.visitSingularUInt64Field(value: self.findTimeoutMillis, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Patrol_ConfigureRequest, rhs: Patrol_ConfigureRequest) -> Bool { - if lhs.findTimeoutMillis != rhs.findTimeoutMillis {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Patrol_OpenAppRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".OpenAppRequest" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "appId"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.appID) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.appID.isEmpty { - try visitor.visitSingularStringField(value: self.appID, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Patrol_OpenAppRequest, rhs: Patrol_OpenAppRequest) -> Bool { - if lhs.appID != rhs.appID {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Patrol_TapOnNotificationRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".TapOnNotificationRequest" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "index"), - 2: .same(proto: "selector"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { - var v: UInt32? - try decoder.decodeSingularUInt32Field(value: &v) - if let v = v { - if self.findBy != nil {try decoder.handleConflictingOneOf()} - self.findBy = .index(v) - } - }() - case 2: try { - var v: Patrol_Selector? - var hadOneofValue = false - if let current = self.findBy { - hadOneofValue = true - if case .selector(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.findBy = .selector(v) - } - }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - switch self.findBy { - case .index?: try { - guard case .index(let v)? = self.findBy else { preconditionFailure() } - try visitor.visitSingularUInt32Field(value: v, fieldNumber: 1) - }() - case .selector?: try { - guard case .selector(let v)? = self.findBy else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - }() - case nil: break - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Patrol_TapOnNotificationRequest, rhs: Patrol_TapOnNotificationRequest) -> Bool { - if lhs.findBy != rhs.findBy {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Patrol_Empty: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Empty" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap() - - public mutating func decodeMessage(decoder: inout D) throws { - while let _ = try decoder.nextFieldNumber() { - } - } - - public func traverse(visitor: inout V) throws { - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Patrol_Empty, rhs: Patrol_Empty) -> Bool { - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Patrol_OpenQuickSettingsRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".OpenQuickSettingsRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap() - - public mutating func decodeMessage(decoder: inout D) throws { - while let _ = try decoder.nextFieldNumber() { - } - } - - public func traverse(visitor: inout V) throws { - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Patrol_OpenQuickSettingsRequest, rhs: Patrol_OpenQuickSettingsRequest) -> Bool { - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Patrol_DarkModeRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".DarkModeRequest" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "appId"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.appID) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.appID.isEmpty { - try visitor.visitSingularStringField(value: self.appID, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Patrol_DarkModeRequest, rhs: Patrol_DarkModeRequest) -> Bool { - if lhs.appID != rhs.appID {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Patrol_GetNativeViewsRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetNativeViewsRequest" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "selector"), - 2: .same(proto: "appId"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._selector) }() - case 2: try { try decoder.decodeSingularStringField(value: &self.appID) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._selector { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - if !self.appID.isEmpty { - try visitor.visitSingularStringField(value: self.appID, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Patrol_GetNativeViewsRequest, rhs: Patrol_GetNativeViewsRequest) -> Bool { - if lhs._selector != rhs._selector {return false} - if lhs.appID != rhs.appID {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Patrol_GetNativeViewsResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetNativeViewsResponse" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 2: .same(proto: "nativeViews"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 2: try { try decoder.decodeRepeatedMessageField(value: &self.nativeViews) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.nativeViews.isEmpty { - try visitor.visitRepeatedMessageField(value: self.nativeViews, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Patrol_GetNativeViewsResponse, rhs: Patrol_GetNativeViewsResponse) -> Bool { - if lhs.nativeViews != rhs.nativeViews {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Patrol_GetNotificationsRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetNotificationsRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap() - - public mutating func decodeMessage(decoder: inout D) throws { - while let _ = try decoder.nextFieldNumber() { - } - } - - public func traverse(visitor: inout V) throws { - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Patrol_GetNotificationsRequest, rhs: Patrol_GetNotificationsRequest) -> Bool { - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Patrol_GetNotificationsResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetNotificationsResponse" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 2: .same(proto: "notifications"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 2: try { try decoder.decodeRepeatedMessageField(value: &self.notifications) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.notifications.isEmpty { - try visitor.visitRepeatedMessageField(value: self.notifications, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Patrol_GetNotificationsResponse, rhs: Patrol_GetNotificationsResponse) -> Bool { - if lhs.notifications != rhs.notifications {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Patrol_TapRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".TapRequest" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "selector"), - 2: .same(proto: "appId"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._selector) }() - case 2: try { try decoder.decodeSingularStringField(value: &self.appID) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._selector { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - if !self.appID.isEmpty { - try visitor.visitSingularStringField(value: self.appID, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Patrol_TapRequest, rhs: Patrol_TapRequest) -> Bool { - if lhs._selector != rhs._selector {return false} - if lhs.appID != rhs.appID {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Patrol_EnterTextRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".EnterTextRequest" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "data"), - 2: .same(proto: "appId"), - 3: .same(proto: "index"), - 4: .same(proto: "selector"), - 5: .same(proto: "showKeyboard"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.data) }() - case 2: try { try decoder.decodeSingularStringField(value: &self.appID) }() - case 3: try { - var v: UInt32? - try decoder.decodeSingularUInt32Field(value: &v) - if let v = v { - if self.findBy != nil {try decoder.handleConflictingOneOf()} - self.findBy = .index(v) - } - }() - case 4: try { - var v: Patrol_Selector? - var hadOneofValue = false - if let current = self.findBy { - hadOneofValue = true - if case .selector(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.findBy = .selector(v) - } - }() - case 5: try { try decoder.decodeSingularBoolField(value: &self.showKeyboard) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if !self.data.isEmpty { - try visitor.visitSingularStringField(value: self.data, fieldNumber: 1) - } - if !self.appID.isEmpty { - try visitor.visitSingularStringField(value: self.appID, fieldNumber: 2) - } - switch self.findBy { - case .index?: try { - guard case .index(let v)? = self.findBy else { preconditionFailure() } - try visitor.visitSingularUInt32Field(value: v, fieldNumber: 3) - }() - case .selector?: try { - guard case .selector(let v)? = self.findBy else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - }() - case nil: break - } - if self.showKeyboard != false { - try visitor.visitSingularBoolField(value: self.showKeyboard, fieldNumber: 5) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Patrol_EnterTextRequest, rhs: Patrol_EnterTextRequest) -> Bool { - if lhs.data != rhs.data {return false} - if lhs.appID != rhs.appID {return false} - if lhs.findBy != rhs.findBy {return false} - if lhs.showKeyboard != rhs.showKeyboard {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Patrol_SwipeRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".SwipeRequest" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "startX"), - 2: .same(proto: "startY"), - 3: .same(proto: "endX"), - 4: .same(proto: "endY"), - 5: .same(proto: "steps"), - 6: .same(proto: "appId"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularFloatField(value: &self.startX) }() - case 2: try { try decoder.decodeSingularFloatField(value: &self.startY) }() - case 3: try { try decoder.decodeSingularFloatField(value: &self.endX) }() - case 4: try { try decoder.decodeSingularFloatField(value: &self.endY) }() - case 5: try { try decoder.decodeSingularUInt32Field(value: &self.steps) }() - case 6: try { try decoder.decodeSingularStringField(value: &self.appID) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.startX != 0 { - try visitor.visitSingularFloatField(value: self.startX, fieldNumber: 1) - } - if self.startY != 0 { - try visitor.visitSingularFloatField(value: self.startY, fieldNumber: 2) - } - if self.endX != 0 { - try visitor.visitSingularFloatField(value: self.endX, fieldNumber: 3) - } - if self.endY != 0 { - try visitor.visitSingularFloatField(value: self.endY, fieldNumber: 4) - } - if self.steps != 0 { - try visitor.visitSingularUInt32Field(value: self.steps, fieldNumber: 5) - } - if !self.appID.isEmpty { - try visitor.visitSingularStringField(value: self.appID, fieldNumber: 6) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Patrol_SwipeRequest, rhs: Patrol_SwipeRequest) -> Bool { - if lhs.startX != rhs.startX {return false} - if lhs.startY != rhs.startY {return false} - if lhs.endX != rhs.endX {return false} - if lhs.endY != rhs.endY {return false} - if lhs.steps != rhs.steps {return false} - if lhs.appID != rhs.appID {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Patrol_WaitUntilVisibleRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".WaitUntilVisibleRequest" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "selector"), - 2: .same(proto: "appId"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._selector) }() - case 2: try { try decoder.decodeSingularStringField(value: &self.appID) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._selector { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - if !self.appID.isEmpty { - try visitor.visitSingularStringField(value: self.appID, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Patrol_WaitUntilVisibleRequest, rhs: Patrol_WaitUntilVisibleRequest) -> Bool { - if lhs._selector != rhs._selector {return false} - if lhs.appID != rhs.appID {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Patrol_HandlePermissionRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".HandlePermissionRequest" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "code"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.code != .whileUsing { - try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Patrol_HandlePermissionRequest, rhs: Patrol_HandlePermissionRequest) -> Bool { - if lhs.code != rhs.code {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Patrol_HandlePermissionRequest.Code: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "WHILE_USING"), - 1: .same(proto: "ONLY_THIS_TIME"), - 2: .same(proto: "DENIED"), - ] -} - -extension Patrol_SetLocationAccuracyRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".SetLocationAccuracyRequest" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "locationAccuracy"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.locationAccuracy) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.locationAccuracy != .coarse { - try visitor.visitSingularEnumField(value: self.locationAccuracy, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Patrol_SetLocationAccuracyRequest, rhs: Patrol_SetLocationAccuracyRequest) -> Bool { - if lhs.locationAccuracy != rhs.locationAccuracy {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Patrol_SetLocationAccuracyRequest.LocationAccuracy: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "COARSE"), - 1: .same(proto: "FINE"), - ] -} - -extension Patrol_PermissionDialogVisibleRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".PermissionDialogVisibleRequest" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "timeoutMillis"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularUInt64Field(value: &self.timeoutMillis) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.timeoutMillis != 0 { - try visitor.visitSingularUInt64Field(value: self.timeoutMillis, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Patrol_PermissionDialogVisibleRequest, rhs: Patrol_PermissionDialogVisibleRequest) -> Bool { - if lhs.timeoutMillis != rhs.timeoutMillis {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Patrol_PermissionDialogVisibleResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".PermissionDialogVisibleResponse" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "visible"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularBoolField(value: &self.visible) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.visible != false { - try visitor.visitSingularBoolField(value: self.visible, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Patrol_PermissionDialogVisibleResponse, rhs: Patrol_PermissionDialogVisibleResponse) -> Bool { - if lhs.visible != rhs.visible {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Patrol_Selector: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Selector" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "text"), - 2: .same(proto: "textStartsWith"), - 3: .same(proto: "textContains"), - 4: .same(proto: "className"), - 5: .same(proto: "contentDescription"), - 6: .same(proto: "contentDescriptionStartsWith"), - 7: .same(proto: "contentDescriptionContains"), - 8: .same(proto: "resourceId"), - 9: .same(proto: "instance"), - 10: .same(proto: "enabled"), - 11: .same(proto: "focused"), - 12: .same(proto: "pkg"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self._text) }() - case 2: try { try decoder.decodeSingularStringField(value: &self._textStartsWith) }() - case 3: try { try decoder.decodeSingularStringField(value: &self._textContains) }() - case 4: try { try decoder.decodeSingularStringField(value: &self._className) }() - case 5: try { try decoder.decodeSingularStringField(value: &self._contentDescription) }() - case 6: try { try decoder.decodeSingularStringField(value: &self._contentDescriptionStartsWith) }() - case 7: try { try decoder.decodeSingularStringField(value: &self._contentDescriptionContains) }() - case 8: try { try decoder.decodeSingularStringField(value: &self._resourceID) }() - case 9: try { try decoder.decodeSingularUInt32Field(value: &self._instance) }() - case 10: try { try decoder.decodeSingularBoolField(value: &self._enabled) }() - case 11: try { try decoder.decodeSingularBoolField(value: &self._focused) }() - case 12: try { try decoder.decodeSingularStringField(value: &self._pkg) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._text { - try visitor.visitSingularStringField(value: v, fieldNumber: 1) - } }() - try { if let v = self._textStartsWith { - try visitor.visitSingularStringField(value: v, fieldNumber: 2) - } }() - try { if let v = self._textContains { - try visitor.visitSingularStringField(value: v, fieldNumber: 3) - } }() - try { if let v = self._className { - try visitor.visitSingularStringField(value: v, fieldNumber: 4) - } }() - try { if let v = self._contentDescription { - try visitor.visitSingularStringField(value: v, fieldNumber: 5) - } }() - try { if let v = self._contentDescriptionStartsWith { - try visitor.visitSingularStringField(value: v, fieldNumber: 6) - } }() - try { if let v = self._contentDescriptionContains { - try visitor.visitSingularStringField(value: v, fieldNumber: 7) - } }() - try { if let v = self._resourceID { - try visitor.visitSingularStringField(value: v, fieldNumber: 8) - } }() - try { if let v = self._instance { - try visitor.visitSingularUInt32Field(value: v, fieldNumber: 9) - } }() - try { if let v = self._enabled { - try visitor.visitSingularBoolField(value: v, fieldNumber: 10) - } }() - try { if let v = self._focused { - try visitor.visitSingularBoolField(value: v, fieldNumber: 11) - } }() - try { if let v = self._pkg { - try visitor.visitSingularStringField(value: v, fieldNumber: 12) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Patrol_Selector, rhs: Patrol_Selector) -> Bool { - if lhs._text != rhs._text {return false} - if lhs._textStartsWith != rhs._textStartsWith {return false} - if lhs._textContains != rhs._textContains {return false} - if lhs._className != rhs._className {return false} - if lhs._contentDescription != rhs._contentDescription {return false} - if lhs._contentDescriptionStartsWith != rhs._contentDescriptionStartsWith {return false} - if lhs._contentDescriptionContains != rhs._contentDescriptionContains {return false} - if lhs._resourceID != rhs._resourceID {return false} - if lhs._instance != rhs._instance {return false} - if lhs._enabled != rhs._enabled {return false} - if lhs._focused != rhs._focused {return false} - if lhs._pkg != rhs._pkg {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Patrol_NativeView: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".NativeView" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "className"), - 2: .same(proto: "text"), - 3: .same(proto: "contentDescription"), - 4: .same(proto: "focused"), - 5: .same(proto: "enabled"), - 6: .same(proto: "childCount"), - 7: .same(proto: "resourceName"), - 8: .same(proto: "applicationPackage"), - 9: .same(proto: "children"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.className) }() - case 2: try { try decoder.decodeSingularStringField(value: &self.text) }() - case 3: try { try decoder.decodeSingularStringField(value: &self.contentDescription) }() - case 4: try { try decoder.decodeSingularBoolField(value: &self.focused) }() - case 5: try { try decoder.decodeSingularBoolField(value: &self.enabled) }() - case 6: try { try decoder.decodeSingularInt32Field(value: &self.childCount) }() - case 7: try { try decoder.decodeSingularStringField(value: &self.resourceName) }() - case 8: try { try decoder.decodeSingularStringField(value: &self.applicationPackage) }() - case 9: try { try decoder.decodeRepeatedMessageField(value: &self.children) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.className.isEmpty { - try visitor.visitSingularStringField(value: self.className, fieldNumber: 1) - } - if !self.text.isEmpty { - try visitor.visitSingularStringField(value: self.text, fieldNumber: 2) - } - if !self.contentDescription.isEmpty { - try visitor.visitSingularStringField(value: self.contentDescription, fieldNumber: 3) - } - if self.focused != false { - try visitor.visitSingularBoolField(value: self.focused, fieldNumber: 4) - } - if self.enabled != false { - try visitor.visitSingularBoolField(value: self.enabled, fieldNumber: 5) - } - if self.childCount != 0 { - try visitor.visitSingularInt32Field(value: self.childCount, fieldNumber: 6) - } - if !self.resourceName.isEmpty { - try visitor.visitSingularStringField(value: self.resourceName, fieldNumber: 7) - } - if !self.applicationPackage.isEmpty { - try visitor.visitSingularStringField(value: self.applicationPackage, fieldNumber: 8) - } - if !self.children.isEmpty { - try visitor.visitRepeatedMessageField(value: self.children, fieldNumber: 9) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Patrol_NativeView, rhs: Patrol_NativeView) -> Bool { - if lhs.className != rhs.className {return false} - if lhs.text != rhs.text {return false} - if lhs.contentDescription != rhs.contentDescription {return false} - if lhs.focused != rhs.focused {return false} - if lhs.enabled != rhs.enabled {return false} - if lhs.childCount != rhs.childCount {return false} - if lhs.resourceName != rhs.resourceName {return false} - if lhs.applicationPackage != rhs.applicationPackage {return false} - if lhs.children != rhs.children {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Patrol_Notification: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Notification" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "appName"), - 2: .same(proto: "title"), - 3: .same(proto: "content"), - 4: .same(proto: "raw"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self._appName) }() - case 2: try { try decoder.decodeSingularStringField(value: &self.title) }() - case 3: try { try decoder.decodeSingularStringField(value: &self.content) }() - case 4: try { try decoder.decodeSingularStringField(value: &self.raw) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._appName { - try visitor.visitSingularStringField(value: v, fieldNumber: 1) - } }() - if !self.title.isEmpty { - try visitor.visitSingularStringField(value: self.title, fieldNumber: 2) - } - if !self.content.isEmpty { - try visitor.visitSingularStringField(value: self.content, fieldNumber: 3) - } - if !self.raw.isEmpty { - try visitor.visitSingularStringField(value: self.raw, fieldNumber: 4) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Patrol_Notification, rhs: Patrol_Notification) -> Bool { - if lhs._appName != rhs._appName {return false} - if lhs.title != rhs.title {return false} - if lhs.content != rhs.content {return false} - if lhs.raw != rhs.raw {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Patrol_SubmitTestResultsRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".SubmitTestResultsRequest" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "results"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &self.results) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.results.isEmpty { - try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: self.results, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Patrol_SubmitTestResultsRequest, rhs: Patrol_SubmitTestResultsRequest) -> Bool { - if lhs.results != rhs.results {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} diff --git a/packages/patrol/ios/Classes/ObjCPatrolAppServiceClient.swift b/packages/patrol/ios/Classes/ObjCPatrolAppServiceClient.swift index 7809b671e..d25ccea51 100644 --- a/packages/patrol/ios/Classes/ObjCPatrolAppServiceClient.swift +++ b/packages/patrol/ios/Classes/ObjCPatrolAppServiceClient.swift @@ -1,5 +1,3 @@ -import Logging - /// The sole reason for existence of this class is that Swift Protobufs can't be used in Objective-C. @objc public class RunDartTestResponse2: NSObject { @objc public dynamic let passed: Bool diff --git a/packages/patrol/ios/Classes/SwiftPatrolPlugin.swift b/packages/patrol/ios/Classes/SwiftPatrolPlugin.swift index 2b6d2eb94..c07ab9da1 100644 --- a/packages/patrol/ios/Classes/SwiftPatrolPlugin.swift +++ b/packages/patrol/ios/Classes/SwiftPatrolPlugin.swift @@ -1,5 +1,4 @@ import Flutter -import GRPC import UIKit let kChannelName = "pl.leancode.patrol/main" diff --git a/packages/patrol/ios/patrol.podspec b/packages/patrol/ios/patrol.podspec index f1cf942f2..15af13f7c 100644 --- a/packages/patrol/ios/patrol.podspec +++ b/packages/patrol/ios/patrol.podspec @@ -24,7 +24,5 @@ Runs tests that use flutter_test and patrol APIs as native iOS integration tests s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' } s.swift_version = '5.0' - s.dependency 'Telegraph', '~> 0.30.0' - s.dependency 'gRPC-Swift', '~> 1.8.0' # This is the last version published on CocoaPods. - # Newer ones are only available on SPM. + s.dependency 'Telegraph', '~> 0.30.0' end diff --git a/packages/patrol_gen/lib/src/generators/ios/ios_telegraph_server_generator.dart b/packages/patrol_gen/lib/src/generators/ios/ios_telegraph_server_generator.dart index 3c366d5e6..3bf362ee3 100644 --- a/packages/patrol_gen/lib/src/generators/ios/ios_telegraph_server_generator.dart +++ b/packages/patrol_gen/lib/src/generators/ios/ios_telegraph_server_generator.dart @@ -4,7 +4,9 @@ import 'package:patrol_gen/src/schema.dart'; class IOSTelegraphServerGenerator { OutputFile generate(Service service, IOSConfig config) { - final buffer = StringBuffer()..write(_contentPrefix(config)); + final buffer = StringBuffer() + ..write(_contentPrefix(config)) + ..write(_generateServerProtocol(service)); return OutputFile( filename: config.serverFileName(service.name), @@ -22,6 +24,25 @@ class IOSTelegraphServerGenerator { '''; } + String _generateServerProtocol(Service service) { + final endpoints = + service.endpoints.map(_generateProtocolMethod).join('\n\n'); + + return ''' +protocol ${service.name}Client { +$endpoints +} +'''; + } + + String _generateProtocolMethod(Endpoint endpoint) { + final request = + endpoint.request != null ? 'request: ${endpoint.request!.name}' : ''; + final response = + endpoint.response != null ? ' -> ${endpoint.response!.name}' : ''; + return ' func ${endpoint.name}($request) async throws$response'; + } + String _generateSetUpRoutes(Service service) { return service.endpoints.map((e) => _generateRoute(e)).join('\n'); } From 3ff0978a19cb2988b6746458545a43eefb1d513b Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Wed, 23 Aug 2023 17:17:41 +0200 Subject: [PATCH 026/110] Generate telegraph routes and handlers --- .../AutomatorServer/AutomatorServer.swift | 12 +- .../NativeAutomatorServer.swift | 436 ++++++++++++++++++ .../AutomatorServer/PatrolServer.swift | 3 - .../ios/ios_telegraph_server_generator.dart | 102 +++- 4 files changed, 525 insertions(+), 28 deletions(-) diff --git a/packages/patrol/ios/Classes/AutomatorServer/AutomatorServer.swift b/packages/patrol/ios/Classes/AutomatorServer/AutomatorServer.swift index ab575c88a..ac32943ca 100644 --- a/packages/patrol/ios/Classes/AutomatorServer/AutomatorServer.swift +++ b/packages/patrol/ios/Classes/AutomatorServer/AutomatorServer.swift @@ -2,7 +2,7 @@ import Foundation -final class AutomatorServer: NativeAutomatorClient { +final class AutomatorServer: NativeAutomatorServer { private let automator: Automator private let onAppReady: (Bool) -> Void @@ -63,13 +63,11 @@ final class AutomatorServer: NativeAutomatorClient { ) async throws -> GetNativeViewsResponse { return try await runCatching { let nativeViews = try await automator.getNativeViews( - byText: request.selector.text, + byText: request.selector.text ?? String(), inApp: request.appId ) - return GetNativeViewsResponse.with { - $0.nativeViews = nativeViews - } + return GetNativeViewsResponse(nativeViews: nativeViews) } } @@ -215,9 +213,7 @@ final class AutomatorServer: NativeAutomatorClient { ) async throws -> GetNotificationsResponse { return try await runCatching { let notifications = try await automator.getNotifications() - return GetNotificationsResponse.with { - $0.notifications = notifications - } + return GetNotificationsResponse(notifications: notifications) } } diff --git a/packages/patrol/ios/Classes/AutomatorServer/NativeAutomatorServer.swift b/packages/patrol/ios/Classes/AutomatorServer/NativeAutomatorServer.swift index c9492ea2b..9d49edb63 100644 --- a/packages/patrol/ios/Classes/AutomatorServer/NativeAutomatorServer.swift +++ b/packages/patrol/ios/Classes/AutomatorServer/NativeAutomatorServer.swift @@ -3,3 +3,439 @@ // source: schema.dart // +import Telegraph + +protocol NativeAutomatorServer { + func initialize() async throws + func configure(request: ConfigureRequest) async throws + func pressHome() async throws + func pressBack() async throws + func pressRecentApps() async throws + func doublePressRecentApps() async throws + func openApp(request: OpenAppRequest) async throws + func openQuickSettings(request: OpenQuickSettingsRequest) async throws + func getNativeViews(request: GetNativeViewsRequest) async throws -> GetNativeViewsResponse + func tap(request: TapRequest) async throws + func doubleTap(request: TapRequest) async throws + func enterText(request: EnterTextRequest) async throws + func swipe(request: SwipeRequest) async throws + func waitUntilVisible(request: WaitUntilVisibleRequest) async throws + func enableAirplaneMode() async throws + func disableAirplaneMode() async throws + func enableWiFi() async throws + func disableWiFi() async throws + func enableCellular() async throws + func disableCellular() async throws + func enableBluetooth() async throws + func disableBluetooth() async throws + func enableDarkMode(request: DarkModeRequest) async throws + func disableDarkMode(request: DarkModeRequest) async throws + func openNotifications() async throws + func closeNotifications() async throws + func closeHeadsUpNotification() async throws + func getNotifications(request: GetNotificationsRequest) async throws -> GetNotificationsResponse + func tapOnNotification(request: TapOnNotificationRequest) async throws + func isPermissionDialogVisible(request: PermissionDialogVisibleRequest) async throws -> PermissionDialogVisibleResponse + func handlePermissionDialog(request: HandlePermissionRequest) async throws + func setLocationAccuracy(request: SetLocationAccuracyRequest) async throws + func debug() async throws + func markPatrolAppServiceReady() async throws +} + +extension NativeAutomatorServer { + private func initializeHandler(request: HTTPRequest) async throws -> HTTPResponse { + try await initialize() + return HTTPResponse(.ok) + } + + private func configureHandler(request: HTTPRequest) async throws -> HTTPResponse { + let requestArg = try JSONDecoder().decode(ConfigureRequest.self, from: request.body) + try await configure(request: requestArg) + return HTTPResponse(.ok) + } + + private func pressHomeHandler(request: HTTPRequest) async throws -> HTTPResponse { + try await pressHome() + return HTTPResponse(.ok) + } + + private func pressBackHandler(request: HTTPRequest) async throws -> HTTPResponse { + try await pressBack() + return HTTPResponse(.ok) + } + + private func pressRecentAppsHandler(request: HTTPRequest) async throws -> HTTPResponse { + try await pressRecentApps() + return HTTPResponse(.ok) + } + + private func doublePressRecentAppsHandler(request: HTTPRequest) async throws -> HTTPResponse { + try await doublePressRecentApps() + return HTTPResponse(.ok) + } + + private func openAppHandler(request: HTTPRequest) async throws -> HTTPResponse { + let requestArg = try JSONDecoder().decode(OpenAppRequest.self, from: request.body) + try await openApp(request: requestArg) + return HTTPResponse(.ok) + } + + private func openQuickSettingsHandler(request: HTTPRequest) async throws -> HTTPResponse { + let requestArg = try JSONDecoder().decode(OpenQuickSettingsRequest.self, from: request.body) + try await openQuickSettings(request: requestArg) + return HTTPResponse(.ok) + } + + private func getNativeViewsHandler(request: HTTPRequest) async throws -> HTTPResponse { + let requestArg = try JSONDecoder().decode(GetNativeViewsRequest.self, from: request.body) + let response = try await getNativeViews(request: requestArg) + let body = try JSONEncoder().encode(response) + return HTTPResponse(.ok, body: body) + } + + private func tapHandler(request: HTTPRequest) async throws -> HTTPResponse { + let requestArg = try JSONDecoder().decode(TapRequest.self, from: request.body) + try await tap(request: requestArg) + return HTTPResponse(.ok) + } + + private func doubleTapHandler(request: HTTPRequest) async throws -> HTTPResponse { + let requestArg = try JSONDecoder().decode(TapRequest.self, from: request.body) + try await doubleTap(request: requestArg) + return HTTPResponse(.ok) + } + + private func enterTextHandler(request: HTTPRequest) async throws -> HTTPResponse { + let requestArg = try JSONDecoder().decode(EnterTextRequest.self, from: request.body) + try await enterText(request: requestArg) + return HTTPResponse(.ok) + } + + private func swipeHandler(request: HTTPRequest) async throws -> HTTPResponse { + let requestArg = try JSONDecoder().decode(SwipeRequest.self, from: request.body) + try await swipe(request: requestArg) + return HTTPResponse(.ok) + } + + private func waitUntilVisibleHandler(request: HTTPRequest) async throws -> HTTPResponse { + let requestArg = try JSONDecoder().decode(WaitUntilVisibleRequest.self, from: request.body) + try await waitUntilVisible(request: requestArg) + return HTTPResponse(.ok) + } + + private func enableAirplaneModeHandler(request: HTTPRequest) async throws -> HTTPResponse { + try await enableAirplaneMode() + return HTTPResponse(.ok) + } + + private func disableAirplaneModeHandler(request: HTTPRequest) async throws -> HTTPResponse { + try await disableAirplaneMode() + return HTTPResponse(.ok) + } + + private func enableWiFiHandler(request: HTTPRequest) async throws -> HTTPResponse { + try await enableWiFi() + return HTTPResponse(.ok) + } + + private func disableWiFiHandler(request: HTTPRequest) async throws -> HTTPResponse { + try await disableWiFi() + return HTTPResponse(.ok) + } + + private func enableCellularHandler(request: HTTPRequest) async throws -> HTTPResponse { + try await enableCellular() + return HTTPResponse(.ok) + } + + private func disableCellularHandler(request: HTTPRequest) async throws -> HTTPResponse { + try await disableCellular() + return HTTPResponse(.ok) + } + + private func enableBluetoothHandler(request: HTTPRequest) async throws -> HTTPResponse { + try await enableBluetooth() + return HTTPResponse(.ok) + } + + private func disableBluetoothHandler(request: HTTPRequest) async throws -> HTTPResponse { + try await disableBluetooth() + return HTTPResponse(.ok) + } + + private func enableDarkModeHandler(request: HTTPRequest) async throws -> HTTPResponse { + let requestArg = try JSONDecoder().decode(DarkModeRequest.self, from: request.body) + try await enableDarkMode(request: requestArg) + return HTTPResponse(.ok) + } + + private func disableDarkModeHandler(request: HTTPRequest) async throws -> HTTPResponse { + let requestArg = try JSONDecoder().decode(DarkModeRequest.self, from: request.body) + try await disableDarkMode(request: requestArg) + return HTTPResponse(.ok) + } + + private func openNotificationsHandler(request: HTTPRequest) async throws -> HTTPResponse { + try await openNotifications() + return HTTPResponse(.ok) + } + + private func closeNotificationsHandler(request: HTTPRequest) async throws -> HTTPResponse { + try await closeNotifications() + return HTTPResponse(.ok) + } + + private func closeHeadsUpNotificationHandler(request: HTTPRequest) async throws -> HTTPResponse { + try await closeHeadsUpNotification() + return HTTPResponse(.ok) + } + + private func getNotificationsHandler(request: HTTPRequest) async throws -> HTTPResponse { + let requestArg = try JSONDecoder().decode(GetNotificationsRequest.self, from: request.body) + let response = try await getNotifications(request: requestArg) + let body = try JSONEncoder().encode(response) + return HTTPResponse(.ok, body: body) + } + + private func tapOnNotificationHandler(request: HTTPRequest) async throws -> HTTPResponse { + let requestArg = try JSONDecoder().decode(TapOnNotificationRequest.self, from: request.body) + try await tapOnNotification(request: requestArg) + return HTTPResponse(.ok) + } + + private func isPermissionDialogVisibleHandler(request: HTTPRequest) async throws -> HTTPResponse { + let requestArg = try JSONDecoder().decode(PermissionDialogVisibleRequest.self, from: request.body) + let response = try await isPermissionDialogVisible(request: requestArg) + let body = try JSONEncoder().encode(response) + return HTTPResponse(.ok, body: body) + } + + private func handlePermissionDialogHandler(request: HTTPRequest) async throws -> HTTPResponse { + let requestArg = try JSONDecoder().decode(HandlePermissionRequest.self, from: request.body) + try await handlePermissionDialog(request: requestArg) + return HTTPResponse(.ok) + } + + private func setLocationAccuracyHandler(request: HTTPRequest) async throws -> HTTPResponse { + let requestArg = try JSONDecoder().decode(SetLocationAccuracyRequest.self, from: request.body) + try await setLocationAccuracy(request: requestArg) + return HTTPResponse(.ok) + } + + private func debugHandler(request: HTTPRequest) async throws -> HTTPResponse { + try await debug() + return HTTPResponse(.ok) + } + + private func markPatrolAppServiceReadyHandler(request: HTTPRequest) async throws -> HTTPResponse { + try await markPatrolAppServiceReady() + return HTTPResponse(.ok) + } +} + +extension NativeAutomatorServer { + func setupRoutes(server: Server) { + server.route(.POST, "initialize") { + request in handleRequest( + request: request, + handler: initializeHandler) + } + server.route(.POST, "configure") { + request in handleRequest( + request: request, + handler: configureHandler) + } + server.route(.POST, "pressHome") { + request in handleRequest( + request: request, + handler: pressHomeHandler) + } + server.route(.POST, "pressBack") { + request in handleRequest( + request: request, + handler: pressBackHandler) + } + server.route(.POST, "pressRecentApps") { + request in handleRequest( + request: request, + handler: pressRecentAppsHandler) + } + server.route(.POST, "doublePressRecentApps") { + request in handleRequest( + request: request, + handler: doublePressRecentAppsHandler) + } + server.route(.POST, "openApp") { + request in handleRequest( + request: request, + handler: openAppHandler) + } + server.route(.POST, "openQuickSettings") { + request in handleRequest( + request: request, + handler: openQuickSettingsHandler) + } + server.route(.POST, "getNativeViews") { + request in handleRequest( + request: request, + handler: getNativeViewsHandler) + } + server.route(.POST, "tap") { + request in handleRequest( + request: request, + handler: tapHandler) + } + server.route(.POST, "doubleTap") { + request in handleRequest( + request: request, + handler: doubleTapHandler) + } + server.route(.POST, "enterText") { + request in handleRequest( + request: request, + handler: enterTextHandler) + } + server.route(.POST, "swipe") { + request in handleRequest( + request: request, + handler: swipeHandler) + } + server.route(.POST, "waitUntilVisible") { + request in handleRequest( + request: request, + handler: waitUntilVisibleHandler) + } + server.route(.POST, "enableAirplaneMode") { + request in handleRequest( + request: request, + handler: enableAirplaneModeHandler) + } + server.route(.POST, "disableAirplaneMode") { + request in handleRequest( + request: request, + handler: disableAirplaneModeHandler) + } + server.route(.POST, "enableWiFi") { + request in handleRequest( + request: request, + handler: enableWiFiHandler) + } + server.route(.POST, "disableWiFi") { + request in handleRequest( + request: request, + handler: disableWiFiHandler) + } + server.route(.POST, "enableCellular") { + request in handleRequest( + request: request, + handler: enableCellularHandler) + } + server.route(.POST, "disableCellular") { + request in handleRequest( + request: request, + handler: disableCellularHandler) + } + server.route(.POST, "enableBluetooth") { + request in handleRequest( + request: request, + handler: enableBluetoothHandler) + } + server.route(.POST, "disableBluetooth") { + request in handleRequest( + request: request, + handler: disableBluetoothHandler) + } + server.route(.POST, "enableDarkMode") { + request in handleRequest( + request: request, + handler: enableDarkModeHandler) + } + server.route(.POST, "disableDarkMode") { + request in handleRequest( + request: request, + handler: disableDarkModeHandler) + } + server.route(.POST, "openNotifications") { + request in handleRequest( + request: request, + handler: openNotificationsHandler) + } + server.route(.POST, "closeNotifications") { + request in handleRequest( + request: request, + handler: closeNotificationsHandler) + } + server.route(.POST, "closeHeadsUpNotification") { + request in handleRequest( + request: request, + handler: closeHeadsUpNotificationHandler) + } + server.route(.POST, "getNotifications") { + request in handleRequest( + request: request, + handler: getNotificationsHandler) + } + server.route(.POST, "tapOnNotification") { + request in handleRequest( + request: request, + handler: tapOnNotificationHandler) + } + server.route(.POST, "isPermissionDialogVisible") { + request in handleRequest( + request: request, + handler: isPermissionDialogVisibleHandler) + } + server.route(.POST, "handlePermissionDialog") { + request in handleRequest( + request: request, + handler: handlePermissionDialogHandler) + } + server.route(.POST, "setLocationAccuracy") { + request in handleRequest( + request: request, + handler: setLocationAccuracyHandler) + } + server.route(.POST, "debug") { + request in handleRequest( + request: request, + handler: debugHandler) + } + server.route(.POST, "markPatrolAppServiceReady") { + request in handleRequest( + request: request, + handler: markPatrolAppServiceReadyHandler) + } + } +} + +fileprivate class Box { + var result: Result? = nil +} + +extension NativeAutomatorServer { + private func handleRequest(request: HTTPRequest, handler: @escaping (HTTPRequest) async throws -> HTTPResponse) -> HTTPResponse { + do { + return try unsafeWait { + return try await handler(request) + } + } catch let err { + return HTTPResponse(.badRequest, headers: [:], error: err) + } + } + + private func unsafeWait(_ f: @escaping () async throws -> ResultType) throws -> ResultType { + let box = Box() + let sema = DispatchSemaphore(value: 0) + Task { + do { + let val = try await f() + box.result = .success(val) + } catch { + box.result = .failure(error) + } + sema.signal() + } + sema.wait() + return try box.result!.get() + } +} diff --git a/packages/patrol/ios/Classes/AutomatorServer/PatrolServer.swift b/packages/patrol/ios/Classes/AutomatorServer/PatrolServer.swift index b8368545c..af67a15cd 100644 --- a/packages/patrol/ios/Classes/AutomatorServer/PatrolServer.swift +++ b/packages/patrol/ios/Classes/AutomatorServer/PatrolServer.swift @@ -1,7 +1,4 @@ import Foundation -import GRPC -import NIOCore -import NIOPosix @objc public class PatrolServer: NSObject { private static let envPortKey = "PATROL_PORT" diff --git a/packages/patrol_gen/lib/src/generators/ios/ios_telegraph_server_generator.dart b/packages/patrol_gen/lib/src/generators/ios/ios_telegraph_server_generator.dart index 3bf362ee3..89cbc90be 100644 --- a/packages/patrol_gen/lib/src/generators/ios/ios_telegraph_server_generator.dart +++ b/packages/patrol_gen/lib/src/generators/ios/ios_telegraph_server_generator.dart @@ -6,7 +6,13 @@ class IOSTelegraphServerGenerator { OutputFile generate(Service service, IOSConfig config) { final buffer = StringBuffer() ..write(_contentPrefix(config)) - ..write(_generateServerProtocol(service)); + ..write(_generateServerProtocol(service)) + ..writeln() + ..write(_generateHandlers(service)) + ..writeln() + ..write(_generateSetupRoutes(service)) + ..writeln() + ..write(_generateUtils()); return OutputFile( filename: config.serverFileName(service.name), @@ -21,15 +27,16 @@ class IOSTelegraphServerGenerator { // source: schema.dart // +import Telegraph + '''; } String _generateServerProtocol(Service service) { - final endpoints = - service.endpoints.map(_generateProtocolMethod).join('\n\n'); + final endpoints = service.endpoints.map(_generateProtocolMethod).join('\n'); return ''' -protocol ${service.name}Client { +protocol ${service.name}Server { $endpoints } '''; @@ -43,30 +50,91 @@ $endpoints return ' func ${endpoint.name}($request) async throws$response'; } - String _generateSetUpRoutes(Service service) { - return service.endpoints.map((e) => _generateRoute(e)).join('\n'); + String _generateHandlers(Service service) { + final handlers = service.endpoints.map(_generateHandler).join('\n\n'); + return ''' +extension ${service.name}Server { +$handlers +} +'''; } - String _generateRoute(Endpoint endpoint) { - final command = endpoint.request != null + String _generateHandler(Endpoint endpoint) { + final requestArg = endpoint.request != null ? ''' - let command = try self.decoder.decode(${endpoint.request!.name}.self, from: request.body)''' + let requestArg = try JSONDecoder().decode(${endpoint.request!.name}.self, from: request.body)''' : ''; + final responseVariable = endpoint.response != null ? 'let response = ' : ''; + final response = endpoint.response != null + ? ''' + let body = try JSONEncoder().encode(response) + return HTTPResponse(.ok, body: body)''' + : ' return HTTPResponse(.ok)'; + return ''' -server.route(.POST, "${endpoint.name}") { request in - do {$command - interface.${endpoint.name}(${command.isNotEmpty ? 'command' : ''}) - return HTTPResponse(.ok) - } catch let err { - return HTTPResponse(.badRequest, headers: [:], error: err) + private func ${endpoint.name}Handler(request: HTTPRequest) async throws -> HTTPResponse {$requestArg + ${responseVariable}try await ${endpoint.name}(${requestArg.isNotEmpty ? 'request: requestArg' : ''}) +$response + }'''; } + + String _generateSetupRoutes(Service service) { + final routes = service.endpoints.map(_generateRoute).join('\n'); + + return ''' +extension ${service.name}Server { + func setupRoutes(server: Server) { +$routes + } } '''; } - String _generateInterface(Service service) { - return ''; + String _generateRoute(Endpoint endpoint) { + return ''' + server.route(.POST, "${endpoint.name}") { + request in handleRequest( + request: request, + handler: ${endpoint.name}Handler) + }'''; + } + + String _generateUtils() { + // https://forums.swift.org/t/using-async-functions-from-synchronous-functions-and-breaking-all-the-rules/59782 + return ''' +fileprivate class Box { + var result: Result? = nil +} + +extension NativeAutomatorServer { + private func handleRequest(request: HTTPRequest, handler: @escaping (HTTPRequest) async throws -> HTTPResponse) -> HTTPResponse { + do { + return try unsafeWait { + return try await handler(request) + } + } catch let err { + return HTTPResponse(.badRequest, headers: [:], error: err) + } + } + + private func unsafeWait(_ f: @escaping () async throws -> ResultType) throws -> ResultType { + let box = Box() + let sema = DispatchSemaphore(value: 0) + Task { + do { + let val = try await f() + box.result = .success(val) + } catch { + box.result = .failure(error) + } + sema.signal() + } + sema.wait() + return try box.result!.get() + } +} +'''; } } From 8b7123907a7b3dc0be6dcf9d86019e9c34edb4cc Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Thu, 24 Aug 2023 11:49:59 +0200 Subject: [PATCH 027/110] Add telegraph server --- .../AutomatorServer/PatrolServer.swift | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/packages/patrol/ios/Classes/AutomatorServer/PatrolServer.swift b/packages/patrol/ios/Classes/AutomatorServer/PatrolServer.swift index af67a15cd..e47bb4179 100644 --- a/packages/patrol/ios/Classes/AutomatorServer/PatrolServer.swift +++ b/packages/patrol/ios/Classes/AutomatorServer/PatrolServer.swift @@ -1,4 +1,5 @@ import Foundation +import Telegraph @objc public class PatrolServer: NSObject { private static let envPortKey = "PATROL_PORT" @@ -8,6 +9,8 @@ import Foundation #if PATROL_ENABLED private let port: Int private let automator: Automator + private let server: Server + private let dispatchGroup = DispatchGroup() #endif @objc @@ -36,6 +39,7 @@ import Foundation Logger.shared.i("PATROL_ENABLED flag is defined") self.port = passedPort self.automator = Automator() + self.server = Server() #else Logger.shared.i("Fatal error: PATROL_ENABLED flag is not defined") #endif @@ -43,19 +47,22 @@ import Foundation @objc public func start() async throws { #if PATROL_ENABLED - let group = MultiThreadedEventLoopGroup(numberOfThreads: 1) + Logger.shared.i("Starting server...") + let provider = AutomatorServer(automator: automator) { appReady in Logger.shared.i("App reported that it is ready") self.appReady = appReady } - - let server = try await Server.insecure(group: group).withServiceProviders([provider]).bind( - host: "0.0.0.0", port: port - ).get() - + + try server.start(port: port) + Logger.shared.i("Server started on http://0.0.0.0:\(port)") - - try await server.onClose.get() + + provider.setupRoutes(server: server) + + dispatchGroup.enter() + dispatchGroup.wait() + Logger.shared.i("Server stopped") #endif } From ad55462a38bb30ca1d00ef5749b9f7799f0237eb Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Thu, 24 Aug 2023 12:05:07 +0200 Subject: [PATCH 028/110] Fix dart deserialization --- .../lib/src/native/contracts/native_automator_client.dart | 5 ++++- .../lib/src/generators/dart/dart_http_client_generator.dart | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/patrol/lib/src/native/contracts/native_automator_client.dart b/packages/patrol/lib/src/native/contracts/native_automator_client.dart index 05063ffcc..f4c27e8ad 100644 --- a/packages/patrol/lib/src/native/contracts/native_automator_client.dart +++ b/packages/patrol/lib/src/native/contracts/native_automator_client.dart @@ -300,6 +300,9 @@ class NativeAutomatorClient { if (response.statusCode != 200) { throw NativeAutomatorClientException(response.statusCode, response.body); } - return jsonDecode(response.body) as Map; + + return response.body.isNotEmpty + ? jsonDecode(response.body) as Map + : {}; } } diff --git a/packages/patrol_gen/lib/src/generators/dart/dart_http_client_generator.dart b/packages/patrol_gen/lib/src/generators/dart/dart_http_client_generator.dart index ae41f55b9..046ee7702 100644 --- a/packages/patrol_gen/lib/src/generators/dart/dart_http_client_generator.dart +++ b/packages/patrol_gen/lib/src/generators/dart/dart_http_client_generator.dart @@ -62,7 +62,10 @@ $endpoints if (response.statusCode != 200) { throw NativeAutomatorClientException(response.statusCode, response.body); } - return jsonDecode(response.body) as Map; + + return response.body.isNotEmpty + ? jsonDecode(response.body) as Map + : {}; } } '''; From f9d4f6f181df1b28c410814d2a1bc5072ee17dbc Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Thu, 24 Aug 2023 14:42:06 +0200 Subject: [PATCH 029/110] Fix app crash when using dark mode on iOS simulators --- .../patrol/ios/Classes/AutomatorServer/Automator.swift | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/patrol/ios/Classes/AutomatorServer/Automator.swift b/packages/patrol/ios/Classes/AutomatorServer/Automator.swift index 7e12d8b8e..a72cf44d2 100644 --- a/packages/patrol/ios/Classes/AutomatorServer/Automator.swift +++ b/packages/patrol/ios/Classes/AutomatorServer/Automator.swift @@ -100,7 +100,7 @@ inApp bundleId: String ) async throws { let view = "text field with text \(format: text) at index \(index) in app \(bundleId)" - var data = "\(data)\n" + let data = "\(data)\n" try await runAction("entering text \(format: data) into \(view)") { let app = try self.getApp(withBundleId: bundleId) @@ -210,8 +210,8 @@ self.preferences.descendants(matching: .any)["Developer"].firstMatch.tap() let value = - self.preferences.descendants(matching: .any)["Dark Appearance"].firstMatch.value! - as! String + self.preferences.descendants(matching: .any)["Dark Appearance"].firstMatch.value + as? String? if value == "0" { self.preferences.descendants(matching: .any)["Dark Appearance"].firstMatch.tap() } @@ -228,8 +228,8 @@ self.preferences.descendants(matching: .any)["Developer"].firstMatch.tap() let value = - self.preferences.descendants(matching: .any)["Dark Appearance"].firstMatch.value! - as! String + self.preferences.descendants(matching: .any)["Dark Appearance"].firstMatch.value + as? String? if value == "1" { self.preferences.descendants(matching: .any)["Dark Appearance"].firstMatch.tap() } From aedf94371e0f4ed19df98ece19a3ca19e1290070 Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Thu, 24 Aug 2023 15:35:11 +0200 Subject: [PATCH 030/110] Change Swift client address --- packages/patrol/ios/Classes/ObjCPatrolAppServiceClient.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/patrol/ios/Classes/ObjCPatrolAppServiceClient.swift b/packages/patrol/ios/Classes/ObjCPatrolAppServiceClient.swift index d25ccea51..53ab21813 100644 --- a/packages/patrol/ios/Classes/ObjCPatrolAppServiceClient.swift +++ b/packages/patrol/ios/Classes/ObjCPatrolAppServiceClient.swift @@ -24,7 +24,7 @@ NSLog("PatrolAppServiceClient: created, port: \(port)") - client = PatrolAppServiceClient(port: port, address: "127.0.0.1") + client = PatrolAppServiceClient(port: port, address: "localhost") } @objc public func listDartTests() async throws -> [String] { From 127a801f34cc17c7b5d90af345cb45e591c038e8 Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Thu, 24 Aug 2023 16:25:38 +0200 Subject: [PATCH 031/110] Add more logs --- .../patrol/ios/Classes/PatrolIntegrationTestRunner.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/patrol/ios/Classes/PatrolIntegrationTestRunner.h b/packages/patrol/ios/Classes/PatrolIntegrationTestRunner.h index 9c5f54c3f..14b5e7beb 100644 --- a/packages/patrol/ios/Classes/PatrolIntegrationTestRunner.h +++ b/packages/patrol/ios/Classes/PatrolIntegrationTestRunner.h @@ -22,9 +22,13 @@ NSLog(@"Server loop done, error: %@", err); \ }]; \ \ + NSLog(@"Create PatrolAppServiceClient"); \ + \ /* Create a client for PatrolAppService, which lets us list and run Dart tests */ \ __block ObjCPatrolAppServiceClient *appServiceClient = [[ObjCPatrolAppServiceClient alloc] init]; \ \ + NSLog(@"Allow the Local Network permission required by Dart Observatory"); \ + \ /* Allow the Local Network permission required by Dart Observatory */ \ XCUIApplication *springboard = [[XCUIApplication alloc] initWithBundleIdentifier:@"com.apple.springboard"]; \ XCUIElementQuery *systemAlerts = springboard.alerts; \ @@ -32,14 +36,20 @@ [systemAlerts.buttons[@"Allow"] tap]; \ } \ \ + NSLog(@"Run the app for the first time"); \ + \ /* Run the app for the first time to gather Dart tests */ \ [[[XCUIApplication alloc] init] launch]; \ \ + NSLog(@"Waiting until the app reports that it is ready"); \ + \ /* Spin the runloop waiting until the app reports that it is ready to report Dart tests */ \ while (!server.appReady) { \ [NSRunLoop.currentRunLoop runUntilDate:[NSDate dateWithTimeIntervalSinceNow:1.0]]; \ } \ \ + NSLog(@"listDartTests"); \ + \ __block NSArray *dartTestFiles = NULL; \ [appServiceClient \ listDartTestsWithCompletionHandler:^(NSArray *_Nullable dartTests, NSError *_Nullable err) { \ From 7dbfb15f063923e375e163021986e9a7bba95e3e Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Thu, 24 Aug 2023 16:49:09 +0200 Subject: [PATCH 032/110] Change shelf config --- packages/patrol/ios/Classes/PatrolIntegrationTestRunner.h | 2 ++ packages/patrol/lib/src/native/patrol_app_service.dart | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/patrol/ios/Classes/PatrolIntegrationTestRunner.h b/packages/patrol/ios/Classes/PatrolIntegrationTestRunner.h index 14b5e7beb..07993aabb 100644 --- a/packages/patrol/ios/Classes/PatrolIntegrationTestRunner.h +++ b/packages/patrol/ios/Classes/PatrolIntegrationTestRunner.h @@ -60,6 +60,8 @@ dartTestFiles = dartTests; \ }]; \ \ + NSLog(@"Spin the runloop waiting"); \ + \ /* Spin the runloop waiting until the app reports the Dart tests it contains */ \ while (!dartTestFiles) { \ [NSRunLoop.currentRunLoop runUntilDate:[NSDate dateWithTimeIntervalSinceNow:1.0]]; \ diff --git a/packages/patrol/lib/src/native/patrol_app_service.dart b/packages/patrol/lib/src/native/patrol_app_service.dart index 1bb441f28..ec3beaf1c 100644 --- a/packages/patrol/lib/src/native/patrol_app_service.dart +++ b/packages/patrol/lib/src/native/patrol_app_service.dart @@ -25,7 +25,13 @@ Future runAppService(PatrolAppService service) async { .addMiddleware(shelf.logRequests()) .addHandler(service.handle); - final server = await shelf_io.serve(pipeline, InternetAddress.anyIPv4, _port); + final server = await shelf_io.serve( + pipeline, + InternetAddress.anyIPv4, + _port, + poweredByHeader: null, + shared: true, + ); final address = server.address; From babd1d265c426e16be2b825f3855cec2a86e6f72 Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Thu, 24 Aug 2023 17:21:44 +0200 Subject: [PATCH 033/110] Throw exception for CI logs --- packages/patrol/ios/Classes/PatrolIntegrationTestRunner.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/patrol/ios/Classes/PatrolIntegrationTestRunner.h b/packages/patrol/ios/Classes/PatrolIntegrationTestRunner.h index 07993aabb..1a7ac1e14 100644 --- a/packages/patrol/ios/Classes/PatrolIntegrationTestRunner.h +++ b/packages/patrol/ios/Classes/PatrolIntegrationTestRunner.h @@ -64,7 +64,8 @@ \ /* Spin the runloop waiting until the app reports the Dart tests it contains */ \ while (!dartTestFiles) { \ - [NSRunLoop.currentRunLoop runUntilDate:[NSDate dateWithTimeIntervalSinceNow:1.0]]; \ + [NSRunLoop.currentRunLoop runUntilDate:[NSDate dateWithTimeIntervalSinceNow:5.0]]; \ + [NSException raise:@"TODOInvalid runUntilDate"] \ } \ \ NSLog(@"Got %lu Dart tests: %@", dartTestFiles.count, dartTestFiles); \ From 02dce75947850fcb312c2d329f0cc5e5a57b827b Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Fri, 25 Aug 2023 11:50:54 +0200 Subject: [PATCH 034/110] Fix macro --- packages/patrol/ios/Classes/PatrolIntegrationTestRunner.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/patrol/ios/Classes/PatrolIntegrationTestRunner.h b/packages/patrol/ios/Classes/PatrolIntegrationTestRunner.h index 1a7ac1e14..321b25395 100644 --- a/packages/patrol/ios/Classes/PatrolIntegrationTestRunner.h +++ b/packages/patrol/ios/Classes/PatrolIntegrationTestRunner.h @@ -65,7 +65,7 @@ /* Spin the runloop waiting until the app reports the Dart tests it contains */ \ while (!dartTestFiles) { \ [NSRunLoop.currentRunLoop runUntilDate:[NSDate dateWithTimeIntervalSinceNow:5.0]]; \ - [NSException raise:@"TODOInvalid runUntilDate"] \ + @throw [NSException exceptionWithName:@"TODO exception1234" reason:@"Test" userInfo:nil]; \ } \ \ NSLog(@"Got %lu Dart tests: %@", dartTestFiles.count, dartTestFiles); \ From c399cb5dd5faf81770ddf44f6912362bcfe0b14c Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Fri, 25 Aug 2023 12:33:41 +0200 Subject: [PATCH 035/110] Comment using DispatchGroup --- .../patrol/ios/Classes/AutomatorServer/PatrolServer.swift | 8 +++----- packages/patrol/ios/Classes/PatrolIntegrationTestRunner.h | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/patrol/ios/Classes/AutomatorServer/PatrolServer.swift b/packages/patrol/ios/Classes/AutomatorServer/PatrolServer.swift index e47bb4179..671096898 100644 --- a/packages/patrol/ios/Classes/AutomatorServer/PatrolServer.swift +++ b/packages/patrol/ios/Classes/AutomatorServer/PatrolServer.swift @@ -10,7 +10,7 @@ import Telegraph private let port: Int private let automator: Automator private let server: Server - private let dispatchGroup = DispatchGroup() +// private let dispatchGroup = DispatchGroup() #endif @objc @@ -60,10 +60,8 @@ import Telegraph provider.setupRoutes(server: server) - dispatchGroup.enter() - dispatchGroup.wait() - - Logger.shared.i("Server stopped") +// dispatchGroup.enter() +// dispatchGroup.wait() #endif } } diff --git a/packages/patrol/ios/Classes/PatrolIntegrationTestRunner.h b/packages/patrol/ios/Classes/PatrolIntegrationTestRunner.h index 321b25395..e5cb72e1b 100644 --- a/packages/patrol/ios/Classes/PatrolIntegrationTestRunner.h +++ b/packages/patrol/ios/Classes/PatrolIntegrationTestRunner.h @@ -65,7 +65,7 @@ /* Spin the runloop waiting until the app reports the Dart tests it contains */ \ while (!dartTestFiles) { \ [NSRunLoop.currentRunLoop runUntilDate:[NSDate dateWithTimeIntervalSinceNow:5.0]]; \ - @throw [NSException exceptionWithName:@"TODO exception1234" reason:@"Test" userInfo:nil]; \ + /* @throw [NSException exceptionWithName:@"TODO exception1234" reason:@"Test" userInfo:nil]; */ \ } \ \ NSLog(@"Got %lu Dart tests: %@", dartTestFiles.count, dartTestFiles); \ From 4f26b3a629023e65b70628fe46f0791dcd6e90ef Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Fri, 25 Aug 2023 16:39:18 +0200 Subject: [PATCH 036/110] Verify race condition theory --- packages/patrol/ios/Classes/ObjCPatrolAppServiceClient.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/patrol/ios/Classes/ObjCPatrolAppServiceClient.swift b/packages/patrol/ios/Classes/ObjCPatrolAppServiceClient.swift index 53ab21813..e16546de8 100644 --- a/packages/patrol/ios/Classes/ObjCPatrolAppServiceClient.swift +++ b/packages/patrol/ios/Classes/ObjCPatrolAppServiceClient.swift @@ -36,6 +36,8 @@ } @objc public func runDartTest(name: String) async throws -> RunDartTestResponse2 { + try await Task.sleep(nanoseconds: UInt64(2 * Double(NSEC_PER_SEC))) + NSLog("PatrolAppServiceClient.runDartTest(\(name))") let request = RunDartTestRequest(name: name) From 950e87557335ce1ad1ff9ff8d378ba92a9cf3b84 Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Fri, 25 Aug 2023 17:50:47 +0200 Subject: [PATCH 037/110] Change timeouts --- .../Classes/AutomatorServer/PatrolAppServiceClient.swift | 9 +++++++-- packages/patrol/lib/src/native/patrol_app_service.dart | 3 ++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/patrol/ios/Classes/AutomatorServer/PatrolAppServiceClient.swift b/packages/patrol/ios/Classes/AutomatorServer/PatrolAppServiceClient.swift index 49d66b770..17dd3f188 100644 --- a/packages/patrol/ios/Classes/AutomatorServer/PatrolAppServiceClient.swift +++ b/packages/patrol/ios/Classes/AutomatorServer/PatrolAppServiceClient.swift @@ -23,12 +23,17 @@ class PatrolAppServiceClient { private func performRequest(requestName: String, body: Data? = nil) async throws -> TResult { let url = URL(string: "http://\(address):\(port)/\(requestName)")! - + + let urlconfig = URLSessionConfiguration.default + urlconfig.timeoutIntervalForRequest = TimeInterval(300) + urlconfig.timeoutIntervalForResource = TimeInterval(300) + var request = URLRequest(url: url) request.httpMethod = "POST" request.httpBody = body + request.timeoutInterval = TimeInterval(300) - let (data, response) = try await URLSession.shared.data(for: request) + let (data, response) = try await URLSession(configuration: urlconfig).data(for: request) guard (response as? HTTPURLResponse)?.statusCode == 200 else { throw PatrolError.internal("Invalid response: \(response) \(data)") } diff --git a/packages/patrol/lib/src/native/patrol_app_service.dart b/packages/patrol/lib/src/native/patrol_app_service.dart index ec3beaf1c..a487da014 100644 --- a/packages/patrol/lib/src/native/patrol_app_service.dart +++ b/packages/patrol/lib/src/native/patrol_app_service.dart @@ -30,9 +30,10 @@ Future runAppService(PatrolAppService service) async { InternetAddress.anyIPv4, _port, poweredByHeader: null, - shared: true, ); + server.idleTimeout = const Duration(seconds: 300); + final address = server.address; print( From 97c224e7beca7eb63f724d71720fed8c817034f6 Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Fri, 25 Aug 2023 18:35:07 +0200 Subject: [PATCH 038/110] Downgrade http --- packages/patrol/pubspec.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/patrol/pubspec.yaml b/packages/patrol/pubspec.yaml index 1d34fc8e5..14d390d46 100644 --- a/packages/patrol/pubspec.yaml +++ b/packages/patrol/pubspec.yaml @@ -16,8 +16,8 @@ dependencies: flutter: sdk: flutter flutter_test: - sdk: flutter - http: ^1.1.0 + sdk: flutter + http: ^0.13.6 integration_test: sdk: flutter json_annotation: ^4.8.1 From b36b4354bd0c2cb9ff4ab4a971a14ead55b1d1b2 Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Fri, 25 Aug 2023 18:41:40 +0200 Subject: [PATCH 039/110] Change dart client default timeout --- .../lib/src/native/contracts/native_automator_client.dart | 2 +- .../lib/src/generators/dart/dart_http_client_generator.dart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/patrol/lib/src/native/contracts/native_automator_client.dart b/packages/patrol/lib/src/native/contracts/native_automator_client.dart index f4c27e8ad..ce312a41d 100644 --- a/packages/patrol/lib/src/native/contracts/native_automator_client.dart +++ b/packages/patrol/lib/src/native/contracts/native_automator_client.dart @@ -27,7 +27,7 @@ class NativeAutomatorClient { const NativeAutomatorClient( this._client, this._apiUri, { - Duration timeout = const Duration(seconds: 30), + Duration timeout = const Duration(seconds: 300), }) : _timeout = timeout; final Duration _timeout; diff --git a/packages/patrol_gen/lib/src/generators/dart/dart_http_client_generator.dart b/packages/patrol_gen/lib/src/generators/dart/dart_http_client_generator.dart index 046ee7702..5975364ac 100644 --- a/packages/patrol_gen/lib/src/generators/dart/dart_http_client_generator.dart +++ b/packages/patrol_gen/lib/src/generators/dart/dart_http_client_generator.dart @@ -42,7 +42,7 @@ class ${service.name}Client { const ${service.name}Client( this._client, this._apiUri, { - Duration timeout = const Duration(seconds: 30), + Duration timeout = const Duration(seconds: 300), }) : _timeout = timeout; final Duration _timeout; From 0dc056bc0bdaf9de29127709166df13140d6178f Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Mon, 28 Aug 2023 13:57:04 +0200 Subject: [PATCH 040/110] Add android contracts generation --- gen_from_schema | 5 +- packages/patrol/android/build.gradle | 1 + .../android/gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 60756 bytes .../gradle/wrapper/gradle-wrapper.properties | 5 + packages/patrol/android/gradlew | 240 ++++++++++++++++++ packages/patrol/android/gradlew.bat | 91 +++++++ .../pl/leancode/patrol/contracts/Contracts.kt | 191 ++++++++++++++ packages/patrol_gen/bin/main.dart | 5 + .../generators/android/android_config.dart | 17 ++ .../android/android_contracts_generator.dart | 73 ++++++ .../generators/android/android_generator.dart | 14 + packages/patrol_gen/lib/src/patrol_gen.dart | 8 +- .../patrol_gen/lib/src/resolve_schema.dart | 6 + packages/patrol_gen/lib/src/schema.dart | 3 +- schema.dart | 4 +- 15 files changed, 658 insertions(+), 5 deletions(-) create mode 100644 packages/patrol/android/gradle/wrapper/gradle-wrapper.jar create mode 100644 packages/patrol/android/gradle/wrapper/gradle-wrapper.properties create mode 100755 packages/patrol/android/gradlew create mode 100644 packages/patrol/android/gradlew.bat create mode 100644 packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/Contracts.kt create mode 100644 packages/patrol_gen/lib/src/generators/android/android_config.dart create mode 100644 packages/patrol_gen/lib/src/generators/android/android_contracts_generator.dart create mode 100644 packages/patrol_gen/lib/src/generators/android/android_generator.dart diff --git a/gen_from_schema b/gen_from_schema index fbaa73cd1..0b908ccf6 100755 --- a/gen_from_schema +++ b/gen_from_schema @@ -13,7 +13,10 @@ patrol_dart_out_dir="lib/src/native/contracts" ios_out="$patrol_package/ios/Classes/AutomatorServer" dart_out="$patrol_package/$patrol_dart_out_dir" -dart run packages/patrol_gen/bin/main.dart $schema $dart_out $ios_out +android_out="$patrol_package/android/src/main/kotlin/pl/leancode/patrol/contracts" +android_package="pl.leancode.patrol.contracts" + +dart run packages/patrol_gen/bin/main.dart $schema $dart_out $ios_out $android_out $android_package cd "${patrol_package}" dart run build_runner build --delete-conflicting-outputs --build-filter="$patrol_dart_out_dir/*.dart" diff --git a/packages/patrol/android/build.gradle b/packages/patrol/android/build.gradle index 15084de39..2bd3fa07e 100644 --- a/packages/patrol/android/build.gradle +++ b/packages/patrol/android/build.gradle @@ -69,6 +69,7 @@ android { implementation "io.grpc:grpc-kotlin-stub:1.3.0" implementation "io.grpc:grpc-okhttp:1.49.2" implementation "javax.annotation:javax.annotation-api:1.3.2" + implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.0" testImplementation "org.jetbrains.kotlin:kotlin-test" } diff --git a/packages/patrol/android/gradle/wrapper/gradle-wrapper.jar b/packages/patrol/android/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000000000000000000000000000000000000..249e5832f090a2944b7473328c07c9755baa3196 GIT binary patch literal 60756 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 '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" +APP_BASE_NAME=${0##*/} + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/packages/patrol/android/gradlew.bat b/packages/patrol/android/gradlew.bat new file mode 100644 index 000000000..53a6b238d --- /dev/null +++ b/packages/patrol/android/gradlew.bat @@ -0,0 +1,91 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 0 goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/Contracts.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/Contracts.kt new file mode 100644 index 000000000..dd5ba068c --- /dev/null +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/Contracts.kt @@ -0,0 +1,191 @@ +/// +// Generated code. Do not modify. +// source: schema.dart +// + +package pl.leancode.patrol.contracts; + +import kotlinx.serialization.Serializable + +@Serializable +enum class RunDartTestResponseResult { + success, + skipped, + failure, +} + +@Serializable +enum class HandlePermissionRequestCode { + whileUsing, + onlyThisTime, + denied, +} + +@Serializable +enum class SetLocationAccuracyRequestLocationAccuracy { + coarse, + fine, +} + +@Serializable +data class DartTestCase ( + val name: String +) + +@Serializable +data class DartTestGroup ( + val name: String, + val tests: List, + val groups: List +) + +@Serializable +data class ListDartTestsResponse ( + val group: DartTestGroup +) + +@Serializable +data class RunDartTestRequest ( + val name: String +) + +@Serializable +data class RunDartTestResponse ( + val result: RunDartTestResponseResult, + val details: String? +) + +@Serializable +data class ConfigureRequest ( + val findTimeoutMillis: Int +) + +@Serializable +data class OpenAppRequest ( + val appId: String +) + +@Serializable +class OpenQuickSettingsRequest ( + +) + +@Serializable +data class Selector ( + val text: String?, + val textStartsWith: String?, + val textContains: String?, + val className: String?, + val contentDescription: String?, + val contentDescriptionStartsWith: String?, + val contentDescriptionContains: String?, + val resourceId: String?, + val instance: Int?, + val enabled: Boolean?, + val focused: Boolean?, + val pkg: String? +) + +@Serializable +data class GetNativeViewsRequest ( + val selector: Selector, + val appId: String +) + +@Serializable +data class NativeView ( + val className: String, + val text: String, + val contentDescription: String, + val focused: Boolean, + val enabled: Boolean, + val childCount: Int, + val resourceName: String, + val applicationPackage: String, + val children: List +) + +@Serializable +data class GetNativeViewsResponse ( + val nativeViews: List +) + +@Serializable +data class TapRequest ( + val selector: Selector, + val appId: String +) + +@Serializable +data class EnterTextRequest ( + val data: String, + val appId: String, + val index: Int?, + val selector: Selector?, + val showKeyboard: Boolean? +) + +@Serializable +data class SwipeRequest ( + val startX: Double, + val startY: Double, + val endX: Double, + val endY: Double, + val steps: Int +) + +@Serializable +data class WaitUntilVisibleRequest ( + val selector: Selector, + val appId: String +) + +@Serializable +data class DarkModeRequest ( + val appId: String +) + +@Serializable +data class Notification ( + val appName: String?, + val title: String, + val content: String, + val raw: String +) + +@Serializable +data class GetNotificationsResponse ( + val notifications: List +) + +@Serializable +class GetNotificationsRequest ( + +) + +@Serializable +data class TapOnNotificationRequest ( + val index: Int?, + val selector: Selector? +) + +@Serializable +data class PermissionDialogVisibleResponse ( + val visible: Boolean +) + +@Serializable +data class PermissionDialogVisibleRequest ( + val timeoutMillis: Int +) + +@Serializable +data class HandlePermissionRequest ( + val code: HandlePermissionRequestCode +) + +@Serializable +data class SetLocationAccuracyRequest ( + val locationAccuracy: SetLocationAccuracyRequestLocationAccuracy +) + diff --git a/packages/patrol_gen/bin/main.dart b/packages/patrol_gen/bin/main.dart index f6ce5b9a5..63b831fa1 100644 --- a/packages/patrol_gen/bin/main.dart +++ b/packages/patrol_gen/bin/main.dart @@ -1,3 +1,4 @@ +import 'package:patrol_gen/src/generators/android/android_config.dart'; import 'package:patrol_gen/src/generators/dart/dart_config.dart'; import 'package:patrol_gen/src/generators/ios/ios_config.dart'; import 'package:patrol_gen/src/patrol_gen.dart'; @@ -13,6 +14,10 @@ Future main(List args) { iosConfig: IOSConfig( outputDirectory: normalizePath(args[2]), ), + androidConfig: AndroidConfig( + outputDirectory: normalizePath(args[3]), + package: args[4], + ), ), ); } diff --git a/packages/patrol_gen/lib/src/generators/android/android_config.dart b/packages/patrol_gen/lib/src/generators/android/android_config.dart new file mode 100644 index 000000000..c30f50fb6 --- /dev/null +++ b/packages/patrol_gen/lib/src/generators/android/android_config.dart @@ -0,0 +1,17 @@ +import 'package:path/path.dart' as path; + +class AndroidConfig { + AndroidConfig({ + required this.outputDirectory, + required this.package, + }) : contractsFilename = path.join(outputDirectory, 'Contracts.kt'); + + final String package; + final String outputDirectory; + final String contractsFilename; + + String clientFileName(String serviceName) => + path.join(outputDirectory, '${serviceName}Client.kt'); + String serverFileName(String serviceName) => + path.join(outputDirectory, '${serviceName}Server.kt'); +} diff --git a/packages/patrol_gen/lib/src/generators/android/android_contracts_generator.dart b/packages/patrol_gen/lib/src/generators/android/android_contracts_generator.dart new file mode 100644 index 000000000..4d95b005a --- /dev/null +++ b/packages/patrol_gen/lib/src/generators/android/android_contracts_generator.dart @@ -0,0 +1,73 @@ +import 'package:patrol_gen/src/generators/android/android_config.dart'; +import 'package:patrol_gen/src/generators/output_file.dart'; +import 'package:patrol_gen/src/schema.dart'; + +class AndroidContractsGenerator { + OutputFile generate(Schema schema, AndroidConfig config) { + final buffer = StringBuffer()..write(_contentPrefix(config)); + + schema.enums.forEach((e) => buffer.writeln(_createEnum(e))); + schema.messages.forEach((e) => buffer.writeln(_createMessage(e))); + + return OutputFile( + filename: config.contractsFilename, + content: buffer.toString(), + ); + } + + String _contentPrefix(AndroidConfig config) { + return ''' +/// +// Generated code. Do not modify. +// source: schema.dart +// + +package ${config.package}; + +import kotlinx.serialization.Serializable + +'''; + } + + String _createMessage(Message message) { + final fields = message.fields.map((e) { + final optional = e.isOptional ? '?' : ''; + return e.isList + ? ' val ${e.name}: List<${_transformType(e.type)}>$optional' + : ' val ${e.name}: ${_transformType(e.type)}$optional'; + }).join(',\n'); + + final dataKeyword = fields.isNotEmpty ? 'data ' : ''; + + return ''' +@Serializable +${dataKeyword}class ${message.name} ( +$fields +) +'''; + } + + String _createEnum(Enum enumDefinition) { + final cases = enumDefinition.fields.map((e) => ' ${e},').join('\n'); + + return ''' +@Serializable +enum class ${enumDefinition.name} { +$cases +} +'''; + } + + String _transformType(String type) { + switch (type) { + case 'int': + return 'Int'; + case 'double': + return 'Double'; + case 'bool': + return 'Boolean'; + default: + return type; + } + } +} diff --git a/packages/patrol_gen/lib/src/generators/android/android_generator.dart b/packages/patrol_gen/lib/src/generators/android/android_generator.dart new file mode 100644 index 000000000..61dc86f24 --- /dev/null +++ b/packages/patrol_gen/lib/src/generators/android/android_generator.dart @@ -0,0 +1,14 @@ +import 'package:patrol_gen/src/generators/android/android_config.dart'; +import 'package:patrol_gen/src/generators/android/android_contracts_generator.dart'; +import 'package:patrol_gen/src/generators/output_file.dart'; +import 'package:patrol_gen/src/schema.dart'; + +class AndroidGenerator { + List generate(Schema schema, AndroidConfig config) { + final result = [ + AndroidContractsGenerator().generate(schema, config), + ]; + + return result; + } +} diff --git a/packages/patrol_gen/lib/src/patrol_gen.dart b/packages/patrol_gen/lib/src/patrol_gen.dart index c6458e070..744832003 100644 --- a/packages/patrol_gen/lib/src/patrol_gen.dart +++ b/packages/patrol_gen/lib/src/patrol_gen.dart @@ -1,3 +1,5 @@ +import 'package:patrol_gen/src/generators/android/android_config.dart'; +import 'package:patrol_gen/src/generators/android/android_generator.dart'; import 'package:patrol_gen/src/generators/dart/dart_config.dart'; import 'package:patrol_gen/src/generators/dart/dart_generator.dart'; import 'package:patrol_gen/src/generators/ios/ios_config.dart'; @@ -10,8 +12,10 @@ class PatrolGenConfig { required this.schemaFilename, required this.dartConfig, required this.iosConfig, + required this.androidConfig, }); + final AndroidConfig androidConfig; final IOSConfig iosConfig; final DartConfig dartConfig; final String schemaFilename; @@ -22,7 +26,9 @@ class PatrolGen { final schema = await resolveSchema(config.schemaFilename); final files = DartGenerator().generate(schema, config.dartConfig); - files.addAll(IOSGenerator().generate(schema, config.iosConfig)); + files + ..addAll(IOSGenerator().generate(schema, config.iosConfig)) + ..addAll(AndroidGenerator().generate(schema, config.androidConfig)); for (var outputFile in files) { await File(outputFile.filename) diff --git a/packages/patrol_gen/lib/src/resolve_schema.dart b/packages/patrol_gen/lib/src/resolve_schema.dart index a47685485..0fa1302bf 100644 --- a/packages/patrol_gen/lib/src/resolve_schema.dart +++ b/packages/patrol_gen/lib/src/resolve_schema.dart @@ -47,10 +47,16 @@ Service _createService(ClassDeclaration declaration, List messages) { genericTypes.contains('DartServer'), ); + final androidGenConfig = ServiceGenConfig( + genericTypes.contains('AndroidClient'), + genericTypes.contains('AndroidServer'), + ); + return Service( declaration.name.lexeme, iosGenConfig, dartGenConfig, + androidGenConfig, declaration.members.whereType().map((method) { final returnType = method.returnType; if (returnType is NamedType) { diff --git a/packages/patrol_gen/lib/src/schema.dart b/packages/patrol_gen/lib/src/schema.dart index 349b08554..71dd0d793 100644 --- a/packages/patrol_gen/lib/src/schema.dart +++ b/packages/patrol_gen/lib/src/schema.dart @@ -37,12 +37,13 @@ class ServiceGenConfig { } class Service { - const Service(this.name, this.ios, this.dart, this.endpoints); + const Service(this.name, this.ios, this.dart, this.android, this.endpoints); final List endpoints; final String name; final ServiceGenConfig ios; final ServiceGenConfig dart; + final ServiceGenConfig android; } class Schema { diff --git a/schema.dart b/schema.dart index bf6110af3..744b6eb0d 100644 --- a/schema.dart +++ b/schema.dart @@ -27,7 +27,7 @@ class RunDartTestResponse { String? details; } -abstract class PatrolAppService { +abstract class PatrolAppService { ListDartTestsResponse listDartTests(); RunDartTestResponse runDartTest(RunDartTestRequest request); } @@ -153,7 +153,7 @@ class SetLocationAccuracyRequest { late SetLocationAccuracyRequestLocationAccuracy locationAccuracy; } -abstract class NativeAutomator { +abstract class NativeAutomator { void initialize(); void configure(ConfigureRequest request); From c052f9b92423f7ebc561d7ec28f72d160d7a7134 Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Mon, 28 Aug 2023 14:00:52 +0200 Subject: [PATCH 041/110] Fix ios client generation --- .../AutomatorServer/PatrolAppServiceClient.swift | 10 +++++----- .../ios/ios_url_session_client_generator.dart | 7 ++++++- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/packages/patrol/ios/Classes/AutomatorServer/PatrolAppServiceClient.swift b/packages/patrol/ios/Classes/AutomatorServer/PatrolAppServiceClient.swift index 17dd3f188..321fc2d86 100644 --- a/packages/patrol/ios/Classes/AutomatorServer/PatrolAppServiceClient.swift +++ b/packages/patrol/ios/Classes/AutomatorServer/PatrolAppServiceClient.swift @@ -23,11 +23,11 @@ class PatrolAppServiceClient { private func performRequest(requestName: String, body: Data? = nil) async throws -> TResult { let url = URL(string: "http://\(address):\(port)/\(requestName)")! - - let urlconfig = URLSessionConfiguration.default - urlconfig.timeoutIntervalForRequest = TimeInterval(300) - urlconfig.timeoutIntervalForResource = TimeInterval(300) - + + let urlconfig = URLSessionConfiguration.default + urlconfig.timeoutIntervalForRequest = TimeInterval(300) + urlconfig.timeoutIntervalForResource = TimeInterval(300) + var request = URLRequest(url: url) request.httpMethod = "POST" request.httpBody = body diff --git a/packages/patrol_gen/lib/src/generators/ios/ios_url_session_client_generator.dart b/packages/patrol_gen/lib/src/generators/ios/ios_url_session_client_generator.dart index 44f374ae5..09bdf6cfe 100644 --- a/packages/patrol_gen/lib/src/generators/ios/ios_url_session_client_generator.dart +++ b/packages/patrol_gen/lib/src/generators/ios/ios_url_session_client_generator.dart @@ -47,11 +47,16 @@ $endpoints private func performRequest(requestName: String, body: Data? = nil) async throws -> TResult { let url = URL(string: "$url")! + let urlconfig = URLSessionConfiguration.default + urlconfig.timeoutIntervalForRequest = TimeInterval(300) + urlconfig.timeoutIntervalForResource = TimeInterval(300) + var request = URLRequest(url: url) request.httpMethod = "POST" request.httpBody = body + request.timeoutInterval = TimeInterval(300) - let (data, response) = try await URLSession.shared.data(for: request) + let (data, response) = try await URLSession(configuration: urlconfig).data(for: request) guard (response as? HTTPURLResponse)?.statusCode == 200 else { $throwException } From 1583d53e124a6c5681a84a9dc61f1395aac0205e Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Mon, 28 Aug 2023 16:21:14 +0200 Subject: [PATCH 042/110] Remove grpc and protobuf dependencies and contracts --- contracts.proto | 221 - gen_protobufs | 48 - packages/patrol/android/build.gradle | 5 - .../patrol/contracts/ConfigureRequestKt.kt | 50 - .../leancode/patrol/contracts/Contracts.java | 12352 ---------------- .../patrol/contracts/ContractsGrpcKt.kt | 1700 --- .../leancode/patrol/contracts/ContractsKt.kt | 7 - .../patrol/contracts/DarkModeRequestKt.kt | 50 - .../patrol/contracts/DartTestCaseKt.kt | 50 - .../patrol/contracts/DartTestGroupKt.kt | 192 - .../pl/leancode/patrol/contracts/EmptyKt.kt | 41 - .../patrol/contracts/EnterTextRequestKt.kt | 142 - .../contracts/GetNativeViewsRequestKt.kt | 77 - .../contracts/GetNativeViewsResponseKt.kt | 104 - .../contracts/GetNotificationsRequestKt.kt | 33 - .../contracts/GetNotificationsResponseKt.kt | 104 - .../contracts/HandlePermissionRequestKt.kt | 57 - .../contracts/ListDartTestsResponseKt.kt | 60 - .../patrol/contracts/NativeAutomatorGrpc.java | 2732 ---- .../leancode/patrol/contracts/NativeViewKt.kt | 246 - .../patrol/contracts/NotificationKt.kt | 112 - .../patrol/contracts/OpenAppRequestKt.kt | 50 - .../contracts/OpenQuickSettingsRequestKt.kt | 33 - .../contracts/PatrolAppServiceGrpc.java | 312 - .../PermissionDialogVisibleRequestKt.kt | 50 - .../PermissionDialogVisibleResponseKt.kt | 50 - .../patrol/contracts/RunDartTestRequestKt.kt | 50 - .../patrol/contracts/RunDartTestResponseKt.kt | 81 - .../leancode/patrol/contracts/SelectorKt.kt | 321 - .../contracts/SetLocationAccuracyRequestKt.kt | 57 - .../contracts/SubmitTestResultsRequestKt.kt | 94 - .../patrol/contracts/SwipeRequestKt.kt | 135 - .../contracts/TapOnNotificationRequestKt.kt | 91 - .../leancode/patrol/contracts/TapRequestKt.kt | 77 - .../contracts/WaitUntilVisibleRequestKt.kt | 77 - 35 files changed, 19861 deletions(-) delete mode 100644 contracts.proto delete mode 100755 gen_protobufs delete mode 100644 packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/ConfigureRequestKt.kt delete mode 100644 packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/Contracts.java delete mode 100644 packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/ContractsGrpcKt.kt delete mode 100644 packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/ContractsKt.kt delete mode 100644 packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/DarkModeRequestKt.kt delete mode 100644 packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/DartTestCaseKt.kt delete mode 100644 packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/DartTestGroupKt.kt delete mode 100644 packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/EmptyKt.kt delete mode 100644 packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/EnterTextRequestKt.kt delete mode 100644 packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/GetNativeViewsRequestKt.kt delete mode 100644 packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/GetNativeViewsResponseKt.kt delete mode 100644 packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/GetNotificationsRequestKt.kt delete mode 100644 packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/GetNotificationsResponseKt.kt delete mode 100644 packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/HandlePermissionRequestKt.kt delete mode 100644 packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/ListDartTestsResponseKt.kt delete mode 100644 packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/NativeAutomatorGrpc.java delete mode 100644 packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/NativeViewKt.kt delete mode 100644 packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/NotificationKt.kt delete mode 100644 packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/OpenAppRequestKt.kt delete mode 100644 packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/OpenQuickSettingsRequestKt.kt delete mode 100644 packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/PatrolAppServiceGrpc.java delete mode 100644 packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/PermissionDialogVisibleRequestKt.kt delete mode 100644 packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/PermissionDialogVisibleResponseKt.kt delete mode 100644 packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/RunDartTestRequestKt.kt delete mode 100644 packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/RunDartTestResponseKt.kt delete mode 100644 packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/SelectorKt.kt delete mode 100644 packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/SetLocationAccuracyRequestKt.kt delete mode 100644 packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/SubmitTestResultsRequestKt.kt delete mode 100644 packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/SwipeRequestKt.kt delete mode 100644 packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/TapOnNotificationRequestKt.kt delete mode 100644 packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/TapRequestKt.kt delete mode 100644 packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/WaitUntilVisibleRequestKt.kt diff --git a/contracts.proto b/contracts.proto deleted file mode 100644 index 7d65f2f81..000000000 --- a/contracts.proto +++ /dev/null @@ -1,221 +0,0 @@ -syntax = "proto3"; -package patrol; - -option java_package = "pl.leancode.patrol.contracts"; - -// service PatrolAppService { -// rpc listDartTests(Empty) returns (ListDartTestsResponse) {} -// rpc runDartTest(RunDartTestRequest) returns (RunDartTestResponse) {} -// } - -// message ListDartTestsResponse { -// DartTestGroup group = 1; -// } - -// message DartTestGroup { -// string name = 1; -// repeated DartTestCase tests = 2; -// repeated DartTestGroup groups = 3; -// } - -// message DartTestCase { -// string name = 1; -// } - -// message RunDartTestRequest { -// string name = 1; -// } - -// message RunDartTestResponse { -// enum Result { -// SUCCESS = 0; -// SKIPPED = 1; -// FAILURE = 2; -// } - -// Result result = 1; -// optional string details = 2; -// } - -// service NativeAutomator { -// rpc initialize(Empty) returns (Empty) {} -// rpc configure(ConfigureRequest) returns (Empty) {} - -// // general -// rpc pressHome(Empty) returns (Empty) {} -// rpc pressBack(Empty) returns (Empty) {} -// rpc pressRecentApps(Empty) returns (Empty) {} -// rpc doublePressRecentApps(Empty) returns (Empty) {} -// rpc openApp(OpenAppRequest) returns (Empty) {} -// rpc openQuickSettings(OpenQuickSettingsRequest) returns (Empty) {} - -// // general UI interaction -// rpc getNativeViews(GetNativeViewsRequest) returns (GetNativeViewsResponse) {} -// rpc tap(TapRequest) returns (Empty) {} -// rpc doubleTap(TapRequest) returns (Empty) {} -// rpc enterText(EnterTextRequest) returns (Empty) {} -// rpc swipe(SwipeRequest) returns (Empty) {} -// rpc waitUntilVisible(WaitUntilVisibleRequest) returns (Empty) {} - -// // services -// rpc enableAirplaneMode(Empty) returns (Empty) {} -// rpc disableAirplaneMode(Empty) returns (Empty) {} -// rpc enableWiFi(Empty) returns (Empty) {} -// rpc disableWiFi(Empty) returns (Empty) {} -// rpc enableCellular(Empty) returns (Empty) {} -// rpc disableCellular(Empty) returns (Empty) {} -// rpc enableBluetooth(Empty) returns (Empty) {} -// rpc disableBluetooth(Empty) returns (Empty) {} -// rpc enableDarkMode(DarkModeRequest) returns (Empty) {} -// rpc disableDarkMode(DarkModeRequest) returns (Empty) {} - -// // notifications -// rpc openNotifications(Empty) returns (Empty) {} -// rpc closeNotifications(Empty) returns (Empty) {} -// rpc closeHeadsUpNotification(Empty) returns (Empty) {} -// rpc getNotifications(GetNotificationsRequest) returns (GetNotificationsResponse) {} -// rpc tapOnNotification(TapOnNotificationRequest) returns (Empty) {} - -// // permissions -// rpc isPermissionDialogVisible(PermissionDialogVisibleRequest) returns (PermissionDialogVisibleResponse) {} -// rpc handlePermissionDialog(HandlePermissionRequest) returns (Empty) {} -// rpc setLocationAccuracy(SetLocationAccuracyRequest) returns (Empty) {} - -// // other -// rpc debug(Empty) returns (Empty) {} - -// // TODO(bartekpacia): Move this RPC into a new PatrolNativeTestService service because it doesn't fit here -// rpc markPatrolAppServiceReady(Empty) returns (Empty) {} -// } - -// message ConfigureRequest { -// uint64 findTimeoutMillis = 1; -// } - -// message OpenAppRequest { string appId = 1; } - -// message TapOnNotificationRequest { -// oneof findBy { -// uint32 index = 1; -// Selector selector = 2; -// } -// } - -// // We're defining our own Empty instead of using google.protobuf.Empty because -// // the Dart plugin can't easily generate it. -// // -// // See: -// // * https://github.com/google/protobuf.dart/issues/170 -// message Empty {} - -// message OpenQuickSettingsRequest {} - -// message DarkModeRequest { string appId = 1; } - -// message GetNativeViewsRequest { -// Selector selector = 1; -// string appId = 2; -// } -// message GetNativeViewsResponse { repeated NativeView nativeViews = 2;} - -// message GetNotificationsRequest {} -// message GetNotificationsResponse { repeated Notification notifications = 2; } - -// message TapRequest { -// Selector selector = 1; -// string appId = 2; -// } - -// message EnterTextRequest { -// string data = 1; -// string appId = 2; -// oneof findBy { -// uint32 index = 3; -// Selector selector = 4; -// } - -// bool showKeyboard = 5; -// } - -// message SwipeRequest { -// float startX = 1; -// float startY = 2; -// float endX = 3; -// float endY = 4; -// uint32 steps = 5; -// string appId = 6; -// } - -// message WaitUntilVisibleRequest { -// Selector selector = 1; -// string appId = 2; -// } - -// message HandlePermissionRequest { -// Code code = 1; - -// enum Code { -// WHILE_USING = 0; -// ONLY_THIS_TIME = 1; -// DENIED = 2; -// } -// } - -// message SetLocationAccuracyRequest { -// LocationAccuracy locationAccuracy = 1; - -// enum LocationAccuracy { -// COARSE = 0; -// FINE = 1; -// } -// } - -// message PermissionDialogVisibleRequest { -// uint64 timeoutMillis = 1; -// } - -// message PermissionDialogVisibleResponse { -// bool visible = 1; -// } - -// message Selector { -// optional string text = 1; -// optional string textStartsWith = 2; -// optional string textContains = 3; -// optional string className = 4; -// optional string contentDescription = 5; -// optional string contentDescriptionStartsWith = 6; -// optional string contentDescriptionContains = 7; -// optional string resourceId = 8; -// optional uint32 instance = 9; -// optional bool enabled = 10; -// optional bool focused = 11; -// optional string pkg = 12; -// } - -// // Represents a native UI control. -// // -// // On Android, this is `android.view.View`. -// message NativeView { -// string className = 1; -// string text = 2; -// string contentDescription = 3; -// bool focused = 4; -// bool enabled = 5; -// int32 childCount = 6; -// string resourceName = 7; -// string applicationPackage = 8; -// repeated NativeView children = 9; -// } - -// // Represents a notification visible in the notification shade. -// message Notification { -// optional string appName = 1; -// string title = 2; -// string content = 3; -// string raw = 4; -// } - -// message SubmitTestResultsRequest { -// map results = 1; -// } diff --git a/gen_protobufs b/gen_protobufs deleted file mode 100755 index 07d59ea05..000000000 --- a/gen_protobufs +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -# gen_protobufs generates Protocol Buffers classes for every used language -# (Dart, Swift, Kotlin/Java) in the appropriate directory. -# -# To use it, you need to have the following programs in your $PATH: -# -# * protoc -# -# * Dart plugin (https://pub.dev/packages/protoc_plugin) -# -# * Swift plugin (https://github.com/apple/swift-protobuf) -# -# * Java plugin (https://github.com/grpc/grpc-java) -# -# * Kotlin plugin (https://github.com/grpc/grpc-kotlin/tree/master/compiler) - -cd "$(dirname "$0")" || exit - -SRC_DIR="." -PROTO_PATH="./contracts.proto" - -mkdir -p ./patrol/packages/patrol/android/src/main/kotlin -mkdir -p ./packages/patrol/ios/Classes/AutomatorServer - -dart_out="./packages/patrol/lib/src/native/contracts" -java_out="packages/patrol/android/src/main/kotlin" -kotlin_out="$java_out" -swift_out="./packages/patrol/ios/Classes/AutomatorServer" - -protoc \ - --dart_out="grpc:$dart_out" \ - -I="$SRC_DIR" \ - "$PROTO_PATH" - -protoc \ - --java_out="lite:$java_out" \ - --kotlin_out="lite:$kotlin_out" \ - --grpc-java_out="lite:$java_out" \ - --grpckt_out="lite:$kotlin_out" \ - "$PROTO_PATH" - -protoc \ - --swift_out="$swift_out" \ - --grpc-swift_out="$swift_out" \ - --swift_opt=Visibility=Public \ - "$PROTO_PATH" diff --git a/packages/patrol/android/build.gradle b/packages/patrol/android/build.gradle index 2bd3fa07e..4ef52d6a4 100644 --- a/packages/patrol/android/build.gradle +++ b/packages/patrol/android/build.gradle @@ -63,11 +63,6 @@ android { api "androidx.test.espresso:espresso-core:3.5.0" api "androidx.test.uiautomator:uiautomator:2.2.0" - implementation "com.google.protobuf:protobuf-kotlin-lite:3.21.7" - implementation "io.grpc:grpc-protobuf-lite:1.49.2" - implementation "io.grpc:grpc-stub:1.49.2" - implementation "io.grpc:grpc-kotlin-stub:1.3.0" - implementation "io.grpc:grpc-okhttp:1.49.2" implementation "javax.annotation:javax.annotation-api:1.3.2" implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.0" diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/ConfigureRequestKt.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/ConfigureRequestKt.kt deleted file mode 100644 index 3273b9781..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/ConfigureRequestKt.kt +++ /dev/null @@ -1,50 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: contracts.proto - -// Generated files should ignore deprecation warnings -@file:Suppress("DEPRECATION") -package pl.leancode.patrol.contracts; - -@kotlin.jvm.JvmName("-initializeconfigureRequest") -public inline fun configureRequest(block: pl.leancode.patrol.contracts.ConfigureRequestKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.ConfigureRequest = - pl.leancode.patrol.contracts.ConfigureRequestKt.Dsl._create(pl.leancode.patrol.contracts.Contracts.ConfigureRequest.newBuilder()).apply { block() }._build() -/** - * Protobuf type `patrol.ConfigureRequest` - */ -public object ConfigureRequestKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - public class Dsl private constructor( - private val _builder: pl.leancode.patrol.contracts.Contracts.ConfigureRequest.Builder - ) { - public companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: pl.leancode.patrol.contracts.Contracts.ConfigureRequest.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): pl.leancode.patrol.contracts.Contracts.ConfigureRequest = _builder.build() - - /** - * uint64 findTimeoutMillis = 1; - */ - public var findTimeoutMillis: kotlin.Long - @JvmName("getFindTimeoutMillis") - get() = _builder.getFindTimeoutMillis() - @JvmName("setFindTimeoutMillis") - set(value) { - _builder.setFindTimeoutMillis(value) - } - /** - * `uint64 findTimeoutMillis = 1;` - */ - public fun clearFindTimeoutMillis() { - _builder.clearFindTimeoutMillis() - } - } -} -public inline fun pl.leancode.patrol.contracts.Contracts.ConfigureRequest.copy(block: pl.leancode.patrol.contracts.ConfigureRequestKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.ConfigureRequest = - pl.leancode.patrol.contracts.ConfigureRequestKt.Dsl._create(this.toBuilder()).apply { block() }._build() - diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/Contracts.java b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/Contracts.java deleted file mode 100644 index 45ab3ee06..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/Contracts.java +++ /dev/null @@ -1,12352 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: contracts.proto - -package pl.leancode.patrol.contracts; - -public final class Contracts { - private Contracts() {} - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistryLite registry) { - } - public interface ListDartTestsResponseOrBuilder extends - // @@protoc_insertion_point(interface_extends:patrol.ListDartTestsResponse) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * .patrol.DartTestGroup group = 1; - * @return Whether the group field is set. - */ - boolean hasGroup(); - /** - * .patrol.DartTestGroup group = 1; - * @return The group. - */ - pl.leancode.patrol.contracts.Contracts.DartTestGroup getGroup(); - } - /** - * Protobuf type {@code patrol.ListDartTestsResponse} - */ - public static final class ListDartTestsResponse extends - com.google.protobuf.GeneratedMessageLite< - ListDartTestsResponse, ListDartTestsResponse.Builder> implements - // @@protoc_insertion_point(message_implements:patrol.ListDartTestsResponse) - ListDartTestsResponseOrBuilder { - private ListDartTestsResponse() { - } - public static final int GROUP_FIELD_NUMBER = 1; - private pl.leancode.patrol.contracts.Contracts.DartTestGroup group_; - /** - * .patrol.DartTestGroup group = 1; - */ - @java.lang.Override - public boolean hasGroup() { - return group_ != null; - } - /** - * .patrol.DartTestGroup group = 1; - */ - @java.lang.Override - public pl.leancode.patrol.contracts.Contracts.DartTestGroup getGroup() { - return group_ == null ? pl.leancode.patrol.contracts.Contracts.DartTestGroup.getDefaultInstance() : group_; - } - /** - * .patrol.DartTestGroup group = 1; - */ - private void setGroup(pl.leancode.patrol.contracts.Contracts.DartTestGroup value) { - value.getClass(); - group_ = value; - - } - /** - * .patrol.DartTestGroup group = 1; - */ - @java.lang.SuppressWarnings({"ReferenceEquality"}) - private void mergeGroup(pl.leancode.patrol.contracts.Contracts.DartTestGroup value) { - value.getClass(); - if (group_ != null && - group_ != pl.leancode.patrol.contracts.Contracts.DartTestGroup.getDefaultInstance()) { - group_ = - pl.leancode.patrol.contracts.Contracts.DartTestGroup.newBuilder(group_).mergeFrom(value).buildPartial(); - } else { - group_ = value; - } - - } - /** - * .patrol.DartTestGroup group = 1; - */ - private void clearGroup() { group_ = null; - - } - - public static pl.leancode.patrol.contracts.Contracts.ListDartTestsResponse parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.ListDartTestsResponse parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.ListDartTestsResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.ListDartTestsResponse parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.ListDartTestsResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.ListDartTestsResponse parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.ListDartTestsResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.ListDartTestsResponse parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static pl.leancode.patrol.contracts.Contracts.ListDartTestsResponse parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - - public static pl.leancode.patrol.contracts.Contracts.ListDartTestsResponse parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.ListDartTestsResponse parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.ListDartTestsResponse parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.ListDartTestsResponse prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - * Protobuf type {@code patrol.ListDartTestsResponse} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - pl.leancode.patrol.contracts.Contracts.ListDartTestsResponse, Builder> implements - // @@protoc_insertion_point(builder_implements:patrol.ListDartTestsResponse) - pl.leancode.patrol.contracts.Contracts.ListDartTestsResponseOrBuilder { - // Construct using pl.leancode.patrol.contracts.Contracts.ListDartTestsResponse.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - * .patrol.DartTestGroup group = 1; - */ - @java.lang.Override - public boolean hasGroup() { - return instance.hasGroup(); - } - /** - * .patrol.DartTestGroup group = 1; - */ - @java.lang.Override - public pl.leancode.patrol.contracts.Contracts.DartTestGroup getGroup() { - return instance.getGroup(); - } - /** - * .patrol.DartTestGroup group = 1; - */ - public Builder setGroup(pl.leancode.patrol.contracts.Contracts.DartTestGroup value) { - copyOnWrite(); - instance.setGroup(value); - return this; - } - /** - * .patrol.DartTestGroup group = 1; - */ - public Builder setGroup( - pl.leancode.patrol.contracts.Contracts.DartTestGroup.Builder builderForValue) { - copyOnWrite(); - instance.setGroup(builderForValue.build()); - return this; - } - /** - * .patrol.DartTestGroup group = 1; - */ - public Builder mergeGroup(pl.leancode.patrol.contracts.Contracts.DartTestGroup value) { - copyOnWrite(); - instance.mergeGroup(value); - return this; - } - /** - * .patrol.DartTestGroup group = 1; - */ - public Builder clearGroup() { copyOnWrite(); - instance.clearGroup(); - return this; - } - - // @@protoc_insertion_point(builder_scope:patrol.ListDartTestsResponse) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new pl.leancode.patrol.contracts.Contracts.ListDartTestsResponse(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "group_", - }; - java.lang.String info = - "\u0000\u0001\u0000\u0000\u0001\u0001\u0001\u0000\u0000\u0000\u0001\t"; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (pl.leancode.patrol.contracts.Contracts.ListDartTestsResponse.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:patrol.ListDartTestsResponse) - private static final pl.leancode.patrol.contracts.Contracts.ListDartTestsResponse DEFAULT_INSTANCE; - static { - ListDartTestsResponse defaultInstance = new ListDartTestsResponse(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - ListDartTestsResponse.class, defaultInstance); - } - - public static pl.leancode.patrol.contracts.Contracts.ListDartTestsResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface DartTestGroupOrBuilder extends - // @@protoc_insertion_point(interface_extends:patrol.DartTestGroup) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * string name = 1; - * @return The name. - */ - java.lang.String getName(); - /** - * string name = 1; - * @return The bytes for name. - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - * repeated .patrol.DartTestCase tests = 2; - */ - java.util.List - getTestsList(); - /** - * repeated .patrol.DartTestCase tests = 2; - */ - pl.leancode.patrol.contracts.Contracts.DartTestCase getTests(int index); - /** - * repeated .patrol.DartTestCase tests = 2; - */ - int getTestsCount(); - - /** - * repeated .patrol.DartTestGroup groups = 3; - */ - java.util.List - getGroupsList(); - /** - * repeated .patrol.DartTestGroup groups = 3; - */ - pl.leancode.patrol.contracts.Contracts.DartTestGroup getGroups(int index); - /** - * repeated .patrol.DartTestGroup groups = 3; - */ - int getGroupsCount(); - } - /** - * Protobuf type {@code patrol.DartTestGroup} - */ - public static final class DartTestGroup extends - com.google.protobuf.GeneratedMessageLite< - DartTestGroup, DartTestGroup.Builder> implements - // @@protoc_insertion_point(message_implements:patrol.DartTestGroup) - DartTestGroupOrBuilder { - private DartTestGroup() { - name_ = ""; - tests_ = emptyProtobufList(); - groups_ = emptyProtobufList(); - } - public static final int NAME_FIELD_NUMBER = 1; - private java.lang.String name_; - /** - * string name = 1; - * @return The name. - */ - @java.lang.Override - public java.lang.String getName() { - return name_; - } - /** - * string name = 1; - * @return The bytes for name. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getNameBytes() { - return com.google.protobuf.ByteString.copyFromUtf8(name_); - } - /** - * string name = 1; - * @param value The name to set. - */ - private void setName( - java.lang.String value) { - java.lang.Class valueClass = value.getClass(); - - name_ = value; - } - /** - * string name = 1; - */ - private void clearName() { - - name_ = getDefaultInstance().getName(); - } - /** - * string name = 1; - * @param value The bytes for name to set. - */ - private void setNameBytes( - com.google.protobuf.ByteString value) { - checkByteStringIsUtf8(value); - name_ = value.toStringUtf8(); - - } - - public static final int TESTS_FIELD_NUMBER = 2; - private com.google.protobuf.Internal.ProtobufList tests_; - /** - * repeated .patrol.DartTestCase tests = 2; - */ - @java.lang.Override - public java.util.List getTestsList() { - return tests_; - } - /** - * repeated .patrol.DartTestCase tests = 2; - */ - public java.util.List - getTestsOrBuilderList() { - return tests_; - } - /** - * repeated .patrol.DartTestCase tests = 2; - */ - @java.lang.Override - public int getTestsCount() { - return tests_.size(); - } - /** - * repeated .patrol.DartTestCase tests = 2; - */ - @java.lang.Override - public pl.leancode.patrol.contracts.Contracts.DartTestCase getTests(int index) { - return tests_.get(index); - } - /** - * repeated .patrol.DartTestCase tests = 2; - */ - public pl.leancode.patrol.contracts.Contracts.DartTestCaseOrBuilder getTestsOrBuilder( - int index) { - return tests_.get(index); - } - private void ensureTestsIsMutable() { - com.google.protobuf.Internal.ProtobufList tmp = tests_; - if (!tmp.isModifiable()) { - tests_ = - com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp); - } - } - - /** - * repeated .patrol.DartTestCase tests = 2; - */ - private void setTests( - int index, pl.leancode.patrol.contracts.Contracts.DartTestCase value) { - value.getClass(); - ensureTestsIsMutable(); - tests_.set(index, value); - } - /** - * repeated .patrol.DartTestCase tests = 2; - */ - private void addTests(pl.leancode.patrol.contracts.Contracts.DartTestCase value) { - value.getClass(); - ensureTestsIsMutable(); - tests_.add(value); - } - /** - * repeated .patrol.DartTestCase tests = 2; - */ - private void addTests( - int index, pl.leancode.patrol.contracts.Contracts.DartTestCase value) { - value.getClass(); - ensureTestsIsMutable(); - tests_.add(index, value); - } - /** - * repeated .patrol.DartTestCase tests = 2; - */ - private void addAllTests( - java.lang.Iterable values) { - ensureTestsIsMutable(); - com.google.protobuf.AbstractMessageLite.addAll( - values, tests_); - } - /** - * repeated .patrol.DartTestCase tests = 2; - */ - private void clearTests() { - tests_ = emptyProtobufList(); - } - /** - * repeated .patrol.DartTestCase tests = 2; - */ - private void removeTests(int index) { - ensureTestsIsMutable(); - tests_.remove(index); - } - - public static final int GROUPS_FIELD_NUMBER = 3; - private com.google.protobuf.Internal.ProtobufList groups_; - /** - * repeated .patrol.DartTestGroup groups = 3; - */ - @java.lang.Override - public java.util.List getGroupsList() { - return groups_; - } - /** - * repeated .patrol.DartTestGroup groups = 3; - */ - public java.util.List - getGroupsOrBuilderList() { - return groups_; - } - /** - * repeated .patrol.DartTestGroup groups = 3; - */ - @java.lang.Override - public int getGroupsCount() { - return groups_.size(); - } - /** - * repeated .patrol.DartTestGroup groups = 3; - */ - @java.lang.Override - public pl.leancode.patrol.contracts.Contracts.DartTestGroup getGroups(int index) { - return groups_.get(index); - } - /** - * repeated .patrol.DartTestGroup groups = 3; - */ - public pl.leancode.patrol.contracts.Contracts.DartTestGroupOrBuilder getGroupsOrBuilder( - int index) { - return groups_.get(index); - } - private void ensureGroupsIsMutable() { - com.google.protobuf.Internal.ProtobufList tmp = groups_; - if (!tmp.isModifiable()) { - groups_ = - com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp); - } - } - - /** - * repeated .patrol.DartTestGroup groups = 3; - */ - private void setGroups( - int index, pl.leancode.patrol.contracts.Contracts.DartTestGroup value) { - value.getClass(); - ensureGroupsIsMutable(); - groups_.set(index, value); - } - /** - * repeated .patrol.DartTestGroup groups = 3; - */ - private void addGroups(pl.leancode.patrol.contracts.Contracts.DartTestGroup value) { - value.getClass(); - ensureGroupsIsMutable(); - groups_.add(value); - } - /** - * repeated .patrol.DartTestGroup groups = 3; - */ - private void addGroups( - int index, pl.leancode.patrol.contracts.Contracts.DartTestGroup value) { - value.getClass(); - ensureGroupsIsMutable(); - groups_.add(index, value); - } - /** - * repeated .patrol.DartTestGroup groups = 3; - */ - private void addAllGroups( - java.lang.Iterable values) { - ensureGroupsIsMutable(); - com.google.protobuf.AbstractMessageLite.addAll( - values, groups_); - } - /** - * repeated .patrol.DartTestGroup groups = 3; - */ - private void clearGroups() { - groups_ = emptyProtobufList(); - } - /** - * repeated .patrol.DartTestGroup groups = 3; - */ - private void removeGroups(int index) { - ensureGroupsIsMutable(); - groups_.remove(index); - } - - public static pl.leancode.patrol.contracts.Contracts.DartTestGroup parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.DartTestGroup parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.DartTestGroup parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.DartTestGroup parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.DartTestGroup parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.DartTestGroup parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.DartTestGroup parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.DartTestGroup parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static pl.leancode.patrol.contracts.Contracts.DartTestGroup parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - - public static pl.leancode.patrol.contracts.Contracts.DartTestGroup parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.DartTestGroup parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.DartTestGroup parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.DartTestGroup prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - * Protobuf type {@code patrol.DartTestGroup} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - pl.leancode.patrol.contracts.Contracts.DartTestGroup, Builder> implements - // @@protoc_insertion_point(builder_implements:patrol.DartTestGroup) - pl.leancode.patrol.contracts.Contracts.DartTestGroupOrBuilder { - // Construct using pl.leancode.patrol.contracts.Contracts.DartTestGroup.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - * string name = 1; - * @return The name. - */ - @java.lang.Override - public java.lang.String getName() { - return instance.getName(); - } - /** - * string name = 1; - * @return The bytes for name. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getNameBytes() { - return instance.getNameBytes(); - } - /** - * string name = 1; - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName( - java.lang.String value) { - copyOnWrite(); - instance.setName(value); - return this; - } - /** - * string name = 1; - * @return This builder for chaining. - */ - public Builder clearName() { - copyOnWrite(); - instance.clearName(); - return this; - } - /** - * string name = 1; - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setNameBytes(value); - return this; - } - - /** - * repeated .patrol.DartTestCase tests = 2; - */ - @java.lang.Override - public java.util.List getTestsList() { - return java.util.Collections.unmodifiableList( - instance.getTestsList()); - } - /** - * repeated .patrol.DartTestCase tests = 2; - */ - @java.lang.Override - public int getTestsCount() { - return instance.getTestsCount(); - }/** - * repeated .patrol.DartTestCase tests = 2; - */ - @java.lang.Override - public pl.leancode.patrol.contracts.Contracts.DartTestCase getTests(int index) { - return instance.getTests(index); - } - /** - * repeated .patrol.DartTestCase tests = 2; - */ - public Builder setTests( - int index, pl.leancode.patrol.contracts.Contracts.DartTestCase value) { - copyOnWrite(); - instance.setTests(index, value); - return this; - } - /** - * repeated .patrol.DartTestCase tests = 2; - */ - public Builder setTests( - int index, pl.leancode.patrol.contracts.Contracts.DartTestCase.Builder builderForValue) { - copyOnWrite(); - instance.setTests(index, - builderForValue.build()); - return this; - } - /** - * repeated .patrol.DartTestCase tests = 2; - */ - public Builder addTests(pl.leancode.patrol.contracts.Contracts.DartTestCase value) { - copyOnWrite(); - instance.addTests(value); - return this; - } - /** - * repeated .patrol.DartTestCase tests = 2; - */ - public Builder addTests( - int index, pl.leancode.patrol.contracts.Contracts.DartTestCase value) { - copyOnWrite(); - instance.addTests(index, value); - return this; - } - /** - * repeated .patrol.DartTestCase tests = 2; - */ - public Builder addTests( - pl.leancode.patrol.contracts.Contracts.DartTestCase.Builder builderForValue) { - copyOnWrite(); - instance.addTests(builderForValue.build()); - return this; - } - /** - * repeated .patrol.DartTestCase tests = 2; - */ - public Builder addTests( - int index, pl.leancode.patrol.contracts.Contracts.DartTestCase.Builder builderForValue) { - copyOnWrite(); - instance.addTests(index, - builderForValue.build()); - return this; - } - /** - * repeated .patrol.DartTestCase tests = 2; - */ - public Builder addAllTests( - java.lang.Iterable values) { - copyOnWrite(); - instance.addAllTests(values); - return this; - } - /** - * repeated .patrol.DartTestCase tests = 2; - */ - public Builder clearTests() { - copyOnWrite(); - instance.clearTests(); - return this; - } - /** - * repeated .patrol.DartTestCase tests = 2; - */ - public Builder removeTests(int index) { - copyOnWrite(); - instance.removeTests(index); - return this; - } - - /** - * repeated .patrol.DartTestGroup groups = 3; - */ - @java.lang.Override - public java.util.List getGroupsList() { - return java.util.Collections.unmodifiableList( - instance.getGroupsList()); - } - /** - * repeated .patrol.DartTestGroup groups = 3; - */ - @java.lang.Override - public int getGroupsCount() { - return instance.getGroupsCount(); - }/** - * repeated .patrol.DartTestGroup groups = 3; - */ - @java.lang.Override - public pl.leancode.patrol.contracts.Contracts.DartTestGroup getGroups(int index) { - return instance.getGroups(index); - } - /** - * repeated .patrol.DartTestGroup groups = 3; - */ - public Builder setGroups( - int index, pl.leancode.patrol.contracts.Contracts.DartTestGroup value) { - copyOnWrite(); - instance.setGroups(index, value); - return this; - } - /** - * repeated .patrol.DartTestGroup groups = 3; - */ - public Builder setGroups( - int index, pl.leancode.patrol.contracts.Contracts.DartTestGroup.Builder builderForValue) { - copyOnWrite(); - instance.setGroups(index, - builderForValue.build()); - return this; - } - /** - * repeated .patrol.DartTestGroup groups = 3; - */ - public Builder addGroups(pl.leancode.patrol.contracts.Contracts.DartTestGroup value) { - copyOnWrite(); - instance.addGroups(value); - return this; - } - /** - * repeated .patrol.DartTestGroup groups = 3; - */ - public Builder addGroups( - int index, pl.leancode.patrol.contracts.Contracts.DartTestGroup value) { - copyOnWrite(); - instance.addGroups(index, value); - return this; - } - /** - * repeated .patrol.DartTestGroup groups = 3; - */ - public Builder addGroups( - pl.leancode.patrol.contracts.Contracts.DartTestGroup.Builder builderForValue) { - copyOnWrite(); - instance.addGroups(builderForValue.build()); - return this; - } - /** - * repeated .patrol.DartTestGroup groups = 3; - */ - public Builder addGroups( - int index, pl.leancode.patrol.contracts.Contracts.DartTestGroup.Builder builderForValue) { - copyOnWrite(); - instance.addGroups(index, - builderForValue.build()); - return this; - } - /** - * repeated .patrol.DartTestGroup groups = 3; - */ - public Builder addAllGroups( - java.lang.Iterable values) { - copyOnWrite(); - instance.addAllGroups(values); - return this; - } - /** - * repeated .patrol.DartTestGroup groups = 3; - */ - public Builder clearGroups() { - copyOnWrite(); - instance.clearGroups(); - return this; - } - /** - * repeated .patrol.DartTestGroup groups = 3; - */ - public Builder removeGroups(int index) { - copyOnWrite(); - instance.removeGroups(index); - return this; - } - - // @@protoc_insertion_point(builder_scope:patrol.DartTestGroup) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new pl.leancode.patrol.contracts.Contracts.DartTestGroup(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "name_", - "tests_", - pl.leancode.patrol.contracts.Contracts.DartTestCase.class, - "groups_", - pl.leancode.patrol.contracts.Contracts.DartTestGroup.class, - }; - java.lang.String info = - "\u0000\u0003\u0000\u0000\u0001\u0003\u0003\u0000\u0002\u0000\u0001\u0208\u0002\u001b" + - "\u0003\u001b"; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (pl.leancode.patrol.contracts.Contracts.DartTestGroup.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:patrol.DartTestGroup) - private static final pl.leancode.patrol.contracts.Contracts.DartTestGroup DEFAULT_INSTANCE; - static { - DartTestGroup defaultInstance = new DartTestGroup(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - DartTestGroup.class, defaultInstance); - } - - public static pl.leancode.patrol.contracts.Contracts.DartTestGroup getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface DartTestCaseOrBuilder extends - // @@protoc_insertion_point(interface_extends:patrol.DartTestCase) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * string name = 1; - * @return The name. - */ - java.lang.String getName(); - /** - * string name = 1; - * @return The bytes for name. - */ - com.google.protobuf.ByteString - getNameBytes(); - } - /** - * Protobuf type {@code patrol.DartTestCase} - */ - public static final class DartTestCase extends - com.google.protobuf.GeneratedMessageLite< - DartTestCase, DartTestCase.Builder> implements - // @@protoc_insertion_point(message_implements:patrol.DartTestCase) - DartTestCaseOrBuilder { - private DartTestCase() { - name_ = ""; - } - public static final int NAME_FIELD_NUMBER = 1; - private java.lang.String name_; - /** - * string name = 1; - * @return The name. - */ - @java.lang.Override - public java.lang.String getName() { - return name_; - } - /** - * string name = 1; - * @return The bytes for name. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getNameBytes() { - return com.google.protobuf.ByteString.copyFromUtf8(name_); - } - /** - * string name = 1; - * @param value The name to set. - */ - private void setName( - java.lang.String value) { - java.lang.Class valueClass = value.getClass(); - - name_ = value; - } - /** - * string name = 1; - */ - private void clearName() { - - name_ = getDefaultInstance().getName(); - } - /** - * string name = 1; - * @param value The bytes for name to set. - */ - private void setNameBytes( - com.google.protobuf.ByteString value) { - checkByteStringIsUtf8(value); - name_ = value.toStringUtf8(); - - } - - public static pl.leancode.patrol.contracts.Contracts.DartTestCase parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.DartTestCase parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.DartTestCase parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.DartTestCase parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.DartTestCase parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.DartTestCase parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.DartTestCase parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.DartTestCase parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static pl.leancode.patrol.contracts.Contracts.DartTestCase parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - - public static pl.leancode.patrol.contracts.Contracts.DartTestCase parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.DartTestCase parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.DartTestCase parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.DartTestCase prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - * Protobuf type {@code patrol.DartTestCase} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - pl.leancode.patrol.contracts.Contracts.DartTestCase, Builder> implements - // @@protoc_insertion_point(builder_implements:patrol.DartTestCase) - pl.leancode.patrol.contracts.Contracts.DartTestCaseOrBuilder { - // Construct using pl.leancode.patrol.contracts.Contracts.DartTestCase.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - * string name = 1; - * @return The name. - */ - @java.lang.Override - public java.lang.String getName() { - return instance.getName(); - } - /** - * string name = 1; - * @return The bytes for name. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getNameBytes() { - return instance.getNameBytes(); - } - /** - * string name = 1; - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName( - java.lang.String value) { - copyOnWrite(); - instance.setName(value); - return this; - } - /** - * string name = 1; - * @return This builder for chaining. - */ - public Builder clearName() { - copyOnWrite(); - instance.clearName(); - return this; - } - /** - * string name = 1; - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setNameBytes(value); - return this; - } - - // @@protoc_insertion_point(builder_scope:patrol.DartTestCase) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new pl.leancode.patrol.contracts.Contracts.DartTestCase(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "name_", - }; - java.lang.String info = - "\u0000\u0001\u0000\u0000\u0001\u0001\u0001\u0000\u0000\u0000\u0001\u0208"; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (pl.leancode.patrol.contracts.Contracts.DartTestCase.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:patrol.DartTestCase) - private static final pl.leancode.patrol.contracts.Contracts.DartTestCase DEFAULT_INSTANCE; - static { - DartTestCase defaultInstance = new DartTestCase(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - DartTestCase.class, defaultInstance); - } - - public static pl.leancode.patrol.contracts.Contracts.DartTestCase getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface RunDartTestRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:patrol.RunDartTestRequest) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * string name = 1; - * @return The name. - */ - java.lang.String getName(); - /** - * string name = 1; - * @return The bytes for name. - */ - com.google.protobuf.ByteString - getNameBytes(); - } - /** - * Protobuf type {@code patrol.RunDartTestRequest} - */ - public static final class RunDartTestRequest extends - com.google.protobuf.GeneratedMessageLite< - RunDartTestRequest, RunDartTestRequest.Builder> implements - // @@protoc_insertion_point(message_implements:patrol.RunDartTestRequest) - RunDartTestRequestOrBuilder { - private RunDartTestRequest() { - name_ = ""; - } - public static final int NAME_FIELD_NUMBER = 1; - private java.lang.String name_; - /** - * string name = 1; - * @return The name. - */ - @java.lang.Override - public java.lang.String getName() { - return name_; - } - /** - * string name = 1; - * @return The bytes for name. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getNameBytes() { - return com.google.protobuf.ByteString.copyFromUtf8(name_); - } - /** - * string name = 1; - * @param value The name to set. - */ - private void setName( - java.lang.String value) { - java.lang.Class valueClass = value.getClass(); - - name_ = value; - } - /** - * string name = 1; - */ - private void clearName() { - - name_ = getDefaultInstance().getName(); - } - /** - * string name = 1; - * @param value The bytes for name to set. - */ - private void setNameBytes( - com.google.protobuf.ByteString value) { - checkByteStringIsUtf8(value); - name_ = value.toStringUtf8(); - - } - - public static pl.leancode.patrol.contracts.Contracts.RunDartTestRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.RunDartTestRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.RunDartTestRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.RunDartTestRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.RunDartTestRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.RunDartTestRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.RunDartTestRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.RunDartTestRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static pl.leancode.patrol.contracts.Contracts.RunDartTestRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - - public static pl.leancode.patrol.contracts.Contracts.RunDartTestRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.RunDartTestRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.RunDartTestRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.RunDartTestRequest prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - * Protobuf type {@code patrol.RunDartTestRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - pl.leancode.patrol.contracts.Contracts.RunDartTestRequest, Builder> implements - // @@protoc_insertion_point(builder_implements:patrol.RunDartTestRequest) - pl.leancode.patrol.contracts.Contracts.RunDartTestRequestOrBuilder { - // Construct using pl.leancode.patrol.contracts.Contracts.RunDartTestRequest.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - * string name = 1; - * @return The name. - */ - @java.lang.Override - public java.lang.String getName() { - return instance.getName(); - } - /** - * string name = 1; - * @return The bytes for name. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getNameBytes() { - return instance.getNameBytes(); - } - /** - * string name = 1; - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName( - java.lang.String value) { - copyOnWrite(); - instance.setName(value); - return this; - } - /** - * string name = 1; - * @return This builder for chaining. - */ - public Builder clearName() { - copyOnWrite(); - instance.clearName(); - return this; - } - /** - * string name = 1; - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setNameBytes(value); - return this; - } - - // @@protoc_insertion_point(builder_scope:patrol.RunDartTestRequest) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new pl.leancode.patrol.contracts.Contracts.RunDartTestRequest(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "name_", - }; - java.lang.String info = - "\u0000\u0001\u0000\u0000\u0001\u0001\u0001\u0000\u0000\u0000\u0001\u0208"; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (pl.leancode.patrol.contracts.Contracts.RunDartTestRequest.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:patrol.RunDartTestRequest) - private static final pl.leancode.patrol.contracts.Contracts.RunDartTestRequest DEFAULT_INSTANCE; - static { - RunDartTestRequest defaultInstance = new RunDartTestRequest(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - RunDartTestRequest.class, defaultInstance); - } - - public static pl.leancode.patrol.contracts.Contracts.RunDartTestRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface RunDartTestResponseOrBuilder extends - // @@protoc_insertion_point(interface_extends:patrol.RunDartTestResponse) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * .patrol.RunDartTestResponse.Result result = 1; - * @return The enum numeric value on the wire for result. - */ - int getResultValue(); - /** - * .patrol.RunDartTestResponse.Result result = 1; - * @return The result. - */ - pl.leancode.patrol.contracts.Contracts.RunDartTestResponse.Result getResult(); - - /** - * optional string details = 2; - * @return Whether the details field is set. - */ - boolean hasDetails(); - /** - * optional string details = 2; - * @return The details. - */ - java.lang.String getDetails(); - /** - * optional string details = 2; - * @return The bytes for details. - */ - com.google.protobuf.ByteString - getDetailsBytes(); - } - /** - * Protobuf type {@code patrol.RunDartTestResponse} - */ - public static final class RunDartTestResponse extends - com.google.protobuf.GeneratedMessageLite< - RunDartTestResponse, RunDartTestResponse.Builder> implements - // @@protoc_insertion_point(message_implements:patrol.RunDartTestResponse) - RunDartTestResponseOrBuilder { - private RunDartTestResponse() { - details_ = ""; - } - /** - * Protobuf enum {@code patrol.RunDartTestResponse.Result} - */ - public enum Result - implements com.google.protobuf.Internal.EnumLite { - /** - * SUCCESS = 0; - */ - SUCCESS(0), - /** - * SKIPPED = 1; - */ - SKIPPED(1), - /** - * FAILURE = 2; - */ - FAILURE(2), - UNRECOGNIZED(-1), - ; - - /** - * SUCCESS = 0; - */ - public static final int SUCCESS_VALUE = 0; - /** - * SKIPPED = 1; - */ - public static final int SKIPPED_VALUE = 1; - /** - * FAILURE = 2; - */ - public static final int FAILURE_VALUE = 2; - - - @java.lang.Override - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - /** - * @param value The number of the enum to look for. - * @return The enum associated with the given number. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static Result valueOf(int value) { - return forNumber(value); - } - - public static Result forNumber(int value) { - switch (value) { - case 0: return SUCCESS; - case 1: return SKIPPED; - case 2: return FAILURE; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static final com.google.protobuf.Internal.EnumLiteMap< - Result> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - @java.lang.Override - public Result findValueByNumber(int number) { - return Result.forNumber(number); - } - }; - - public static com.google.protobuf.Internal.EnumVerifier - internalGetVerifier() { - return ResultVerifier.INSTANCE; - } - - private static final class ResultVerifier implements - com.google.protobuf.Internal.EnumVerifier { - static final com.google.protobuf.Internal.EnumVerifier INSTANCE = new ResultVerifier(); - @java.lang.Override - public boolean isInRange(int number) { - return Result.forNumber(number) != null; - } - }; - - private final int value; - - private Result(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:patrol.RunDartTestResponse.Result) - } - - private int bitField0_; - public static final int RESULT_FIELD_NUMBER = 1; - private int result_; - /** - * .patrol.RunDartTestResponse.Result result = 1; - * @return The enum numeric value on the wire for result. - */ - @java.lang.Override - public int getResultValue() { - return result_; - } - /** - * .patrol.RunDartTestResponse.Result result = 1; - * @return The result. - */ - @java.lang.Override - public pl.leancode.patrol.contracts.Contracts.RunDartTestResponse.Result getResult() { - pl.leancode.patrol.contracts.Contracts.RunDartTestResponse.Result result = pl.leancode.patrol.contracts.Contracts.RunDartTestResponse.Result.forNumber(result_); - return result == null ? pl.leancode.patrol.contracts.Contracts.RunDartTestResponse.Result.UNRECOGNIZED : result; - } - /** - * .patrol.RunDartTestResponse.Result result = 1; - * @param value The enum numeric value on the wire for result to set. - */ - private void setResultValue(int value) { - result_ = value; - } - /** - * .patrol.RunDartTestResponse.Result result = 1; - * @param value The result to set. - */ - private void setResult(pl.leancode.patrol.contracts.Contracts.RunDartTestResponse.Result value) { - result_ = value.getNumber(); - - } - /** - * .patrol.RunDartTestResponse.Result result = 1; - */ - private void clearResult() { - - result_ = 0; - } - - public static final int DETAILS_FIELD_NUMBER = 2; - private java.lang.String details_; - /** - * optional string details = 2; - * @return Whether the details field is set. - */ - @java.lang.Override - public boolean hasDetails() { - return ((bitField0_ & 0x00000001) != 0); - } - /** - * optional string details = 2; - * @return The details. - */ - @java.lang.Override - public java.lang.String getDetails() { - return details_; - } - /** - * optional string details = 2; - * @return The bytes for details. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getDetailsBytes() { - return com.google.protobuf.ByteString.copyFromUtf8(details_); - } - /** - * optional string details = 2; - * @param value The details to set. - */ - private void setDetails( - java.lang.String value) { - java.lang.Class valueClass = value.getClass(); - bitField0_ |= 0x00000001; - details_ = value; - } - /** - * optional string details = 2; - */ - private void clearDetails() { - bitField0_ = (bitField0_ & ~0x00000001); - details_ = getDefaultInstance().getDetails(); - } - /** - * optional string details = 2; - * @param value The bytes for details to set. - */ - private void setDetailsBytes( - com.google.protobuf.ByteString value) { - checkByteStringIsUtf8(value); - details_ = value.toStringUtf8(); - bitField0_ |= 0x00000001; - } - - public static pl.leancode.patrol.contracts.Contracts.RunDartTestResponse parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.RunDartTestResponse parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.RunDartTestResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.RunDartTestResponse parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.RunDartTestResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.RunDartTestResponse parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.RunDartTestResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.RunDartTestResponse parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static pl.leancode.patrol.contracts.Contracts.RunDartTestResponse parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - - public static pl.leancode.patrol.contracts.Contracts.RunDartTestResponse parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.RunDartTestResponse parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.RunDartTestResponse parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.RunDartTestResponse prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - * Protobuf type {@code patrol.RunDartTestResponse} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - pl.leancode.patrol.contracts.Contracts.RunDartTestResponse, Builder> implements - // @@protoc_insertion_point(builder_implements:patrol.RunDartTestResponse) - pl.leancode.patrol.contracts.Contracts.RunDartTestResponseOrBuilder { - // Construct using pl.leancode.patrol.contracts.Contracts.RunDartTestResponse.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - * .patrol.RunDartTestResponse.Result result = 1; - * @return The enum numeric value on the wire for result. - */ - @java.lang.Override - public int getResultValue() { - return instance.getResultValue(); - } - /** - * .patrol.RunDartTestResponse.Result result = 1; - * @param value The result to set. - * @return This builder for chaining. - */ - public Builder setResultValue(int value) { - copyOnWrite(); - instance.setResultValue(value); - return this; - } - /** - * .patrol.RunDartTestResponse.Result result = 1; - * @return The result. - */ - @java.lang.Override - public pl.leancode.patrol.contracts.Contracts.RunDartTestResponse.Result getResult() { - return instance.getResult(); - } - /** - * .patrol.RunDartTestResponse.Result result = 1; - * @param value The enum numeric value on the wire for result to set. - * @return This builder for chaining. - */ - public Builder setResult(pl.leancode.patrol.contracts.Contracts.RunDartTestResponse.Result value) { - copyOnWrite(); - instance.setResult(value); - return this; - } - /** - * .patrol.RunDartTestResponse.Result result = 1; - * @return This builder for chaining. - */ - public Builder clearResult() { - copyOnWrite(); - instance.clearResult(); - return this; - } - - /** - * optional string details = 2; - * @return Whether the details field is set. - */ - @java.lang.Override - public boolean hasDetails() { - return instance.hasDetails(); - } - /** - * optional string details = 2; - * @return The details. - */ - @java.lang.Override - public java.lang.String getDetails() { - return instance.getDetails(); - } - /** - * optional string details = 2; - * @return The bytes for details. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getDetailsBytes() { - return instance.getDetailsBytes(); - } - /** - * optional string details = 2; - * @param value The details to set. - * @return This builder for chaining. - */ - public Builder setDetails( - java.lang.String value) { - copyOnWrite(); - instance.setDetails(value); - return this; - } - /** - * optional string details = 2; - * @return This builder for chaining. - */ - public Builder clearDetails() { - copyOnWrite(); - instance.clearDetails(); - return this; - } - /** - * optional string details = 2; - * @param value The bytes for details to set. - * @return This builder for chaining. - */ - public Builder setDetailsBytes( - com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setDetailsBytes(value); - return this; - } - - // @@protoc_insertion_point(builder_scope:patrol.RunDartTestResponse) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new pl.leancode.patrol.contracts.Contracts.RunDartTestResponse(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "bitField0_", - "result_", - "details_", - }; - java.lang.String info = - "\u0000\u0002\u0000\u0001\u0001\u0002\u0002\u0000\u0000\u0000\u0001\f\u0002\u1208" + - "\u0000"; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (pl.leancode.patrol.contracts.Contracts.RunDartTestResponse.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:patrol.RunDartTestResponse) - private static final pl.leancode.patrol.contracts.Contracts.RunDartTestResponse DEFAULT_INSTANCE; - static { - RunDartTestResponse defaultInstance = new RunDartTestResponse(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - RunDartTestResponse.class, defaultInstance); - } - - public static pl.leancode.patrol.contracts.Contracts.RunDartTestResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface ConfigureRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:patrol.ConfigureRequest) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * uint64 findTimeoutMillis = 1; - * @return The findTimeoutMillis. - */ - long getFindTimeoutMillis(); - } - /** - * Protobuf type {@code patrol.ConfigureRequest} - */ - public static final class ConfigureRequest extends - com.google.protobuf.GeneratedMessageLite< - ConfigureRequest, ConfigureRequest.Builder> implements - // @@protoc_insertion_point(message_implements:patrol.ConfigureRequest) - ConfigureRequestOrBuilder { - private ConfigureRequest() { - } - public static final int FINDTIMEOUTMILLIS_FIELD_NUMBER = 1; - private long findTimeoutMillis_; - /** - * uint64 findTimeoutMillis = 1; - * @return The findTimeoutMillis. - */ - @java.lang.Override - public long getFindTimeoutMillis() { - return findTimeoutMillis_; - } - /** - * uint64 findTimeoutMillis = 1; - * @param value The findTimeoutMillis to set. - */ - private void setFindTimeoutMillis(long value) { - - findTimeoutMillis_ = value; - } - /** - * uint64 findTimeoutMillis = 1; - */ - private void clearFindTimeoutMillis() { - - findTimeoutMillis_ = 0L; - } - - public static pl.leancode.patrol.contracts.Contracts.ConfigureRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.ConfigureRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.ConfigureRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.ConfigureRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.ConfigureRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.ConfigureRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.ConfigureRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.ConfigureRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static pl.leancode.patrol.contracts.Contracts.ConfigureRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - - public static pl.leancode.patrol.contracts.Contracts.ConfigureRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.ConfigureRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.ConfigureRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.ConfigureRequest prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - * Protobuf type {@code patrol.ConfigureRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - pl.leancode.patrol.contracts.Contracts.ConfigureRequest, Builder> implements - // @@protoc_insertion_point(builder_implements:patrol.ConfigureRequest) - pl.leancode.patrol.contracts.Contracts.ConfigureRequestOrBuilder { - // Construct using pl.leancode.patrol.contracts.Contracts.ConfigureRequest.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - * uint64 findTimeoutMillis = 1; - * @return The findTimeoutMillis. - */ - @java.lang.Override - public long getFindTimeoutMillis() { - return instance.getFindTimeoutMillis(); - } - /** - * uint64 findTimeoutMillis = 1; - * @param value The findTimeoutMillis to set. - * @return This builder for chaining. - */ - public Builder setFindTimeoutMillis(long value) { - copyOnWrite(); - instance.setFindTimeoutMillis(value); - return this; - } - /** - * uint64 findTimeoutMillis = 1; - * @return This builder for chaining. - */ - public Builder clearFindTimeoutMillis() { - copyOnWrite(); - instance.clearFindTimeoutMillis(); - return this; - } - - // @@protoc_insertion_point(builder_scope:patrol.ConfigureRequest) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new pl.leancode.patrol.contracts.Contracts.ConfigureRequest(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "findTimeoutMillis_", - }; - java.lang.String info = - "\u0000\u0001\u0000\u0000\u0001\u0001\u0001\u0000\u0000\u0000\u0001\u0003"; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (pl.leancode.patrol.contracts.Contracts.ConfigureRequest.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:patrol.ConfigureRequest) - private static final pl.leancode.patrol.contracts.Contracts.ConfigureRequest DEFAULT_INSTANCE; - static { - ConfigureRequest defaultInstance = new ConfigureRequest(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - ConfigureRequest.class, defaultInstance); - } - - public static pl.leancode.patrol.contracts.Contracts.ConfigureRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface OpenAppRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:patrol.OpenAppRequest) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * string appId = 1; - * @return The appId. - */ - java.lang.String getAppId(); - /** - * string appId = 1; - * @return The bytes for appId. - */ - com.google.protobuf.ByteString - getAppIdBytes(); - } - /** - * Protobuf type {@code patrol.OpenAppRequest} - */ - public static final class OpenAppRequest extends - com.google.protobuf.GeneratedMessageLite< - OpenAppRequest, OpenAppRequest.Builder> implements - // @@protoc_insertion_point(message_implements:patrol.OpenAppRequest) - OpenAppRequestOrBuilder { - private OpenAppRequest() { - appId_ = ""; - } - public static final int APPID_FIELD_NUMBER = 1; - private java.lang.String appId_; - /** - * string appId = 1; - * @return The appId. - */ - @java.lang.Override - public java.lang.String getAppId() { - return appId_; - } - /** - * string appId = 1; - * @return The bytes for appId. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getAppIdBytes() { - return com.google.protobuf.ByteString.copyFromUtf8(appId_); - } - /** - * string appId = 1; - * @param value The appId to set. - */ - private void setAppId( - java.lang.String value) { - java.lang.Class valueClass = value.getClass(); - - appId_ = value; - } - /** - * string appId = 1; - */ - private void clearAppId() { - - appId_ = getDefaultInstance().getAppId(); - } - /** - * string appId = 1; - * @param value The bytes for appId to set. - */ - private void setAppIdBytes( - com.google.protobuf.ByteString value) { - checkByteStringIsUtf8(value); - appId_ = value.toStringUtf8(); - - } - - public static pl.leancode.patrol.contracts.Contracts.OpenAppRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.OpenAppRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.OpenAppRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.OpenAppRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.OpenAppRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.OpenAppRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.OpenAppRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.OpenAppRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static pl.leancode.patrol.contracts.Contracts.OpenAppRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - - public static pl.leancode.patrol.contracts.Contracts.OpenAppRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.OpenAppRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.OpenAppRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.OpenAppRequest prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - * Protobuf type {@code patrol.OpenAppRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - pl.leancode.patrol.contracts.Contracts.OpenAppRequest, Builder> implements - // @@protoc_insertion_point(builder_implements:patrol.OpenAppRequest) - pl.leancode.patrol.contracts.Contracts.OpenAppRequestOrBuilder { - // Construct using pl.leancode.patrol.contracts.Contracts.OpenAppRequest.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - * string appId = 1; - * @return The appId. - */ - @java.lang.Override - public java.lang.String getAppId() { - return instance.getAppId(); - } - /** - * string appId = 1; - * @return The bytes for appId. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getAppIdBytes() { - return instance.getAppIdBytes(); - } - /** - * string appId = 1; - * @param value The appId to set. - * @return This builder for chaining. - */ - public Builder setAppId( - java.lang.String value) { - copyOnWrite(); - instance.setAppId(value); - return this; - } - /** - * string appId = 1; - * @return This builder for chaining. - */ - public Builder clearAppId() { - copyOnWrite(); - instance.clearAppId(); - return this; - } - /** - * string appId = 1; - * @param value The bytes for appId to set. - * @return This builder for chaining. - */ - public Builder setAppIdBytes( - com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setAppIdBytes(value); - return this; - } - - // @@protoc_insertion_point(builder_scope:patrol.OpenAppRequest) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new pl.leancode.patrol.contracts.Contracts.OpenAppRequest(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "appId_", - }; - java.lang.String info = - "\u0000\u0001\u0000\u0000\u0001\u0001\u0001\u0000\u0000\u0000\u0001\u0208"; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (pl.leancode.patrol.contracts.Contracts.OpenAppRequest.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:patrol.OpenAppRequest) - private static final pl.leancode.patrol.contracts.Contracts.OpenAppRequest DEFAULT_INSTANCE; - static { - OpenAppRequest defaultInstance = new OpenAppRequest(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - OpenAppRequest.class, defaultInstance); - } - - public static pl.leancode.patrol.contracts.Contracts.OpenAppRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface TapOnNotificationRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:patrol.TapOnNotificationRequest) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * uint32 index = 1; - * @return Whether the index field is set. - */ - boolean hasIndex(); - /** - * uint32 index = 1; - * @return The index. - */ - int getIndex(); - - /** - * .patrol.Selector selector = 2; - * @return Whether the selector field is set. - */ - boolean hasSelector(); - /** - * .patrol.Selector selector = 2; - * @return The selector. - */ - pl.leancode.patrol.contracts.Contracts.Selector getSelector(); - - public pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest.FindByCase getFindByCase(); - } - /** - * Protobuf type {@code patrol.TapOnNotificationRequest} - */ - public static final class TapOnNotificationRequest extends - com.google.protobuf.GeneratedMessageLite< - TapOnNotificationRequest, TapOnNotificationRequest.Builder> implements - // @@protoc_insertion_point(message_implements:patrol.TapOnNotificationRequest) - TapOnNotificationRequestOrBuilder { - private TapOnNotificationRequest() { - } - private int findByCase_ = 0; - private java.lang.Object findBy_; - public enum FindByCase { - INDEX(1), - SELECTOR(2), - FINDBY_NOT_SET(0); - private final int value; - private FindByCase(int value) { - this.value = value; - } - /** - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static FindByCase valueOf(int value) { - return forNumber(value); - } - - public static FindByCase forNumber(int value) { - switch (value) { - case 1: return INDEX; - case 2: return SELECTOR; - case 0: return FINDBY_NOT_SET; - default: return null; - } - } - public int getNumber() { - return this.value; - } - }; - - @java.lang.Override - public FindByCase - getFindByCase() { - return FindByCase.forNumber( - findByCase_); - } - - private void clearFindBy() { - findByCase_ = 0; - findBy_ = null; - } - - public static final int INDEX_FIELD_NUMBER = 1; - /** - * uint32 index = 1; - * @return Whether the index field is set. - */ - @java.lang.Override - public boolean hasIndex() { - return findByCase_ == 1; - } - /** - * uint32 index = 1; - * @return The index. - */ - @java.lang.Override - public int getIndex() { - if (findByCase_ == 1) { - return (java.lang.Integer) findBy_; - } - return 0; - } - /** - * uint32 index = 1; - * @param value The index to set. - */ - private void setIndex(int value) { - findByCase_ = 1; - findBy_ = value; - } - /** - * uint32 index = 1; - */ - private void clearIndex() { - if (findByCase_ == 1) { - findByCase_ = 0; - findBy_ = null; - } - } - - public static final int SELECTOR_FIELD_NUMBER = 2; - /** - * .patrol.Selector selector = 2; - */ - @java.lang.Override - public boolean hasSelector() { - return findByCase_ == 2; - } - /** - * .patrol.Selector selector = 2; - */ - @java.lang.Override - public pl.leancode.patrol.contracts.Contracts.Selector getSelector() { - if (findByCase_ == 2) { - return (pl.leancode.patrol.contracts.Contracts.Selector) findBy_; - } - return pl.leancode.patrol.contracts.Contracts.Selector.getDefaultInstance(); - } - /** - * .patrol.Selector selector = 2; - */ - private void setSelector(pl.leancode.patrol.contracts.Contracts.Selector value) { - value.getClass(); - findBy_ = value; - findByCase_ = 2; - } - /** - * .patrol.Selector selector = 2; - */ - private void mergeSelector(pl.leancode.patrol.contracts.Contracts.Selector value) { - value.getClass(); - if (findByCase_ == 2 && - findBy_ != pl.leancode.patrol.contracts.Contracts.Selector.getDefaultInstance()) { - findBy_ = pl.leancode.patrol.contracts.Contracts.Selector.newBuilder((pl.leancode.patrol.contracts.Contracts.Selector) findBy_) - .mergeFrom(value).buildPartial(); - } else { - findBy_ = value; - } - findByCase_ = 2; - } - /** - * .patrol.Selector selector = 2; - */ - private void clearSelector() { - if (findByCase_ == 2) { - findByCase_ = 0; - findBy_ = null; - } - } - - public static pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - - public static pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - * Protobuf type {@code patrol.TapOnNotificationRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest, Builder> implements - // @@protoc_insertion_point(builder_implements:patrol.TapOnNotificationRequest) - pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequestOrBuilder { - // Construct using pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - @java.lang.Override - public FindByCase - getFindByCase() { - return instance.getFindByCase(); - } - - public Builder clearFindBy() { - copyOnWrite(); - instance.clearFindBy(); - return this; - } - - - /** - * uint32 index = 1; - * @return Whether the index field is set. - */ - @java.lang.Override - public boolean hasIndex() { - return instance.hasIndex(); - } - /** - * uint32 index = 1; - * @return The index. - */ - @java.lang.Override - public int getIndex() { - return instance.getIndex(); - } - /** - * uint32 index = 1; - * @param value The index to set. - * @return This builder for chaining. - */ - public Builder setIndex(int value) { - copyOnWrite(); - instance.setIndex(value); - return this; - } - /** - * uint32 index = 1; - * @return This builder for chaining. - */ - public Builder clearIndex() { - copyOnWrite(); - instance.clearIndex(); - return this; - } - - /** - * .patrol.Selector selector = 2; - */ - @java.lang.Override - public boolean hasSelector() { - return instance.hasSelector(); - } - /** - * .patrol.Selector selector = 2; - */ - @java.lang.Override - public pl.leancode.patrol.contracts.Contracts.Selector getSelector() { - return instance.getSelector(); - } - /** - * .patrol.Selector selector = 2; - */ - public Builder setSelector(pl.leancode.patrol.contracts.Contracts.Selector value) { - copyOnWrite(); - instance.setSelector(value); - return this; - } - /** - * .patrol.Selector selector = 2; - */ - public Builder setSelector( - pl.leancode.patrol.contracts.Contracts.Selector.Builder builderForValue) { - copyOnWrite(); - instance.setSelector(builderForValue.build()); - return this; - } - /** - * .patrol.Selector selector = 2; - */ - public Builder mergeSelector(pl.leancode.patrol.contracts.Contracts.Selector value) { - copyOnWrite(); - instance.mergeSelector(value); - return this; - } - /** - * .patrol.Selector selector = 2; - */ - public Builder clearSelector() { - copyOnWrite(); - instance.clearSelector(); - return this; - } - - // @@protoc_insertion_point(builder_scope:patrol.TapOnNotificationRequest) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "findBy_", - "findByCase_", - pl.leancode.patrol.contracts.Contracts.Selector.class, - }; - java.lang.String info = - "\u0000\u0002\u0001\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001>\u0000\u0002<" + - "\u0000"; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:patrol.TapOnNotificationRequest) - private static final pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest DEFAULT_INSTANCE; - static { - TapOnNotificationRequest defaultInstance = new TapOnNotificationRequest(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - TapOnNotificationRequest.class, defaultInstance); - } - - public static pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface EmptyOrBuilder extends - // @@protoc_insertion_point(interface_extends:patrol.Empty) - com.google.protobuf.MessageLiteOrBuilder { - } - /** - *

-   * We're defining our own Empty instead of using google.protobuf.Empty because
-   * the Dart plugin can't easily generate it.
-   *
-   * See:
-   *  * https://github.com/google/protobuf.dart/issues/170
-   * 
- * - * Protobuf type {@code patrol.Empty} - */ - public static final class Empty extends - com.google.protobuf.GeneratedMessageLite< - Empty, Empty.Builder> implements - // @@protoc_insertion_point(message_implements:patrol.Empty) - EmptyOrBuilder { - private Empty() { - } - public static pl.leancode.patrol.contracts.Contracts.Empty parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.Empty parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.Empty parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.Empty parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.Empty parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.Empty parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.Empty parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.Empty parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static pl.leancode.patrol.contracts.Contracts.Empty parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - - public static pl.leancode.patrol.contracts.Contracts.Empty parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.Empty parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.Empty parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.Empty prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - *
-     * We're defining our own Empty instead of using google.protobuf.Empty because
-     * the Dart plugin can't easily generate it.
-     *
-     * See:
-     *  * https://github.com/google/protobuf.dart/issues/170
-     * 
- * - * Protobuf type {@code patrol.Empty} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - pl.leancode.patrol.contracts.Contracts.Empty, Builder> implements - // @@protoc_insertion_point(builder_implements:patrol.Empty) - pl.leancode.patrol.contracts.Contracts.EmptyOrBuilder { - // Construct using pl.leancode.patrol.contracts.Contracts.Empty.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - // @@protoc_insertion_point(builder_scope:patrol.Empty) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new pl.leancode.patrol.contracts.Contracts.Empty(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = null;java.lang.String info = - "\u0000\u0000"; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (pl.leancode.patrol.contracts.Contracts.Empty.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:patrol.Empty) - private static final pl.leancode.patrol.contracts.Contracts.Empty DEFAULT_INSTANCE; - static { - Empty defaultInstance = new Empty(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - Empty.class, defaultInstance); - } - - public static pl.leancode.patrol.contracts.Contracts.Empty getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface OpenQuickSettingsRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:patrol.OpenQuickSettingsRequest) - com.google.protobuf.MessageLiteOrBuilder { - } - /** - * Protobuf type {@code patrol.OpenQuickSettingsRequest} - */ - public static final class OpenQuickSettingsRequest extends - com.google.protobuf.GeneratedMessageLite< - OpenQuickSettingsRequest, OpenQuickSettingsRequest.Builder> implements - // @@protoc_insertion_point(message_implements:patrol.OpenQuickSettingsRequest) - OpenQuickSettingsRequestOrBuilder { - private OpenQuickSettingsRequest() { - } - public static pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - - public static pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - * Protobuf type {@code patrol.OpenQuickSettingsRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest, Builder> implements - // @@protoc_insertion_point(builder_implements:patrol.OpenQuickSettingsRequest) - pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequestOrBuilder { - // Construct using pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - // @@protoc_insertion_point(builder_scope:patrol.OpenQuickSettingsRequest) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = null;java.lang.String info = - "\u0000\u0000"; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:patrol.OpenQuickSettingsRequest) - private static final pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest DEFAULT_INSTANCE; - static { - OpenQuickSettingsRequest defaultInstance = new OpenQuickSettingsRequest(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - OpenQuickSettingsRequest.class, defaultInstance); - } - - public static pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface DarkModeRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:patrol.DarkModeRequest) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * string appId = 1; - * @return The appId. - */ - java.lang.String getAppId(); - /** - * string appId = 1; - * @return The bytes for appId. - */ - com.google.protobuf.ByteString - getAppIdBytes(); - } - /** - * Protobuf type {@code patrol.DarkModeRequest} - */ - public static final class DarkModeRequest extends - com.google.protobuf.GeneratedMessageLite< - DarkModeRequest, DarkModeRequest.Builder> implements - // @@protoc_insertion_point(message_implements:patrol.DarkModeRequest) - DarkModeRequestOrBuilder { - private DarkModeRequest() { - appId_ = ""; - } - public static final int APPID_FIELD_NUMBER = 1; - private java.lang.String appId_; - /** - * string appId = 1; - * @return The appId. - */ - @java.lang.Override - public java.lang.String getAppId() { - return appId_; - } - /** - * string appId = 1; - * @return The bytes for appId. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getAppIdBytes() { - return com.google.protobuf.ByteString.copyFromUtf8(appId_); - } - /** - * string appId = 1; - * @param value The appId to set. - */ - private void setAppId( - java.lang.String value) { - java.lang.Class valueClass = value.getClass(); - - appId_ = value; - } - /** - * string appId = 1; - */ - private void clearAppId() { - - appId_ = getDefaultInstance().getAppId(); - } - /** - * string appId = 1; - * @param value The bytes for appId to set. - */ - private void setAppIdBytes( - com.google.protobuf.ByteString value) { - checkByteStringIsUtf8(value); - appId_ = value.toStringUtf8(); - - } - - public static pl.leancode.patrol.contracts.Contracts.DarkModeRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.DarkModeRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.DarkModeRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.DarkModeRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.DarkModeRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.DarkModeRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.DarkModeRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.DarkModeRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static pl.leancode.patrol.contracts.Contracts.DarkModeRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - - public static pl.leancode.patrol.contracts.Contracts.DarkModeRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.DarkModeRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.DarkModeRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.DarkModeRequest prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - * Protobuf type {@code patrol.DarkModeRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - pl.leancode.patrol.contracts.Contracts.DarkModeRequest, Builder> implements - // @@protoc_insertion_point(builder_implements:patrol.DarkModeRequest) - pl.leancode.patrol.contracts.Contracts.DarkModeRequestOrBuilder { - // Construct using pl.leancode.patrol.contracts.Contracts.DarkModeRequest.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - * string appId = 1; - * @return The appId. - */ - @java.lang.Override - public java.lang.String getAppId() { - return instance.getAppId(); - } - /** - * string appId = 1; - * @return The bytes for appId. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getAppIdBytes() { - return instance.getAppIdBytes(); - } - /** - * string appId = 1; - * @param value The appId to set. - * @return This builder for chaining. - */ - public Builder setAppId( - java.lang.String value) { - copyOnWrite(); - instance.setAppId(value); - return this; - } - /** - * string appId = 1; - * @return This builder for chaining. - */ - public Builder clearAppId() { - copyOnWrite(); - instance.clearAppId(); - return this; - } - /** - * string appId = 1; - * @param value The bytes for appId to set. - * @return This builder for chaining. - */ - public Builder setAppIdBytes( - com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setAppIdBytes(value); - return this; - } - - // @@protoc_insertion_point(builder_scope:patrol.DarkModeRequest) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new pl.leancode.patrol.contracts.Contracts.DarkModeRequest(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "appId_", - }; - java.lang.String info = - "\u0000\u0001\u0000\u0000\u0001\u0001\u0001\u0000\u0000\u0000\u0001\u0208"; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (pl.leancode.patrol.contracts.Contracts.DarkModeRequest.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:patrol.DarkModeRequest) - private static final pl.leancode.patrol.contracts.Contracts.DarkModeRequest DEFAULT_INSTANCE; - static { - DarkModeRequest defaultInstance = new DarkModeRequest(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - DarkModeRequest.class, defaultInstance); - } - - public static pl.leancode.patrol.contracts.Contracts.DarkModeRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface GetNativeViewsRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:patrol.GetNativeViewsRequest) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * .patrol.Selector selector = 1; - * @return Whether the selector field is set. - */ - boolean hasSelector(); - /** - * .patrol.Selector selector = 1; - * @return The selector. - */ - pl.leancode.patrol.contracts.Contracts.Selector getSelector(); - - /** - * string appId = 2; - * @return The appId. - */ - java.lang.String getAppId(); - /** - * string appId = 2; - * @return The bytes for appId. - */ - com.google.protobuf.ByteString - getAppIdBytes(); - } - /** - * Protobuf type {@code patrol.GetNativeViewsRequest} - */ - public static final class GetNativeViewsRequest extends - com.google.protobuf.GeneratedMessageLite< - GetNativeViewsRequest, GetNativeViewsRequest.Builder> implements - // @@protoc_insertion_point(message_implements:patrol.GetNativeViewsRequest) - GetNativeViewsRequestOrBuilder { - private GetNativeViewsRequest() { - appId_ = ""; - } - public static final int SELECTOR_FIELD_NUMBER = 1; - private pl.leancode.patrol.contracts.Contracts.Selector selector_; - /** - * .patrol.Selector selector = 1; - */ - @java.lang.Override - public boolean hasSelector() { - return selector_ != null; - } - /** - * .patrol.Selector selector = 1; - */ - @java.lang.Override - public pl.leancode.patrol.contracts.Contracts.Selector getSelector() { - return selector_ == null ? pl.leancode.patrol.contracts.Contracts.Selector.getDefaultInstance() : selector_; - } - /** - * .patrol.Selector selector = 1; - */ - private void setSelector(pl.leancode.patrol.contracts.Contracts.Selector value) { - value.getClass(); - selector_ = value; - - } - /** - * .patrol.Selector selector = 1; - */ - @java.lang.SuppressWarnings({"ReferenceEquality"}) - private void mergeSelector(pl.leancode.patrol.contracts.Contracts.Selector value) { - value.getClass(); - if (selector_ != null && - selector_ != pl.leancode.patrol.contracts.Contracts.Selector.getDefaultInstance()) { - selector_ = - pl.leancode.patrol.contracts.Contracts.Selector.newBuilder(selector_).mergeFrom(value).buildPartial(); - } else { - selector_ = value; - } - - } - /** - * .patrol.Selector selector = 1; - */ - private void clearSelector() { selector_ = null; - - } - - public static final int APPID_FIELD_NUMBER = 2; - private java.lang.String appId_; - /** - * string appId = 2; - * @return The appId. - */ - @java.lang.Override - public java.lang.String getAppId() { - return appId_; - } - /** - * string appId = 2; - * @return The bytes for appId. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getAppIdBytes() { - return com.google.protobuf.ByteString.copyFromUtf8(appId_); - } - /** - * string appId = 2; - * @param value The appId to set. - */ - private void setAppId( - java.lang.String value) { - java.lang.Class valueClass = value.getClass(); - - appId_ = value; - } - /** - * string appId = 2; - */ - private void clearAppId() { - - appId_ = getDefaultInstance().getAppId(); - } - /** - * string appId = 2; - * @param value The bytes for appId to set. - */ - private void setAppIdBytes( - com.google.protobuf.ByteString value) { - checkByteStringIsUtf8(value); - appId_ = value.toStringUtf8(); - - } - - public static pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - - public static pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - * Protobuf type {@code patrol.GetNativeViewsRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest, Builder> implements - // @@protoc_insertion_point(builder_implements:patrol.GetNativeViewsRequest) - pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequestOrBuilder { - // Construct using pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - * .patrol.Selector selector = 1; - */ - @java.lang.Override - public boolean hasSelector() { - return instance.hasSelector(); - } - /** - * .patrol.Selector selector = 1; - */ - @java.lang.Override - public pl.leancode.patrol.contracts.Contracts.Selector getSelector() { - return instance.getSelector(); - } - /** - * .patrol.Selector selector = 1; - */ - public Builder setSelector(pl.leancode.patrol.contracts.Contracts.Selector value) { - copyOnWrite(); - instance.setSelector(value); - return this; - } - /** - * .patrol.Selector selector = 1; - */ - public Builder setSelector( - pl.leancode.patrol.contracts.Contracts.Selector.Builder builderForValue) { - copyOnWrite(); - instance.setSelector(builderForValue.build()); - return this; - } - /** - * .patrol.Selector selector = 1; - */ - public Builder mergeSelector(pl.leancode.patrol.contracts.Contracts.Selector value) { - copyOnWrite(); - instance.mergeSelector(value); - return this; - } - /** - * .patrol.Selector selector = 1; - */ - public Builder clearSelector() { copyOnWrite(); - instance.clearSelector(); - return this; - } - - /** - * string appId = 2; - * @return The appId. - */ - @java.lang.Override - public java.lang.String getAppId() { - return instance.getAppId(); - } - /** - * string appId = 2; - * @return The bytes for appId. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getAppIdBytes() { - return instance.getAppIdBytes(); - } - /** - * string appId = 2; - * @param value The appId to set. - * @return This builder for chaining. - */ - public Builder setAppId( - java.lang.String value) { - copyOnWrite(); - instance.setAppId(value); - return this; - } - /** - * string appId = 2; - * @return This builder for chaining. - */ - public Builder clearAppId() { - copyOnWrite(); - instance.clearAppId(); - return this; - } - /** - * string appId = 2; - * @param value The bytes for appId to set. - * @return This builder for chaining. - */ - public Builder setAppIdBytes( - com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setAppIdBytes(value); - return this; - } - - // @@protoc_insertion_point(builder_scope:patrol.GetNativeViewsRequest) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "selector_", - "appId_", - }; - java.lang.String info = - "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001\t\u0002\u0208" + - ""; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:patrol.GetNativeViewsRequest) - private static final pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest DEFAULT_INSTANCE; - static { - GetNativeViewsRequest defaultInstance = new GetNativeViewsRequest(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - GetNativeViewsRequest.class, defaultInstance); - } - - public static pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface GetNativeViewsResponseOrBuilder extends - // @@protoc_insertion_point(interface_extends:patrol.GetNativeViewsResponse) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * repeated .patrol.NativeView nativeViews = 2; - */ - java.util.List - getNativeViewsList(); - /** - * repeated .patrol.NativeView nativeViews = 2; - */ - pl.leancode.patrol.contracts.Contracts.NativeView getNativeViews(int index); - /** - * repeated .patrol.NativeView nativeViews = 2; - */ - int getNativeViewsCount(); - } - /** - * Protobuf type {@code patrol.GetNativeViewsResponse} - */ - public static final class GetNativeViewsResponse extends - com.google.protobuf.GeneratedMessageLite< - GetNativeViewsResponse, GetNativeViewsResponse.Builder> implements - // @@protoc_insertion_point(message_implements:patrol.GetNativeViewsResponse) - GetNativeViewsResponseOrBuilder { - private GetNativeViewsResponse() { - nativeViews_ = emptyProtobufList(); - } - public static final int NATIVEVIEWS_FIELD_NUMBER = 2; - private com.google.protobuf.Internal.ProtobufList nativeViews_; - /** - * repeated .patrol.NativeView nativeViews = 2; - */ - @java.lang.Override - public java.util.List getNativeViewsList() { - return nativeViews_; - } - /** - * repeated .patrol.NativeView nativeViews = 2; - */ - public java.util.List - getNativeViewsOrBuilderList() { - return nativeViews_; - } - /** - * repeated .patrol.NativeView nativeViews = 2; - */ - @java.lang.Override - public int getNativeViewsCount() { - return nativeViews_.size(); - } - /** - * repeated .patrol.NativeView nativeViews = 2; - */ - @java.lang.Override - public pl.leancode.patrol.contracts.Contracts.NativeView getNativeViews(int index) { - return nativeViews_.get(index); - } - /** - * repeated .patrol.NativeView nativeViews = 2; - */ - public pl.leancode.patrol.contracts.Contracts.NativeViewOrBuilder getNativeViewsOrBuilder( - int index) { - return nativeViews_.get(index); - } - private void ensureNativeViewsIsMutable() { - com.google.protobuf.Internal.ProtobufList tmp = nativeViews_; - if (!tmp.isModifiable()) { - nativeViews_ = - com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp); - } - } - - /** - * repeated .patrol.NativeView nativeViews = 2; - */ - private void setNativeViews( - int index, pl.leancode.patrol.contracts.Contracts.NativeView value) { - value.getClass(); - ensureNativeViewsIsMutable(); - nativeViews_.set(index, value); - } - /** - * repeated .patrol.NativeView nativeViews = 2; - */ - private void addNativeViews(pl.leancode.patrol.contracts.Contracts.NativeView value) { - value.getClass(); - ensureNativeViewsIsMutable(); - nativeViews_.add(value); - } - /** - * repeated .patrol.NativeView nativeViews = 2; - */ - private void addNativeViews( - int index, pl.leancode.patrol.contracts.Contracts.NativeView value) { - value.getClass(); - ensureNativeViewsIsMutable(); - nativeViews_.add(index, value); - } - /** - * repeated .patrol.NativeView nativeViews = 2; - */ - private void addAllNativeViews( - java.lang.Iterable values) { - ensureNativeViewsIsMutable(); - com.google.protobuf.AbstractMessageLite.addAll( - values, nativeViews_); - } - /** - * repeated .patrol.NativeView nativeViews = 2; - */ - private void clearNativeViews() { - nativeViews_ = emptyProtobufList(); - } - /** - * repeated .patrol.NativeView nativeViews = 2; - */ - private void removeNativeViews(int index) { - ensureNativeViewsIsMutable(); - nativeViews_.remove(index); - } - - public static pl.leancode.patrol.contracts.Contracts.GetNativeViewsResponse parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.GetNativeViewsResponse parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.GetNativeViewsResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.GetNativeViewsResponse parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.GetNativeViewsResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.GetNativeViewsResponse parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.GetNativeViewsResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.GetNativeViewsResponse parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static pl.leancode.patrol.contracts.Contracts.GetNativeViewsResponse parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - - public static pl.leancode.patrol.contracts.Contracts.GetNativeViewsResponse parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.GetNativeViewsResponse parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.GetNativeViewsResponse parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.GetNativeViewsResponse prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - * Protobuf type {@code patrol.GetNativeViewsResponse} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - pl.leancode.patrol.contracts.Contracts.GetNativeViewsResponse, Builder> implements - // @@protoc_insertion_point(builder_implements:patrol.GetNativeViewsResponse) - pl.leancode.patrol.contracts.Contracts.GetNativeViewsResponseOrBuilder { - // Construct using pl.leancode.patrol.contracts.Contracts.GetNativeViewsResponse.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - * repeated .patrol.NativeView nativeViews = 2; - */ - @java.lang.Override - public java.util.List getNativeViewsList() { - return java.util.Collections.unmodifiableList( - instance.getNativeViewsList()); - } - /** - * repeated .patrol.NativeView nativeViews = 2; - */ - @java.lang.Override - public int getNativeViewsCount() { - return instance.getNativeViewsCount(); - }/** - * repeated .patrol.NativeView nativeViews = 2; - */ - @java.lang.Override - public pl.leancode.patrol.contracts.Contracts.NativeView getNativeViews(int index) { - return instance.getNativeViews(index); - } - /** - * repeated .patrol.NativeView nativeViews = 2; - */ - public Builder setNativeViews( - int index, pl.leancode.patrol.contracts.Contracts.NativeView value) { - copyOnWrite(); - instance.setNativeViews(index, value); - return this; - } - /** - * repeated .patrol.NativeView nativeViews = 2; - */ - public Builder setNativeViews( - int index, pl.leancode.patrol.contracts.Contracts.NativeView.Builder builderForValue) { - copyOnWrite(); - instance.setNativeViews(index, - builderForValue.build()); - return this; - } - /** - * repeated .patrol.NativeView nativeViews = 2; - */ - public Builder addNativeViews(pl.leancode.patrol.contracts.Contracts.NativeView value) { - copyOnWrite(); - instance.addNativeViews(value); - return this; - } - /** - * repeated .patrol.NativeView nativeViews = 2; - */ - public Builder addNativeViews( - int index, pl.leancode.patrol.contracts.Contracts.NativeView value) { - copyOnWrite(); - instance.addNativeViews(index, value); - return this; - } - /** - * repeated .patrol.NativeView nativeViews = 2; - */ - public Builder addNativeViews( - pl.leancode.patrol.contracts.Contracts.NativeView.Builder builderForValue) { - copyOnWrite(); - instance.addNativeViews(builderForValue.build()); - return this; - } - /** - * repeated .patrol.NativeView nativeViews = 2; - */ - public Builder addNativeViews( - int index, pl.leancode.patrol.contracts.Contracts.NativeView.Builder builderForValue) { - copyOnWrite(); - instance.addNativeViews(index, - builderForValue.build()); - return this; - } - /** - * repeated .patrol.NativeView nativeViews = 2; - */ - public Builder addAllNativeViews( - java.lang.Iterable values) { - copyOnWrite(); - instance.addAllNativeViews(values); - return this; - } - /** - * repeated .patrol.NativeView nativeViews = 2; - */ - public Builder clearNativeViews() { - copyOnWrite(); - instance.clearNativeViews(); - return this; - } - /** - * repeated .patrol.NativeView nativeViews = 2; - */ - public Builder removeNativeViews(int index) { - copyOnWrite(); - instance.removeNativeViews(index); - return this; - } - - // @@protoc_insertion_point(builder_scope:patrol.GetNativeViewsResponse) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new pl.leancode.patrol.contracts.Contracts.GetNativeViewsResponse(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "nativeViews_", - pl.leancode.patrol.contracts.Contracts.NativeView.class, - }; - java.lang.String info = - "\u0000\u0001\u0000\u0000\u0002\u0002\u0001\u0000\u0001\u0000\u0002\u001b"; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (pl.leancode.patrol.contracts.Contracts.GetNativeViewsResponse.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:patrol.GetNativeViewsResponse) - private static final pl.leancode.patrol.contracts.Contracts.GetNativeViewsResponse DEFAULT_INSTANCE; - static { - GetNativeViewsResponse defaultInstance = new GetNativeViewsResponse(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - GetNativeViewsResponse.class, defaultInstance); - } - - public static pl.leancode.patrol.contracts.Contracts.GetNativeViewsResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface GetNotificationsRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:patrol.GetNotificationsRequest) - com.google.protobuf.MessageLiteOrBuilder { - } - /** - * Protobuf type {@code patrol.GetNotificationsRequest} - */ - public static final class GetNotificationsRequest extends - com.google.protobuf.GeneratedMessageLite< - GetNotificationsRequest, GetNotificationsRequest.Builder> implements - // @@protoc_insertion_point(message_implements:patrol.GetNotificationsRequest) - GetNotificationsRequestOrBuilder { - private GetNotificationsRequest() { - } - public static pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - - public static pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - * Protobuf type {@code patrol.GetNotificationsRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest, Builder> implements - // @@protoc_insertion_point(builder_implements:patrol.GetNotificationsRequest) - pl.leancode.patrol.contracts.Contracts.GetNotificationsRequestOrBuilder { - // Construct using pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - // @@protoc_insertion_point(builder_scope:patrol.GetNotificationsRequest) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = null;java.lang.String info = - "\u0000\u0000"; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:patrol.GetNotificationsRequest) - private static final pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest DEFAULT_INSTANCE; - static { - GetNotificationsRequest defaultInstance = new GetNotificationsRequest(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - GetNotificationsRequest.class, defaultInstance); - } - - public static pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface GetNotificationsResponseOrBuilder extends - // @@protoc_insertion_point(interface_extends:patrol.GetNotificationsResponse) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * repeated .patrol.Notification notifications = 2; - */ - java.util.List - getNotificationsList(); - /** - * repeated .patrol.Notification notifications = 2; - */ - pl.leancode.patrol.contracts.Contracts.Notification getNotifications(int index); - /** - * repeated .patrol.Notification notifications = 2; - */ - int getNotificationsCount(); - } - /** - * Protobuf type {@code patrol.GetNotificationsResponse} - */ - public static final class GetNotificationsResponse extends - com.google.protobuf.GeneratedMessageLite< - GetNotificationsResponse, GetNotificationsResponse.Builder> implements - // @@protoc_insertion_point(message_implements:patrol.GetNotificationsResponse) - GetNotificationsResponseOrBuilder { - private GetNotificationsResponse() { - notifications_ = emptyProtobufList(); - } - public static final int NOTIFICATIONS_FIELD_NUMBER = 2; - private com.google.protobuf.Internal.ProtobufList notifications_; - /** - * repeated .patrol.Notification notifications = 2; - */ - @java.lang.Override - public java.util.List getNotificationsList() { - return notifications_; - } - /** - * repeated .patrol.Notification notifications = 2; - */ - public java.util.List - getNotificationsOrBuilderList() { - return notifications_; - } - /** - * repeated .patrol.Notification notifications = 2; - */ - @java.lang.Override - public int getNotificationsCount() { - return notifications_.size(); - } - /** - * repeated .patrol.Notification notifications = 2; - */ - @java.lang.Override - public pl.leancode.patrol.contracts.Contracts.Notification getNotifications(int index) { - return notifications_.get(index); - } - /** - * repeated .patrol.Notification notifications = 2; - */ - public pl.leancode.patrol.contracts.Contracts.NotificationOrBuilder getNotificationsOrBuilder( - int index) { - return notifications_.get(index); - } - private void ensureNotificationsIsMutable() { - com.google.protobuf.Internal.ProtobufList tmp = notifications_; - if (!tmp.isModifiable()) { - notifications_ = - com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp); - } - } - - /** - * repeated .patrol.Notification notifications = 2; - */ - private void setNotifications( - int index, pl.leancode.patrol.contracts.Contracts.Notification value) { - value.getClass(); - ensureNotificationsIsMutable(); - notifications_.set(index, value); - } - /** - * repeated .patrol.Notification notifications = 2; - */ - private void addNotifications(pl.leancode.patrol.contracts.Contracts.Notification value) { - value.getClass(); - ensureNotificationsIsMutable(); - notifications_.add(value); - } - /** - * repeated .patrol.Notification notifications = 2; - */ - private void addNotifications( - int index, pl.leancode.patrol.contracts.Contracts.Notification value) { - value.getClass(); - ensureNotificationsIsMutable(); - notifications_.add(index, value); - } - /** - * repeated .patrol.Notification notifications = 2; - */ - private void addAllNotifications( - java.lang.Iterable values) { - ensureNotificationsIsMutable(); - com.google.protobuf.AbstractMessageLite.addAll( - values, notifications_); - } - /** - * repeated .patrol.Notification notifications = 2; - */ - private void clearNotifications() { - notifications_ = emptyProtobufList(); - } - /** - * repeated .patrol.Notification notifications = 2; - */ - private void removeNotifications(int index) { - ensureNotificationsIsMutable(); - notifications_.remove(index); - } - - public static pl.leancode.patrol.contracts.Contracts.GetNotificationsResponse parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.GetNotificationsResponse parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.GetNotificationsResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.GetNotificationsResponse parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.GetNotificationsResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.GetNotificationsResponse parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.GetNotificationsResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.GetNotificationsResponse parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static pl.leancode.patrol.contracts.Contracts.GetNotificationsResponse parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - - public static pl.leancode.patrol.contracts.Contracts.GetNotificationsResponse parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.GetNotificationsResponse parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.GetNotificationsResponse parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.GetNotificationsResponse prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - * Protobuf type {@code patrol.GetNotificationsResponse} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - pl.leancode.patrol.contracts.Contracts.GetNotificationsResponse, Builder> implements - // @@protoc_insertion_point(builder_implements:patrol.GetNotificationsResponse) - pl.leancode.patrol.contracts.Contracts.GetNotificationsResponseOrBuilder { - // Construct using pl.leancode.patrol.contracts.Contracts.GetNotificationsResponse.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - * repeated .patrol.Notification notifications = 2; - */ - @java.lang.Override - public java.util.List getNotificationsList() { - return java.util.Collections.unmodifiableList( - instance.getNotificationsList()); - } - /** - * repeated .patrol.Notification notifications = 2; - */ - @java.lang.Override - public int getNotificationsCount() { - return instance.getNotificationsCount(); - }/** - * repeated .patrol.Notification notifications = 2; - */ - @java.lang.Override - public pl.leancode.patrol.contracts.Contracts.Notification getNotifications(int index) { - return instance.getNotifications(index); - } - /** - * repeated .patrol.Notification notifications = 2; - */ - public Builder setNotifications( - int index, pl.leancode.patrol.contracts.Contracts.Notification value) { - copyOnWrite(); - instance.setNotifications(index, value); - return this; - } - /** - * repeated .patrol.Notification notifications = 2; - */ - public Builder setNotifications( - int index, pl.leancode.patrol.contracts.Contracts.Notification.Builder builderForValue) { - copyOnWrite(); - instance.setNotifications(index, - builderForValue.build()); - return this; - } - /** - * repeated .patrol.Notification notifications = 2; - */ - public Builder addNotifications(pl.leancode.patrol.contracts.Contracts.Notification value) { - copyOnWrite(); - instance.addNotifications(value); - return this; - } - /** - * repeated .patrol.Notification notifications = 2; - */ - public Builder addNotifications( - int index, pl.leancode.patrol.contracts.Contracts.Notification value) { - copyOnWrite(); - instance.addNotifications(index, value); - return this; - } - /** - * repeated .patrol.Notification notifications = 2; - */ - public Builder addNotifications( - pl.leancode.patrol.contracts.Contracts.Notification.Builder builderForValue) { - copyOnWrite(); - instance.addNotifications(builderForValue.build()); - return this; - } - /** - * repeated .patrol.Notification notifications = 2; - */ - public Builder addNotifications( - int index, pl.leancode.patrol.contracts.Contracts.Notification.Builder builderForValue) { - copyOnWrite(); - instance.addNotifications(index, - builderForValue.build()); - return this; - } - /** - * repeated .patrol.Notification notifications = 2; - */ - public Builder addAllNotifications( - java.lang.Iterable values) { - copyOnWrite(); - instance.addAllNotifications(values); - return this; - } - /** - * repeated .patrol.Notification notifications = 2; - */ - public Builder clearNotifications() { - copyOnWrite(); - instance.clearNotifications(); - return this; - } - /** - * repeated .patrol.Notification notifications = 2; - */ - public Builder removeNotifications(int index) { - copyOnWrite(); - instance.removeNotifications(index); - return this; - } - - // @@protoc_insertion_point(builder_scope:patrol.GetNotificationsResponse) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new pl.leancode.patrol.contracts.Contracts.GetNotificationsResponse(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "notifications_", - pl.leancode.patrol.contracts.Contracts.Notification.class, - }; - java.lang.String info = - "\u0000\u0001\u0000\u0000\u0002\u0002\u0001\u0000\u0001\u0000\u0002\u001b"; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (pl.leancode.patrol.contracts.Contracts.GetNotificationsResponse.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:patrol.GetNotificationsResponse) - private static final pl.leancode.patrol.contracts.Contracts.GetNotificationsResponse DEFAULT_INSTANCE; - static { - GetNotificationsResponse defaultInstance = new GetNotificationsResponse(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - GetNotificationsResponse.class, defaultInstance); - } - - public static pl.leancode.patrol.contracts.Contracts.GetNotificationsResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface TapRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:patrol.TapRequest) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * .patrol.Selector selector = 1; - * @return Whether the selector field is set. - */ - boolean hasSelector(); - /** - * .patrol.Selector selector = 1; - * @return The selector. - */ - pl.leancode.patrol.contracts.Contracts.Selector getSelector(); - - /** - * string appId = 2; - * @return The appId. - */ - java.lang.String getAppId(); - /** - * string appId = 2; - * @return The bytes for appId. - */ - com.google.protobuf.ByteString - getAppIdBytes(); - } - /** - * Protobuf type {@code patrol.TapRequest} - */ - public static final class TapRequest extends - com.google.protobuf.GeneratedMessageLite< - TapRequest, TapRequest.Builder> implements - // @@protoc_insertion_point(message_implements:patrol.TapRequest) - TapRequestOrBuilder { - private TapRequest() { - appId_ = ""; - } - public static final int SELECTOR_FIELD_NUMBER = 1; - private pl.leancode.patrol.contracts.Contracts.Selector selector_; - /** - * .patrol.Selector selector = 1; - */ - @java.lang.Override - public boolean hasSelector() { - return selector_ != null; - } - /** - * .patrol.Selector selector = 1; - */ - @java.lang.Override - public pl.leancode.patrol.contracts.Contracts.Selector getSelector() { - return selector_ == null ? pl.leancode.patrol.contracts.Contracts.Selector.getDefaultInstance() : selector_; - } - /** - * .patrol.Selector selector = 1; - */ - private void setSelector(pl.leancode.patrol.contracts.Contracts.Selector value) { - value.getClass(); - selector_ = value; - - } - /** - * .patrol.Selector selector = 1; - */ - @java.lang.SuppressWarnings({"ReferenceEquality"}) - private void mergeSelector(pl.leancode.patrol.contracts.Contracts.Selector value) { - value.getClass(); - if (selector_ != null && - selector_ != pl.leancode.patrol.contracts.Contracts.Selector.getDefaultInstance()) { - selector_ = - pl.leancode.patrol.contracts.Contracts.Selector.newBuilder(selector_).mergeFrom(value).buildPartial(); - } else { - selector_ = value; - } - - } - /** - * .patrol.Selector selector = 1; - */ - private void clearSelector() { selector_ = null; - - } - - public static final int APPID_FIELD_NUMBER = 2; - private java.lang.String appId_; - /** - * string appId = 2; - * @return The appId. - */ - @java.lang.Override - public java.lang.String getAppId() { - return appId_; - } - /** - * string appId = 2; - * @return The bytes for appId. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getAppIdBytes() { - return com.google.protobuf.ByteString.copyFromUtf8(appId_); - } - /** - * string appId = 2; - * @param value The appId to set. - */ - private void setAppId( - java.lang.String value) { - java.lang.Class valueClass = value.getClass(); - - appId_ = value; - } - /** - * string appId = 2; - */ - private void clearAppId() { - - appId_ = getDefaultInstance().getAppId(); - } - /** - * string appId = 2; - * @param value The bytes for appId to set. - */ - private void setAppIdBytes( - com.google.protobuf.ByteString value) { - checkByteStringIsUtf8(value); - appId_ = value.toStringUtf8(); - - } - - public static pl.leancode.patrol.contracts.Contracts.TapRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.TapRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.TapRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.TapRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.TapRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.TapRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.TapRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.TapRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static pl.leancode.patrol.contracts.Contracts.TapRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - - public static pl.leancode.patrol.contracts.Contracts.TapRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.TapRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.TapRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.TapRequest prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - * Protobuf type {@code patrol.TapRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - pl.leancode.patrol.contracts.Contracts.TapRequest, Builder> implements - // @@protoc_insertion_point(builder_implements:patrol.TapRequest) - pl.leancode.patrol.contracts.Contracts.TapRequestOrBuilder { - // Construct using pl.leancode.patrol.contracts.Contracts.TapRequest.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - * .patrol.Selector selector = 1; - */ - @java.lang.Override - public boolean hasSelector() { - return instance.hasSelector(); - } - /** - * .patrol.Selector selector = 1; - */ - @java.lang.Override - public pl.leancode.patrol.contracts.Contracts.Selector getSelector() { - return instance.getSelector(); - } - /** - * .patrol.Selector selector = 1; - */ - public Builder setSelector(pl.leancode.patrol.contracts.Contracts.Selector value) { - copyOnWrite(); - instance.setSelector(value); - return this; - } - /** - * .patrol.Selector selector = 1; - */ - public Builder setSelector( - pl.leancode.patrol.contracts.Contracts.Selector.Builder builderForValue) { - copyOnWrite(); - instance.setSelector(builderForValue.build()); - return this; - } - /** - * .patrol.Selector selector = 1; - */ - public Builder mergeSelector(pl.leancode.patrol.contracts.Contracts.Selector value) { - copyOnWrite(); - instance.mergeSelector(value); - return this; - } - /** - * .patrol.Selector selector = 1; - */ - public Builder clearSelector() { copyOnWrite(); - instance.clearSelector(); - return this; - } - - /** - * string appId = 2; - * @return The appId. - */ - @java.lang.Override - public java.lang.String getAppId() { - return instance.getAppId(); - } - /** - * string appId = 2; - * @return The bytes for appId. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getAppIdBytes() { - return instance.getAppIdBytes(); - } - /** - * string appId = 2; - * @param value The appId to set. - * @return This builder for chaining. - */ - public Builder setAppId( - java.lang.String value) { - copyOnWrite(); - instance.setAppId(value); - return this; - } - /** - * string appId = 2; - * @return This builder for chaining. - */ - public Builder clearAppId() { - copyOnWrite(); - instance.clearAppId(); - return this; - } - /** - * string appId = 2; - * @param value The bytes for appId to set. - * @return This builder for chaining. - */ - public Builder setAppIdBytes( - com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setAppIdBytes(value); - return this; - } - - // @@protoc_insertion_point(builder_scope:patrol.TapRequest) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new pl.leancode.patrol.contracts.Contracts.TapRequest(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "selector_", - "appId_", - }; - java.lang.String info = - "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001\t\u0002\u0208" + - ""; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (pl.leancode.patrol.contracts.Contracts.TapRequest.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:patrol.TapRequest) - private static final pl.leancode.patrol.contracts.Contracts.TapRequest DEFAULT_INSTANCE; - static { - TapRequest defaultInstance = new TapRequest(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - TapRequest.class, defaultInstance); - } - - public static pl.leancode.patrol.contracts.Contracts.TapRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface EnterTextRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:patrol.EnterTextRequest) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * string data = 1; - * @return The data. - */ - java.lang.String getData(); - /** - * string data = 1; - * @return The bytes for data. - */ - com.google.protobuf.ByteString - getDataBytes(); - - /** - * string appId = 2; - * @return The appId. - */ - java.lang.String getAppId(); - /** - * string appId = 2; - * @return The bytes for appId. - */ - com.google.protobuf.ByteString - getAppIdBytes(); - - /** - * uint32 index = 3; - * @return Whether the index field is set. - */ - boolean hasIndex(); - /** - * uint32 index = 3; - * @return The index. - */ - int getIndex(); - - /** - * .patrol.Selector selector = 4; - * @return Whether the selector field is set. - */ - boolean hasSelector(); - /** - * .patrol.Selector selector = 4; - * @return The selector. - */ - pl.leancode.patrol.contracts.Contracts.Selector getSelector(); - - /** - * bool showKeyboard = 5; - * @return The showKeyboard. - */ - boolean getShowKeyboard(); - - public pl.leancode.patrol.contracts.Contracts.EnterTextRequest.FindByCase getFindByCase(); - } - /** - * Protobuf type {@code patrol.EnterTextRequest} - */ - public static final class EnterTextRequest extends - com.google.protobuf.GeneratedMessageLite< - EnterTextRequest, EnterTextRequest.Builder> implements - // @@protoc_insertion_point(message_implements:patrol.EnterTextRequest) - EnterTextRequestOrBuilder { - private EnterTextRequest() { - data_ = ""; - appId_ = ""; - } - private int findByCase_ = 0; - private java.lang.Object findBy_; - public enum FindByCase { - INDEX(3), - SELECTOR(4), - FINDBY_NOT_SET(0); - private final int value; - private FindByCase(int value) { - this.value = value; - } - /** - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static FindByCase valueOf(int value) { - return forNumber(value); - } - - public static FindByCase forNumber(int value) { - switch (value) { - case 3: return INDEX; - case 4: return SELECTOR; - case 0: return FINDBY_NOT_SET; - default: return null; - } - } - public int getNumber() { - return this.value; - } - }; - - @java.lang.Override - public FindByCase - getFindByCase() { - return FindByCase.forNumber( - findByCase_); - } - - private void clearFindBy() { - findByCase_ = 0; - findBy_ = null; - } - - public static final int DATA_FIELD_NUMBER = 1; - private java.lang.String data_; - /** - * string data = 1; - * @return The data. - */ - @java.lang.Override - public java.lang.String getData() { - return data_; - } - /** - * string data = 1; - * @return The bytes for data. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getDataBytes() { - return com.google.protobuf.ByteString.copyFromUtf8(data_); - } - /** - * string data = 1; - * @param value The data to set. - */ - private void setData( - java.lang.String value) { - java.lang.Class valueClass = value.getClass(); - - data_ = value; - } - /** - * string data = 1; - */ - private void clearData() { - - data_ = getDefaultInstance().getData(); - } - /** - * string data = 1; - * @param value The bytes for data to set. - */ - private void setDataBytes( - com.google.protobuf.ByteString value) { - checkByteStringIsUtf8(value); - data_ = value.toStringUtf8(); - - } - - public static final int APPID_FIELD_NUMBER = 2; - private java.lang.String appId_; - /** - * string appId = 2; - * @return The appId. - */ - @java.lang.Override - public java.lang.String getAppId() { - return appId_; - } - /** - * string appId = 2; - * @return The bytes for appId. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getAppIdBytes() { - return com.google.protobuf.ByteString.copyFromUtf8(appId_); - } - /** - * string appId = 2; - * @param value The appId to set. - */ - private void setAppId( - java.lang.String value) { - java.lang.Class valueClass = value.getClass(); - - appId_ = value; - } - /** - * string appId = 2; - */ - private void clearAppId() { - - appId_ = getDefaultInstance().getAppId(); - } - /** - * string appId = 2; - * @param value The bytes for appId to set. - */ - private void setAppIdBytes( - com.google.protobuf.ByteString value) { - checkByteStringIsUtf8(value); - appId_ = value.toStringUtf8(); - - } - - public static final int INDEX_FIELD_NUMBER = 3; - /** - * uint32 index = 3; - * @return Whether the index field is set. - */ - @java.lang.Override - public boolean hasIndex() { - return findByCase_ == 3; - } - /** - * uint32 index = 3; - * @return The index. - */ - @java.lang.Override - public int getIndex() { - if (findByCase_ == 3) { - return (java.lang.Integer) findBy_; - } - return 0; - } - /** - * uint32 index = 3; - * @param value The index to set. - */ - private void setIndex(int value) { - findByCase_ = 3; - findBy_ = value; - } - /** - * uint32 index = 3; - */ - private void clearIndex() { - if (findByCase_ == 3) { - findByCase_ = 0; - findBy_ = null; - } - } - - public static final int SELECTOR_FIELD_NUMBER = 4; - /** - * .patrol.Selector selector = 4; - */ - @java.lang.Override - public boolean hasSelector() { - return findByCase_ == 4; - } - /** - * .patrol.Selector selector = 4; - */ - @java.lang.Override - public pl.leancode.patrol.contracts.Contracts.Selector getSelector() { - if (findByCase_ == 4) { - return (pl.leancode.patrol.contracts.Contracts.Selector) findBy_; - } - return pl.leancode.patrol.contracts.Contracts.Selector.getDefaultInstance(); - } - /** - * .patrol.Selector selector = 4; - */ - private void setSelector(pl.leancode.patrol.contracts.Contracts.Selector value) { - value.getClass(); - findBy_ = value; - findByCase_ = 4; - } - /** - * .patrol.Selector selector = 4; - */ - private void mergeSelector(pl.leancode.patrol.contracts.Contracts.Selector value) { - value.getClass(); - if (findByCase_ == 4 && - findBy_ != pl.leancode.patrol.contracts.Contracts.Selector.getDefaultInstance()) { - findBy_ = pl.leancode.patrol.contracts.Contracts.Selector.newBuilder((pl.leancode.patrol.contracts.Contracts.Selector) findBy_) - .mergeFrom(value).buildPartial(); - } else { - findBy_ = value; - } - findByCase_ = 4; - } - /** - * .patrol.Selector selector = 4; - */ - private void clearSelector() { - if (findByCase_ == 4) { - findByCase_ = 0; - findBy_ = null; - } - } - - public static final int SHOWKEYBOARD_FIELD_NUMBER = 5; - private boolean showKeyboard_; - /** - * bool showKeyboard = 5; - * @return The showKeyboard. - */ - @java.lang.Override - public boolean getShowKeyboard() { - return showKeyboard_; - } - /** - * bool showKeyboard = 5; - * @param value The showKeyboard to set. - */ - private void setShowKeyboard(boolean value) { - - showKeyboard_ = value; - } - /** - * bool showKeyboard = 5; - */ - private void clearShowKeyboard() { - - showKeyboard_ = false; - } - - public static pl.leancode.patrol.contracts.Contracts.EnterTextRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.EnterTextRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.EnterTextRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.EnterTextRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.EnterTextRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.EnterTextRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.EnterTextRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.EnterTextRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static pl.leancode.patrol.contracts.Contracts.EnterTextRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - - public static pl.leancode.patrol.contracts.Contracts.EnterTextRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.EnterTextRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.EnterTextRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.EnterTextRequest prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - * Protobuf type {@code patrol.EnterTextRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - pl.leancode.patrol.contracts.Contracts.EnterTextRequest, Builder> implements - // @@protoc_insertion_point(builder_implements:patrol.EnterTextRequest) - pl.leancode.patrol.contracts.Contracts.EnterTextRequestOrBuilder { - // Construct using pl.leancode.patrol.contracts.Contracts.EnterTextRequest.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - @java.lang.Override - public FindByCase - getFindByCase() { - return instance.getFindByCase(); - } - - public Builder clearFindBy() { - copyOnWrite(); - instance.clearFindBy(); - return this; - } - - - /** - * string data = 1; - * @return The data. - */ - @java.lang.Override - public java.lang.String getData() { - return instance.getData(); - } - /** - * string data = 1; - * @return The bytes for data. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getDataBytes() { - return instance.getDataBytes(); - } - /** - * string data = 1; - * @param value The data to set. - * @return This builder for chaining. - */ - public Builder setData( - java.lang.String value) { - copyOnWrite(); - instance.setData(value); - return this; - } - /** - * string data = 1; - * @return This builder for chaining. - */ - public Builder clearData() { - copyOnWrite(); - instance.clearData(); - return this; - } - /** - * string data = 1; - * @param value The bytes for data to set. - * @return This builder for chaining. - */ - public Builder setDataBytes( - com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setDataBytes(value); - return this; - } - - /** - * string appId = 2; - * @return The appId. - */ - @java.lang.Override - public java.lang.String getAppId() { - return instance.getAppId(); - } - /** - * string appId = 2; - * @return The bytes for appId. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getAppIdBytes() { - return instance.getAppIdBytes(); - } - /** - * string appId = 2; - * @param value The appId to set. - * @return This builder for chaining. - */ - public Builder setAppId( - java.lang.String value) { - copyOnWrite(); - instance.setAppId(value); - return this; - } - /** - * string appId = 2; - * @return This builder for chaining. - */ - public Builder clearAppId() { - copyOnWrite(); - instance.clearAppId(); - return this; - } - /** - * string appId = 2; - * @param value The bytes for appId to set. - * @return This builder for chaining. - */ - public Builder setAppIdBytes( - com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setAppIdBytes(value); - return this; - } - - /** - * uint32 index = 3; - * @return Whether the index field is set. - */ - @java.lang.Override - public boolean hasIndex() { - return instance.hasIndex(); - } - /** - * uint32 index = 3; - * @return The index. - */ - @java.lang.Override - public int getIndex() { - return instance.getIndex(); - } - /** - * uint32 index = 3; - * @param value The index to set. - * @return This builder for chaining. - */ - public Builder setIndex(int value) { - copyOnWrite(); - instance.setIndex(value); - return this; - } - /** - * uint32 index = 3; - * @return This builder for chaining. - */ - public Builder clearIndex() { - copyOnWrite(); - instance.clearIndex(); - return this; - } - - /** - * .patrol.Selector selector = 4; - */ - @java.lang.Override - public boolean hasSelector() { - return instance.hasSelector(); - } - /** - * .patrol.Selector selector = 4; - */ - @java.lang.Override - public pl.leancode.patrol.contracts.Contracts.Selector getSelector() { - return instance.getSelector(); - } - /** - * .patrol.Selector selector = 4; - */ - public Builder setSelector(pl.leancode.patrol.contracts.Contracts.Selector value) { - copyOnWrite(); - instance.setSelector(value); - return this; - } - /** - * .patrol.Selector selector = 4; - */ - public Builder setSelector( - pl.leancode.patrol.contracts.Contracts.Selector.Builder builderForValue) { - copyOnWrite(); - instance.setSelector(builderForValue.build()); - return this; - } - /** - * .patrol.Selector selector = 4; - */ - public Builder mergeSelector(pl.leancode.patrol.contracts.Contracts.Selector value) { - copyOnWrite(); - instance.mergeSelector(value); - return this; - } - /** - * .patrol.Selector selector = 4; - */ - public Builder clearSelector() { - copyOnWrite(); - instance.clearSelector(); - return this; - } - - /** - * bool showKeyboard = 5; - * @return The showKeyboard. - */ - @java.lang.Override - public boolean getShowKeyboard() { - return instance.getShowKeyboard(); - } - /** - * bool showKeyboard = 5; - * @param value The showKeyboard to set. - * @return This builder for chaining. - */ - public Builder setShowKeyboard(boolean value) { - copyOnWrite(); - instance.setShowKeyboard(value); - return this; - } - /** - * bool showKeyboard = 5; - * @return This builder for chaining. - */ - public Builder clearShowKeyboard() { - copyOnWrite(); - instance.clearShowKeyboard(); - return this; - } - - // @@protoc_insertion_point(builder_scope:patrol.EnterTextRequest) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new pl.leancode.patrol.contracts.Contracts.EnterTextRequest(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "findBy_", - "findByCase_", - "data_", - "appId_", - pl.leancode.patrol.contracts.Contracts.Selector.class, - "showKeyboard_", - }; - java.lang.String info = - "\u0000\u0005\u0001\u0000\u0001\u0005\u0005\u0000\u0000\u0000\u0001\u0208\u0002\u0208" + - "\u0003>\u0000\u0004<\u0000\u0005\u0007"; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (pl.leancode.patrol.contracts.Contracts.EnterTextRequest.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:patrol.EnterTextRequest) - private static final pl.leancode.patrol.contracts.Contracts.EnterTextRequest DEFAULT_INSTANCE; - static { - EnterTextRequest defaultInstance = new EnterTextRequest(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - EnterTextRequest.class, defaultInstance); - } - - public static pl.leancode.patrol.contracts.Contracts.EnterTextRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface SwipeRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:patrol.SwipeRequest) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * float startX = 1; - * @return The startX. - */ - float getStartX(); - - /** - * float startY = 2; - * @return The startY. - */ - float getStartY(); - - /** - * float endX = 3; - * @return The endX. - */ - float getEndX(); - - /** - * float endY = 4; - * @return The endY. - */ - float getEndY(); - - /** - * uint32 steps = 5; - * @return The steps. - */ - int getSteps(); - - /** - * string appId = 6; - * @return The appId. - */ - java.lang.String getAppId(); - /** - * string appId = 6; - * @return The bytes for appId. - */ - com.google.protobuf.ByteString - getAppIdBytes(); - } - /** - * Protobuf type {@code patrol.SwipeRequest} - */ - public static final class SwipeRequest extends - com.google.protobuf.GeneratedMessageLite< - SwipeRequest, SwipeRequest.Builder> implements - // @@protoc_insertion_point(message_implements:patrol.SwipeRequest) - SwipeRequestOrBuilder { - private SwipeRequest() { - appId_ = ""; - } - public static final int STARTX_FIELD_NUMBER = 1; - private float startX_; - /** - * float startX = 1; - * @return The startX. - */ - @java.lang.Override - public float getStartX() { - return startX_; - } - /** - * float startX = 1; - * @param value The startX to set. - */ - private void setStartX(float value) { - - startX_ = value; - } - /** - * float startX = 1; - */ - private void clearStartX() { - - startX_ = 0F; - } - - public static final int STARTY_FIELD_NUMBER = 2; - private float startY_; - /** - * float startY = 2; - * @return The startY. - */ - @java.lang.Override - public float getStartY() { - return startY_; - } - /** - * float startY = 2; - * @param value The startY to set. - */ - private void setStartY(float value) { - - startY_ = value; - } - /** - * float startY = 2; - */ - private void clearStartY() { - - startY_ = 0F; - } - - public static final int ENDX_FIELD_NUMBER = 3; - private float endX_; - /** - * float endX = 3; - * @return The endX. - */ - @java.lang.Override - public float getEndX() { - return endX_; - } - /** - * float endX = 3; - * @param value The endX to set. - */ - private void setEndX(float value) { - - endX_ = value; - } - /** - * float endX = 3; - */ - private void clearEndX() { - - endX_ = 0F; - } - - public static final int ENDY_FIELD_NUMBER = 4; - private float endY_; - /** - * float endY = 4; - * @return The endY. - */ - @java.lang.Override - public float getEndY() { - return endY_; - } - /** - * float endY = 4; - * @param value The endY to set. - */ - private void setEndY(float value) { - - endY_ = value; - } - /** - * float endY = 4; - */ - private void clearEndY() { - - endY_ = 0F; - } - - public static final int STEPS_FIELD_NUMBER = 5; - private int steps_; - /** - * uint32 steps = 5; - * @return The steps. - */ - @java.lang.Override - public int getSteps() { - return steps_; - } - /** - * uint32 steps = 5; - * @param value The steps to set. - */ - private void setSteps(int value) { - - steps_ = value; - } - /** - * uint32 steps = 5; - */ - private void clearSteps() { - - steps_ = 0; - } - - public static final int APPID_FIELD_NUMBER = 6; - private java.lang.String appId_; - /** - * string appId = 6; - * @return The appId. - */ - @java.lang.Override - public java.lang.String getAppId() { - return appId_; - } - /** - * string appId = 6; - * @return The bytes for appId. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getAppIdBytes() { - return com.google.protobuf.ByteString.copyFromUtf8(appId_); - } - /** - * string appId = 6; - * @param value The appId to set. - */ - private void setAppId( - java.lang.String value) { - java.lang.Class valueClass = value.getClass(); - - appId_ = value; - } - /** - * string appId = 6; - */ - private void clearAppId() { - - appId_ = getDefaultInstance().getAppId(); - } - /** - * string appId = 6; - * @param value The bytes for appId to set. - */ - private void setAppIdBytes( - com.google.protobuf.ByteString value) { - checkByteStringIsUtf8(value); - appId_ = value.toStringUtf8(); - - } - - public static pl.leancode.patrol.contracts.Contracts.SwipeRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.SwipeRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.SwipeRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.SwipeRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.SwipeRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.SwipeRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.SwipeRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.SwipeRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static pl.leancode.patrol.contracts.Contracts.SwipeRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - - public static pl.leancode.patrol.contracts.Contracts.SwipeRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.SwipeRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.SwipeRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.SwipeRequest prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - * Protobuf type {@code patrol.SwipeRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - pl.leancode.patrol.contracts.Contracts.SwipeRequest, Builder> implements - // @@protoc_insertion_point(builder_implements:patrol.SwipeRequest) - pl.leancode.patrol.contracts.Contracts.SwipeRequestOrBuilder { - // Construct using pl.leancode.patrol.contracts.Contracts.SwipeRequest.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - * float startX = 1; - * @return The startX. - */ - @java.lang.Override - public float getStartX() { - return instance.getStartX(); - } - /** - * float startX = 1; - * @param value The startX to set. - * @return This builder for chaining. - */ - public Builder setStartX(float value) { - copyOnWrite(); - instance.setStartX(value); - return this; - } - /** - * float startX = 1; - * @return This builder for chaining. - */ - public Builder clearStartX() { - copyOnWrite(); - instance.clearStartX(); - return this; - } - - /** - * float startY = 2; - * @return The startY. - */ - @java.lang.Override - public float getStartY() { - return instance.getStartY(); - } - /** - * float startY = 2; - * @param value The startY to set. - * @return This builder for chaining. - */ - public Builder setStartY(float value) { - copyOnWrite(); - instance.setStartY(value); - return this; - } - /** - * float startY = 2; - * @return This builder for chaining. - */ - public Builder clearStartY() { - copyOnWrite(); - instance.clearStartY(); - return this; - } - - /** - * float endX = 3; - * @return The endX. - */ - @java.lang.Override - public float getEndX() { - return instance.getEndX(); - } - /** - * float endX = 3; - * @param value The endX to set. - * @return This builder for chaining. - */ - public Builder setEndX(float value) { - copyOnWrite(); - instance.setEndX(value); - return this; - } - /** - * float endX = 3; - * @return This builder for chaining. - */ - public Builder clearEndX() { - copyOnWrite(); - instance.clearEndX(); - return this; - } - - /** - * float endY = 4; - * @return The endY. - */ - @java.lang.Override - public float getEndY() { - return instance.getEndY(); - } - /** - * float endY = 4; - * @param value The endY to set. - * @return This builder for chaining. - */ - public Builder setEndY(float value) { - copyOnWrite(); - instance.setEndY(value); - return this; - } - /** - * float endY = 4; - * @return This builder for chaining. - */ - public Builder clearEndY() { - copyOnWrite(); - instance.clearEndY(); - return this; - } - - /** - * uint32 steps = 5; - * @return The steps. - */ - @java.lang.Override - public int getSteps() { - return instance.getSteps(); - } - /** - * uint32 steps = 5; - * @param value The steps to set. - * @return This builder for chaining. - */ - public Builder setSteps(int value) { - copyOnWrite(); - instance.setSteps(value); - return this; - } - /** - * uint32 steps = 5; - * @return This builder for chaining. - */ - public Builder clearSteps() { - copyOnWrite(); - instance.clearSteps(); - return this; - } - - /** - * string appId = 6; - * @return The appId. - */ - @java.lang.Override - public java.lang.String getAppId() { - return instance.getAppId(); - } - /** - * string appId = 6; - * @return The bytes for appId. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getAppIdBytes() { - return instance.getAppIdBytes(); - } - /** - * string appId = 6; - * @param value The appId to set. - * @return This builder for chaining. - */ - public Builder setAppId( - java.lang.String value) { - copyOnWrite(); - instance.setAppId(value); - return this; - } - /** - * string appId = 6; - * @return This builder for chaining. - */ - public Builder clearAppId() { - copyOnWrite(); - instance.clearAppId(); - return this; - } - /** - * string appId = 6; - * @param value The bytes for appId to set. - * @return This builder for chaining. - */ - public Builder setAppIdBytes( - com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setAppIdBytes(value); - return this; - } - - // @@protoc_insertion_point(builder_scope:patrol.SwipeRequest) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new pl.leancode.patrol.contracts.Contracts.SwipeRequest(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "startX_", - "startY_", - "endX_", - "endY_", - "steps_", - "appId_", - }; - java.lang.String info = - "\u0000\u0006\u0000\u0000\u0001\u0006\u0006\u0000\u0000\u0000\u0001\u0001\u0002\u0001" + - "\u0003\u0001\u0004\u0001\u0005\u000b\u0006\u0208"; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (pl.leancode.patrol.contracts.Contracts.SwipeRequest.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:patrol.SwipeRequest) - private static final pl.leancode.patrol.contracts.Contracts.SwipeRequest DEFAULT_INSTANCE; - static { - SwipeRequest defaultInstance = new SwipeRequest(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - SwipeRequest.class, defaultInstance); - } - - public static pl.leancode.patrol.contracts.Contracts.SwipeRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface WaitUntilVisibleRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:patrol.WaitUntilVisibleRequest) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * .patrol.Selector selector = 1; - * @return Whether the selector field is set. - */ - boolean hasSelector(); - /** - * .patrol.Selector selector = 1; - * @return The selector. - */ - pl.leancode.patrol.contracts.Contracts.Selector getSelector(); - - /** - * string appId = 2; - * @return The appId. - */ - java.lang.String getAppId(); - /** - * string appId = 2; - * @return The bytes for appId. - */ - com.google.protobuf.ByteString - getAppIdBytes(); - } - /** - * Protobuf type {@code patrol.WaitUntilVisibleRequest} - */ - public static final class WaitUntilVisibleRequest extends - com.google.protobuf.GeneratedMessageLite< - WaitUntilVisibleRequest, WaitUntilVisibleRequest.Builder> implements - // @@protoc_insertion_point(message_implements:patrol.WaitUntilVisibleRequest) - WaitUntilVisibleRequestOrBuilder { - private WaitUntilVisibleRequest() { - appId_ = ""; - } - public static final int SELECTOR_FIELD_NUMBER = 1; - private pl.leancode.patrol.contracts.Contracts.Selector selector_; - /** - * .patrol.Selector selector = 1; - */ - @java.lang.Override - public boolean hasSelector() { - return selector_ != null; - } - /** - * .patrol.Selector selector = 1; - */ - @java.lang.Override - public pl.leancode.patrol.contracts.Contracts.Selector getSelector() { - return selector_ == null ? pl.leancode.patrol.contracts.Contracts.Selector.getDefaultInstance() : selector_; - } - /** - * .patrol.Selector selector = 1; - */ - private void setSelector(pl.leancode.patrol.contracts.Contracts.Selector value) { - value.getClass(); - selector_ = value; - - } - /** - * .patrol.Selector selector = 1; - */ - @java.lang.SuppressWarnings({"ReferenceEquality"}) - private void mergeSelector(pl.leancode.patrol.contracts.Contracts.Selector value) { - value.getClass(); - if (selector_ != null && - selector_ != pl.leancode.patrol.contracts.Contracts.Selector.getDefaultInstance()) { - selector_ = - pl.leancode.patrol.contracts.Contracts.Selector.newBuilder(selector_).mergeFrom(value).buildPartial(); - } else { - selector_ = value; - } - - } - /** - * .patrol.Selector selector = 1; - */ - private void clearSelector() { selector_ = null; - - } - - public static final int APPID_FIELD_NUMBER = 2; - private java.lang.String appId_; - /** - * string appId = 2; - * @return The appId. - */ - @java.lang.Override - public java.lang.String getAppId() { - return appId_; - } - /** - * string appId = 2; - * @return The bytes for appId. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getAppIdBytes() { - return com.google.protobuf.ByteString.copyFromUtf8(appId_); - } - /** - * string appId = 2; - * @param value The appId to set. - */ - private void setAppId( - java.lang.String value) { - java.lang.Class valueClass = value.getClass(); - - appId_ = value; - } - /** - * string appId = 2; - */ - private void clearAppId() { - - appId_ = getDefaultInstance().getAppId(); - } - /** - * string appId = 2; - * @param value The bytes for appId to set. - */ - private void setAppIdBytes( - com.google.protobuf.ByteString value) { - checkByteStringIsUtf8(value); - appId_ = value.toStringUtf8(); - - } - - public static pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - - public static pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - * Protobuf type {@code patrol.WaitUntilVisibleRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest, Builder> implements - // @@protoc_insertion_point(builder_implements:patrol.WaitUntilVisibleRequest) - pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequestOrBuilder { - // Construct using pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - * .patrol.Selector selector = 1; - */ - @java.lang.Override - public boolean hasSelector() { - return instance.hasSelector(); - } - /** - * .patrol.Selector selector = 1; - */ - @java.lang.Override - public pl.leancode.patrol.contracts.Contracts.Selector getSelector() { - return instance.getSelector(); - } - /** - * .patrol.Selector selector = 1; - */ - public Builder setSelector(pl.leancode.patrol.contracts.Contracts.Selector value) { - copyOnWrite(); - instance.setSelector(value); - return this; - } - /** - * .patrol.Selector selector = 1; - */ - public Builder setSelector( - pl.leancode.patrol.contracts.Contracts.Selector.Builder builderForValue) { - copyOnWrite(); - instance.setSelector(builderForValue.build()); - return this; - } - /** - * .patrol.Selector selector = 1; - */ - public Builder mergeSelector(pl.leancode.patrol.contracts.Contracts.Selector value) { - copyOnWrite(); - instance.mergeSelector(value); - return this; - } - /** - * .patrol.Selector selector = 1; - */ - public Builder clearSelector() { copyOnWrite(); - instance.clearSelector(); - return this; - } - - /** - * string appId = 2; - * @return The appId. - */ - @java.lang.Override - public java.lang.String getAppId() { - return instance.getAppId(); - } - /** - * string appId = 2; - * @return The bytes for appId. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getAppIdBytes() { - return instance.getAppIdBytes(); - } - /** - * string appId = 2; - * @param value The appId to set. - * @return This builder for chaining. - */ - public Builder setAppId( - java.lang.String value) { - copyOnWrite(); - instance.setAppId(value); - return this; - } - /** - * string appId = 2; - * @return This builder for chaining. - */ - public Builder clearAppId() { - copyOnWrite(); - instance.clearAppId(); - return this; - } - /** - * string appId = 2; - * @param value The bytes for appId to set. - * @return This builder for chaining. - */ - public Builder setAppIdBytes( - com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setAppIdBytes(value); - return this; - } - - // @@protoc_insertion_point(builder_scope:patrol.WaitUntilVisibleRequest) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "selector_", - "appId_", - }; - java.lang.String info = - "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001\t\u0002\u0208" + - ""; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:patrol.WaitUntilVisibleRequest) - private static final pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest DEFAULT_INSTANCE; - static { - WaitUntilVisibleRequest defaultInstance = new WaitUntilVisibleRequest(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - WaitUntilVisibleRequest.class, defaultInstance); - } - - public static pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface HandlePermissionRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:patrol.HandlePermissionRequest) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * .patrol.HandlePermissionRequest.Code code = 1; - * @return The enum numeric value on the wire for code. - */ - int getCodeValue(); - /** - * .patrol.HandlePermissionRequest.Code code = 1; - * @return The code. - */ - pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest.Code getCode(); - } - /** - * Protobuf type {@code patrol.HandlePermissionRequest} - */ - public static final class HandlePermissionRequest extends - com.google.protobuf.GeneratedMessageLite< - HandlePermissionRequest, HandlePermissionRequest.Builder> implements - // @@protoc_insertion_point(message_implements:patrol.HandlePermissionRequest) - HandlePermissionRequestOrBuilder { - private HandlePermissionRequest() { - } - /** - * Protobuf enum {@code patrol.HandlePermissionRequest.Code} - */ - public enum Code - implements com.google.protobuf.Internal.EnumLite { - /** - * WHILE_USING = 0; - */ - WHILE_USING(0), - /** - * ONLY_THIS_TIME = 1; - */ - ONLY_THIS_TIME(1), - /** - * DENIED = 2; - */ - DENIED(2), - UNRECOGNIZED(-1), - ; - - /** - * WHILE_USING = 0; - */ - public static final int WHILE_USING_VALUE = 0; - /** - * ONLY_THIS_TIME = 1; - */ - public static final int ONLY_THIS_TIME_VALUE = 1; - /** - * DENIED = 2; - */ - public static final int DENIED_VALUE = 2; - - - @java.lang.Override - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - /** - * @param value The number of the enum to look for. - * @return The enum associated with the given number. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static Code valueOf(int value) { - return forNumber(value); - } - - public static Code forNumber(int value) { - switch (value) { - case 0: return WHILE_USING; - case 1: return ONLY_THIS_TIME; - case 2: return DENIED; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static final com.google.protobuf.Internal.EnumLiteMap< - Code> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - @java.lang.Override - public Code findValueByNumber(int number) { - return Code.forNumber(number); - } - }; - - public static com.google.protobuf.Internal.EnumVerifier - internalGetVerifier() { - return CodeVerifier.INSTANCE; - } - - private static final class CodeVerifier implements - com.google.protobuf.Internal.EnumVerifier { - static final com.google.protobuf.Internal.EnumVerifier INSTANCE = new CodeVerifier(); - @java.lang.Override - public boolean isInRange(int number) { - return Code.forNumber(number) != null; - } - }; - - private final int value; - - private Code(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:patrol.HandlePermissionRequest.Code) - } - - public static final int CODE_FIELD_NUMBER = 1; - private int code_; - /** - * .patrol.HandlePermissionRequest.Code code = 1; - * @return The enum numeric value on the wire for code. - */ - @java.lang.Override - public int getCodeValue() { - return code_; - } - /** - * .patrol.HandlePermissionRequest.Code code = 1; - * @return The code. - */ - @java.lang.Override - public pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest.Code getCode() { - pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest.Code result = pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest.Code.forNumber(code_); - return result == null ? pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest.Code.UNRECOGNIZED : result; - } - /** - * .patrol.HandlePermissionRequest.Code code = 1; - * @param value The enum numeric value on the wire for code to set. - */ - private void setCodeValue(int value) { - code_ = value; - } - /** - * .patrol.HandlePermissionRequest.Code code = 1; - * @param value The code to set. - */ - private void setCode(pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest.Code value) { - code_ = value.getNumber(); - - } - /** - * .patrol.HandlePermissionRequest.Code code = 1; - */ - private void clearCode() { - - code_ = 0; - } - - public static pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - - public static pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - * Protobuf type {@code patrol.HandlePermissionRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest, Builder> implements - // @@protoc_insertion_point(builder_implements:patrol.HandlePermissionRequest) - pl.leancode.patrol.contracts.Contracts.HandlePermissionRequestOrBuilder { - // Construct using pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - * .patrol.HandlePermissionRequest.Code code = 1; - * @return The enum numeric value on the wire for code. - */ - @java.lang.Override - public int getCodeValue() { - return instance.getCodeValue(); - } - /** - * .patrol.HandlePermissionRequest.Code code = 1; - * @param value The code to set. - * @return This builder for chaining. - */ - public Builder setCodeValue(int value) { - copyOnWrite(); - instance.setCodeValue(value); - return this; - } - /** - * .patrol.HandlePermissionRequest.Code code = 1; - * @return The code. - */ - @java.lang.Override - public pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest.Code getCode() { - return instance.getCode(); - } - /** - * .patrol.HandlePermissionRequest.Code code = 1; - * @param value The enum numeric value on the wire for code to set. - * @return This builder for chaining. - */ - public Builder setCode(pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest.Code value) { - copyOnWrite(); - instance.setCode(value); - return this; - } - /** - * .patrol.HandlePermissionRequest.Code code = 1; - * @return This builder for chaining. - */ - public Builder clearCode() { - copyOnWrite(); - instance.clearCode(); - return this; - } - - // @@protoc_insertion_point(builder_scope:patrol.HandlePermissionRequest) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "code_", - }; - java.lang.String info = - "\u0000\u0001\u0000\u0000\u0001\u0001\u0001\u0000\u0000\u0000\u0001\f"; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:patrol.HandlePermissionRequest) - private static final pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest DEFAULT_INSTANCE; - static { - HandlePermissionRequest defaultInstance = new HandlePermissionRequest(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - HandlePermissionRequest.class, defaultInstance); - } - - public static pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface SetLocationAccuracyRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:patrol.SetLocationAccuracyRequest) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * .patrol.SetLocationAccuracyRequest.LocationAccuracy locationAccuracy = 1; - * @return The enum numeric value on the wire for locationAccuracy. - */ - int getLocationAccuracyValue(); - /** - * .patrol.SetLocationAccuracyRequest.LocationAccuracy locationAccuracy = 1; - * @return The locationAccuracy. - */ - pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest.LocationAccuracy getLocationAccuracy(); - } - /** - * Protobuf type {@code patrol.SetLocationAccuracyRequest} - */ - public static final class SetLocationAccuracyRequest extends - com.google.protobuf.GeneratedMessageLite< - SetLocationAccuracyRequest, SetLocationAccuracyRequest.Builder> implements - // @@protoc_insertion_point(message_implements:patrol.SetLocationAccuracyRequest) - SetLocationAccuracyRequestOrBuilder { - private SetLocationAccuracyRequest() { - } - /** - * Protobuf enum {@code patrol.SetLocationAccuracyRequest.LocationAccuracy} - */ - public enum LocationAccuracy - implements com.google.protobuf.Internal.EnumLite { - /** - * COARSE = 0; - */ - COARSE(0), - /** - * FINE = 1; - */ - FINE(1), - UNRECOGNIZED(-1), - ; - - /** - * COARSE = 0; - */ - public static final int COARSE_VALUE = 0; - /** - * FINE = 1; - */ - public static final int FINE_VALUE = 1; - - - @java.lang.Override - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - /** - * @param value The number of the enum to look for. - * @return The enum associated with the given number. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static LocationAccuracy valueOf(int value) { - return forNumber(value); - } - - public static LocationAccuracy forNumber(int value) { - switch (value) { - case 0: return COARSE; - case 1: return FINE; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static final com.google.protobuf.Internal.EnumLiteMap< - LocationAccuracy> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - @java.lang.Override - public LocationAccuracy findValueByNumber(int number) { - return LocationAccuracy.forNumber(number); - } - }; - - public static com.google.protobuf.Internal.EnumVerifier - internalGetVerifier() { - return LocationAccuracyVerifier.INSTANCE; - } - - private static final class LocationAccuracyVerifier implements - com.google.protobuf.Internal.EnumVerifier { - static final com.google.protobuf.Internal.EnumVerifier INSTANCE = new LocationAccuracyVerifier(); - @java.lang.Override - public boolean isInRange(int number) { - return LocationAccuracy.forNumber(number) != null; - } - }; - - private final int value; - - private LocationAccuracy(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:patrol.SetLocationAccuracyRequest.LocationAccuracy) - } - - public static final int LOCATIONACCURACY_FIELD_NUMBER = 1; - private int locationAccuracy_; - /** - * .patrol.SetLocationAccuracyRequest.LocationAccuracy locationAccuracy = 1; - * @return The enum numeric value on the wire for locationAccuracy. - */ - @java.lang.Override - public int getLocationAccuracyValue() { - return locationAccuracy_; - } - /** - * .patrol.SetLocationAccuracyRequest.LocationAccuracy locationAccuracy = 1; - * @return The locationAccuracy. - */ - @java.lang.Override - public pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest.LocationAccuracy getLocationAccuracy() { - pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest.LocationAccuracy result = pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest.LocationAccuracy.forNumber(locationAccuracy_); - return result == null ? pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest.LocationAccuracy.UNRECOGNIZED : result; - } - /** - * .patrol.SetLocationAccuracyRequest.LocationAccuracy locationAccuracy = 1; - * @param value The enum numeric value on the wire for locationAccuracy to set. - */ - private void setLocationAccuracyValue(int value) { - locationAccuracy_ = value; - } - /** - * .patrol.SetLocationAccuracyRequest.LocationAccuracy locationAccuracy = 1; - * @param value The locationAccuracy to set. - */ - private void setLocationAccuracy(pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest.LocationAccuracy value) { - locationAccuracy_ = value.getNumber(); - - } - /** - * .patrol.SetLocationAccuracyRequest.LocationAccuracy locationAccuracy = 1; - */ - private void clearLocationAccuracy() { - - locationAccuracy_ = 0; - } - - public static pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - - public static pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - * Protobuf type {@code patrol.SetLocationAccuracyRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest, Builder> implements - // @@protoc_insertion_point(builder_implements:patrol.SetLocationAccuracyRequest) - pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequestOrBuilder { - // Construct using pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - * .patrol.SetLocationAccuracyRequest.LocationAccuracy locationAccuracy = 1; - * @return The enum numeric value on the wire for locationAccuracy. - */ - @java.lang.Override - public int getLocationAccuracyValue() { - return instance.getLocationAccuracyValue(); - } - /** - * .patrol.SetLocationAccuracyRequest.LocationAccuracy locationAccuracy = 1; - * @param value The locationAccuracy to set. - * @return This builder for chaining. - */ - public Builder setLocationAccuracyValue(int value) { - copyOnWrite(); - instance.setLocationAccuracyValue(value); - return this; - } - /** - * .patrol.SetLocationAccuracyRequest.LocationAccuracy locationAccuracy = 1; - * @return The locationAccuracy. - */ - @java.lang.Override - public pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest.LocationAccuracy getLocationAccuracy() { - return instance.getLocationAccuracy(); - } - /** - * .patrol.SetLocationAccuracyRequest.LocationAccuracy locationAccuracy = 1; - * @param value The enum numeric value on the wire for locationAccuracy to set. - * @return This builder for chaining. - */ - public Builder setLocationAccuracy(pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest.LocationAccuracy value) { - copyOnWrite(); - instance.setLocationAccuracy(value); - return this; - } - /** - * .patrol.SetLocationAccuracyRequest.LocationAccuracy locationAccuracy = 1; - * @return This builder for chaining. - */ - public Builder clearLocationAccuracy() { - copyOnWrite(); - instance.clearLocationAccuracy(); - return this; - } - - // @@protoc_insertion_point(builder_scope:patrol.SetLocationAccuracyRequest) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "locationAccuracy_", - }; - java.lang.String info = - "\u0000\u0001\u0000\u0000\u0001\u0001\u0001\u0000\u0000\u0000\u0001\f"; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:patrol.SetLocationAccuracyRequest) - private static final pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest DEFAULT_INSTANCE; - static { - SetLocationAccuracyRequest defaultInstance = new SetLocationAccuracyRequest(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - SetLocationAccuracyRequest.class, defaultInstance); - } - - public static pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface PermissionDialogVisibleRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:patrol.PermissionDialogVisibleRequest) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * uint64 timeoutMillis = 1; - * @return The timeoutMillis. - */ - long getTimeoutMillis(); - } - /** - * Protobuf type {@code patrol.PermissionDialogVisibleRequest} - */ - public static final class PermissionDialogVisibleRequest extends - com.google.protobuf.GeneratedMessageLite< - PermissionDialogVisibleRequest, PermissionDialogVisibleRequest.Builder> implements - // @@protoc_insertion_point(message_implements:patrol.PermissionDialogVisibleRequest) - PermissionDialogVisibleRequestOrBuilder { - private PermissionDialogVisibleRequest() { - } - public static final int TIMEOUTMILLIS_FIELD_NUMBER = 1; - private long timeoutMillis_; - /** - * uint64 timeoutMillis = 1; - * @return The timeoutMillis. - */ - @java.lang.Override - public long getTimeoutMillis() { - return timeoutMillis_; - } - /** - * uint64 timeoutMillis = 1; - * @param value The timeoutMillis to set. - */ - private void setTimeoutMillis(long value) { - - timeoutMillis_ = value; - } - /** - * uint64 timeoutMillis = 1; - */ - private void clearTimeoutMillis() { - - timeoutMillis_ = 0L; - } - - public static pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - - public static pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - * Protobuf type {@code patrol.PermissionDialogVisibleRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest, Builder> implements - // @@protoc_insertion_point(builder_implements:patrol.PermissionDialogVisibleRequest) - pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequestOrBuilder { - // Construct using pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - * uint64 timeoutMillis = 1; - * @return The timeoutMillis. - */ - @java.lang.Override - public long getTimeoutMillis() { - return instance.getTimeoutMillis(); - } - /** - * uint64 timeoutMillis = 1; - * @param value The timeoutMillis to set. - * @return This builder for chaining. - */ - public Builder setTimeoutMillis(long value) { - copyOnWrite(); - instance.setTimeoutMillis(value); - return this; - } - /** - * uint64 timeoutMillis = 1; - * @return This builder for chaining. - */ - public Builder clearTimeoutMillis() { - copyOnWrite(); - instance.clearTimeoutMillis(); - return this; - } - - // @@protoc_insertion_point(builder_scope:patrol.PermissionDialogVisibleRequest) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "timeoutMillis_", - }; - java.lang.String info = - "\u0000\u0001\u0000\u0000\u0001\u0001\u0001\u0000\u0000\u0000\u0001\u0003"; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:patrol.PermissionDialogVisibleRequest) - private static final pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest DEFAULT_INSTANCE; - static { - PermissionDialogVisibleRequest defaultInstance = new PermissionDialogVisibleRequest(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - PermissionDialogVisibleRequest.class, defaultInstance); - } - - public static pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface PermissionDialogVisibleResponseOrBuilder extends - // @@protoc_insertion_point(interface_extends:patrol.PermissionDialogVisibleResponse) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * bool visible = 1; - * @return The visible. - */ - boolean getVisible(); - } - /** - * Protobuf type {@code patrol.PermissionDialogVisibleResponse} - */ - public static final class PermissionDialogVisibleResponse extends - com.google.protobuf.GeneratedMessageLite< - PermissionDialogVisibleResponse, PermissionDialogVisibleResponse.Builder> implements - // @@protoc_insertion_point(message_implements:patrol.PermissionDialogVisibleResponse) - PermissionDialogVisibleResponseOrBuilder { - private PermissionDialogVisibleResponse() { - } - public static final int VISIBLE_FIELD_NUMBER = 1; - private boolean visible_; - /** - * bool visible = 1; - * @return The visible. - */ - @java.lang.Override - public boolean getVisible() { - return visible_; - } - /** - * bool visible = 1; - * @param value The visible to set. - */ - private void setVisible(boolean value) { - - visible_ = value; - } - /** - * bool visible = 1; - */ - private void clearVisible() { - - visible_ = false; - } - - public static pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleResponse parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleResponse parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleResponse parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleResponse parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleResponse parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleResponse parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - - public static pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleResponse parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleResponse parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleResponse parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleResponse prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - * Protobuf type {@code patrol.PermissionDialogVisibleResponse} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleResponse, Builder> implements - // @@protoc_insertion_point(builder_implements:patrol.PermissionDialogVisibleResponse) - pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleResponseOrBuilder { - // Construct using pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleResponse.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - * bool visible = 1; - * @return The visible. - */ - @java.lang.Override - public boolean getVisible() { - return instance.getVisible(); - } - /** - * bool visible = 1; - * @param value The visible to set. - * @return This builder for chaining. - */ - public Builder setVisible(boolean value) { - copyOnWrite(); - instance.setVisible(value); - return this; - } - /** - * bool visible = 1; - * @return This builder for chaining. - */ - public Builder clearVisible() { - copyOnWrite(); - instance.clearVisible(); - return this; - } - - // @@protoc_insertion_point(builder_scope:patrol.PermissionDialogVisibleResponse) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleResponse(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "visible_", - }; - java.lang.String info = - "\u0000\u0001\u0000\u0000\u0001\u0001\u0001\u0000\u0000\u0000\u0001\u0007"; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleResponse.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:patrol.PermissionDialogVisibleResponse) - private static final pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleResponse DEFAULT_INSTANCE; - static { - PermissionDialogVisibleResponse defaultInstance = new PermissionDialogVisibleResponse(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - PermissionDialogVisibleResponse.class, defaultInstance); - } - - public static pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface SelectorOrBuilder extends - // @@protoc_insertion_point(interface_extends:patrol.Selector) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * optional string text = 1; - * @return Whether the text field is set. - */ - boolean hasText(); - /** - * optional string text = 1; - * @return The text. - */ - java.lang.String getText(); - /** - * optional string text = 1; - * @return The bytes for text. - */ - com.google.protobuf.ByteString - getTextBytes(); - - /** - * optional string textStartsWith = 2; - * @return Whether the textStartsWith field is set. - */ - boolean hasTextStartsWith(); - /** - * optional string textStartsWith = 2; - * @return The textStartsWith. - */ - java.lang.String getTextStartsWith(); - /** - * optional string textStartsWith = 2; - * @return The bytes for textStartsWith. - */ - com.google.protobuf.ByteString - getTextStartsWithBytes(); - - /** - * optional string textContains = 3; - * @return Whether the textContains field is set. - */ - boolean hasTextContains(); - /** - * optional string textContains = 3; - * @return The textContains. - */ - java.lang.String getTextContains(); - /** - * optional string textContains = 3; - * @return The bytes for textContains. - */ - com.google.protobuf.ByteString - getTextContainsBytes(); - - /** - * optional string className = 4; - * @return Whether the className field is set. - */ - boolean hasClassName(); - /** - * optional string className = 4; - * @return The className. - */ - java.lang.String getClassName(); - /** - * optional string className = 4; - * @return The bytes for className. - */ - com.google.protobuf.ByteString - getClassNameBytes(); - - /** - * optional string contentDescription = 5; - * @return Whether the contentDescription field is set. - */ - boolean hasContentDescription(); - /** - * optional string contentDescription = 5; - * @return The contentDescription. - */ - java.lang.String getContentDescription(); - /** - * optional string contentDescription = 5; - * @return The bytes for contentDescription. - */ - com.google.protobuf.ByteString - getContentDescriptionBytes(); - - /** - * optional string contentDescriptionStartsWith = 6; - * @return Whether the contentDescriptionStartsWith field is set. - */ - boolean hasContentDescriptionStartsWith(); - /** - * optional string contentDescriptionStartsWith = 6; - * @return The contentDescriptionStartsWith. - */ - java.lang.String getContentDescriptionStartsWith(); - /** - * optional string contentDescriptionStartsWith = 6; - * @return The bytes for contentDescriptionStartsWith. - */ - com.google.protobuf.ByteString - getContentDescriptionStartsWithBytes(); - - /** - * optional string contentDescriptionContains = 7; - * @return Whether the contentDescriptionContains field is set. - */ - boolean hasContentDescriptionContains(); - /** - * optional string contentDescriptionContains = 7; - * @return The contentDescriptionContains. - */ - java.lang.String getContentDescriptionContains(); - /** - * optional string contentDescriptionContains = 7; - * @return The bytes for contentDescriptionContains. - */ - com.google.protobuf.ByteString - getContentDescriptionContainsBytes(); - - /** - * optional string resourceId = 8; - * @return Whether the resourceId field is set. - */ - boolean hasResourceId(); - /** - * optional string resourceId = 8; - * @return The resourceId. - */ - java.lang.String getResourceId(); - /** - * optional string resourceId = 8; - * @return The bytes for resourceId. - */ - com.google.protobuf.ByteString - getResourceIdBytes(); - - /** - * optional uint32 instance = 9; - * @return Whether the instance field is set. - */ - boolean hasInstance(); - /** - * optional uint32 instance = 9; - * @return The instance. - */ - int getInstance(); - - /** - * optional bool enabled = 10; - * @return Whether the enabled field is set. - */ - boolean hasEnabled(); - /** - * optional bool enabled = 10; - * @return The enabled. - */ - boolean getEnabled(); - - /** - * optional bool focused = 11; - * @return Whether the focused field is set. - */ - boolean hasFocused(); - /** - * optional bool focused = 11; - * @return The focused. - */ - boolean getFocused(); - - /** - * optional string pkg = 12; - * @return Whether the pkg field is set. - */ - boolean hasPkg(); - /** - * optional string pkg = 12; - * @return The pkg. - */ - java.lang.String getPkg(); - /** - * optional string pkg = 12; - * @return The bytes for pkg. - */ - com.google.protobuf.ByteString - getPkgBytes(); - } - /** - * Protobuf type {@code patrol.Selector} - */ - public static final class Selector extends - com.google.protobuf.GeneratedMessageLite< - Selector, Selector.Builder> implements - // @@protoc_insertion_point(message_implements:patrol.Selector) - SelectorOrBuilder { - private Selector() { - text_ = ""; - textStartsWith_ = ""; - textContains_ = ""; - className_ = ""; - contentDescription_ = ""; - contentDescriptionStartsWith_ = ""; - contentDescriptionContains_ = ""; - resourceId_ = ""; - pkg_ = ""; - } - private int bitField0_; - public static final int TEXT_FIELD_NUMBER = 1; - private java.lang.String text_; - /** - * optional string text = 1; - * @return Whether the text field is set. - */ - @java.lang.Override - public boolean hasText() { - return ((bitField0_ & 0x00000001) != 0); - } - /** - * optional string text = 1; - * @return The text. - */ - @java.lang.Override - public java.lang.String getText() { - return text_; - } - /** - * optional string text = 1; - * @return The bytes for text. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getTextBytes() { - return com.google.protobuf.ByteString.copyFromUtf8(text_); - } - /** - * optional string text = 1; - * @param value The text to set. - */ - private void setText( - java.lang.String value) { - java.lang.Class valueClass = value.getClass(); - bitField0_ |= 0x00000001; - text_ = value; - } - /** - * optional string text = 1; - */ - private void clearText() { - bitField0_ = (bitField0_ & ~0x00000001); - text_ = getDefaultInstance().getText(); - } - /** - * optional string text = 1; - * @param value The bytes for text to set. - */ - private void setTextBytes( - com.google.protobuf.ByteString value) { - checkByteStringIsUtf8(value); - text_ = value.toStringUtf8(); - bitField0_ |= 0x00000001; - } - - public static final int TEXTSTARTSWITH_FIELD_NUMBER = 2; - private java.lang.String textStartsWith_; - /** - * optional string textStartsWith = 2; - * @return Whether the textStartsWith field is set. - */ - @java.lang.Override - public boolean hasTextStartsWith() { - return ((bitField0_ & 0x00000002) != 0); - } - /** - * optional string textStartsWith = 2; - * @return The textStartsWith. - */ - @java.lang.Override - public java.lang.String getTextStartsWith() { - return textStartsWith_; - } - /** - * optional string textStartsWith = 2; - * @return The bytes for textStartsWith. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getTextStartsWithBytes() { - return com.google.protobuf.ByteString.copyFromUtf8(textStartsWith_); - } - /** - * optional string textStartsWith = 2; - * @param value The textStartsWith to set. - */ - private void setTextStartsWith( - java.lang.String value) { - java.lang.Class valueClass = value.getClass(); - bitField0_ |= 0x00000002; - textStartsWith_ = value; - } - /** - * optional string textStartsWith = 2; - */ - private void clearTextStartsWith() { - bitField0_ = (bitField0_ & ~0x00000002); - textStartsWith_ = getDefaultInstance().getTextStartsWith(); - } - /** - * optional string textStartsWith = 2; - * @param value The bytes for textStartsWith to set. - */ - private void setTextStartsWithBytes( - com.google.protobuf.ByteString value) { - checkByteStringIsUtf8(value); - textStartsWith_ = value.toStringUtf8(); - bitField0_ |= 0x00000002; - } - - public static final int TEXTCONTAINS_FIELD_NUMBER = 3; - private java.lang.String textContains_; - /** - * optional string textContains = 3; - * @return Whether the textContains field is set. - */ - @java.lang.Override - public boolean hasTextContains() { - return ((bitField0_ & 0x00000004) != 0); - } - /** - * optional string textContains = 3; - * @return The textContains. - */ - @java.lang.Override - public java.lang.String getTextContains() { - return textContains_; - } - /** - * optional string textContains = 3; - * @return The bytes for textContains. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getTextContainsBytes() { - return com.google.protobuf.ByteString.copyFromUtf8(textContains_); - } - /** - * optional string textContains = 3; - * @param value The textContains to set. - */ - private void setTextContains( - java.lang.String value) { - java.lang.Class valueClass = value.getClass(); - bitField0_ |= 0x00000004; - textContains_ = value; - } - /** - * optional string textContains = 3; - */ - private void clearTextContains() { - bitField0_ = (bitField0_ & ~0x00000004); - textContains_ = getDefaultInstance().getTextContains(); - } - /** - * optional string textContains = 3; - * @param value The bytes for textContains to set. - */ - private void setTextContainsBytes( - com.google.protobuf.ByteString value) { - checkByteStringIsUtf8(value); - textContains_ = value.toStringUtf8(); - bitField0_ |= 0x00000004; - } - - public static final int CLASSNAME_FIELD_NUMBER = 4; - private java.lang.String className_; - /** - * optional string className = 4; - * @return Whether the className field is set. - */ - @java.lang.Override - public boolean hasClassName() { - return ((bitField0_ & 0x00000008) != 0); - } - /** - * optional string className = 4; - * @return The className. - */ - @java.lang.Override - public java.lang.String getClassName() { - return className_; - } - /** - * optional string className = 4; - * @return The bytes for className. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getClassNameBytes() { - return com.google.protobuf.ByteString.copyFromUtf8(className_); - } - /** - * optional string className = 4; - * @param value The className to set. - */ - private void setClassName( - java.lang.String value) { - java.lang.Class valueClass = value.getClass(); - bitField0_ |= 0x00000008; - className_ = value; - } - /** - * optional string className = 4; - */ - private void clearClassName() { - bitField0_ = (bitField0_ & ~0x00000008); - className_ = getDefaultInstance().getClassName(); - } - /** - * optional string className = 4; - * @param value The bytes for className to set. - */ - private void setClassNameBytes( - com.google.protobuf.ByteString value) { - checkByteStringIsUtf8(value); - className_ = value.toStringUtf8(); - bitField0_ |= 0x00000008; - } - - public static final int CONTENTDESCRIPTION_FIELD_NUMBER = 5; - private java.lang.String contentDescription_; - /** - * optional string contentDescription = 5; - * @return Whether the contentDescription field is set. - */ - @java.lang.Override - public boolean hasContentDescription() { - return ((bitField0_ & 0x00000010) != 0); - } - /** - * optional string contentDescription = 5; - * @return The contentDescription. - */ - @java.lang.Override - public java.lang.String getContentDescription() { - return contentDescription_; - } - /** - * optional string contentDescription = 5; - * @return The bytes for contentDescription. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getContentDescriptionBytes() { - return com.google.protobuf.ByteString.copyFromUtf8(contentDescription_); - } - /** - * optional string contentDescription = 5; - * @param value The contentDescription to set. - */ - private void setContentDescription( - java.lang.String value) { - java.lang.Class valueClass = value.getClass(); - bitField0_ |= 0x00000010; - contentDescription_ = value; - } - /** - * optional string contentDescription = 5; - */ - private void clearContentDescription() { - bitField0_ = (bitField0_ & ~0x00000010); - contentDescription_ = getDefaultInstance().getContentDescription(); - } - /** - * optional string contentDescription = 5; - * @param value The bytes for contentDescription to set. - */ - private void setContentDescriptionBytes( - com.google.protobuf.ByteString value) { - checkByteStringIsUtf8(value); - contentDescription_ = value.toStringUtf8(); - bitField0_ |= 0x00000010; - } - - public static final int CONTENTDESCRIPTIONSTARTSWITH_FIELD_NUMBER = 6; - private java.lang.String contentDescriptionStartsWith_; - /** - * optional string contentDescriptionStartsWith = 6; - * @return Whether the contentDescriptionStartsWith field is set. - */ - @java.lang.Override - public boolean hasContentDescriptionStartsWith() { - return ((bitField0_ & 0x00000020) != 0); - } - /** - * optional string contentDescriptionStartsWith = 6; - * @return The contentDescriptionStartsWith. - */ - @java.lang.Override - public java.lang.String getContentDescriptionStartsWith() { - return contentDescriptionStartsWith_; - } - /** - * optional string contentDescriptionStartsWith = 6; - * @return The bytes for contentDescriptionStartsWith. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getContentDescriptionStartsWithBytes() { - return com.google.protobuf.ByteString.copyFromUtf8(contentDescriptionStartsWith_); - } - /** - * optional string contentDescriptionStartsWith = 6; - * @param value The contentDescriptionStartsWith to set. - */ - private void setContentDescriptionStartsWith( - java.lang.String value) { - java.lang.Class valueClass = value.getClass(); - bitField0_ |= 0x00000020; - contentDescriptionStartsWith_ = value; - } - /** - * optional string contentDescriptionStartsWith = 6; - */ - private void clearContentDescriptionStartsWith() { - bitField0_ = (bitField0_ & ~0x00000020); - contentDescriptionStartsWith_ = getDefaultInstance().getContentDescriptionStartsWith(); - } - /** - * optional string contentDescriptionStartsWith = 6; - * @param value The bytes for contentDescriptionStartsWith to set. - */ - private void setContentDescriptionStartsWithBytes( - com.google.protobuf.ByteString value) { - checkByteStringIsUtf8(value); - contentDescriptionStartsWith_ = value.toStringUtf8(); - bitField0_ |= 0x00000020; - } - - public static final int CONTENTDESCRIPTIONCONTAINS_FIELD_NUMBER = 7; - private java.lang.String contentDescriptionContains_; - /** - * optional string contentDescriptionContains = 7; - * @return Whether the contentDescriptionContains field is set. - */ - @java.lang.Override - public boolean hasContentDescriptionContains() { - return ((bitField0_ & 0x00000040) != 0); - } - /** - * optional string contentDescriptionContains = 7; - * @return The contentDescriptionContains. - */ - @java.lang.Override - public java.lang.String getContentDescriptionContains() { - return contentDescriptionContains_; - } - /** - * optional string contentDescriptionContains = 7; - * @return The bytes for contentDescriptionContains. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getContentDescriptionContainsBytes() { - return com.google.protobuf.ByteString.copyFromUtf8(contentDescriptionContains_); - } - /** - * optional string contentDescriptionContains = 7; - * @param value The contentDescriptionContains to set. - */ - private void setContentDescriptionContains( - java.lang.String value) { - java.lang.Class valueClass = value.getClass(); - bitField0_ |= 0x00000040; - contentDescriptionContains_ = value; - } - /** - * optional string contentDescriptionContains = 7; - */ - private void clearContentDescriptionContains() { - bitField0_ = (bitField0_ & ~0x00000040); - contentDescriptionContains_ = getDefaultInstance().getContentDescriptionContains(); - } - /** - * optional string contentDescriptionContains = 7; - * @param value The bytes for contentDescriptionContains to set. - */ - private void setContentDescriptionContainsBytes( - com.google.protobuf.ByteString value) { - checkByteStringIsUtf8(value); - contentDescriptionContains_ = value.toStringUtf8(); - bitField0_ |= 0x00000040; - } - - public static final int RESOURCEID_FIELD_NUMBER = 8; - private java.lang.String resourceId_; - /** - * optional string resourceId = 8; - * @return Whether the resourceId field is set. - */ - @java.lang.Override - public boolean hasResourceId() { - return ((bitField0_ & 0x00000080) != 0); - } - /** - * optional string resourceId = 8; - * @return The resourceId. - */ - @java.lang.Override - public java.lang.String getResourceId() { - return resourceId_; - } - /** - * optional string resourceId = 8; - * @return The bytes for resourceId. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getResourceIdBytes() { - return com.google.protobuf.ByteString.copyFromUtf8(resourceId_); - } - /** - * optional string resourceId = 8; - * @param value The resourceId to set. - */ - private void setResourceId( - java.lang.String value) { - java.lang.Class valueClass = value.getClass(); - bitField0_ |= 0x00000080; - resourceId_ = value; - } - /** - * optional string resourceId = 8; - */ - private void clearResourceId() { - bitField0_ = (bitField0_ & ~0x00000080); - resourceId_ = getDefaultInstance().getResourceId(); - } - /** - * optional string resourceId = 8; - * @param value The bytes for resourceId to set. - */ - private void setResourceIdBytes( - com.google.protobuf.ByteString value) { - checkByteStringIsUtf8(value); - resourceId_ = value.toStringUtf8(); - bitField0_ |= 0x00000080; - } - - public static final int INSTANCE_FIELD_NUMBER = 9; - private int instance_; - /** - * optional uint32 instance = 9; - * @return Whether the instance field is set. - */ - @java.lang.Override - public boolean hasInstance() { - return ((bitField0_ & 0x00000100) != 0); - } - /** - * optional uint32 instance = 9; - * @return The instance. - */ - @java.lang.Override - public int getInstance() { - return instance_; - } - /** - * optional uint32 instance = 9; - * @param value The instance to set. - */ - private void setInstance(int value) { - bitField0_ |= 0x00000100; - instance_ = value; - } - /** - * optional uint32 instance = 9; - */ - private void clearInstance() { - bitField0_ = (bitField0_ & ~0x00000100); - instance_ = 0; - } - - public static final int ENABLED_FIELD_NUMBER = 10; - private boolean enabled_; - /** - * optional bool enabled = 10; - * @return Whether the enabled field is set. - */ - @java.lang.Override - public boolean hasEnabled() { - return ((bitField0_ & 0x00000200) != 0); - } - /** - * optional bool enabled = 10; - * @return The enabled. - */ - @java.lang.Override - public boolean getEnabled() { - return enabled_; - } - /** - * optional bool enabled = 10; - * @param value The enabled to set. - */ - private void setEnabled(boolean value) { - bitField0_ |= 0x00000200; - enabled_ = value; - } - /** - * optional bool enabled = 10; - */ - private void clearEnabled() { - bitField0_ = (bitField0_ & ~0x00000200); - enabled_ = false; - } - - public static final int FOCUSED_FIELD_NUMBER = 11; - private boolean focused_; - /** - * optional bool focused = 11; - * @return Whether the focused field is set. - */ - @java.lang.Override - public boolean hasFocused() { - return ((bitField0_ & 0x00000400) != 0); - } - /** - * optional bool focused = 11; - * @return The focused. - */ - @java.lang.Override - public boolean getFocused() { - return focused_; - } - /** - * optional bool focused = 11; - * @param value The focused to set. - */ - private void setFocused(boolean value) { - bitField0_ |= 0x00000400; - focused_ = value; - } - /** - * optional bool focused = 11; - */ - private void clearFocused() { - bitField0_ = (bitField0_ & ~0x00000400); - focused_ = false; - } - - public static final int PKG_FIELD_NUMBER = 12; - private java.lang.String pkg_; - /** - * optional string pkg = 12; - * @return Whether the pkg field is set. - */ - @java.lang.Override - public boolean hasPkg() { - return ((bitField0_ & 0x00000800) != 0); - } - /** - * optional string pkg = 12; - * @return The pkg. - */ - @java.lang.Override - public java.lang.String getPkg() { - return pkg_; - } - /** - * optional string pkg = 12; - * @return The bytes for pkg. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getPkgBytes() { - return com.google.protobuf.ByteString.copyFromUtf8(pkg_); - } - /** - * optional string pkg = 12; - * @param value The pkg to set. - */ - private void setPkg( - java.lang.String value) { - java.lang.Class valueClass = value.getClass(); - bitField0_ |= 0x00000800; - pkg_ = value; - } - /** - * optional string pkg = 12; - */ - private void clearPkg() { - bitField0_ = (bitField0_ & ~0x00000800); - pkg_ = getDefaultInstance().getPkg(); - } - /** - * optional string pkg = 12; - * @param value The bytes for pkg to set. - */ - private void setPkgBytes( - com.google.protobuf.ByteString value) { - checkByteStringIsUtf8(value); - pkg_ = value.toStringUtf8(); - bitField0_ |= 0x00000800; - } - - public static pl.leancode.patrol.contracts.Contracts.Selector parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.Selector parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.Selector parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.Selector parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.Selector parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.Selector parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.Selector parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.Selector parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static pl.leancode.patrol.contracts.Contracts.Selector parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - - public static pl.leancode.patrol.contracts.Contracts.Selector parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.Selector parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.Selector parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.Selector prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - * Protobuf type {@code patrol.Selector} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - pl.leancode.patrol.contracts.Contracts.Selector, Builder> implements - // @@protoc_insertion_point(builder_implements:patrol.Selector) - pl.leancode.patrol.contracts.Contracts.SelectorOrBuilder { - // Construct using pl.leancode.patrol.contracts.Contracts.Selector.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - * optional string text = 1; - * @return Whether the text field is set. - */ - @java.lang.Override - public boolean hasText() { - return instance.hasText(); - } - /** - * optional string text = 1; - * @return The text. - */ - @java.lang.Override - public java.lang.String getText() { - return instance.getText(); - } - /** - * optional string text = 1; - * @return The bytes for text. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getTextBytes() { - return instance.getTextBytes(); - } - /** - * optional string text = 1; - * @param value The text to set. - * @return This builder for chaining. - */ - public Builder setText( - java.lang.String value) { - copyOnWrite(); - instance.setText(value); - return this; - } - /** - * optional string text = 1; - * @return This builder for chaining. - */ - public Builder clearText() { - copyOnWrite(); - instance.clearText(); - return this; - } - /** - * optional string text = 1; - * @param value The bytes for text to set. - * @return This builder for chaining. - */ - public Builder setTextBytes( - com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setTextBytes(value); - return this; - } - - /** - * optional string textStartsWith = 2; - * @return Whether the textStartsWith field is set. - */ - @java.lang.Override - public boolean hasTextStartsWith() { - return instance.hasTextStartsWith(); - } - /** - * optional string textStartsWith = 2; - * @return The textStartsWith. - */ - @java.lang.Override - public java.lang.String getTextStartsWith() { - return instance.getTextStartsWith(); - } - /** - * optional string textStartsWith = 2; - * @return The bytes for textStartsWith. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getTextStartsWithBytes() { - return instance.getTextStartsWithBytes(); - } - /** - * optional string textStartsWith = 2; - * @param value The textStartsWith to set. - * @return This builder for chaining. - */ - public Builder setTextStartsWith( - java.lang.String value) { - copyOnWrite(); - instance.setTextStartsWith(value); - return this; - } - /** - * optional string textStartsWith = 2; - * @return This builder for chaining. - */ - public Builder clearTextStartsWith() { - copyOnWrite(); - instance.clearTextStartsWith(); - return this; - } - /** - * optional string textStartsWith = 2; - * @param value The bytes for textStartsWith to set. - * @return This builder for chaining. - */ - public Builder setTextStartsWithBytes( - com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setTextStartsWithBytes(value); - return this; - } - - /** - * optional string textContains = 3; - * @return Whether the textContains field is set. - */ - @java.lang.Override - public boolean hasTextContains() { - return instance.hasTextContains(); - } - /** - * optional string textContains = 3; - * @return The textContains. - */ - @java.lang.Override - public java.lang.String getTextContains() { - return instance.getTextContains(); - } - /** - * optional string textContains = 3; - * @return The bytes for textContains. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getTextContainsBytes() { - return instance.getTextContainsBytes(); - } - /** - * optional string textContains = 3; - * @param value The textContains to set. - * @return This builder for chaining. - */ - public Builder setTextContains( - java.lang.String value) { - copyOnWrite(); - instance.setTextContains(value); - return this; - } - /** - * optional string textContains = 3; - * @return This builder for chaining. - */ - public Builder clearTextContains() { - copyOnWrite(); - instance.clearTextContains(); - return this; - } - /** - * optional string textContains = 3; - * @param value The bytes for textContains to set. - * @return This builder for chaining. - */ - public Builder setTextContainsBytes( - com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setTextContainsBytes(value); - return this; - } - - /** - * optional string className = 4; - * @return Whether the className field is set. - */ - @java.lang.Override - public boolean hasClassName() { - return instance.hasClassName(); - } - /** - * optional string className = 4; - * @return The className. - */ - @java.lang.Override - public java.lang.String getClassName() { - return instance.getClassName(); - } - /** - * optional string className = 4; - * @return The bytes for className. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getClassNameBytes() { - return instance.getClassNameBytes(); - } - /** - * optional string className = 4; - * @param value The className to set. - * @return This builder for chaining. - */ - public Builder setClassName( - java.lang.String value) { - copyOnWrite(); - instance.setClassName(value); - return this; - } - /** - * optional string className = 4; - * @return This builder for chaining. - */ - public Builder clearClassName() { - copyOnWrite(); - instance.clearClassName(); - return this; - } - /** - * optional string className = 4; - * @param value The bytes for className to set. - * @return This builder for chaining. - */ - public Builder setClassNameBytes( - com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setClassNameBytes(value); - return this; - } - - /** - * optional string contentDescription = 5; - * @return Whether the contentDescription field is set. - */ - @java.lang.Override - public boolean hasContentDescription() { - return instance.hasContentDescription(); - } - /** - * optional string contentDescription = 5; - * @return The contentDescription. - */ - @java.lang.Override - public java.lang.String getContentDescription() { - return instance.getContentDescription(); - } - /** - * optional string contentDescription = 5; - * @return The bytes for contentDescription. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getContentDescriptionBytes() { - return instance.getContentDescriptionBytes(); - } - /** - * optional string contentDescription = 5; - * @param value The contentDescription to set. - * @return This builder for chaining. - */ - public Builder setContentDescription( - java.lang.String value) { - copyOnWrite(); - instance.setContentDescription(value); - return this; - } - /** - * optional string contentDescription = 5; - * @return This builder for chaining. - */ - public Builder clearContentDescription() { - copyOnWrite(); - instance.clearContentDescription(); - return this; - } - /** - * optional string contentDescription = 5; - * @param value The bytes for contentDescription to set. - * @return This builder for chaining. - */ - public Builder setContentDescriptionBytes( - com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setContentDescriptionBytes(value); - return this; - } - - /** - * optional string contentDescriptionStartsWith = 6; - * @return Whether the contentDescriptionStartsWith field is set. - */ - @java.lang.Override - public boolean hasContentDescriptionStartsWith() { - return instance.hasContentDescriptionStartsWith(); - } - /** - * optional string contentDescriptionStartsWith = 6; - * @return The contentDescriptionStartsWith. - */ - @java.lang.Override - public java.lang.String getContentDescriptionStartsWith() { - return instance.getContentDescriptionStartsWith(); - } - /** - * optional string contentDescriptionStartsWith = 6; - * @return The bytes for contentDescriptionStartsWith. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getContentDescriptionStartsWithBytes() { - return instance.getContentDescriptionStartsWithBytes(); - } - /** - * optional string contentDescriptionStartsWith = 6; - * @param value The contentDescriptionStartsWith to set. - * @return This builder for chaining. - */ - public Builder setContentDescriptionStartsWith( - java.lang.String value) { - copyOnWrite(); - instance.setContentDescriptionStartsWith(value); - return this; - } - /** - * optional string contentDescriptionStartsWith = 6; - * @return This builder for chaining. - */ - public Builder clearContentDescriptionStartsWith() { - copyOnWrite(); - instance.clearContentDescriptionStartsWith(); - return this; - } - /** - * optional string contentDescriptionStartsWith = 6; - * @param value The bytes for contentDescriptionStartsWith to set. - * @return This builder for chaining. - */ - public Builder setContentDescriptionStartsWithBytes( - com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setContentDescriptionStartsWithBytes(value); - return this; - } - - /** - * optional string contentDescriptionContains = 7; - * @return Whether the contentDescriptionContains field is set. - */ - @java.lang.Override - public boolean hasContentDescriptionContains() { - return instance.hasContentDescriptionContains(); - } - /** - * optional string contentDescriptionContains = 7; - * @return The contentDescriptionContains. - */ - @java.lang.Override - public java.lang.String getContentDescriptionContains() { - return instance.getContentDescriptionContains(); - } - /** - * optional string contentDescriptionContains = 7; - * @return The bytes for contentDescriptionContains. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getContentDescriptionContainsBytes() { - return instance.getContentDescriptionContainsBytes(); - } - /** - * optional string contentDescriptionContains = 7; - * @param value The contentDescriptionContains to set. - * @return This builder for chaining. - */ - public Builder setContentDescriptionContains( - java.lang.String value) { - copyOnWrite(); - instance.setContentDescriptionContains(value); - return this; - } - /** - * optional string contentDescriptionContains = 7; - * @return This builder for chaining. - */ - public Builder clearContentDescriptionContains() { - copyOnWrite(); - instance.clearContentDescriptionContains(); - return this; - } - /** - * optional string contentDescriptionContains = 7; - * @param value The bytes for contentDescriptionContains to set. - * @return This builder for chaining. - */ - public Builder setContentDescriptionContainsBytes( - com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setContentDescriptionContainsBytes(value); - return this; - } - - /** - * optional string resourceId = 8; - * @return Whether the resourceId field is set. - */ - @java.lang.Override - public boolean hasResourceId() { - return instance.hasResourceId(); - } - /** - * optional string resourceId = 8; - * @return The resourceId. - */ - @java.lang.Override - public java.lang.String getResourceId() { - return instance.getResourceId(); - } - /** - * optional string resourceId = 8; - * @return The bytes for resourceId. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getResourceIdBytes() { - return instance.getResourceIdBytes(); - } - /** - * optional string resourceId = 8; - * @param value The resourceId to set. - * @return This builder for chaining. - */ - public Builder setResourceId( - java.lang.String value) { - copyOnWrite(); - instance.setResourceId(value); - return this; - } - /** - * optional string resourceId = 8; - * @return This builder for chaining. - */ - public Builder clearResourceId() { - copyOnWrite(); - instance.clearResourceId(); - return this; - } - /** - * optional string resourceId = 8; - * @param value The bytes for resourceId to set. - * @return This builder for chaining. - */ - public Builder setResourceIdBytes( - com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setResourceIdBytes(value); - return this; - } - - /** - * optional uint32 instance = 9; - * @return Whether the instance field is set. - */ - @java.lang.Override - public boolean hasInstance() { - return instance.hasInstance(); - } - /** - * optional uint32 instance = 9; - * @return The instance. - */ - @java.lang.Override - public int getInstance() { - return instance.getInstance(); - } - /** - * optional uint32 instance = 9; - * @param value The instance to set. - * @return This builder for chaining. - */ - public Builder setInstance(int value) { - copyOnWrite(); - instance.setInstance(value); - return this; - } - /** - * optional uint32 instance = 9; - * @return This builder for chaining. - */ - public Builder clearInstance() { - copyOnWrite(); - instance.clearInstance(); - return this; - } - - /** - * optional bool enabled = 10; - * @return Whether the enabled field is set. - */ - @java.lang.Override - public boolean hasEnabled() { - return instance.hasEnabled(); - } - /** - * optional bool enabled = 10; - * @return The enabled. - */ - @java.lang.Override - public boolean getEnabled() { - return instance.getEnabled(); - } - /** - * optional bool enabled = 10; - * @param value The enabled to set. - * @return This builder for chaining. - */ - public Builder setEnabled(boolean value) { - copyOnWrite(); - instance.setEnabled(value); - return this; - } - /** - * optional bool enabled = 10; - * @return This builder for chaining. - */ - public Builder clearEnabled() { - copyOnWrite(); - instance.clearEnabled(); - return this; - } - - /** - * optional bool focused = 11; - * @return Whether the focused field is set. - */ - @java.lang.Override - public boolean hasFocused() { - return instance.hasFocused(); - } - /** - * optional bool focused = 11; - * @return The focused. - */ - @java.lang.Override - public boolean getFocused() { - return instance.getFocused(); - } - /** - * optional bool focused = 11; - * @param value The focused to set. - * @return This builder for chaining. - */ - public Builder setFocused(boolean value) { - copyOnWrite(); - instance.setFocused(value); - return this; - } - /** - * optional bool focused = 11; - * @return This builder for chaining. - */ - public Builder clearFocused() { - copyOnWrite(); - instance.clearFocused(); - return this; - } - - /** - * optional string pkg = 12; - * @return Whether the pkg field is set. - */ - @java.lang.Override - public boolean hasPkg() { - return instance.hasPkg(); - } - /** - * optional string pkg = 12; - * @return The pkg. - */ - @java.lang.Override - public java.lang.String getPkg() { - return instance.getPkg(); - } - /** - * optional string pkg = 12; - * @return The bytes for pkg. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getPkgBytes() { - return instance.getPkgBytes(); - } - /** - * optional string pkg = 12; - * @param value The pkg to set. - * @return This builder for chaining. - */ - public Builder setPkg( - java.lang.String value) { - copyOnWrite(); - instance.setPkg(value); - return this; - } - /** - * optional string pkg = 12; - * @return This builder for chaining. - */ - public Builder clearPkg() { - copyOnWrite(); - instance.clearPkg(); - return this; - } - /** - * optional string pkg = 12; - * @param value The bytes for pkg to set. - * @return This builder for chaining. - */ - public Builder setPkgBytes( - com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setPkgBytes(value); - return this; - } - - // @@protoc_insertion_point(builder_scope:patrol.Selector) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new pl.leancode.patrol.contracts.Contracts.Selector(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "bitField0_", - "text_", - "textStartsWith_", - "textContains_", - "className_", - "contentDescription_", - "contentDescriptionStartsWith_", - "contentDescriptionContains_", - "resourceId_", - "instance_", - "enabled_", - "focused_", - "pkg_", - }; - java.lang.String info = - "\u0000\f\u0000\u0001\u0001\f\f\u0000\u0000\u0000\u0001\u1208\u0000\u0002\u1208\u0001" + - "\u0003\u1208\u0002\u0004\u1208\u0003\u0005\u1208\u0004\u0006\u1208\u0005\u0007\u1208" + - "\u0006\b\u1208\u0007\t\u100b\b\n\u1007\t\u000b\u1007\n\f\u1208\u000b"; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (pl.leancode.patrol.contracts.Contracts.Selector.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:patrol.Selector) - private static final pl.leancode.patrol.contracts.Contracts.Selector DEFAULT_INSTANCE; - static { - Selector defaultInstance = new Selector(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - Selector.class, defaultInstance); - } - - public static pl.leancode.patrol.contracts.Contracts.Selector getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface NativeViewOrBuilder extends - // @@protoc_insertion_point(interface_extends:patrol.NativeView) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * string className = 1; - * @return The className. - */ - java.lang.String getClassName(); - /** - * string className = 1; - * @return The bytes for className. - */ - com.google.protobuf.ByteString - getClassNameBytes(); - - /** - * string text = 2; - * @return The text. - */ - java.lang.String getText(); - /** - * string text = 2; - * @return The bytes for text. - */ - com.google.protobuf.ByteString - getTextBytes(); - - /** - * string contentDescription = 3; - * @return The contentDescription. - */ - java.lang.String getContentDescription(); - /** - * string contentDescription = 3; - * @return The bytes for contentDescription. - */ - com.google.protobuf.ByteString - getContentDescriptionBytes(); - - /** - * bool focused = 4; - * @return The focused. - */ - boolean getFocused(); - - /** - * bool enabled = 5; - * @return The enabled. - */ - boolean getEnabled(); - - /** - * int32 childCount = 6; - * @return The childCount. - */ - int getChildCount(); - - /** - * string resourceName = 7; - * @return The resourceName. - */ - java.lang.String getResourceName(); - /** - * string resourceName = 7; - * @return The bytes for resourceName. - */ - com.google.protobuf.ByteString - getResourceNameBytes(); - - /** - * string applicationPackage = 8; - * @return The applicationPackage. - */ - java.lang.String getApplicationPackage(); - /** - * string applicationPackage = 8; - * @return The bytes for applicationPackage. - */ - com.google.protobuf.ByteString - getApplicationPackageBytes(); - - /** - * repeated .patrol.NativeView children = 9; - */ - java.util.List - getChildrenList(); - /** - * repeated .patrol.NativeView children = 9; - */ - pl.leancode.patrol.contracts.Contracts.NativeView getChildren(int index); - /** - * repeated .patrol.NativeView children = 9; - */ - int getChildrenCount(); - } - /** - *
-   * Represents a native UI control.
-   *
-   * On Android, this is `android.view.View`.
-   * 
- * - * Protobuf type {@code patrol.NativeView} - */ - public static final class NativeView extends - com.google.protobuf.GeneratedMessageLite< - NativeView, NativeView.Builder> implements - // @@protoc_insertion_point(message_implements:patrol.NativeView) - NativeViewOrBuilder { - private NativeView() { - className_ = ""; - text_ = ""; - contentDescription_ = ""; - resourceName_ = ""; - applicationPackage_ = ""; - children_ = emptyProtobufList(); - } - public static final int CLASSNAME_FIELD_NUMBER = 1; - private java.lang.String className_; - /** - * string className = 1; - * @return The className. - */ - @java.lang.Override - public java.lang.String getClassName() { - return className_; - } - /** - * string className = 1; - * @return The bytes for className. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getClassNameBytes() { - return com.google.protobuf.ByteString.copyFromUtf8(className_); - } - /** - * string className = 1; - * @param value The className to set. - */ - private void setClassName( - java.lang.String value) { - java.lang.Class valueClass = value.getClass(); - - className_ = value; - } - /** - * string className = 1; - */ - private void clearClassName() { - - className_ = getDefaultInstance().getClassName(); - } - /** - * string className = 1; - * @param value The bytes for className to set. - */ - private void setClassNameBytes( - com.google.protobuf.ByteString value) { - checkByteStringIsUtf8(value); - className_ = value.toStringUtf8(); - - } - - public static final int TEXT_FIELD_NUMBER = 2; - private java.lang.String text_; - /** - * string text = 2; - * @return The text. - */ - @java.lang.Override - public java.lang.String getText() { - return text_; - } - /** - * string text = 2; - * @return The bytes for text. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getTextBytes() { - return com.google.protobuf.ByteString.copyFromUtf8(text_); - } - /** - * string text = 2; - * @param value The text to set. - */ - private void setText( - java.lang.String value) { - java.lang.Class valueClass = value.getClass(); - - text_ = value; - } - /** - * string text = 2; - */ - private void clearText() { - - text_ = getDefaultInstance().getText(); - } - /** - * string text = 2; - * @param value The bytes for text to set. - */ - private void setTextBytes( - com.google.protobuf.ByteString value) { - checkByteStringIsUtf8(value); - text_ = value.toStringUtf8(); - - } - - public static final int CONTENTDESCRIPTION_FIELD_NUMBER = 3; - private java.lang.String contentDescription_; - /** - * string contentDescription = 3; - * @return The contentDescription. - */ - @java.lang.Override - public java.lang.String getContentDescription() { - return contentDescription_; - } - /** - * string contentDescription = 3; - * @return The bytes for contentDescription. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getContentDescriptionBytes() { - return com.google.protobuf.ByteString.copyFromUtf8(contentDescription_); - } - /** - * string contentDescription = 3; - * @param value The contentDescription to set. - */ - private void setContentDescription( - java.lang.String value) { - java.lang.Class valueClass = value.getClass(); - - contentDescription_ = value; - } - /** - * string contentDescription = 3; - */ - private void clearContentDescription() { - - contentDescription_ = getDefaultInstance().getContentDescription(); - } - /** - * string contentDescription = 3; - * @param value The bytes for contentDescription to set. - */ - private void setContentDescriptionBytes( - com.google.protobuf.ByteString value) { - checkByteStringIsUtf8(value); - contentDescription_ = value.toStringUtf8(); - - } - - public static final int FOCUSED_FIELD_NUMBER = 4; - private boolean focused_; - /** - * bool focused = 4; - * @return The focused. - */ - @java.lang.Override - public boolean getFocused() { - return focused_; - } - /** - * bool focused = 4; - * @param value The focused to set. - */ - private void setFocused(boolean value) { - - focused_ = value; - } - /** - * bool focused = 4; - */ - private void clearFocused() { - - focused_ = false; - } - - public static final int ENABLED_FIELD_NUMBER = 5; - private boolean enabled_; - /** - * bool enabled = 5; - * @return The enabled. - */ - @java.lang.Override - public boolean getEnabled() { - return enabled_; - } - /** - * bool enabled = 5; - * @param value The enabled to set. - */ - private void setEnabled(boolean value) { - - enabled_ = value; - } - /** - * bool enabled = 5; - */ - private void clearEnabled() { - - enabled_ = false; - } - - public static final int CHILDCOUNT_FIELD_NUMBER = 6; - private int childCount_; - /** - * int32 childCount = 6; - * @return The childCount. - */ - @java.lang.Override - public int getChildCount() { - return childCount_; - } - /** - * int32 childCount = 6; - * @param value The childCount to set. - */ - private void setChildCount(int value) { - - childCount_ = value; - } - /** - * int32 childCount = 6; - */ - private void clearChildCount() { - - childCount_ = 0; - } - - public static final int RESOURCENAME_FIELD_NUMBER = 7; - private java.lang.String resourceName_; - /** - * string resourceName = 7; - * @return The resourceName. - */ - @java.lang.Override - public java.lang.String getResourceName() { - return resourceName_; - } - /** - * string resourceName = 7; - * @return The bytes for resourceName. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getResourceNameBytes() { - return com.google.protobuf.ByteString.copyFromUtf8(resourceName_); - } - /** - * string resourceName = 7; - * @param value The resourceName to set. - */ - private void setResourceName( - java.lang.String value) { - java.lang.Class valueClass = value.getClass(); - - resourceName_ = value; - } - /** - * string resourceName = 7; - */ - private void clearResourceName() { - - resourceName_ = getDefaultInstance().getResourceName(); - } - /** - * string resourceName = 7; - * @param value The bytes for resourceName to set. - */ - private void setResourceNameBytes( - com.google.protobuf.ByteString value) { - checkByteStringIsUtf8(value); - resourceName_ = value.toStringUtf8(); - - } - - public static final int APPLICATIONPACKAGE_FIELD_NUMBER = 8; - private java.lang.String applicationPackage_; - /** - * string applicationPackage = 8; - * @return The applicationPackage. - */ - @java.lang.Override - public java.lang.String getApplicationPackage() { - return applicationPackage_; - } - /** - * string applicationPackage = 8; - * @return The bytes for applicationPackage. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getApplicationPackageBytes() { - return com.google.protobuf.ByteString.copyFromUtf8(applicationPackage_); - } - /** - * string applicationPackage = 8; - * @param value The applicationPackage to set. - */ - private void setApplicationPackage( - java.lang.String value) { - java.lang.Class valueClass = value.getClass(); - - applicationPackage_ = value; - } - /** - * string applicationPackage = 8; - */ - private void clearApplicationPackage() { - - applicationPackage_ = getDefaultInstance().getApplicationPackage(); - } - /** - * string applicationPackage = 8; - * @param value The bytes for applicationPackage to set. - */ - private void setApplicationPackageBytes( - com.google.protobuf.ByteString value) { - checkByteStringIsUtf8(value); - applicationPackage_ = value.toStringUtf8(); - - } - - public static final int CHILDREN_FIELD_NUMBER = 9; - private com.google.protobuf.Internal.ProtobufList children_; - /** - * repeated .patrol.NativeView children = 9; - */ - @java.lang.Override - public java.util.List getChildrenList() { - return children_; - } - /** - * repeated .patrol.NativeView children = 9; - */ - public java.util.List - getChildrenOrBuilderList() { - return children_; - } - /** - * repeated .patrol.NativeView children = 9; - */ - @java.lang.Override - public int getChildrenCount() { - return children_.size(); - } - /** - * repeated .patrol.NativeView children = 9; - */ - @java.lang.Override - public pl.leancode.patrol.contracts.Contracts.NativeView getChildren(int index) { - return children_.get(index); - } - /** - * repeated .patrol.NativeView children = 9; - */ - public pl.leancode.patrol.contracts.Contracts.NativeViewOrBuilder getChildrenOrBuilder( - int index) { - return children_.get(index); - } - private void ensureChildrenIsMutable() { - com.google.protobuf.Internal.ProtobufList tmp = children_; - if (!tmp.isModifiable()) { - children_ = - com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp); - } - } - - /** - * repeated .patrol.NativeView children = 9; - */ - private void setChildren( - int index, pl.leancode.patrol.contracts.Contracts.NativeView value) { - value.getClass(); - ensureChildrenIsMutable(); - children_.set(index, value); - } - /** - * repeated .patrol.NativeView children = 9; - */ - private void addChildren(pl.leancode.patrol.contracts.Contracts.NativeView value) { - value.getClass(); - ensureChildrenIsMutable(); - children_.add(value); - } - /** - * repeated .patrol.NativeView children = 9; - */ - private void addChildren( - int index, pl.leancode.patrol.contracts.Contracts.NativeView value) { - value.getClass(); - ensureChildrenIsMutable(); - children_.add(index, value); - } - /** - * repeated .patrol.NativeView children = 9; - */ - private void addAllChildren( - java.lang.Iterable values) { - ensureChildrenIsMutable(); - com.google.protobuf.AbstractMessageLite.addAll( - values, children_); - } - /** - * repeated .patrol.NativeView children = 9; - */ - private void clearChildren() { - children_ = emptyProtobufList(); - } - /** - * repeated .patrol.NativeView children = 9; - */ - private void removeChildren(int index) { - ensureChildrenIsMutable(); - children_.remove(index); - } - - public static pl.leancode.patrol.contracts.Contracts.NativeView parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.NativeView parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.NativeView parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.NativeView parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.NativeView parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.NativeView parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.NativeView parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.NativeView parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static pl.leancode.patrol.contracts.Contracts.NativeView parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - - public static pl.leancode.patrol.contracts.Contracts.NativeView parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.NativeView parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.NativeView parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.NativeView prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - *
-     * Represents a native UI control.
-     *
-     * On Android, this is `android.view.View`.
-     * 
- * - * Protobuf type {@code patrol.NativeView} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - pl.leancode.patrol.contracts.Contracts.NativeView, Builder> implements - // @@protoc_insertion_point(builder_implements:patrol.NativeView) - pl.leancode.patrol.contracts.Contracts.NativeViewOrBuilder { - // Construct using pl.leancode.patrol.contracts.Contracts.NativeView.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - * string className = 1; - * @return The className. - */ - @java.lang.Override - public java.lang.String getClassName() { - return instance.getClassName(); - } - /** - * string className = 1; - * @return The bytes for className. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getClassNameBytes() { - return instance.getClassNameBytes(); - } - /** - * string className = 1; - * @param value The className to set. - * @return This builder for chaining. - */ - public Builder setClassName( - java.lang.String value) { - copyOnWrite(); - instance.setClassName(value); - return this; - } - /** - * string className = 1; - * @return This builder for chaining. - */ - public Builder clearClassName() { - copyOnWrite(); - instance.clearClassName(); - return this; - } - /** - * string className = 1; - * @param value The bytes for className to set. - * @return This builder for chaining. - */ - public Builder setClassNameBytes( - com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setClassNameBytes(value); - return this; - } - - /** - * string text = 2; - * @return The text. - */ - @java.lang.Override - public java.lang.String getText() { - return instance.getText(); - } - /** - * string text = 2; - * @return The bytes for text. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getTextBytes() { - return instance.getTextBytes(); - } - /** - * string text = 2; - * @param value The text to set. - * @return This builder for chaining. - */ - public Builder setText( - java.lang.String value) { - copyOnWrite(); - instance.setText(value); - return this; - } - /** - * string text = 2; - * @return This builder for chaining. - */ - public Builder clearText() { - copyOnWrite(); - instance.clearText(); - return this; - } - /** - * string text = 2; - * @param value The bytes for text to set. - * @return This builder for chaining. - */ - public Builder setTextBytes( - com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setTextBytes(value); - return this; - } - - /** - * string contentDescription = 3; - * @return The contentDescription. - */ - @java.lang.Override - public java.lang.String getContentDescription() { - return instance.getContentDescription(); - } - /** - * string contentDescription = 3; - * @return The bytes for contentDescription. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getContentDescriptionBytes() { - return instance.getContentDescriptionBytes(); - } - /** - * string contentDescription = 3; - * @param value The contentDescription to set. - * @return This builder for chaining. - */ - public Builder setContentDescription( - java.lang.String value) { - copyOnWrite(); - instance.setContentDescription(value); - return this; - } - /** - * string contentDescription = 3; - * @return This builder for chaining. - */ - public Builder clearContentDescription() { - copyOnWrite(); - instance.clearContentDescription(); - return this; - } - /** - * string contentDescription = 3; - * @param value The bytes for contentDescription to set. - * @return This builder for chaining. - */ - public Builder setContentDescriptionBytes( - com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setContentDescriptionBytes(value); - return this; - } - - /** - * bool focused = 4; - * @return The focused. - */ - @java.lang.Override - public boolean getFocused() { - return instance.getFocused(); - } - /** - * bool focused = 4; - * @param value The focused to set. - * @return This builder for chaining. - */ - public Builder setFocused(boolean value) { - copyOnWrite(); - instance.setFocused(value); - return this; - } - /** - * bool focused = 4; - * @return This builder for chaining. - */ - public Builder clearFocused() { - copyOnWrite(); - instance.clearFocused(); - return this; - } - - /** - * bool enabled = 5; - * @return The enabled. - */ - @java.lang.Override - public boolean getEnabled() { - return instance.getEnabled(); - } - /** - * bool enabled = 5; - * @param value The enabled to set. - * @return This builder for chaining. - */ - public Builder setEnabled(boolean value) { - copyOnWrite(); - instance.setEnabled(value); - return this; - } - /** - * bool enabled = 5; - * @return This builder for chaining. - */ - public Builder clearEnabled() { - copyOnWrite(); - instance.clearEnabled(); - return this; - } - - /** - * int32 childCount = 6; - * @return The childCount. - */ - @java.lang.Override - public int getChildCount() { - return instance.getChildCount(); - } - /** - * int32 childCount = 6; - * @param value The childCount to set. - * @return This builder for chaining. - */ - public Builder setChildCount(int value) { - copyOnWrite(); - instance.setChildCount(value); - return this; - } - /** - * int32 childCount = 6; - * @return This builder for chaining. - */ - public Builder clearChildCount() { - copyOnWrite(); - instance.clearChildCount(); - return this; - } - - /** - * string resourceName = 7; - * @return The resourceName. - */ - @java.lang.Override - public java.lang.String getResourceName() { - return instance.getResourceName(); - } - /** - * string resourceName = 7; - * @return The bytes for resourceName. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getResourceNameBytes() { - return instance.getResourceNameBytes(); - } - /** - * string resourceName = 7; - * @param value The resourceName to set. - * @return This builder for chaining. - */ - public Builder setResourceName( - java.lang.String value) { - copyOnWrite(); - instance.setResourceName(value); - return this; - } - /** - * string resourceName = 7; - * @return This builder for chaining. - */ - public Builder clearResourceName() { - copyOnWrite(); - instance.clearResourceName(); - return this; - } - /** - * string resourceName = 7; - * @param value The bytes for resourceName to set. - * @return This builder for chaining. - */ - public Builder setResourceNameBytes( - com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setResourceNameBytes(value); - return this; - } - - /** - * string applicationPackage = 8; - * @return The applicationPackage. - */ - @java.lang.Override - public java.lang.String getApplicationPackage() { - return instance.getApplicationPackage(); - } - /** - * string applicationPackage = 8; - * @return The bytes for applicationPackage. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getApplicationPackageBytes() { - return instance.getApplicationPackageBytes(); - } - /** - * string applicationPackage = 8; - * @param value The applicationPackage to set. - * @return This builder for chaining. - */ - public Builder setApplicationPackage( - java.lang.String value) { - copyOnWrite(); - instance.setApplicationPackage(value); - return this; - } - /** - * string applicationPackage = 8; - * @return This builder for chaining. - */ - public Builder clearApplicationPackage() { - copyOnWrite(); - instance.clearApplicationPackage(); - return this; - } - /** - * string applicationPackage = 8; - * @param value The bytes for applicationPackage to set. - * @return This builder for chaining. - */ - public Builder setApplicationPackageBytes( - com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setApplicationPackageBytes(value); - return this; - } - - /** - * repeated .patrol.NativeView children = 9; - */ - @java.lang.Override - public java.util.List getChildrenList() { - return java.util.Collections.unmodifiableList( - instance.getChildrenList()); - } - /** - * repeated .patrol.NativeView children = 9; - */ - @java.lang.Override - public int getChildrenCount() { - return instance.getChildrenCount(); - }/** - * repeated .patrol.NativeView children = 9; - */ - @java.lang.Override - public pl.leancode.patrol.contracts.Contracts.NativeView getChildren(int index) { - return instance.getChildren(index); - } - /** - * repeated .patrol.NativeView children = 9; - */ - public Builder setChildren( - int index, pl.leancode.patrol.contracts.Contracts.NativeView value) { - copyOnWrite(); - instance.setChildren(index, value); - return this; - } - /** - * repeated .patrol.NativeView children = 9; - */ - public Builder setChildren( - int index, pl.leancode.patrol.contracts.Contracts.NativeView.Builder builderForValue) { - copyOnWrite(); - instance.setChildren(index, - builderForValue.build()); - return this; - } - /** - * repeated .patrol.NativeView children = 9; - */ - public Builder addChildren(pl.leancode.patrol.contracts.Contracts.NativeView value) { - copyOnWrite(); - instance.addChildren(value); - return this; - } - /** - * repeated .patrol.NativeView children = 9; - */ - public Builder addChildren( - int index, pl.leancode.patrol.contracts.Contracts.NativeView value) { - copyOnWrite(); - instance.addChildren(index, value); - return this; - } - /** - * repeated .patrol.NativeView children = 9; - */ - public Builder addChildren( - pl.leancode.patrol.contracts.Contracts.NativeView.Builder builderForValue) { - copyOnWrite(); - instance.addChildren(builderForValue.build()); - return this; - } - /** - * repeated .patrol.NativeView children = 9; - */ - public Builder addChildren( - int index, pl.leancode.patrol.contracts.Contracts.NativeView.Builder builderForValue) { - copyOnWrite(); - instance.addChildren(index, - builderForValue.build()); - return this; - } - /** - * repeated .patrol.NativeView children = 9; - */ - public Builder addAllChildren( - java.lang.Iterable values) { - copyOnWrite(); - instance.addAllChildren(values); - return this; - } - /** - * repeated .patrol.NativeView children = 9; - */ - public Builder clearChildren() { - copyOnWrite(); - instance.clearChildren(); - return this; - } - /** - * repeated .patrol.NativeView children = 9; - */ - public Builder removeChildren(int index) { - copyOnWrite(); - instance.removeChildren(index); - return this; - } - - // @@protoc_insertion_point(builder_scope:patrol.NativeView) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new pl.leancode.patrol.contracts.Contracts.NativeView(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "className_", - "text_", - "contentDescription_", - "focused_", - "enabled_", - "childCount_", - "resourceName_", - "applicationPackage_", - "children_", - pl.leancode.patrol.contracts.Contracts.NativeView.class, - }; - java.lang.String info = - "\u0000\t\u0000\u0000\u0001\t\t\u0000\u0001\u0000\u0001\u0208\u0002\u0208\u0003\u0208" + - "\u0004\u0007\u0005\u0007\u0006\u0004\u0007\u0208\b\u0208\t\u001b"; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (pl.leancode.patrol.contracts.Contracts.NativeView.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:patrol.NativeView) - private static final pl.leancode.patrol.contracts.Contracts.NativeView DEFAULT_INSTANCE; - static { - NativeView defaultInstance = new NativeView(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - NativeView.class, defaultInstance); - } - - public static pl.leancode.patrol.contracts.Contracts.NativeView getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface NotificationOrBuilder extends - // @@protoc_insertion_point(interface_extends:patrol.Notification) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * optional string appName = 1; - * @return Whether the appName field is set. - */ - boolean hasAppName(); - /** - * optional string appName = 1; - * @return The appName. - */ - java.lang.String getAppName(); - /** - * optional string appName = 1; - * @return The bytes for appName. - */ - com.google.protobuf.ByteString - getAppNameBytes(); - - /** - * string title = 2; - * @return The title. - */ - java.lang.String getTitle(); - /** - * string title = 2; - * @return The bytes for title. - */ - com.google.protobuf.ByteString - getTitleBytes(); - - /** - * string content = 3; - * @return The content. - */ - java.lang.String getContent(); - /** - * string content = 3; - * @return The bytes for content. - */ - com.google.protobuf.ByteString - getContentBytes(); - - /** - * string raw = 4; - * @return The raw. - */ - java.lang.String getRaw(); - /** - * string raw = 4; - * @return The bytes for raw. - */ - com.google.protobuf.ByteString - getRawBytes(); - } - /** - *
-   * Represents a notification visible in the notification shade.
-   * 
- * - * Protobuf type {@code patrol.Notification} - */ - public static final class Notification extends - com.google.protobuf.GeneratedMessageLite< - Notification, Notification.Builder> implements - // @@protoc_insertion_point(message_implements:patrol.Notification) - NotificationOrBuilder { - private Notification() { - appName_ = ""; - title_ = ""; - content_ = ""; - raw_ = ""; - } - private int bitField0_; - public static final int APPNAME_FIELD_NUMBER = 1; - private java.lang.String appName_; - /** - * optional string appName = 1; - * @return Whether the appName field is set. - */ - @java.lang.Override - public boolean hasAppName() { - return ((bitField0_ & 0x00000001) != 0); - } - /** - * optional string appName = 1; - * @return The appName. - */ - @java.lang.Override - public java.lang.String getAppName() { - return appName_; - } - /** - * optional string appName = 1; - * @return The bytes for appName. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getAppNameBytes() { - return com.google.protobuf.ByteString.copyFromUtf8(appName_); - } - /** - * optional string appName = 1; - * @param value The appName to set. - */ - private void setAppName( - java.lang.String value) { - java.lang.Class valueClass = value.getClass(); - bitField0_ |= 0x00000001; - appName_ = value; - } - /** - * optional string appName = 1; - */ - private void clearAppName() { - bitField0_ = (bitField0_ & ~0x00000001); - appName_ = getDefaultInstance().getAppName(); - } - /** - * optional string appName = 1; - * @param value The bytes for appName to set. - */ - private void setAppNameBytes( - com.google.protobuf.ByteString value) { - checkByteStringIsUtf8(value); - appName_ = value.toStringUtf8(); - bitField0_ |= 0x00000001; - } - - public static final int TITLE_FIELD_NUMBER = 2; - private java.lang.String title_; - /** - * string title = 2; - * @return The title. - */ - @java.lang.Override - public java.lang.String getTitle() { - return title_; - } - /** - * string title = 2; - * @return The bytes for title. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getTitleBytes() { - return com.google.protobuf.ByteString.copyFromUtf8(title_); - } - /** - * string title = 2; - * @param value The title to set. - */ - private void setTitle( - java.lang.String value) { - java.lang.Class valueClass = value.getClass(); - - title_ = value; - } - /** - * string title = 2; - */ - private void clearTitle() { - - title_ = getDefaultInstance().getTitle(); - } - /** - * string title = 2; - * @param value The bytes for title to set. - */ - private void setTitleBytes( - com.google.protobuf.ByteString value) { - checkByteStringIsUtf8(value); - title_ = value.toStringUtf8(); - - } - - public static final int CONTENT_FIELD_NUMBER = 3; - private java.lang.String content_; - /** - * string content = 3; - * @return The content. - */ - @java.lang.Override - public java.lang.String getContent() { - return content_; - } - /** - * string content = 3; - * @return The bytes for content. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getContentBytes() { - return com.google.protobuf.ByteString.copyFromUtf8(content_); - } - /** - * string content = 3; - * @param value The content to set. - */ - private void setContent( - java.lang.String value) { - java.lang.Class valueClass = value.getClass(); - - content_ = value; - } - /** - * string content = 3; - */ - private void clearContent() { - - content_ = getDefaultInstance().getContent(); - } - /** - * string content = 3; - * @param value The bytes for content to set. - */ - private void setContentBytes( - com.google.protobuf.ByteString value) { - checkByteStringIsUtf8(value); - content_ = value.toStringUtf8(); - - } - - public static final int RAW_FIELD_NUMBER = 4; - private java.lang.String raw_; - /** - * string raw = 4; - * @return The raw. - */ - @java.lang.Override - public java.lang.String getRaw() { - return raw_; - } - /** - * string raw = 4; - * @return The bytes for raw. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getRawBytes() { - return com.google.protobuf.ByteString.copyFromUtf8(raw_); - } - /** - * string raw = 4; - * @param value The raw to set. - */ - private void setRaw( - java.lang.String value) { - java.lang.Class valueClass = value.getClass(); - - raw_ = value; - } - /** - * string raw = 4; - */ - private void clearRaw() { - - raw_ = getDefaultInstance().getRaw(); - } - /** - * string raw = 4; - * @param value The bytes for raw to set. - */ - private void setRawBytes( - com.google.protobuf.ByteString value) { - checkByteStringIsUtf8(value); - raw_ = value.toStringUtf8(); - - } - - public static pl.leancode.patrol.contracts.Contracts.Notification parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.Notification parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.Notification parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.Notification parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.Notification parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.Notification parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.Notification parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.Notification parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static pl.leancode.patrol.contracts.Contracts.Notification parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - - public static pl.leancode.patrol.contracts.Contracts.Notification parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.Notification parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.Notification parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.Notification prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - *
-     * Represents a notification visible in the notification shade.
-     * 
- * - * Protobuf type {@code patrol.Notification} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - pl.leancode.patrol.contracts.Contracts.Notification, Builder> implements - // @@protoc_insertion_point(builder_implements:patrol.Notification) - pl.leancode.patrol.contracts.Contracts.NotificationOrBuilder { - // Construct using pl.leancode.patrol.contracts.Contracts.Notification.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - * optional string appName = 1; - * @return Whether the appName field is set. - */ - @java.lang.Override - public boolean hasAppName() { - return instance.hasAppName(); - } - /** - * optional string appName = 1; - * @return The appName. - */ - @java.lang.Override - public java.lang.String getAppName() { - return instance.getAppName(); - } - /** - * optional string appName = 1; - * @return The bytes for appName. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getAppNameBytes() { - return instance.getAppNameBytes(); - } - /** - * optional string appName = 1; - * @param value The appName to set. - * @return This builder for chaining. - */ - public Builder setAppName( - java.lang.String value) { - copyOnWrite(); - instance.setAppName(value); - return this; - } - /** - * optional string appName = 1; - * @return This builder for chaining. - */ - public Builder clearAppName() { - copyOnWrite(); - instance.clearAppName(); - return this; - } - /** - * optional string appName = 1; - * @param value The bytes for appName to set. - * @return This builder for chaining. - */ - public Builder setAppNameBytes( - com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setAppNameBytes(value); - return this; - } - - /** - * string title = 2; - * @return The title. - */ - @java.lang.Override - public java.lang.String getTitle() { - return instance.getTitle(); - } - /** - * string title = 2; - * @return The bytes for title. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getTitleBytes() { - return instance.getTitleBytes(); - } - /** - * string title = 2; - * @param value The title to set. - * @return This builder for chaining. - */ - public Builder setTitle( - java.lang.String value) { - copyOnWrite(); - instance.setTitle(value); - return this; - } - /** - * string title = 2; - * @return This builder for chaining. - */ - public Builder clearTitle() { - copyOnWrite(); - instance.clearTitle(); - return this; - } - /** - * string title = 2; - * @param value The bytes for title to set. - * @return This builder for chaining. - */ - public Builder setTitleBytes( - com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setTitleBytes(value); - return this; - } - - /** - * string content = 3; - * @return The content. - */ - @java.lang.Override - public java.lang.String getContent() { - return instance.getContent(); - } - /** - * string content = 3; - * @return The bytes for content. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getContentBytes() { - return instance.getContentBytes(); - } - /** - * string content = 3; - * @param value The content to set. - * @return This builder for chaining. - */ - public Builder setContent( - java.lang.String value) { - copyOnWrite(); - instance.setContent(value); - return this; - } - /** - * string content = 3; - * @return This builder for chaining. - */ - public Builder clearContent() { - copyOnWrite(); - instance.clearContent(); - return this; - } - /** - * string content = 3; - * @param value The bytes for content to set. - * @return This builder for chaining. - */ - public Builder setContentBytes( - com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setContentBytes(value); - return this; - } - - /** - * string raw = 4; - * @return The raw. - */ - @java.lang.Override - public java.lang.String getRaw() { - return instance.getRaw(); - } - /** - * string raw = 4; - * @return The bytes for raw. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getRawBytes() { - return instance.getRawBytes(); - } - /** - * string raw = 4; - * @param value The raw to set. - * @return This builder for chaining. - */ - public Builder setRaw( - java.lang.String value) { - copyOnWrite(); - instance.setRaw(value); - return this; - } - /** - * string raw = 4; - * @return This builder for chaining. - */ - public Builder clearRaw() { - copyOnWrite(); - instance.clearRaw(); - return this; - } - /** - * string raw = 4; - * @param value The bytes for raw to set. - * @return This builder for chaining. - */ - public Builder setRawBytes( - com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setRawBytes(value); - return this; - } - - // @@protoc_insertion_point(builder_scope:patrol.Notification) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new pl.leancode.patrol.contracts.Contracts.Notification(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "bitField0_", - "appName_", - "title_", - "content_", - "raw_", - }; - java.lang.String info = - "\u0000\u0004\u0000\u0001\u0001\u0004\u0004\u0000\u0000\u0000\u0001\u1208\u0000\u0002" + - "\u0208\u0003\u0208\u0004\u0208"; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (pl.leancode.patrol.contracts.Contracts.Notification.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:patrol.Notification) - private static final pl.leancode.patrol.contracts.Contracts.Notification DEFAULT_INSTANCE; - static { - Notification defaultInstance = new Notification(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - Notification.class, defaultInstance); - } - - public static pl.leancode.patrol.contracts.Contracts.Notification getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface SubmitTestResultsRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:patrol.SubmitTestResultsRequest) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * map<string, string> results = 1; - */ - int getResultsCount(); - /** - * map<string, string> results = 1; - */ - boolean containsResults( - java.lang.String key); - /** - * Use {@link #getResultsMap()} instead. - */ - @java.lang.Deprecated - java.util.Map - getResults(); - /** - * map<string, string> results = 1; - */ - java.util.Map - getResultsMap(); - /** - * map<string, string> results = 1; - */ - - /* nullable */ -java.lang.String getResultsOrDefault( - java.lang.String key, - /* nullable */ -java.lang.String defaultValue); - /** - * map<string, string> results = 1; - */ - - java.lang.String getResultsOrThrow( - java.lang.String key); - } - /** - * Protobuf type {@code patrol.SubmitTestResultsRequest} - */ - public static final class SubmitTestResultsRequest extends - com.google.protobuf.GeneratedMessageLite< - SubmitTestResultsRequest, SubmitTestResultsRequest.Builder> implements - // @@protoc_insertion_point(message_implements:patrol.SubmitTestResultsRequest) - SubmitTestResultsRequestOrBuilder { - private SubmitTestResultsRequest() { - } - public static final int RESULTS_FIELD_NUMBER = 1; - private static final class ResultsDefaultEntryHolder { - static final com.google.protobuf.MapEntryLite< - java.lang.String, java.lang.String> defaultEntry = - com.google.protobuf.MapEntryLite - .newDefaultInstance( - com.google.protobuf.WireFormat.FieldType.STRING, - "", - com.google.protobuf.WireFormat.FieldType.STRING, - ""); - } - private com.google.protobuf.MapFieldLite< - java.lang.String, java.lang.String> results_ = - com.google.protobuf.MapFieldLite.emptyMapField(); - private com.google.protobuf.MapFieldLite - internalGetResults() { - return results_; - } - private com.google.protobuf.MapFieldLite - internalGetMutableResults() { - if (!results_.isMutable()) { - results_ = results_.mutableCopy(); - } - return results_; - } - @java.lang.Override - - public int getResultsCount() { - return internalGetResults().size(); - } - /** - * map<string, string> results = 1; - */ - @java.lang.Override - - public boolean containsResults( - java.lang.String key) { - java.lang.Class keyClass = key.getClass(); - return internalGetResults().containsKey(key); - } - /** - * Use {@link #getResultsMap()} instead. - */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map getResults() { - return getResultsMap(); - } - /** - * map<string, string> results = 1; - */ - @java.lang.Override - - public java.util.Map getResultsMap() { - return java.util.Collections.unmodifiableMap( - internalGetResults()); - } - /** - * map<string, string> results = 1; - */ - @java.lang.Override - - public /* nullable */ -java.lang.String getResultsOrDefault( - java.lang.String key, - /* nullable */ -java.lang.String defaultValue) { - java.lang.Class keyClass = key.getClass(); - java.util.Map map = - internalGetResults(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - * map<string, string> results = 1; - */ - @java.lang.Override - - public java.lang.String getResultsOrThrow( - java.lang.String key) { - java.lang.Class keyClass = key.getClass(); - java.util.Map map = - internalGetResults(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - /** - * map<string, string> results = 1; - */ - private java.util.Map - getMutableResultsMap() { - return internalGetMutableResults(); - } - - public static pl.leancode.patrol.contracts.Contracts.SubmitTestResultsRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.SubmitTestResultsRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.SubmitTestResultsRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.SubmitTestResultsRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.SubmitTestResultsRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.SubmitTestResultsRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.SubmitTestResultsRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.SubmitTestResultsRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static pl.leancode.patrol.contracts.Contracts.SubmitTestResultsRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - - public static pl.leancode.patrol.contracts.Contracts.SubmitTestResultsRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.SubmitTestResultsRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.SubmitTestResultsRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.SubmitTestResultsRequest prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - * Protobuf type {@code patrol.SubmitTestResultsRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - pl.leancode.patrol.contracts.Contracts.SubmitTestResultsRequest, Builder> implements - // @@protoc_insertion_point(builder_implements:patrol.SubmitTestResultsRequest) - pl.leancode.patrol.contracts.Contracts.SubmitTestResultsRequestOrBuilder { - // Construct using pl.leancode.patrol.contracts.Contracts.SubmitTestResultsRequest.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - @java.lang.Override - - public int getResultsCount() { - return instance.getResultsMap().size(); - } - /** - * map<string, string> results = 1; - */ - @java.lang.Override - - public boolean containsResults( - java.lang.String key) { - java.lang.Class keyClass = key.getClass(); - return instance.getResultsMap().containsKey(key); - } - - public Builder clearResults() { - copyOnWrite(); - instance.getMutableResultsMap().clear(); - return this; - } - /** - * map<string, string> results = 1; - */ - - public Builder removeResults( - java.lang.String key) { - java.lang.Class keyClass = key.getClass(); - copyOnWrite(); - instance.getMutableResultsMap().remove(key); - return this; - } - /** - * Use {@link #getResultsMap()} instead. - */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map getResults() { - return getResultsMap(); - } - /** - * map<string, string> results = 1; - */ - @java.lang.Override - public java.util.Map getResultsMap() { - return java.util.Collections.unmodifiableMap( - instance.getResultsMap()); - } - /** - * map<string, string> results = 1; - */ - @java.lang.Override - - public /* nullable */ -java.lang.String getResultsOrDefault( - java.lang.String key, - /* nullable */ -java.lang.String defaultValue) { - java.lang.Class keyClass = key.getClass(); - java.util.Map map = - instance.getResultsMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - * map<string, string> results = 1; - */ - @java.lang.Override - - public java.lang.String getResultsOrThrow( - java.lang.String key) { - java.lang.Class keyClass = key.getClass(); - java.util.Map map = - instance.getResultsMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - /** - * map<string, string> results = 1; - */ - public Builder putResults( - java.lang.String key, - java.lang.String value) { - java.lang.Class keyClass = key.getClass(); - java.lang.Class valueClass = value.getClass(); - copyOnWrite(); - instance.getMutableResultsMap().put(key, value); - return this; - } - /** - * map<string, string> results = 1; - */ - public Builder putAllResults( - java.util.Map values) { - copyOnWrite(); - instance.getMutableResultsMap().putAll(values); - return this; - } - - // @@protoc_insertion_point(builder_scope:patrol.SubmitTestResultsRequest) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new pl.leancode.patrol.contracts.Contracts.SubmitTestResultsRequest(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "results_", - ResultsDefaultEntryHolder.defaultEntry, - }; - java.lang.String info = - "\u0000\u0001\u0000\u0000\u0001\u0001\u0001\u0001\u0000\u0000\u00012"; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (pl.leancode.patrol.contracts.Contracts.SubmitTestResultsRequest.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:patrol.SubmitTestResultsRequest) - private static final pl.leancode.patrol.contracts.Contracts.SubmitTestResultsRequest DEFAULT_INSTANCE; - static { - SubmitTestResultsRequest defaultInstance = new SubmitTestResultsRequest(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - SubmitTestResultsRequest.class, defaultInstance); - } - - public static pl.leancode.patrol.contracts.Contracts.SubmitTestResultsRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - - static { - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/ContractsGrpcKt.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/ContractsGrpcKt.kt deleted file mode 100644 index ad00b8870..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/ContractsGrpcKt.kt +++ /dev/null @@ -1,1700 +0,0 @@ -package pl.leancode.patrol.contracts - -import io.grpc.CallOptions -import io.grpc.CallOptions.DEFAULT -import io.grpc.Channel -import io.grpc.Metadata -import io.grpc.MethodDescriptor -import io.grpc.ServerServiceDefinition -import io.grpc.ServerServiceDefinition.builder -import io.grpc.ServiceDescriptor -import io.grpc.Status -import io.grpc.Status.UNIMPLEMENTED -import io.grpc.StatusException -import io.grpc.kotlin.AbstractCoroutineServerImpl -import io.grpc.kotlin.AbstractCoroutineStub -import io.grpc.kotlin.ClientCalls -import io.grpc.kotlin.ClientCalls.unaryRpc -import io.grpc.kotlin.ServerCalls -import io.grpc.kotlin.ServerCalls.unaryServerMethodDefinition -import io.grpc.kotlin.StubFor -import kotlin.String -import kotlin.coroutines.CoroutineContext -import kotlin.coroutines.EmptyCoroutineContext -import kotlin.jvm.JvmOverloads -import kotlin.jvm.JvmStatic -import pl.leancode.patrol.contracts.PatrolAppServiceGrpc.getServiceDescriptor - -/** - * Holder for Kotlin coroutine-based client and server APIs for patrol.PatrolAppService. - */ -public object PatrolAppServiceGrpcKt { - public const val SERVICE_NAME: String = PatrolAppServiceGrpc.SERVICE_NAME - - @JvmStatic - public val serviceDescriptor: ServiceDescriptor - get() = PatrolAppServiceGrpc.getServiceDescriptor() - - public val listDartTestsMethod: MethodDescriptor - @JvmStatic - get() = PatrolAppServiceGrpc.getListDartTestsMethod() - - public val runDartTestMethod: - MethodDescriptor - @JvmStatic - get() = PatrolAppServiceGrpc.getRunDartTestMethod() - - /** - * A stub for issuing RPCs to a(n) patrol.PatrolAppService service as suspending coroutines. - */ - @StubFor(PatrolAppServiceGrpc::class) - public class PatrolAppServiceCoroutineStub @JvmOverloads constructor( - channel: Channel, - callOptions: CallOptions = DEFAULT, - ) : AbstractCoroutineStub(channel, callOptions) { - public override fun build(channel: Channel, callOptions: CallOptions): - PatrolAppServiceCoroutineStub = PatrolAppServiceCoroutineStub(channel, callOptions) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun listDartTests(request: Contracts.Empty, headers: Metadata = Metadata()): - Contracts.ListDartTestsResponse = unaryRpc( - channel, - PatrolAppServiceGrpc.getListDartTestsMethod(), - request, - callOptions, - headers - ) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun runDartTest(request: Contracts.RunDartTestRequest, headers: Metadata = - Metadata()): Contracts.RunDartTestResponse = unaryRpc( - channel, - PatrolAppServiceGrpc.getRunDartTestMethod(), - request, - callOptions, - headers - ) - } - - /** - * Skeletal implementation of the patrol.PatrolAppService service based on Kotlin coroutines. - */ - public abstract class PatrolAppServiceCoroutineImplBase( - coroutineContext: CoroutineContext = EmptyCoroutineContext, - ) : AbstractCoroutineServerImpl(coroutineContext) { - /** - * Returns the response to an RPC for patrol.PatrolAppService.listDartTests. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend fun listDartTests(request: Contracts.Empty): Contracts.ListDartTestsResponse - = throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.PatrolAppService.listDartTests is unimplemented")) - - /** - * Returns the response to an RPC for patrol.PatrolAppService.runDartTest. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend fun runDartTest(request: Contracts.RunDartTestRequest): - Contracts.RunDartTestResponse = throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.PatrolAppService.runDartTest is unimplemented")) - - public final override fun bindService(): ServerServiceDefinition = - builder(getServiceDescriptor()) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = PatrolAppServiceGrpc.getListDartTestsMethod(), - implementation = ::listDartTests - )) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = PatrolAppServiceGrpc.getRunDartTestMethod(), - implementation = ::runDartTest - )).build() - } -} - -/** - * Holder for Kotlin coroutine-based client and server APIs for patrol.NativeAutomator. - */ -public object NativeAutomatorGrpcKt { - public const val SERVICE_NAME: String = NativeAutomatorGrpc.SERVICE_NAME - - @JvmStatic - public val serviceDescriptor: ServiceDescriptor - get() = NativeAutomatorGrpc.getServiceDescriptor() - - public val initializeMethod: MethodDescriptor - @JvmStatic - get() = NativeAutomatorGrpc.getInitializeMethod() - - public val configureMethod: MethodDescriptor - @JvmStatic - get() = NativeAutomatorGrpc.getConfigureMethod() - - public val pressHomeMethod: MethodDescriptor - @JvmStatic - get() = NativeAutomatorGrpc.getPressHomeMethod() - - public val pressBackMethod: MethodDescriptor - @JvmStatic - get() = NativeAutomatorGrpc.getPressBackMethod() - - public val pressRecentAppsMethod: MethodDescriptor - @JvmStatic - get() = NativeAutomatorGrpc.getPressRecentAppsMethod() - - public val doublePressRecentAppsMethod: MethodDescriptor - @JvmStatic - get() = NativeAutomatorGrpc.getDoublePressRecentAppsMethod() - - public val openAppMethod: MethodDescriptor - @JvmStatic - get() = NativeAutomatorGrpc.getOpenAppMethod() - - public val openQuickSettingsMethod: - MethodDescriptor - @JvmStatic - get() = NativeAutomatorGrpc.getOpenQuickSettingsMethod() - - public val getNativeViewsMethod: - MethodDescriptor - @JvmStatic - get() = NativeAutomatorGrpc.getGetNativeViewsMethod() - - public val tapMethod: MethodDescriptor - @JvmStatic - get() = NativeAutomatorGrpc.getTapMethod() - - public val doubleTapMethod: MethodDescriptor - @JvmStatic - get() = NativeAutomatorGrpc.getDoubleTapMethod() - - public val enterTextMethod: MethodDescriptor - @JvmStatic - get() = NativeAutomatorGrpc.getEnterTextMethod() - - public val swipeMethod: MethodDescriptor - @JvmStatic - get() = NativeAutomatorGrpc.getSwipeMethod() - - public val waitUntilVisibleMethod: - MethodDescriptor - @JvmStatic - get() = NativeAutomatorGrpc.getWaitUntilVisibleMethod() - - public val enableAirplaneModeMethod: MethodDescriptor - @JvmStatic - get() = NativeAutomatorGrpc.getEnableAirplaneModeMethod() - - public val disableAirplaneModeMethod: MethodDescriptor - @JvmStatic - get() = NativeAutomatorGrpc.getDisableAirplaneModeMethod() - - public val enableWiFiMethod: MethodDescriptor - @JvmStatic - get() = NativeAutomatorGrpc.getEnableWiFiMethod() - - public val disableWiFiMethod: MethodDescriptor - @JvmStatic - get() = NativeAutomatorGrpc.getDisableWiFiMethod() - - public val enableCellularMethod: MethodDescriptor - @JvmStatic - get() = NativeAutomatorGrpc.getEnableCellularMethod() - - public val disableCellularMethod: MethodDescriptor - @JvmStatic - get() = NativeAutomatorGrpc.getDisableCellularMethod() - - public val enableBluetoothMethod: MethodDescriptor - @JvmStatic - get() = NativeAutomatorGrpc.getEnableBluetoothMethod() - - public val disableBluetoothMethod: MethodDescriptor - @JvmStatic - get() = NativeAutomatorGrpc.getDisableBluetoothMethod() - - public val enableDarkModeMethod: MethodDescriptor - @JvmStatic - get() = NativeAutomatorGrpc.getEnableDarkModeMethod() - - public val disableDarkModeMethod: MethodDescriptor - @JvmStatic - get() = NativeAutomatorGrpc.getDisableDarkModeMethod() - - public val openNotificationsMethod: MethodDescriptor - @JvmStatic - get() = NativeAutomatorGrpc.getOpenNotificationsMethod() - - public val closeNotificationsMethod: MethodDescriptor - @JvmStatic - get() = NativeAutomatorGrpc.getCloseNotificationsMethod() - - public val closeHeadsUpNotificationMethod: MethodDescriptor - @JvmStatic - get() = NativeAutomatorGrpc.getCloseHeadsUpNotificationMethod() - - public val getNotificationsMethod: - MethodDescriptor - @JvmStatic - get() = NativeAutomatorGrpc.getGetNotificationsMethod() - - public val tapOnNotificationMethod: - MethodDescriptor - @JvmStatic - get() = NativeAutomatorGrpc.getTapOnNotificationMethod() - - public val isPermissionDialogVisibleMethod: - MethodDescriptor - @JvmStatic - get() = NativeAutomatorGrpc.getIsPermissionDialogVisibleMethod() - - public val handlePermissionDialogMethod: - MethodDescriptor - @JvmStatic - get() = NativeAutomatorGrpc.getHandlePermissionDialogMethod() - - public val setLocationAccuracyMethod: - MethodDescriptor - @JvmStatic - get() = NativeAutomatorGrpc.getSetLocationAccuracyMethod() - - public val debugMethod: MethodDescriptor - @JvmStatic - get() = NativeAutomatorGrpc.getDebugMethod() - - public val markPatrolAppServiceReadyMethod: MethodDescriptor - @JvmStatic - get() = NativeAutomatorGrpc.getMarkPatrolAppServiceReadyMethod() - - /** - * A stub for issuing RPCs to a(n) patrol.NativeAutomator service as suspending coroutines. - */ - @StubFor(NativeAutomatorGrpc::class) - public class NativeAutomatorCoroutineStub @JvmOverloads constructor( - channel: Channel, - callOptions: CallOptions = DEFAULT, - ) : AbstractCoroutineStub(channel, callOptions) { - public override fun build(channel: Channel, callOptions: CallOptions): - NativeAutomatorCoroutineStub = NativeAutomatorCoroutineStub(channel, callOptions) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun initialize(request: Contracts.Empty, headers: Metadata = Metadata()): - Contracts.Empty = unaryRpc( - channel, - NativeAutomatorGrpc.getInitializeMethod(), - request, - callOptions, - headers - ) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun configure(request: Contracts.ConfigureRequest, headers: Metadata = - Metadata()): Contracts.Empty = unaryRpc( - channel, - NativeAutomatorGrpc.getConfigureMethod(), - request, - callOptions, - headers - ) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun pressHome(request: Contracts.Empty, headers: Metadata = Metadata()): - Contracts.Empty = unaryRpc( - channel, - NativeAutomatorGrpc.getPressHomeMethod(), - request, - callOptions, - headers - ) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun pressBack(request: Contracts.Empty, headers: Metadata = Metadata()): - Contracts.Empty = unaryRpc( - channel, - NativeAutomatorGrpc.getPressBackMethod(), - request, - callOptions, - headers - ) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun pressRecentApps(request: Contracts.Empty, headers: Metadata = Metadata()): - Contracts.Empty = unaryRpc( - channel, - NativeAutomatorGrpc.getPressRecentAppsMethod(), - request, - callOptions, - headers - ) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun doublePressRecentApps(request: Contracts.Empty, headers: Metadata = - Metadata()): Contracts.Empty = unaryRpc( - channel, - NativeAutomatorGrpc.getDoublePressRecentAppsMethod(), - request, - callOptions, - headers - ) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun openApp(request: Contracts.OpenAppRequest, headers: Metadata = Metadata()): - Contracts.Empty = unaryRpc( - channel, - NativeAutomatorGrpc.getOpenAppMethod(), - request, - callOptions, - headers - ) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun openQuickSettings(request: Contracts.OpenQuickSettingsRequest, - headers: Metadata = Metadata()): Contracts.Empty = unaryRpc( - channel, - NativeAutomatorGrpc.getOpenQuickSettingsMethod(), - request, - callOptions, - headers - ) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun getNativeViews(request: Contracts.GetNativeViewsRequest, headers: Metadata = - Metadata()): Contracts.GetNativeViewsResponse = unaryRpc( - channel, - NativeAutomatorGrpc.getGetNativeViewsMethod(), - request, - callOptions, - headers - ) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun tap(request: Contracts.TapRequest, headers: Metadata = Metadata()): - Contracts.Empty = unaryRpc( - channel, - NativeAutomatorGrpc.getTapMethod(), - request, - callOptions, - headers - ) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun doubleTap(request: Contracts.TapRequest, headers: Metadata = Metadata()): - Contracts.Empty = unaryRpc( - channel, - NativeAutomatorGrpc.getDoubleTapMethod(), - request, - callOptions, - headers - ) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun enterText(request: Contracts.EnterTextRequest, headers: Metadata = - Metadata()): Contracts.Empty = unaryRpc( - channel, - NativeAutomatorGrpc.getEnterTextMethod(), - request, - callOptions, - headers - ) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun swipe(request: Contracts.SwipeRequest, headers: Metadata = Metadata()): - Contracts.Empty = unaryRpc( - channel, - NativeAutomatorGrpc.getSwipeMethod(), - request, - callOptions, - headers - ) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun waitUntilVisible(request: Contracts.WaitUntilVisibleRequest, - headers: Metadata = Metadata()): Contracts.Empty = unaryRpc( - channel, - NativeAutomatorGrpc.getWaitUntilVisibleMethod(), - request, - callOptions, - headers - ) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun enableAirplaneMode(request: Contracts.Empty, headers: Metadata = Metadata()): - Contracts.Empty = unaryRpc( - channel, - NativeAutomatorGrpc.getEnableAirplaneModeMethod(), - request, - callOptions, - headers - ) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun disableAirplaneMode(request: Contracts.Empty, headers: Metadata = - Metadata()): Contracts.Empty = unaryRpc( - channel, - NativeAutomatorGrpc.getDisableAirplaneModeMethod(), - request, - callOptions, - headers - ) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun enableWiFi(request: Contracts.Empty, headers: Metadata = Metadata()): - Contracts.Empty = unaryRpc( - channel, - NativeAutomatorGrpc.getEnableWiFiMethod(), - request, - callOptions, - headers - ) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun disableWiFi(request: Contracts.Empty, headers: Metadata = Metadata()): - Contracts.Empty = unaryRpc( - channel, - NativeAutomatorGrpc.getDisableWiFiMethod(), - request, - callOptions, - headers - ) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun enableCellular(request: Contracts.Empty, headers: Metadata = Metadata()): - Contracts.Empty = unaryRpc( - channel, - NativeAutomatorGrpc.getEnableCellularMethod(), - request, - callOptions, - headers - ) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun disableCellular(request: Contracts.Empty, headers: Metadata = Metadata()): - Contracts.Empty = unaryRpc( - channel, - NativeAutomatorGrpc.getDisableCellularMethod(), - request, - callOptions, - headers - ) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun enableBluetooth(request: Contracts.Empty, headers: Metadata = Metadata()): - Contracts.Empty = unaryRpc( - channel, - NativeAutomatorGrpc.getEnableBluetoothMethod(), - request, - callOptions, - headers - ) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun disableBluetooth(request: Contracts.Empty, headers: Metadata = Metadata()): - Contracts.Empty = unaryRpc( - channel, - NativeAutomatorGrpc.getDisableBluetoothMethod(), - request, - callOptions, - headers - ) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun enableDarkMode(request: Contracts.DarkModeRequest, headers: Metadata = - Metadata()): Contracts.Empty = unaryRpc( - channel, - NativeAutomatorGrpc.getEnableDarkModeMethod(), - request, - callOptions, - headers - ) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun disableDarkMode(request: Contracts.DarkModeRequest, headers: Metadata = - Metadata()): Contracts.Empty = unaryRpc( - channel, - NativeAutomatorGrpc.getDisableDarkModeMethod(), - request, - callOptions, - headers - ) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun openNotifications(request: Contracts.Empty, headers: Metadata = Metadata()): - Contracts.Empty = unaryRpc( - channel, - NativeAutomatorGrpc.getOpenNotificationsMethod(), - request, - callOptions, - headers - ) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun closeNotifications(request: Contracts.Empty, headers: Metadata = Metadata()): - Contracts.Empty = unaryRpc( - channel, - NativeAutomatorGrpc.getCloseNotificationsMethod(), - request, - callOptions, - headers - ) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun closeHeadsUpNotification(request: Contracts.Empty, headers: Metadata = - Metadata()): Contracts.Empty = unaryRpc( - channel, - NativeAutomatorGrpc.getCloseHeadsUpNotificationMethod(), - request, - callOptions, - headers - ) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun getNotifications(request: Contracts.GetNotificationsRequest, - headers: Metadata = Metadata()): Contracts.GetNotificationsResponse = unaryRpc( - channel, - NativeAutomatorGrpc.getGetNotificationsMethod(), - request, - callOptions, - headers - ) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun tapOnNotification(request: Contracts.TapOnNotificationRequest, - headers: Metadata = Metadata()): Contracts.Empty = unaryRpc( - channel, - NativeAutomatorGrpc.getTapOnNotificationMethod(), - request, - callOptions, - headers - ) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun isPermissionDialogVisible(request: Contracts.PermissionDialogVisibleRequest, - headers: Metadata = Metadata()): Contracts.PermissionDialogVisibleResponse = unaryRpc( - channel, - NativeAutomatorGrpc.getIsPermissionDialogVisibleMethod(), - request, - callOptions, - headers - ) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun handlePermissionDialog(request: Contracts.HandlePermissionRequest, - headers: Metadata = Metadata()): Contracts.Empty = unaryRpc( - channel, - NativeAutomatorGrpc.getHandlePermissionDialogMethod(), - request, - callOptions, - headers - ) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun setLocationAccuracy(request: Contracts.SetLocationAccuracyRequest, - headers: Metadata = Metadata()): Contracts.Empty = unaryRpc( - channel, - NativeAutomatorGrpc.getSetLocationAccuracyMethod(), - request, - callOptions, - headers - ) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun debug(request: Contracts.Empty, headers: Metadata = Metadata()): - Contracts.Empty = unaryRpc( - channel, - NativeAutomatorGrpc.getDebugMethod(), - request, - callOptions, - headers - ) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun markPatrolAppServiceReady(request: Contracts.Empty, headers: Metadata = - Metadata()): Contracts.Empty = unaryRpc( - channel, - NativeAutomatorGrpc.getMarkPatrolAppServiceReadyMethod(), - request, - callOptions, - headers - ) - } - - /** - * Skeletal implementation of the patrol.NativeAutomator service based on Kotlin coroutines. - */ - public abstract class NativeAutomatorCoroutineImplBase( - coroutineContext: CoroutineContext = EmptyCoroutineContext, - ) : AbstractCoroutineServerImpl(coroutineContext) { - /** - * Returns the response to an RPC for patrol.NativeAutomator.initialize. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend fun initialize(request: Contracts.Empty): Contracts.Empty = throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.initialize is unimplemented")) - - /** - * Returns the response to an RPC for patrol.NativeAutomator.configure. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend fun configure(request: Contracts.ConfigureRequest): Contracts.Empty = throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.configure is unimplemented")) - - /** - * Returns the response to an RPC for patrol.NativeAutomator.pressHome. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend fun pressHome(request: Contracts.Empty): Contracts.Empty = throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.pressHome is unimplemented")) - - /** - * Returns the response to an RPC for patrol.NativeAutomator.pressBack. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend fun pressBack(request: Contracts.Empty): Contracts.Empty = throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.pressBack is unimplemented")) - - /** - * Returns the response to an RPC for patrol.NativeAutomator.pressRecentApps. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend fun pressRecentApps(request: Contracts.Empty): Contracts.Empty = throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.pressRecentApps is unimplemented")) - - /** - * Returns the response to an RPC for patrol.NativeAutomator.doublePressRecentApps. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend fun doublePressRecentApps(request: Contracts.Empty): Contracts.Empty = throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.doublePressRecentApps is unimplemented")) - - /** - * Returns the response to an RPC for patrol.NativeAutomator.openApp. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend fun openApp(request: Contracts.OpenAppRequest): Contracts.Empty = throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.openApp is unimplemented")) - - /** - * Returns the response to an RPC for patrol.NativeAutomator.openQuickSettings. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend fun openQuickSettings(request: Contracts.OpenQuickSettingsRequest): - Contracts.Empty = throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.openQuickSettings is unimplemented")) - - /** - * Returns the response to an RPC for patrol.NativeAutomator.getNativeViews. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend fun getNativeViews(request: Contracts.GetNativeViewsRequest): - Contracts.GetNativeViewsResponse = throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.getNativeViews is unimplemented")) - - /** - * Returns the response to an RPC for patrol.NativeAutomator.tap. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend fun tap(request: Contracts.TapRequest): Contracts.Empty = throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.tap is unimplemented")) - - /** - * Returns the response to an RPC for patrol.NativeAutomator.doubleTap. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend fun doubleTap(request: Contracts.TapRequest): Contracts.Empty = throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.doubleTap is unimplemented")) - - /** - * Returns the response to an RPC for patrol.NativeAutomator.enterText. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend fun enterText(request: Contracts.EnterTextRequest): Contracts.Empty = throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.enterText is unimplemented")) - - /** - * Returns the response to an RPC for patrol.NativeAutomator.swipe. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend fun swipe(request: Contracts.SwipeRequest): Contracts.Empty = throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.swipe is unimplemented")) - - /** - * Returns the response to an RPC for patrol.NativeAutomator.waitUntilVisible. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend fun waitUntilVisible(request: Contracts.WaitUntilVisibleRequest): - Contracts.Empty = throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.waitUntilVisible is unimplemented")) - - /** - * Returns the response to an RPC for patrol.NativeAutomator.enableAirplaneMode. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend fun enableAirplaneMode(request: Contracts.Empty): Contracts.Empty = throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.enableAirplaneMode is unimplemented")) - - /** - * Returns the response to an RPC for patrol.NativeAutomator.disableAirplaneMode. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend fun disableAirplaneMode(request: Contracts.Empty): Contracts.Empty = throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.disableAirplaneMode is unimplemented")) - - /** - * Returns the response to an RPC for patrol.NativeAutomator.enableWiFi. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend fun enableWiFi(request: Contracts.Empty): Contracts.Empty = throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.enableWiFi is unimplemented")) - - /** - * Returns the response to an RPC for patrol.NativeAutomator.disableWiFi. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend fun disableWiFi(request: Contracts.Empty): Contracts.Empty = throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.disableWiFi is unimplemented")) - - /** - * Returns the response to an RPC for patrol.NativeAutomator.enableCellular. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend fun enableCellular(request: Contracts.Empty): Contracts.Empty = throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.enableCellular is unimplemented")) - - /** - * Returns the response to an RPC for patrol.NativeAutomator.disableCellular. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend fun disableCellular(request: Contracts.Empty): Contracts.Empty = throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.disableCellular is unimplemented")) - - /** - * Returns the response to an RPC for patrol.NativeAutomator.enableBluetooth. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend fun enableBluetooth(request: Contracts.Empty): Contracts.Empty = throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.enableBluetooth is unimplemented")) - - /** - * Returns the response to an RPC for patrol.NativeAutomator.disableBluetooth. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend fun disableBluetooth(request: Contracts.Empty): Contracts.Empty = throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.disableBluetooth is unimplemented")) - - /** - * Returns the response to an RPC for patrol.NativeAutomator.enableDarkMode. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend fun enableDarkMode(request: Contracts.DarkModeRequest): Contracts.Empty = - throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.enableDarkMode is unimplemented")) - - /** - * Returns the response to an RPC for patrol.NativeAutomator.disableDarkMode. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend fun disableDarkMode(request: Contracts.DarkModeRequest): Contracts.Empty = - throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.disableDarkMode is unimplemented")) - - /** - * Returns the response to an RPC for patrol.NativeAutomator.openNotifications. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend fun openNotifications(request: Contracts.Empty): Contracts.Empty = throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.openNotifications is unimplemented")) - - /** - * Returns the response to an RPC for patrol.NativeAutomator.closeNotifications. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend fun closeNotifications(request: Contracts.Empty): Contracts.Empty = throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.closeNotifications is unimplemented")) - - /** - * Returns the response to an RPC for patrol.NativeAutomator.closeHeadsUpNotification. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend fun closeHeadsUpNotification(request: Contracts.Empty): Contracts.Empty = - throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.closeHeadsUpNotification is unimplemented")) - - /** - * Returns the response to an RPC for patrol.NativeAutomator.getNotifications. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend fun getNotifications(request: Contracts.GetNotificationsRequest): - Contracts.GetNotificationsResponse = throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.getNotifications is unimplemented")) - - /** - * Returns the response to an RPC for patrol.NativeAutomator.tapOnNotification. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend fun tapOnNotification(request: Contracts.TapOnNotificationRequest): - Contracts.Empty = throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.tapOnNotification is unimplemented")) - - /** - * Returns the response to an RPC for patrol.NativeAutomator.isPermissionDialogVisible. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend - fun isPermissionDialogVisible(request: Contracts.PermissionDialogVisibleRequest): - Contracts.PermissionDialogVisibleResponse = throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.isPermissionDialogVisible is unimplemented")) - - /** - * Returns the response to an RPC for patrol.NativeAutomator.handlePermissionDialog. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend fun handlePermissionDialog(request: Contracts.HandlePermissionRequest): - Contracts.Empty = throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.handlePermissionDialog is unimplemented")) - - /** - * Returns the response to an RPC for patrol.NativeAutomator.setLocationAccuracy. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend fun setLocationAccuracy(request: Contracts.SetLocationAccuracyRequest): - Contracts.Empty = throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.setLocationAccuracy is unimplemented")) - - /** - * Returns the response to an RPC for patrol.NativeAutomator.debug. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend fun debug(request: Contracts.Empty): Contracts.Empty = throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.debug is unimplemented")) - - /** - * Returns the response to an RPC for patrol.NativeAutomator.markPatrolAppServiceReady. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend fun markPatrolAppServiceReady(request: Contracts.Empty): Contracts.Empty = - throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.markPatrolAppServiceReady is unimplemented")) - - public final override fun bindService(): ServerServiceDefinition = - builder(NativeAutomatorGrpc.getServiceDescriptor()) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = NativeAutomatorGrpc.getInitializeMethod(), - implementation = ::initialize - )) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = NativeAutomatorGrpc.getConfigureMethod(), - implementation = ::configure - )) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = NativeAutomatorGrpc.getPressHomeMethod(), - implementation = ::pressHome - )) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = NativeAutomatorGrpc.getPressBackMethod(), - implementation = ::pressBack - )) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = NativeAutomatorGrpc.getPressRecentAppsMethod(), - implementation = ::pressRecentApps - )) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = NativeAutomatorGrpc.getDoublePressRecentAppsMethod(), - implementation = ::doublePressRecentApps - )) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = NativeAutomatorGrpc.getOpenAppMethod(), - implementation = ::openApp - )) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = NativeAutomatorGrpc.getOpenQuickSettingsMethod(), - implementation = ::openQuickSettings - )) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = NativeAutomatorGrpc.getGetNativeViewsMethod(), - implementation = ::getNativeViews - )) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = NativeAutomatorGrpc.getTapMethod(), - implementation = ::tap - )) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = NativeAutomatorGrpc.getDoubleTapMethod(), - implementation = ::doubleTap - )) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = NativeAutomatorGrpc.getEnterTextMethod(), - implementation = ::enterText - )) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = NativeAutomatorGrpc.getSwipeMethod(), - implementation = ::swipe - )) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = NativeAutomatorGrpc.getWaitUntilVisibleMethod(), - implementation = ::waitUntilVisible - )) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = NativeAutomatorGrpc.getEnableAirplaneModeMethod(), - implementation = ::enableAirplaneMode - )) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = NativeAutomatorGrpc.getDisableAirplaneModeMethod(), - implementation = ::disableAirplaneMode - )) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = NativeAutomatorGrpc.getEnableWiFiMethod(), - implementation = ::enableWiFi - )) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = NativeAutomatorGrpc.getDisableWiFiMethod(), - implementation = ::disableWiFi - )) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = NativeAutomatorGrpc.getEnableCellularMethod(), - implementation = ::enableCellular - )) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = NativeAutomatorGrpc.getDisableCellularMethod(), - implementation = ::disableCellular - )) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = NativeAutomatorGrpc.getEnableBluetoothMethod(), - implementation = ::enableBluetooth - )) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = NativeAutomatorGrpc.getDisableBluetoothMethod(), - implementation = ::disableBluetooth - )) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = NativeAutomatorGrpc.getEnableDarkModeMethod(), - implementation = ::enableDarkMode - )) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = NativeAutomatorGrpc.getDisableDarkModeMethod(), - implementation = ::disableDarkMode - )) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = NativeAutomatorGrpc.getOpenNotificationsMethod(), - implementation = ::openNotifications - )) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = NativeAutomatorGrpc.getCloseNotificationsMethod(), - implementation = ::closeNotifications - )) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = NativeAutomatorGrpc.getCloseHeadsUpNotificationMethod(), - implementation = ::closeHeadsUpNotification - )) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = NativeAutomatorGrpc.getGetNotificationsMethod(), - implementation = ::getNotifications - )) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = NativeAutomatorGrpc.getTapOnNotificationMethod(), - implementation = ::tapOnNotification - )) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = NativeAutomatorGrpc.getIsPermissionDialogVisibleMethod(), - implementation = ::isPermissionDialogVisible - )) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = NativeAutomatorGrpc.getHandlePermissionDialogMethod(), - implementation = ::handlePermissionDialog - )) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = NativeAutomatorGrpc.getSetLocationAccuracyMethod(), - implementation = ::setLocationAccuracy - )) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = NativeAutomatorGrpc.getDebugMethod(), - implementation = ::debug - )) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = NativeAutomatorGrpc.getMarkPatrolAppServiceReadyMethod(), - implementation = ::markPatrolAppServiceReady - )).build() - } -} diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/ContractsKt.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/ContractsKt.kt deleted file mode 100644 index 10cc09af0..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/ContractsKt.kt +++ /dev/null @@ -1,7 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: contracts.proto - -// Generated files should ignore deprecation warnings -@file:Suppress("DEPRECATION") -package pl.leancode.patrol.contracts; - diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/DarkModeRequestKt.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/DarkModeRequestKt.kt deleted file mode 100644 index 7dbc07e61..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/DarkModeRequestKt.kt +++ /dev/null @@ -1,50 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: contracts.proto - -// Generated files should ignore deprecation warnings -@file:Suppress("DEPRECATION") -package pl.leancode.patrol.contracts; - -@kotlin.jvm.JvmName("-initializedarkModeRequest") -public inline fun darkModeRequest(block: pl.leancode.patrol.contracts.DarkModeRequestKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.DarkModeRequest = - pl.leancode.patrol.contracts.DarkModeRequestKt.Dsl._create(pl.leancode.patrol.contracts.Contracts.DarkModeRequest.newBuilder()).apply { block() }._build() -/** - * Protobuf type `patrol.DarkModeRequest` - */ -public object DarkModeRequestKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - public class Dsl private constructor( - private val _builder: pl.leancode.patrol.contracts.Contracts.DarkModeRequest.Builder - ) { - public companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: pl.leancode.patrol.contracts.Contracts.DarkModeRequest.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): pl.leancode.patrol.contracts.Contracts.DarkModeRequest = _builder.build() - - /** - * `string appId = 1;` - */ - public var appId: kotlin.String - @JvmName("getAppId") - get() = _builder.getAppId() - @JvmName("setAppId") - set(value) { - _builder.setAppId(value) - } - /** - * `string appId = 1;` - */ - public fun clearAppId() { - _builder.clearAppId() - } - } -} -public inline fun pl.leancode.patrol.contracts.Contracts.DarkModeRequest.copy(block: pl.leancode.patrol.contracts.DarkModeRequestKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.DarkModeRequest = - pl.leancode.patrol.contracts.DarkModeRequestKt.Dsl._create(this.toBuilder()).apply { block() }._build() - diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/DartTestCaseKt.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/DartTestCaseKt.kt deleted file mode 100644 index d9213b71c..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/DartTestCaseKt.kt +++ /dev/null @@ -1,50 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: contracts.proto - -// Generated files should ignore deprecation warnings -@file:Suppress("DEPRECATION") -package pl.leancode.patrol.contracts; - -@kotlin.jvm.JvmName("-initializedartTestCase") -public inline fun dartTestCase(block: pl.leancode.patrol.contracts.DartTestCaseKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.DartTestCase = - pl.leancode.patrol.contracts.DartTestCaseKt.Dsl._create(pl.leancode.patrol.contracts.Contracts.DartTestCase.newBuilder()).apply { block() }._build() -/** - * Protobuf type `patrol.DartTestCase` - */ -public object DartTestCaseKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - public class Dsl private constructor( - private val _builder: pl.leancode.patrol.contracts.Contracts.DartTestCase.Builder - ) { - public companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: pl.leancode.patrol.contracts.Contracts.DartTestCase.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): pl.leancode.patrol.contracts.Contracts.DartTestCase = _builder.build() - - /** - * `string name = 1;` - */ - public var name: kotlin.String - @JvmName("getName") - get() = _builder.getName() - @JvmName("setName") - set(value) { - _builder.setName(value) - } - /** - * `string name = 1;` - */ - public fun clearName() { - _builder.clearName() - } - } -} -public inline fun pl.leancode.patrol.contracts.Contracts.DartTestCase.copy(block: pl.leancode.patrol.contracts.DartTestCaseKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.DartTestCase = - pl.leancode.patrol.contracts.DartTestCaseKt.Dsl._create(this.toBuilder()).apply { block() }._build() - diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/DartTestGroupKt.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/DartTestGroupKt.kt deleted file mode 100644 index 2bf1e489c..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/DartTestGroupKt.kt +++ /dev/null @@ -1,192 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: contracts.proto - -// Generated files should ignore deprecation warnings -@file:Suppress("DEPRECATION") -package pl.leancode.patrol.contracts; - -@kotlin.jvm.JvmName("-initializedartTestGroup") -public inline fun dartTestGroup(block: pl.leancode.patrol.contracts.DartTestGroupKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.DartTestGroup = - pl.leancode.patrol.contracts.DartTestGroupKt.Dsl._create(pl.leancode.patrol.contracts.Contracts.DartTestGroup.newBuilder()).apply { block() }._build() -/** - * Protobuf type `patrol.DartTestGroup` - */ -public object DartTestGroupKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - public class Dsl private constructor( - private val _builder: pl.leancode.patrol.contracts.Contracts.DartTestGroup.Builder - ) { - public companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: pl.leancode.patrol.contracts.Contracts.DartTestGroup.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): pl.leancode.patrol.contracts.Contracts.DartTestGroup = _builder.build() - - /** - * `string name = 1;` - */ - public var name: kotlin.String - @JvmName("getName") - get() = _builder.getName() - @JvmName("setName") - set(value) { - _builder.setName(value) - } - /** - * `string name = 1;` - */ - public fun clearName() { - _builder.clearName() - } - - /** - * An uninstantiable, behaviorless type to represent the field in - * generics. - */ - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - public class TestsProxy private constructor() : com.google.protobuf.kotlin.DslProxy() - /** - * `repeated .patrol.DartTestCase tests = 2;` - */ - public val tests: com.google.protobuf.kotlin.DslList - @kotlin.jvm.JvmSynthetic - get() = com.google.protobuf.kotlin.DslList( - _builder.getTestsList() - ) - /** - * `repeated .patrol.DartTestCase tests = 2;` - * @param value The tests to add. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("addTests") - public fun com.google.protobuf.kotlin.DslList.add(value: pl.leancode.patrol.contracts.Contracts.DartTestCase) { - _builder.addTests(value) - } - /** - * `repeated .patrol.DartTestCase tests = 2;` - * @param value The tests to add. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("plusAssignTests") - @Suppress("NOTHING_TO_INLINE") - public inline operator fun com.google.protobuf.kotlin.DslList.plusAssign(value: pl.leancode.patrol.contracts.Contracts.DartTestCase) { - add(value) - } - /** - * `repeated .patrol.DartTestCase tests = 2;` - * @param values The tests to add. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("addAllTests") - public fun com.google.protobuf.kotlin.DslList.addAll(values: kotlin.collections.Iterable) { - _builder.addAllTests(values) - } - /** - * `repeated .patrol.DartTestCase tests = 2;` - * @param values The tests to add. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("plusAssignAllTests") - @Suppress("NOTHING_TO_INLINE") - public inline operator fun com.google.protobuf.kotlin.DslList.plusAssign(values: kotlin.collections.Iterable) { - addAll(values) - } - /** - * `repeated .patrol.DartTestCase tests = 2;` - * @param index The index to set the value at. - * @param value The tests to set. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("setTests") - public operator fun com.google.protobuf.kotlin.DslList.set(index: kotlin.Int, value: pl.leancode.patrol.contracts.Contracts.DartTestCase) { - _builder.setTests(index, value) - } - /** - * `repeated .patrol.DartTestCase tests = 2;` - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("clearTests") - public fun com.google.protobuf.kotlin.DslList.clear() { - _builder.clearTests() - } - - /** - * An uninstantiable, behaviorless type to represent the field in - * generics. - */ - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - public class GroupsProxy private constructor() : com.google.protobuf.kotlin.DslProxy() - /** - * `repeated .patrol.DartTestGroup groups = 3;` - */ - public val groups: com.google.protobuf.kotlin.DslList - @kotlin.jvm.JvmSynthetic - get() = com.google.protobuf.kotlin.DslList( - _builder.getGroupsList() - ) - /** - * `repeated .patrol.DartTestGroup groups = 3;` - * @param value The groups to add. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("addGroups") - public fun com.google.protobuf.kotlin.DslList.add(value: pl.leancode.patrol.contracts.Contracts.DartTestGroup) { - _builder.addGroups(value) - } - /** - * `repeated .patrol.DartTestGroup groups = 3;` - * @param value The groups to add. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("plusAssignGroups") - @Suppress("NOTHING_TO_INLINE") - public inline operator fun com.google.protobuf.kotlin.DslList.plusAssign(value: pl.leancode.patrol.contracts.Contracts.DartTestGroup) { - add(value) - } - /** - * `repeated .patrol.DartTestGroup groups = 3;` - * @param values The groups to add. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("addAllGroups") - public fun com.google.protobuf.kotlin.DslList.addAll(values: kotlin.collections.Iterable) { - _builder.addAllGroups(values) - } - /** - * `repeated .patrol.DartTestGroup groups = 3;` - * @param values The groups to add. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("plusAssignAllGroups") - @Suppress("NOTHING_TO_INLINE") - public inline operator fun com.google.protobuf.kotlin.DslList.plusAssign(values: kotlin.collections.Iterable) { - addAll(values) - } - /** - * `repeated .patrol.DartTestGroup groups = 3;` - * @param index The index to set the value at. - * @param value The groups to set. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("setGroups") - public operator fun com.google.protobuf.kotlin.DslList.set(index: kotlin.Int, value: pl.leancode.patrol.contracts.Contracts.DartTestGroup) { - _builder.setGroups(index, value) - } - /** - * `repeated .patrol.DartTestGroup groups = 3;` - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("clearGroups") - public fun com.google.protobuf.kotlin.DslList.clear() { - _builder.clearGroups() - } - } -} -public inline fun pl.leancode.patrol.contracts.Contracts.DartTestGroup.copy(block: pl.leancode.patrol.contracts.DartTestGroupKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.DartTestGroup = - pl.leancode.patrol.contracts.DartTestGroupKt.Dsl._create(this.toBuilder()).apply { block() }._build() - diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/EmptyKt.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/EmptyKt.kt deleted file mode 100644 index c32da0a83..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/EmptyKt.kt +++ /dev/null @@ -1,41 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: contracts.proto - -// Generated files should ignore deprecation warnings -@file:Suppress("DEPRECATION") -package pl.leancode.patrol.contracts; - -@kotlin.jvm.JvmName("-initializeempty") -public inline fun empty(block: pl.leancode.patrol.contracts.EmptyKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.Empty = - pl.leancode.patrol.contracts.EmptyKt.Dsl._create(pl.leancode.patrol.contracts.Contracts.Empty.newBuilder()).apply { block() }._build() -/** - * ``` - * We're defining our own Empty instead of using google.protobuf.Empty because - * the Dart plugin can't easily generate it. - * - * See: - * * https://github.com/google/protobuf.dart/issues/170 - * ``` - * - * Protobuf type `patrol.Empty` - */ -public object EmptyKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - public class Dsl private constructor( - private val _builder: pl.leancode.patrol.contracts.Contracts.Empty.Builder - ) { - public companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: pl.leancode.patrol.contracts.Contracts.Empty.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): pl.leancode.patrol.contracts.Contracts.Empty = _builder.build() - } -} -public inline fun pl.leancode.patrol.contracts.Contracts.Empty.copy(block: pl.leancode.patrol.contracts.EmptyKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.Empty = - pl.leancode.patrol.contracts.EmptyKt.Dsl._create(this.toBuilder()).apply { block() }._build() - diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/EnterTextRequestKt.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/EnterTextRequestKt.kt deleted file mode 100644 index 2832d7dc1..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/EnterTextRequestKt.kt +++ /dev/null @@ -1,142 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: contracts.proto - -// Generated files should ignore deprecation warnings -@file:Suppress("DEPRECATION") -package pl.leancode.patrol.contracts; - -@kotlin.jvm.JvmName("-initializeenterTextRequest") -public inline fun enterTextRequest(block: pl.leancode.patrol.contracts.EnterTextRequestKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.EnterTextRequest = - pl.leancode.patrol.contracts.EnterTextRequestKt.Dsl._create(pl.leancode.patrol.contracts.Contracts.EnterTextRequest.newBuilder()).apply { block() }._build() -/** - * Protobuf type `patrol.EnterTextRequest` - */ -public object EnterTextRequestKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - public class Dsl private constructor( - private val _builder: pl.leancode.patrol.contracts.Contracts.EnterTextRequest.Builder - ) { - public companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: pl.leancode.patrol.contracts.Contracts.EnterTextRequest.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): pl.leancode.patrol.contracts.Contracts.EnterTextRequest = _builder.build() - - /** - * `string data = 1;` - */ - public var data: kotlin.String - @JvmName("getData") - get() = _builder.getData() - @JvmName("setData") - set(value) { - _builder.setData(value) - } - /** - * `string data = 1;` - */ - public fun clearData() { - _builder.clearData() - } - - /** - * `string appId = 2;` - */ - public var appId: kotlin.String - @JvmName("getAppId") - get() = _builder.getAppId() - @JvmName("setAppId") - set(value) { - _builder.setAppId(value) - } - /** - * `string appId = 2;` - */ - public fun clearAppId() { - _builder.clearAppId() - } - - /** - * uint32 index = 3; - */ - public var index: kotlin.Int - @JvmName("getIndex") - get() = _builder.getIndex() - @JvmName("setIndex") - set(value) { - _builder.setIndex(value) - } - /** - * `uint32 index = 3;` - */ - public fun clearIndex() { - _builder.clearIndex() - } - /** - * `uint32 index = 3;` - * @return Whether the index field is set. - */ - public fun hasIndex(): kotlin.Boolean { - return _builder.hasIndex() - } - - /** - * `.patrol.Selector selector = 4;` - */ - public var selector: pl.leancode.patrol.contracts.Contracts.Selector - @JvmName("getSelector") - get() = _builder.getSelector() - @JvmName("setSelector") - set(value) { - _builder.setSelector(value) - } - /** - * `.patrol.Selector selector = 4;` - */ - public fun clearSelector() { - _builder.clearSelector() - } - /** - * `.patrol.Selector selector = 4;` - * @return Whether the selector field is set. - */ - public fun hasSelector(): kotlin.Boolean { - return _builder.hasSelector() - } - - /** - * bool showKeyboard = 5; - */ - public var showKeyboard: kotlin.Boolean - @JvmName("getShowKeyboard") - get() = _builder.getShowKeyboard() - @JvmName("setShowKeyboard") - set(value) { - _builder.setShowKeyboard(value) - } - /** - * `bool showKeyboard = 5;` - */ - public fun clearShowKeyboard() { - _builder.clearShowKeyboard() - } - public val findByCase: pl.leancode.patrol.contracts.Contracts.EnterTextRequest.FindByCase - @JvmName("getFindByCase") - get() = _builder.getFindByCase() - - public fun clearFindBy() { - _builder.clearFindBy() - } - } -} -public inline fun pl.leancode.patrol.contracts.Contracts.EnterTextRequest.copy(block: pl.leancode.patrol.contracts.EnterTextRequestKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.EnterTextRequest = - pl.leancode.patrol.contracts.EnterTextRequestKt.Dsl._create(this.toBuilder()).apply { block() }._build() - -public val pl.leancode.patrol.contracts.Contracts.EnterTextRequestOrBuilder.selectorOrNull: pl.leancode.patrol.contracts.Contracts.Selector? - get() = if (hasSelector()) getSelector() else null - diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/GetNativeViewsRequestKt.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/GetNativeViewsRequestKt.kt deleted file mode 100644 index d3afacc60..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/GetNativeViewsRequestKt.kt +++ /dev/null @@ -1,77 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: contracts.proto - -// Generated files should ignore deprecation warnings -@file:Suppress("DEPRECATION") -package pl.leancode.patrol.contracts; - -@kotlin.jvm.JvmName("-initializegetNativeViewsRequest") -public inline fun getNativeViewsRequest(block: pl.leancode.patrol.contracts.GetNativeViewsRequestKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest = - pl.leancode.patrol.contracts.GetNativeViewsRequestKt.Dsl._create(pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest.newBuilder()).apply { block() }._build() -/** - * Protobuf type `patrol.GetNativeViewsRequest` - */ -public object GetNativeViewsRequestKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - public class Dsl private constructor( - private val _builder: pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest.Builder - ) { - public companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest = _builder.build() - - /** - * `.patrol.Selector selector = 1;` - */ - public var selector: pl.leancode.patrol.contracts.Contracts.Selector - @JvmName("getSelector") - get() = _builder.getSelector() - @JvmName("setSelector") - set(value) { - _builder.setSelector(value) - } - /** - * `.patrol.Selector selector = 1;` - */ - public fun clearSelector() { - _builder.clearSelector() - } - /** - * `.patrol.Selector selector = 1;` - * @return Whether the selector field is set. - */ - public fun hasSelector(): kotlin.Boolean { - return _builder.hasSelector() - } - - /** - * `string appId = 2;` - */ - public var appId: kotlin.String - @JvmName("getAppId") - get() = _builder.getAppId() - @JvmName("setAppId") - set(value) { - _builder.setAppId(value) - } - /** - * `string appId = 2;` - */ - public fun clearAppId() { - _builder.clearAppId() - } - } -} -public inline fun pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest.copy(block: pl.leancode.patrol.contracts.GetNativeViewsRequestKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest = - pl.leancode.patrol.contracts.GetNativeViewsRequestKt.Dsl._create(this.toBuilder()).apply { block() }._build() - -public val pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequestOrBuilder.selectorOrNull: pl.leancode.patrol.contracts.Contracts.Selector? - get() = if (hasSelector()) getSelector() else null - diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/GetNativeViewsResponseKt.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/GetNativeViewsResponseKt.kt deleted file mode 100644 index 541907f43..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/GetNativeViewsResponseKt.kt +++ /dev/null @@ -1,104 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: contracts.proto - -// Generated files should ignore deprecation warnings -@file:Suppress("DEPRECATION") -package pl.leancode.patrol.contracts; - -@kotlin.jvm.JvmName("-initializegetNativeViewsResponse") -public inline fun getNativeViewsResponse(block: pl.leancode.patrol.contracts.GetNativeViewsResponseKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.GetNativeViewsResponse = - pl.leancode.patrol.contracts.GetNativeViewsResponseKt.Dsl._create(pl.leancode.patrol.contracts.Contracts.GetNativeViewsResponse.newBuilder()).apply { block() }._build() -/** - * Protobuf type `patrol.GetNativeViewsResponse` - */ -public object GetNativeViewsResponseKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - public class Dsl private constructor( - private val _builder: pl.leancode.patrol.contracts.Contracts.GetNativeViewsResponse.Builder - ) { - public companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: pl.leancode.patrol.contracts.Contracts.GetNativeViewsResponse.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): pl.leancode.patrol.contracts.Contracts.GetNativeViewsResponse = _builder.build() - - /** - * An uninstantiable, behaviorless type to represent the field in - * generics. - */ - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - public class NativeViewsProxy private constructor() : com.google.protobuf.kotlin.DslProxy() - /** - * `repeated .patrol.NativeView nativeViews = 2;` - */ - public val nativeViews: com.google.protobuf.kotlin.DslList - @kotlin.jvm.JvmSynthetic - get() = com.google.protobuf.kotlin.DslList( - _builder.getNativeViewsList() - ) - /** - * `repeated .patrol.NativeView nativeViews = 2;` - * @param value The nativeViews to add. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("addNativeViews") - public fun com.google.protobuf.kotlin.DslList.add(value: pl.leancode.patrol.contracts.Contracts.NativeView) { - _builder.addNativeViews(value) - } - /** - * `repeated .patrol.NativeView nativeViews = 2;` - * @param value The nativeViews to add. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("plusAssignNativeViews") - @Suppress("NOTHING_TO_INLINE") - public inline operator fun com.google.protobuf.kotlin.DslList.plusAssign(value: pl.leancode.patrol.contracts.Contracts.NativeView) { - add(value) - } - /** - * `repeated .patrol.NativeView nativeViews = 2;` - * @param values The nativeViews to add. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("addAllNativeViews") - public fun com.google.protobuf.kotlin.DslList.addAll(values: kotlin.collections.Iterable) { - _builder.addAllNativeViews(values) - } - /** - * `repeated .patrol.NativeView nativeViews = 2;` - * @param values The nativeViews to add. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("plusAssignAllNativeViews") - @Suppress("NOTHING_TO_INLINE") - public inline operator fun com.google.protobuf.kotlin.DslList.plusAssign(values: kotlin.collections.Iterable) { - addAll(values) - } - /** - * `repeated .patrol.NativeView nativeViews = 2;` - * @param index The index to set the value at. - * @param value The nativeViews to set. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("setNativeViews") - public operator fun com.google.protobuf.kotlin.DslList.set(index: kotlin.Int, value: pl.leancode.patrol.contracts.Contracts.NativeView) { - _builder.setNativeViews(index, value) - } - /** - * `repeated .patrol.NativeView nativeViews = 2;` - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("clearNativeViews") - public fun com.google.protobuf.kotlin.DslList.clear() { - _builder.clearNativeViews() - } - } -} -public inline fun pl.leancode.patrol.contracts.Contracts.GetNativeViewsResponse.copy(block: pl.leancode.patrol.contracts.GetNativeViewsResponseKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.GetNativeViewsResponse = - pl.leancode.patrol.contracts.GetNativeViewsResponseKt.Dsl._create(this.toBuilder()).apply { block() }._build() - diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/GetNotificationsRequestKt.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/GetNotificationsRequestKt.kt deleted file mode 100644 index 59cc82208..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/GetNotificationsRequestKt.kt +++ /dev/null @@ -1,33 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: contracts.proto - -// Generated files should ignore deprecation warnings -@file:Suppress("DEPRECATION") -package pl.leancode.patrol.contracts; - -@kotlin.jvm.JvmName("-initializegetNotificationsRequest") -public inline fun getNotificationsRequest(block: pl.leancode.patrol.contracts.GetNotificationsRequestKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest = - pl.leancode.patrol.contracts.GetNotificationsRequestKt.Dsl._create(pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest.newBuilder()).apply { block() }._build() -/** - * Protobuf type `patrol.GetNotificationsRequest` - */ -public object GetNotificationsRequestKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - public class Dsl private constructor( - private val _builder: pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest.Builder - ) { - public companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest = _builder.build() - } -} -public inline fun pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest.copy(block: pl.leancode.patrol.contracts.GetNotificationsRequestKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest = - pl.leancode.patrol.contracts.GetNotificationsRequestKt.Dsl._create(this.toBuilder()).apply { block() }._build() - diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/GetNotificationsResponseKt.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/GetNotificationsResponseKt.kt deleted file mode 100644 index 0283e2ca9..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/GetNotificationsResponseKt.kt +++ /dev/null @@ -1,104 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: contracts.proto - -// Generated files should ignore deprecation warnings -@file:Suppress("DEPRECATION") -package pl.leancode.patrol.contracts; - -@kotlin.jvm.JvmName("-initializegetNotificationsResponse") -public inline fun getNotificationsResponse(block: pl.leancode.patrol.contracts.GetNotificationsResponseKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.GetNotificationsResponse = - pl.leancode.patrol.contracts.GetNotificationsResponseKt.Dsl._create(pl.leancode.patrol.contracts.Contracts.GetNotificationsResponse.newBuilder()).apply { block() }._build() -/** - * Protobuf type `patrol.GetNotificationsResponse` - */ -public object GetNotificationsResponseKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - public class Dsl private constructor( - private val _builder: pl.leancode.patrol.contracts.Contracts.GetNotificationsResponse.Builder - ) { - public companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: pl.leancode.patrol.contracts.Contracts.GetNotificationsResponse.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): pl.leancode.patrol.contracts.Contracts.GetNotificationsResponse = _builder.build() - - /** - * An uninstantiable, behaviorless type to represent the field in - * generics. - */ - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - public class NotificationsProxy private constructor() : com.google.protobuf.kotlin.DslProxy() - /** - * `repeated .patrol.Notification notifications = 2;` - */ - public val notifications: com.google.protobuf.kotlin.DslList - @kotlin.jvm.JvmSynthetic - get() = com.google.protobuf.kotlin.DslList( - _builder.getNotificationsList() - ) - /** - * `repeated .patrol.Notification notifications = 2;` - * @param value The notifications to add. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("addNotifications") - public fun com.google.protobuf.kotlin.DslList.add(value: pl.leancode.patrol.contracts.Contracts.Notification) { - _builder.addNotifications(value) - } - /** - * `repeated .patrol.Notification notifications = 2;` - * @param value The notifications to add. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("plusAssignNotifications") - @Suppress("NOTHING_TO_INLINE") - public inline operator fun com.google.protobuf.kotlin.DslList.plusAssign(value: pl.leancode.patrol.contracts.Contracts.Notification) { - add(value) - } - /** - * `repeated .patrol.Notification notifications = 2;` - * @param values The notifications to add. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("addAllNotifications") - public fun com.google.protobuf.kotlin.DslList.addAll(values: kotlin.collections.Iterable) { - _builder.addAllNotifications(values) - } - /** - * `repeated .patrol.Notification notifications = 2;` - * @param values The notifications to add. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("plusAssignAllNotifications") - @Suppress("NOTHING_TO_INLINE") - public inline operator fun com.google.protobuf.kotlin.DslList.plusAssign(values: kotlin.collections.Iterable) { - addAll(values) - } - /** - * `repeated .patrol.Notification notifications = 2;` - * @param index The index to set the value at. - * @param value The notifications to set. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("setNotifications") - public operator fun com.google.protobuf.kotlin.DslList.set(index: kotlin.Int, value: pl.leancode.patrol.contracts.Contracts.Notification) { - _builder.setNotifications(index, value) - } - /** - * `repeated .patrol.Notification notifications = 2;` - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("clearNotifications") - public fun com.google.protobuf.kotlin.DslList.clear() { - _builder.clearNotifications() - } - } -} -public inline fun pl.leancode.patrol.contracts.Contracts.GetNotificationsResponse.copy(block: pl.leancode.patrol.contracts.GetNotificationsResponseKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.GetNotificationsResponse = - pl.leancode.patrol.contracts.GetNotificationsResponseKt.Dsl._create(this.toBuilder()).apply { block() }._build() - diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/HandlePermissionRequestKt.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/HandlePermissionRequestKt.kt deleted file mode 100644 index da7b66092..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/HandlePermissionRequestKt.kt +++ /dev/null @@ -1,57 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: contracts.proto - -// Generated files should ignore deprecation warnings -@file:Suppress("DEPRECATION") -package pl.leancode.patrol.contracts; - -@kotlin.jvm.JvmName("-initializehandlePermissionRequest") -public inline fun handlePermissionRequest(block: pl.leancode.patrol.contracts.HandlePermissionRequestKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest = - pl.leancode.patrol.contracts.HandlePermissionRequestKt.Dsl._create(pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest.newBuilder()).apply { block() }._build() -/** - * Protobuf type `patrol.HandlePermissionRequest` - */ -public object HandlePermissionRequestKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - public class Dsl private constructor( - private val _builder: pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest.Builder - ) { - public companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest = _builder.build() - - /** - * `.patrol.HandlePermissionRequest.Code code = 1;` - */ - public var code: pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest.Code - @JvmName("getCode") - get() = _builder.getCode() - @JvmName("setCode") - set(value) { - _builder.setCode(value) - } - public var codeValue: kotlin.Int - @JvmName("getCodeValue") - get() = _builder.getCodeValue() - @JvmName("setCodeValue") - set(value) { - _builder.setCodeValue(value) - } - /** - * `.patrol.HandlePermissionRequest.Code code = 1;` - */ - public fun clearCode() { - _builder.clearCode() - } - } -} -public inline fun pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest.copy(block: pl.leancode.patrol.contracts.HandlePermissionRequestKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest = - pl.leancode.patrol.contracts.HandlePermissionRequestKt.Dsl._create(this.toBuilder()).apply { block() }._build() - diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/ListDartTestsResponseKt.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/ListDartTestsResponseKt.kt deleted file mode 100644 index b40a14ecc..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/ListDartTestsResponseKt.kt +++ /dev/null @@ -1,60 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: contracts.proto - -// Generated files should ignore deprecation warnings -@file:Suppress("DEPRECATION") -package pl.leancode.patrol.contracts; - -@kotlin.jvm.JvmName("-initializelistDartTestsResponse") -public inline fun listDartTestsResponse(block: pl.leancode.patrol.contracts.ListDartTestsResponseKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.ListDartTestsResponse = - pl.leancode.patrol.contracts.ListDartTestsResponseKt.Dsl._create(pl.leancode.patrol.contracts.Contracts.ListDartTestsResponse.newBuilder()).apply { block() }._build() -/** - * Protobuf type `patrol.ListDartTestsResponse` - */ -public object ListDartTestsResponseKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - public class Dsl private constructor( - private val _builder: pl.leancode.patrol.contracts.Contracts.ListDartTestsResponse.Builder - ) { - public companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: pl.leancode.patrol.contracts.Contracts.ListDartTestsResponse.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): pl.leancode.patrol.contracts.Contracts.ListDartTestsResponse = _builder.build() - - /** - * `.patrol.DartTestGroup group = 1;` - */ - public var group: pl.leancode.patrol.contracts.Contracts.DartTestGroup - @JvmName("getGroup") - get() = _builder.getGroup() - @JvmName("setGroup") - set(value) { - _builder.setGroup(value) - } - /** - * `.patrol.DartTestGroup group = 1;` - */ - public fun clearGroup() { - _builder.clearGroup() - } - /** - * `.patrol.DartTestGroup group = 1;` - * @return Whether the group field is set. - */ - public fun hasGroup(): kotlin.Boolean { - return _builder.hasGroup() - } - } -} -public inline fun pl.leancode.patrol.contracts.Contracts.ListDartTestsResponse.copy(block: pl.leancode.patrol.contracts.ListDartTestsResponseKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.ListDartTestsResponse = - pl.leancode.patrol.contracts.ListDartTestsResponseKt.Dsl._create(this.toBuilder()).apply { block() }._build() - -public val pl.leancode.patrol.contracts.Contracts.ListDartTestsResponseOrBuilder.groupOrNull: pl.leancode.patrol.contracts.Contracts.DartTestGroup? - get() = if (hasGroup()) getGroup() else null - diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/NativeAutomatorGrpc.java b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/NativeAutomatorGrpc.java deleted file mode 100644 index 0c299eb82..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/NativeAutomatorGrpc.java +++ /dev/null @@ -1,2732 +0,0 @@ -package pl.leancode.patrol.contracts; - -import static io.grpc.MethodDescriptor.generateFullMethodName; - -/** - */ -@javax.annotation.Generated( - value = "by gRPC proto compiler (version 1.49.1)", - comments = "Source: contracts.proto") -@io.grpc.stub.annotations.GrpcGenerated -public final class NativeAutomatorGrpc { - - private NativeAutomatorGrpc() {} - - public static final String SERVICE_NAME = "patrol.NativeAutomator"; - - // Static method descriptors that strictly reflect the proto. - private static volatile io.grpc.MethodDescriptor getInitializeMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "initialize", - requestType = pl.leancode.patrol.contracts.Contracts.Empty.class, - responseType = pl.leancode.patrol.contracts.Contracts.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getInitializeMethod() { - io.grpc.MethodDescriptor getInitializeMethod; - if ((getInitializeMethod = NativeAutomatorGrpc.getInitializeMethod) == null) { - synchronized (NativeAutomatorGrpc.class) { - if ((getInitializeMethod = NativeAutomatorGrpc.getInitializeMethod) == null) { - NativeAutomatorGrpc.getInitializeMethod = getInitializeMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "initialize")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .build(); - } - } - } - return getInitializeMethod; - } - - private static volatile io.grpc.MethodDescriptor getConfigureMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "configure", - requestType = pl.leancode.patrol.contracts.Contracts.ConfigureRequest.class, - responseType = pl.leancode.patrol.contracts.Contracts.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getConfigureMethod() { - io.grpc.MethodDescriptor getConfigureMethod; - if ((getConfigureMethod = NativeAutomatorGrpc.getConfigureMethod) == null) { - synchronized (NativeAutomatorGrpc.class) { - if ((getConfigureMethod = NativeAutomatorGrpc.getConfigureMethod) == null) { - NativeAutomatorGrpc.getConfigureMethod = getConfigureMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "configure")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.ConfigureRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .build(); - } - } - } - return getConfigureMethod; - } - - private static volatile io.grpc.MethodDescriptor getPressHomeMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "pressHome", - requestType = pl.leancode.patrol.contracts.Contracts.Empty.class, - responseType = pl.leancode.patrol.contracts.Contracts.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getPressHomeMethod() { - io.grpc.MethodDescriptor getPressHomeMethod; - if ((getPressHomeMethod = NativeAutomatorGrpc.getPressHomeMethod) == null) { - synchronized (NativeAutomatorGrpc.class) { - if ((getPressHomeMethod = NativeAutomatorGrpc.getPressHomeMethod) == null) { - NativeAutomatorGrpc.getPressHomeMethod = getPressHomeMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "pressHome")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .build(); - } - } - } - return getPressHomeMethod; - } - - private static volatile io.grpc.MethodDescriptor getPressBackMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "pressBack", - requestType = pl.leancode.patrol.contracts.Contracts.Empty.class, - responseType = pl.leancode.patrol.contracts.Contracts.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getPressBackMethod() { - io.grpc.MethodDescriptor getPressBackMethod; - if ((getPressBackMethod = NativeAutomatorGrpc.getPressBackMethod) == null) { - synchronized (NativeAutomatorGrpc.class) { - if ((getPressBackMethod = NativeAutomatorGrpc.getPressBackMethod) == null) { - NativeAutomatorGrpc.getPressBackMethod = getPressBackMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "pressBack")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .build(); - } - } - } - return getPressBackMethod; - } - - private static volatile io.grpc.MethodDescriptor getPressRecentAppsMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "pressRecentApps", - requestType = pl.leancode.patrol.contracts.Contracts.Empty.class, - responseType = pl.leancode.patrol.contracts.Contracts.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getPressRecentAppsMethod() { - io.grpc.MethodDescriptor getPressRecentAppsMethod; - if ((getPressRecentAppsMethod = NativeAutomatorGrpc.getPressRecentAppsMethod) == null) { - synchronized (NativeAutomatorGrpc.class) { - if ((getPressRecentAppsMethod = NativeAutomatorGrpc.getPressRecentAppsMethod) == null) { - NativeAutomatorGrpc.getPressRecentAppsMethod = getPressRecentAppsMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "pressRecentApps")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .build(); - } - } - } - return getPressRecentAppsMethod; - } - - private static volatile io.grpc.MethodDescriptor getDoublePressRecentAppsMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "doublePressRecentApps", - requestType = pl.leancode.patrol.contracts.Contracts.Empty.class, - responseType = pl.leancode.patrol.contracts.Contracts.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getDoublePressRecentAppsMethod() { - io.grpc.MethodDescriptor getDoublePressRecentAppsMethod; - if ((getDoublePressRecentAppsMethod = NativeAutomatorGrpc.getDoublePressRecentAppsMethod) == null) { - synchronized (NativeAutomatorGrpc.class) { - if ((getDoublePressRecentAppsMethod = NativeAutomatorGrpc.getDoublePressRecentAppsMethod) == null) { - NativeAutomatorGrpc.getDoublePressRecentAppsMethod = getDoublePressRecentAppsMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "doublePressRecentApps")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .build(); - } - } - } - return getDoublePressRecentAppsMethod; - } - - private static volatile io.grpc.MethodDescriptor getOpenAppMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "openApp", - requestType = pl.leancode.patrol.contracts.Contracts.OpenAppRequest.class, - responseType = pl.leancode.patrol.contracts.Contracts.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getOpenAppMethod() { - io.grpc.MethodDescriptor getOpenAppMethod; - if ((getOpenAppMethod = NativeAutomatorGrpc.getOpenAppMethod) == null) { - synchronized (NativeAutomatorGrpc.class) { - if ((getOpenAppMethod = NativeAutomatorGrpc.getOpenAppMethod) == null) { - NativeAutomatorGrpc.getOpenAppMethod = getOpenAppMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "openApp")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.OpenAppRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .build(); - } - } - } - return getOpenAppMethod; - } - - private static volatile io.grpc.MethodDescriptor getOpenQuickSettingsMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "openQuickSettings", - requestType = pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest.class, - responseType = pl.leancode.patrol.contracts.Contracts.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getOpenQuickSettingsMethod() { - io.grpc.MethodDescriptor getOpenQuickSettingsMethod; - if ((getOpenQuickSettingsMethod = NativeAutomatorGrpc.getOpenQuickSettingsMethod) == null) { - synchronized (NativeAutomatorGrpc.class) { - if ((getOpenQuickSettingsMethod = NativeAutomatorGrpc.getOpenQuickSettingsMethod) == null) { - NativeAutomatorGrpc.getOpenQuickSettingsMethod = getOpenQuickSettingsMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "openQuickSettings")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .build(); - } - } - } - return getOpenQuickSettingsMethod; - } - - private static volatile io.grpc.MethodDescriptor getGetNativeViewsMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "getNativeViews", - requestType = pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest.class, - responseType = pl.leancode.patrol.contracts.Contracts.GetNativeViewsResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getGetNativeViewsMethod() { - io.grpc.MethodDescriptor getGetNativeViewsMethod; - if ((getGetNativeViewsMethod = NativeAutomatorGrpc.getGetNativeViewsMethod) == null) { - synchronized (NativeAutomatorGrpc.class) { - if ((getGetNativeViewsMethod = NativeAutomatorGrpc.getGetNativeViewsMethod) == null) { - NativeAutomatorGrpc.getGetNativeViewsMethod = getGetNativeViewsMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "getNativeViews")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.GetNativeViewsResponse.getDefaultInstance())) - .build(); - } - } - } - return getGetNativeViewsMethod; - } - - private static volatile io.grpc.MethodDescriptor getTapMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "tap", - requestType = pl.leancode.patrol.contracts.Contracts.TapRequest.class, - responseType = pl.leancode.patrol.contracts.Contracts.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getTapMethod() { - io.grpc.MethodDescriptor getTapMethod; - if ((getTapMethod = NativeAutomatorGrpc.getTapMethod) == null) { - synchronized (NativeAutomatorGrpc.class) { - if ((getTapMethod = NativeAutomatorGrpc.getTapMethod) == null) { - NativeAutomatorGrpc.getTapMethod = getTapMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "tap")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.TapRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .build(); - } - } - } - return getTapMethod; - } - - private static volatile io.grpc.MethodDescriptor getDoubleTapMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "doubleTap", - requestType = pl.leancode.patrol.contracts.Contracts.TapRequest.class, - responseType = pl.leancode.patrol.contracts.Contracts.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getDoubleTapMethod() { - io.grpc.MethodDescriptor getDoubleTapMethod; - if ((getDoubleTapMethod = NativeAutomatorGrpc.getDoubleTapMethod) == null) { - synchronized (NativeAutomatorGrpc.class) { - if ((getDoubleTapMethod = NativeAutomatorGrpc.getDoubleTapMethod) == null) { - NativeAutomatorGrpc.getDoubleTapMethod = getDoubleTapMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "doubleTap")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.TapRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .build(); - } - } - } - return getDoubleTapMethod; - } - - private static volatile io.grpc.MethodDescriptor getEnterTextMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "enterText", - requestType = pl.leancode.patrol.contracts.Contracts.EnterTextRequest.class, - responseType = pl.leancode.patrol.contracts.Contracts.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getEnterTextMethod() { - io.grpc.MethodDescriptor getEnterTextMethod; - if ((getEnterTextMethod = NativeAutomatorGrpc.getEnterTextMethod) == null) { - synchronized (NativeAutomatorGrpc.class) { - if ((getEnterTextMethod = NativeAutomatorGrpc.getEnterTextMethod) == null) { - NativeAutomatorGrpc.getEnterTextMethod = getEnterTextMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "enterText")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.EnterTextRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .build(); - } - } - } - return getEnterTextMethod; - } - - private static volatile io.grpc.MethodDescriptor getSwipeMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "swipe", - requestType = pl.leancode.patrol.contracts.Contracts.SwipeRequest.class, - responseType = pl.leancode.patrol.contracts.Contracts.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getSwipeMethod() { - io.grpc.MethodDescriptor getSwipeMethod; - if ((getSwipeMethod = NativeAutomatorGrpc.getSwipeMethod) == null) { - synchronized (NativeAutomatorGrpc.class) { - if ((getSwipeMethod = NativeAutomatorGrpc.getSwipeMethod) == null) { - NativeAutomatorGrpc.getSwipeMethod = getSwipeMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "swipe")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.SwipeRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .build(); - } - } - } - return getSwipeMethod; - } - - private static volatile io.grpc.MethodDescriptor getWaitUntilVisibleMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "waitUntilVisible", - requestType = pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest.class, - responseType = pl.leancode.patrol.contracts.Contracts.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getWaitUntilVisibleMethod() { - io.grpc.MethodDescriptor getWaitUntilVisibleMethod; - if ((getWaitUntilVisibleMethod = NativeAutomatorGrpc.getWaitUntilVisibleMethod) == null) { - synchronized (NativeAutomatorGrpc.class) { - if ((getWaitUntilVisibleMethod = NativeAutomatorGrpc.getWaitUntilVisibleMethod) == null) { - NativeAutomatorGrpc.getWaitUntilVisibleMethod = getWaitUntilVisibleMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "waitUntilVisible")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .build(); - } - } - } - return getWaitUntilVisibleMethod; - } - - private static volatile io.grpc.MethodDescriptor getEnableAirplaneModeMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "enableAirplaneMode", - requestType = pl.leancode.patrol.contracts.Contracts.Empty.class, - responseType = pl.leancode.patrol.contracts.Contracts.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getEnableAirplaneModeMethod() { - io.grpc.MethodDescriptor getEnableAirplaneModeMethod; - if ((getEnableAirplaneModeMethod = NativeAutomatorGrpc.getEnableAirplaneModeMethod) == null) { - synchronized (NativeAutomatorGrpc.class) { - if ((getEnableAirplaneModeMethod = NativeAutomatorGrpc.getEnableAirplaneModeMethod) == null) { - NativeAutomatorGrpc.getEnableAirplaneModeMethod = getEnableAirplaneModeMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "enableAirplaneMode")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .build(); - } - } - } - return getEnableAirplaneModeMethod; - } - - private static volatile io.grpc.MethodDescriptor getDisableAirplaneModeMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "disableAirplaneMode", - requestType = pl.leancode.patrol.contracts.Contracts.Empty.class, - responseType = pl.leancode.patrol.contracts.Contracts.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getDisableAirplaneModeMethod() { - io.grpc.MethodDescriptor getDisableAirplaneModeMethod; - if ((getDisableAirplaneModeMethod = NativeAutomatorGrpc.getDisableAirplaneModeMethod) == null) { - synchronized (NativeAutomatorGrpc.class) { - if ((getDisableAirplaneModeMethod = NativeAutomatorGrpc.getDisableAirplaneModeMethod) == null) { - NativeAutomatorGrpc.getDisableAirplaneModeMethod = getDisableAirplaneModeMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "disableAirplaneMode")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .build(); - } - } - } - return getDisableAirplaneModeMethod; - } - - private static volatile io.grpc.MethodDescriptor getEnableWiFiMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "enableWiFi", - requestType = pl.leancode.patrol.contracts.Contracts.Empty.class, - responseType = pl.leancode.patrol.contracts.Contracts.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getEnableWiFiMethod() { - io.grpc.MethodDescriptor getEnableWiFiMethod; - if ((getEnableWiFiMethod = NativeAutomatorGrpc.getEnableWiFiMethod) == null) { - synchronized (NativeAutomatorGrpc.class) { - if ((getEnableWiFiMethod = NativeAutomatorGrpc.getEnableWiFiMethod) == null) { - NativeAutomatorGrpc.getEnableWiFiMethod = getEnableWiFiMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "enableWiFi")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .build(); - } - } - } - return getEnableWiFiMethod; - } - - private static volatile io.grpc.MethodDescriptor getDisableWiFiMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "disableWiFi", - requestType = pl.leancode.patrol.contracts.Contracts.Empty.class, - responseType = pl.leancode.patrol.contracts.Contracts.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getDisableWiFiMethod() { - io.grpc.MethodDescriptor getDisableWiFiMethod; - if ((getDisableWiFiMethod = NativeAutomatorGrpc.getDisableWiFiMethod) == null) { - synchronized (NativeAutomatorGrpc.class) { - if ((getDisableWiFiMethod = NativeAutomatorGrpc.getDisableWiFiMethod) == null) { - NativeAutomatorGrpc.getDisableWiFiMethod = getDisableWiFiMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "disableWiFi")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .build(); - } - } - } - return getDisableWiFiMethod; - } - - private static volatile io.grpc.MethodDescriptor getEnableCellularMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "enableCellular", - requestType = pl.leancode.patrol.contracts.Contracts.Empty.class, - responseType = pl.leancode.patrol.contracts.Contracts.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getEnableCellularMethod() { - io.grpc.MethodDescriptor getEnableCellularMethod; - if ((getEnableCellularMethod = NativeAutomatorGrpc.getEnableCellularMethod) == null) { - synchronized (NativeAutomatorGrpc.class) { - if ((getEnableCellularMethod = NativeAutomatorGrpc.getEnableCellularMethod) == null) { - NativeAutomatorGrpc.getEnableCellularMethod = getEnableCellularMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "enableCellular")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .build(); - } - } - } - return getEnableCellularMethod; - } - - private static volatile io.grpc.MethodDescriptor getDisableCellularMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "disableCellular", - requestType = pl.leancode.patrol.contracts.Contracts.Empty.class, - responseType = pl.leancode.patrol.contracts.Contracts.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getDisableCellularMethod() { - io.grpc.MethodDescriptor getDisableCellularMethod; - if ((getDisableCellularMethod = NativeAutomatorGrpc.getDisableCellularMethod) == null) { - synchronized (NativeAutomatorGrpc.class) { - if ((getDisableCellularMethod = NativeAutomatorGrpc.getDisableCellularMethod) == null) { - NativeAutomatorGrpc.getDisableCellularMethod = getDisableCellularMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "disableCellular")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .build(); - } - } - } - return getDisableCellularMethod; - } - - private static volatile io.grpc.MethodDescriptor getEnableBluetoothMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "enableBluetooth", - requestType = pl.leancode.patrol.contracts.Contracts.Empty.class, - responseType = pl.leancode.patrol.contracts.Contracts.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getEnableBluetoothMethod() { - io.grpc.MethodDescriptor getEnableBluetoothMethod; - if ((getEnableBluetoothMethod = NativeAutomatorGrpc.getEnableBluetoothMethod) == null) { - synchronized (NativeAutomatorGrpc.class) { - if ((getEnableBluetoothMethod = NativeAutomatorGrpc.getEnableBluetoothMethod) == null) { - NativeAutomatorGrpc.getEnableBluetoothMethod = getEnableBluetoothMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "enableBluetooth")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .build(); - } - } - } - return getEnableBluetoothMethod; - } - - private static volatile io.grpc.MethodDescriptor getDisableBluetoothMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "disableBluetooth", - requestType = pl.leancode.patrol.contracts.Contracts.Empty.class, - responseType = pl.leancode.patrol.contracts.Contracts.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getDisableBluetoothMethod() { - io.grpc.MethodDescriptor getDisableBluetoothMethod; - if ((getDisableBluetoothMethod = NativeAutomatorGrpc.getDisableBluetoothMethod) == null) { - synchronized (NativeAutomatorGrpc.class) { - if ((getDisableBluetoothMethod = NativeAutomatorGrpc.getDisableBluetoothMethod) == null) { - NativeAutomatorGrpc.getDisableBluetoothMethod = getDisableBluetoothMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "disableBluetooth")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .build(); - } - } - } - return getDisableBluetoothMethod; - } - - private static volatile io.grpc.MethodDescriptor getEnableDarkModeMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "enableDarkMode", - requestType = pl.leancode.patrol.contracts.Contracts.DarkModeRequest.class, - responseType = pl.leancode.patrol.contracts.Contracts.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getEnableDarkModeMethod() { - io.grpc.MethodDescriptor getEnableDarkModeMethod; - if ((getEnableDarkModeMethod = NativeAutomatorGrpc.getEnableDarkModeMethod) == null) { - synchronized (NativeAutomatorGrpc.class) { - if ((getEnableDarkModeMethod = NativeAutomatorGrpc.getEnableDarkModeMethod) == null) { - NativeAutomatorGrpc.getEnableDarkModeMethod = getEnableDarkModeMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "enableDarkMode")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.DarkModeRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .build(); - } - } - } - return getEnableDarkModeMethod; - } - - private static volatile io.grpc.MethodDescriptor getDisableDarkModeMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "disableDarkMode", - requestType = pl.leancode.patrol.contracts.Contracts.DarkModeRequest.class, - responseType = pl.leancode.patrol.contracts.Contracts.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getDisableDarkModeMethod() { - io.grpc.MethodDescriptor getDisableDarkModeMethod; - if ((getDisableDarkModeMethod = NativeAutomatorGrpc.getDisableDarkModeMethod) == null) { - synchronized (NativeAutomatorGrpc.class) { - if ((getDisableDarkModeMethod = NativeAutomatorGrpc.getDisableDarkModeMethod) == null) { - NativeAutomatorGrpc.getDisableDarkModeMethod = getDisableDarkModeMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "disableDarkMode")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.DarkModeRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .build(); - } - } - } - return getDisableDarkModeMethod; - } - - private static volatile io.grpc.MethodDescriptor getOpenNotificationsMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "openNotifications", - requestType = pl.leancode.patrol.contracts.Contracts.Empty.class, - responseType = pl.leancode.patrol.contracts.Contracts.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getOpenNotificationsMethod() { - io.grpc.MethodDescriptor getOpenNotificationsMethod; - if ((getOpenNotificationsMethod = NativeAutomatorGrpc.getOpenNotificationsMethod) == null) { - synchronized (NativeAutomatorGrpc.class) { - if ((getOpenNotificationsMethod = NativeAutomatorGrpc.getOpenNotificationsMethod) == null) { - NativeAutomatorGrpc.getOpenNotificationsMethod = getOpenNotificationsMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "openNotifications")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .build(); - } - } - } - return getOpenNotificationsMethod; - } - - private static volatile io.grpc.MethodDescriptor getCloseNotificationsMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "closeNotifications", - requestType = pl.leancode.patrol.contracts.Contracts.Empty.class, - responseType = pl.leancode.patrol.contracts.Contracts.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getCloseNotificationsMethod() { - io.grpc.MethodDescriptor getCloseNotificationsMethod; - if ((getCloseNotificationsMethod = NativeAutomatorGrpc.getCloseNotificationsMethod) == null) { - synchronized (NativeAutomatorGrpc.class) { - if ((getCloseNotificationsMethod = NativeAutomatorGrpc.getCloseNotificationsMethod) == null) { - NativeAutomatorGrpc.getCloseNotificationsMethod = getCloseNotificationsMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "closeNotifications")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .build(); - } - } - } - return getCloseNotificationsMethod; - } - - private static volatile io.grpc.MethodDescriptor getCloseHeadsUpNotificationMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "closeHeadsUpNotification", - requestType = pl.leancode.patrol.contracts.Contracts.Empty.class, - responseType = pl.leancode.patrol.contracts.Contracts.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getCloseHeadsUpNotificationMethod() { - io.grpc.MethodDescriptor getCloseHeadsUpNotificationMethod; - if ((getCloseHeadsUpNotificationMethod = NativeAutomatorGrpc.getCloseHeadsUpNotificationMethod) == null) { - synchronized (NativeAutomatorGrpc.class) { - if ((getCloseHeadsUpNotificationMethod = NativeAutomatorGrpc.getCloseHeadsUpNotificationMethod) == null) { - NativeAutomatorGrpc.getCloseHeadsUpNotificationMethod = getCloseHeadsUpNotificationMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "closeHeadsUpNotification")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .build(); - } - } - } - return getCloseHeadsUpNotificationMethod; - } - - private static volatile io.grpc.MethodDescriptor getGetNotificationsMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "getNotifications", - requestType = pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest.class, - responseType = pl.leancode.patrol.contracts.Contracts.GetNotificationsResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getGetNotificationsMethod() { - io.grpc.MethodDescriptor getGetNotificationsMethod; - if ((getGetNotificationsMethod = NativeAutomatorGrpc.getGetNotificationsMethod) == null) { - synchronized (NativeAutomatorGrpc.class) { - if ((getGetNotificationsMethod = NativeAutomatorGrpc.getGetNotificationsMethod) == null) { - NativeAutomatorGrpc.getGetNotificationsMethod = getGetNotificationsMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "getNotifications")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.GetNotificationsResponse.getDefaultInstance())) - .build(); - } - } - } - return getGetNotificationsMethod; - } - - private static volatile io.grpc.MethodDescriptor getTapOnNotificationMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "tapOnNotification", - requestType = pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest.class, - responseType = pl.leancode.patrol.contracts.Contracts.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getTapOnNotificationMethod() { - io.grpc.MethodDescriptor getTapOnNotificationMethod; - if ((getTapOnNotificationMethod = NativeAutomatorGrpc.getTapOnNotificationMethod) == null) { - synchronized (NativeAutomatorGrpc.class) { - if ((getTapOnNotificationMethod = NativeAutomatorGrpc.getTapOnNotificationMethod) == null) { - NativeAutomatorGrpc.getTapOnNotificationMethod = getTapOnNotificationMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "tapOnNotification")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .build(); - } - } - } - return getTapOnNotificationMethod; - } - - private static volatile io.grpc.MethodDescriptor getIsPermissionDialogVisibleMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "isPermissionDialogVisible", - requestType = pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest.class, - responseType = pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getIsPermissionDialogVisibleMethod() { - io.grpc.MethodDescriptor getIsPermissionDialogVisibleMethod; - if ((getIsPermissionDialogVisibleMethod = NativeAutomatorGrpc.getIsPermissionDialogVisibleMethod) == null) { - synchronized (NativeAutomatorGrpc.class) { - if ((getIsPermissionDialogVisibleMethod = NativeAutomatorGrpc.getIsPermissionDialogVisibleMethod) == null) { - NativeAutomatorGrpc.getIsPermissionDialogVisibleMethod = getIsPermissionDialogVisibleMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "isPermissionDialogVisible")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleResponse.getDefaultInstance())) - .build(); - } - } - } - return getIsPermissionDialogVisibleMethod; - } - - private static volatile io.grpc.MethodDescriptor getHandlePermissionDialogMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "handlePermissionDialog", - requestType = pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest.class, - responseType = pl.leancode.patrol.contracts.Contracts.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getHandlePermissionDialogMethod() { - io.grpc.MethodDescriptor getHandlePermissionDialogMethod; - if ((getHandlePermissionDialogMethod = NativeAutomatorGrpc.getHandlePermissionDialogMethod) == null) { - synchronized (NativeAutomatorGrpc.class) { - if ((getHandlePermissionDialogMethod = NativeAutomatorGrpc.getHandlePermissionDialogMethod) == null) { - NativeAutomatorGrpc.getHandlePermissionDialogMethod = getHandlePermissionDialogMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "handlePermissionDialog")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .build(); - } - } - } - return getHandlePermissionDialogMethod; - } - - private static volatile io.grpc.MethodDescriptor getSetLocationAccuracyMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "setLocationAccuracy", - requestType = pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest.class, - responseType = pl.leancode.patrol.contracts.Contracts.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getSetLocationAccuracyMethod() { - io.grpc.MethodDescriptor getSetLocationAccuracyMethod; - if ((getSetLocationAccuracyMethod = NativeAutomatorGrpc.getSetLocationAccuracyMethod) == null) { - synchronized (NativeAutomatorGrpc.class) { - if ((getSetLocationAccuracyMethod = NativeAutomatorGrpc.getSetLocationAccuracyMethod) == null) { - NativeAutomatorGrpc.getSetLocationAccuracyMethod = getSetLocationAccuracyMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "setLocationAccuracy")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .build(); - } - } - } - return getSetLocationAccuracyMethod; - } - - private static volatile io.grpc.MethodDescriptor getDebugMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "debug", - requestType = pl.leancode.patrol.contracts.Contracts.Empty.class, - responseType = pl.leancode.patrol.contracts.Contracts.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getDebugMethod() { - io.grpc.MethodDescriptor getDebugMethod; - if ((getDebugMethod = NativeAutomatorGrpc.getDebugMethod) == null) { - synchronized (NativeAutomatorGrpc.class) { - if ((getDebugMethod = NativeAutomatorGrpc.getDebugMethod) == null) { - NativeAutomatorGrpc.getDebugMethod = getDebugMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "debug")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .build(); - } - } - } - return getDebugMethod; - } - - private static volatile io.grpc.MethodDescriptor getMarkPatrolAppServiceReadyMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "markPatrolAppServiceReady", - requestType = pl.leancode.patrol.contracts.Contracts.Empty.class, - responseType = pl.leancode.patrol.contracts.Contracts.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getMarkPatrolAppServiceReadyMethod() { - io.grpc.MethodDescriptor getMarkPatrolAppServiceReadyMethod; - if ((getMarkPatrolAppServiceReadyMethod = NativeAutomatorGrpc.getMarkPatrolAppServiceReadyMethod) == null) { - synchronized (NativeAutomatorGrpc.class) { - if ((getMarkPatrolAppServiceReadyMethod = NativeAutomatorGrpc.getMarkPatrolAppServiceReadyMethod) == null) { - NativeAutomatorGrpc.getMarkPatrolAppServiceReadyMethod = getMarkPatrolAppServiceReadyMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "markPatrolAppServiceReady")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .build(); - } - } - } - return getMarkPatrolAppServiceReadyMethod; - } - - /** - * Creates a new async stub that supports all call types for the service - */ - public static NativeAutomatorStub newStub(io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public NativeAutomatorStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new NativeAutomatorStub(channel, callOptions); - } - }; - return NativeAutomatorStub.newStub(factory, channel); - } - - /** - * Creates a new blocking-style stub that supports unary and streaming output calls on the service - */ - public static NativeAutomatorBlockingStub newBlockingStub( - io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public NativeAutomatorBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new NativeAutomatorBlockingStub(channel, callOptions); - } - }; - return NativeAutomatorBlockingStub.newStub(factory, channel); - } - - /** - * Creates a new ListenableFuture-style stub that supports unary calls on the service - */ - public static NativeAutomatorFutureStub newFutureStub( - io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public NativeAutomatorFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new NativeAutomatorFutureStub(channel, callOptions); - } - }; - return NativeAutomatorFutureStub.newStub(factory, channel); - } - - /** - */ - public static abstract class NativeAutomatorImplBase implements io.grpc.BindableService { - - /** - */ - public void initialize(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getInitializeMethod(), responseObserver); - } - - /** - */ - public void configure(pl.leancode.patrol.contracts.Contracts.ConfigureRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getConfigureMethod(), responseObserver); - } - - /** - *
-     * general
-     * 
- */ - public void pressHome(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getPressHomeMethod(), responseObserver); - } - - /** - */ - public void pressBack(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getPressBackMethod(), responseObserver); - } - - /** - */ - public void pressRecentApps(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getPressRecentAppsMethod(), responseObserver); - } - - /** - */ - public void doublePressRecentApps(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDoublePressRecentAppsMethod(), responseObserver); - } - - /** - */ - public void openApp(pl.leancode.patrol.contracts.Contracts.OpenAppRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getOpenAppMethod(), responseObserver); - } - - /** - */ - public void openQuickSettings(pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getOpenQuickSettingsMethod(), responseObserver); - } - - /** - *
-     * general UI interaction
-     * 
- */ - public void getNativeViews(pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetNativeViewsMethod(), responseObserver); - } - - /** - */ - public void tap(pl.leancode.patrol.contracts.Contracts.TapRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getTapMethod(), responseObserver); - } - - /** - */ - public void doubleTap(pl.leancode.patrol.contracts.Contracts.TapRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDoubleTapMethod(), responseObserver); - } - - /** - */ - public void enterText(pl.leancode.patrol.contracts.Contracts.EnterTextRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getEnterTextMethod(), responseObserver); - } - - /** - */ - public void swipe(pl.leancode.patrol.contracts.Contracts.SwipeRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getSwipeMethod(), responseObserver); - } - - /** - */ - public void waitUntilVisible(pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getWaitUntilVisibleMethod(), responseObserver); - } - - /** - *
-     * services
-     * 
- */ - public void enableAirplaneMode(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getEnableAirplaneModeMethod(), responseObserver); - } - - /** - */ - public void disableAirplaneMode(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDisableAirplaneModeMethod(), responseObserver); - } - - /** - */ - public void enableWiFi(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getEnableWiFiMethod(), responseObserver); - } - - /** - */ - public void disableWiFi(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDisableWiFiMethod(), responseObserver); - } - - /** - */ - public void enableCellular(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getEnableCellularMethod(), responseObserver); - } - - /** - */ - public void disableCellular(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDisableCellularMethod(), responseObserver); - } - - /** - */ - public void enableBluetooth(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getEnableBluetoothMethod(), responseObserver); - } - - /** - */ - public void disableBluetooth(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDisableBluetoothMethod(), responseObserver); - } - - /** - */ - public void enableDarkMode(pl.leancode.patrol.contracts.Contracts.DarkModeRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getEnableDarkModeMethod(), responseObserver); - } - - /** - */ - public void disableDarkMode(pl.leancode.patrol.contracts.Contracts.DarkModeRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDisableDarkModeMethod(), responseObserver); - } - - /** - *
-     * notifications
-     * 
- */ - public void openNotifications(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getOpenNotificationsMethod(), responseObserver); - } - - /** - */ - public void closeNotifications(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCloseNotificationsMethod(), responseObserver); - } - - /** - */ - public void closeHeadsUpNotification(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCloseHeadsUpNotificationMethod(), responseObserver); - } - - /** - */ - public void getNotifications(pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetNotificationsMethod(), responseObserver); - } - - /** - */ - public void tapOnNotification(pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getTapOnNotificationMethod(), responseObserver); - } - - /** - *
-     * permissions
-     * 
- */ - public void isPermissionDialogVisible(pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getIsPermissionDialogVisibleMethod(), responseObserver); - } - - /** - */ - public void handlePermissionDialog(pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getHandlePermissionDialogMethod(), responseObserver); - } - - /** - */ - public void setLocationAccuracy(pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getSetLocationAccuracyMethod(), responseObserver); - } - - /** - *
-     * other
-     * 
- */ - public void debug(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDebugMethod(), responseObserver); - } - - /** - *
-     * TODO(bartekpacia): Move this RPC into a new PatrolNativeTestService service because it doesn't fit here
-     * 
- */ - public void markPatrolAppServiceReady(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getMarkPatrolAppServiceReadyMethod(), responseObserver); - } - - @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getInitializeMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.Empty, - pl.leancode.patrol.contracts.Contracts.Empty>( - this, METHODID_INITIALIZE))) - .addMethod( - getConfigureMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.ConfigureRequest, - pl.leancode.patrol.contracts.Contracts.Empty>( - this, METHODID_CONFIGURE))) - .addMethod( - getPressHomeMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.Empty, - pl.leancode.patrol.contracts.Contracts.Empty>( - this, METHODID_PRESS_HOME))) - .addMethod( - getPressBackMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.Empty, - pl.leancode.patrol.contracts.Contracts.Empty>( - this, METHODID_PRESS_BACK))) - .addMethod( - getPressRecentAppsMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.Empty, - pl.leancode.patrol.contracts.Contracts.Empty>( - this, METHODID_PRESS_RECENT_APPS))) - .addMethod( - getDoublePressRecentAppsMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.Empty, - pl.leancode.patrol.contracts.Contracts.Empty>( - this, METHODID_DOUBLE_PRESS_RECENT_APPS))) - .addMethod( - getOpenAppMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.OpenAppRequest, - pl.leancode.patrol.contracts.Contracts.Empty>( - this, METHODID_OPEN_APP))) - .addMethod( - getOpenQuickSettingsMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest, - pl.leancode.patrol.contracts.Contracts.Empty>( - this, METHODID_OPEN_QUICK_SETTINGS))) - .addMethod( - getGetNativeViewsMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest, - pl.leancode.patrol.contracts.Contracts.GetNativeViewsResponse>( - this, METHODID_GET_NATIVE_VIEWS))) - .addMethod( - getTapMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.TapRequest, - pl.leancode.patrol.contracts.Contracts.Empty>( - this, METHODID_TAP))) - .addMethod( - getDoubleTapMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.TapRequest, - pl.leancode.patrol.contracts.Contracts.Empty>( - this, METHODID_DOUBLE_TAP))) - .addMethod( - getEnterTextMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.EnterTextRequest, - pl.leancode.patrol.contracts.Contracts.Empty>( - this, METHODID_ENTER_TEXT))) - .addMethod( - getSwipeMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.SwipeRequest, - pl.leancode.patrol.contracts.Contracts.Empty>( - this, METHODID_SWIPE))) - .addMethod( - getWaitUntilVisibleMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest, - pl.leancode.patrol.contracts.Contracts.Empty>( - this, METHODID_WAIT_UNTIL_VISIBLE))) - .addMethod( - getEnableAirplaneModeMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.Empty, - pl.leancode.patrol.contracts.Contracts.Empty>( - this, METHODID_ENABLE_AIRPLANE_MODE))) - .addMethod( - getDisableAirplaneModeMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.Empty, - pl.leancode.patrol.contracts.Contracts.Empty>( - this, METHODID_DISABLE_AIRPLANE_MODE))) - .addMethod( - getEnableWiFiMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.Empty, - pl.leancode.patrol.contracts.Contracts.Empty>( - this, METHODID_ENABLE_WI_FI))) - .addMethod( - getDisableWiFiMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.Empty, - pl.leancode.patrol.contracts.Contracts.Empty>( - this, METHODID_DISABLE_WI_FI))) - .addMethod( - getEnableCellularMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.Empty, - pl.leancode.patrol.contracts.Contracts.Empty>( - this, METHODID_ENABLE_CELLULAR))) - .addMethod( - getDisableCellularMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.Empty, - pl.leancode.patrol.contracts.Contracts.Empty>( - this, METHODID_DISABLE_CELLULAR))) - .addMethod( - getEnableBluetoothMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.Empty, - pl.leancode.patrol.contracts.Contracts.Empty>( - this, METHODID_ENABLE_BLUETOOTH))) - .addMethod( - getDisableBluetoothMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.Empty, - pl.leancode.patrol.contracts.Contracts.Empty>( - this, METHODID_DISABLE_BLUETOOTH))) - .addMethod( - getEnableDarkModeMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.DarkModeRequest, - pl.leancode.patrol.contracts.Contracts.Empty>( - this, METHODID_ENABLE_DARK_MODE))) - .addMethod( - getDisableDarkModeMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.DarkModeRequest, - pl.leancode.patrol.contracts.Contracts.Empty>( - this, METHODID_DISABLE_DARK_MODE))) - .addMethod( - getOpenNotificationsMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.Empty, - pl.leancode.patrol.contracts.Contracts.Empty>( - this, METHODID_OPEN_NOTIFICATIONS))) - .addMethod( - getCloseNotificationsMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.Empty, - pl.leancode.patrol.contracts.Contracts.Empty>( - this, METHODID_CLOSE_NOTIFICATIONS))) - .addMethod( - getCloseHeadsUpNotificationMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.Empty, - pl.leancode.patrol.contracts.Contracts.Empty>( - this, METHODID_CLOSE_HEADS_UP_NOTIFICATION))) - .addMethod( - getGetNotificationsMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest, - pl.leancode.patrol.contracts.Contracts.GetNotificationsResponse>( - this, METHODID_GET_NOTIFICATIONS))) - .addMethod( - getTapOnNotificationMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest, - pl.leancode.patrol.contracts.Contracts.Empty>( - this, METHODID_TAP_ON_NOTIFICATION))) - .addMethod( - getIsPermissionDialogVisibleMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest, - pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleResponse>( - this, METHODID_IS_PERMISSION_DIALOG_VISIBLE))) - .addMethod( - getHandlePermissionDialogMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest, - pl.leancode.patrol.contracts.Contracts.Empty>( - this, METHODID_HANDLE_PERMISSION_DIALOG))) - .addMethod( - getSetLocationAccuracyMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest, - pl.leancode.patrol.contracts.Contracts.Empty>( - this, METHODID_SET_LOCATION_ACCURACY))) - .addMethod( - getDebugMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.Empty, - pl.leancode.patrol.contracts.Contracts.Empty>( - this, METHODID_DEBUG))) - .addMethod( - getMarkPatrolAppServiceReadyMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.Empty, - pl.leancode.patrol.contracts.Contracts.Empty>( - this, METHODID_MARK_PATROL_APP_SERVICE_READY))) - .build(); - } - } - - /** - */ - public static final class NativeAutomatorStub extends io.grpc.stub.AbstractAsyncStub { - private NativeAutomatorStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected NativeAutomatorStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new NativeAutomatorStub(channel, callOptions); - } - - /** - */ - public void initialize(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getInitializeMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void configure(pl.leancode.patrol.contracts.Contracts.ConfigureRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getConfigureMethod(), getCallOptions()), request, responseObserver); - } - - /** - *
-     * general
-     * 
- */ - public void pressHome(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getPressHomeMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void pressBack(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getPressBackMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void pressRecentApps(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getPressRecentAppsMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void doublePressRecentApps(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getDoublePressRecentAppsMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void openApp(pl.leancode.patrol.contracts.Contracts.OpenAppRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getOpenAppMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void openQuickSettings(pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getOpenQuickSettingsMethod(), getCallOptions()), request, responseObserver); - } - - /** - *
-     * general UI interaction
-     * 
- */ - public void getNativeViews(pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getGetNativeViewsMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void tap(pl.leancode.patrol.contracts.Contracts.TapRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getTapMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void doubleTap(pl.leancode.patrol.contracts.Contracts.TapRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getDoubleTapMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void enterText(pl.leancode.patrol.contracts.Contracts.EnterTextRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getEnterTextMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void swipe(pl.leancode.patrol.contracts.Contracts.SwipeRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getSwipeMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void waitUntilVisible(pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getWaitUntilVisibleMethod(), getCallOptions()), request, responseObserver); - } - - /** - *
-     * services
-     * 
- */ - public void enableAirplaneMode(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getEnableAirplaneModeMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void disableAirplaneMode(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getDisableAirplaneModeMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void enableWiFi(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getEnableWiFiMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void disableWiFi(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getDisableWiFiMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void enableCellular(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getEnableCellularMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void disableCellular(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getDisableCellularMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void enableBluetooth(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getEnableBluetoothMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void disableBluetooth(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getDisableBluetoothMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void enableDarkMode(pl.leancode.patrol.contracts.Contracts.DarkModeRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getEnableDarkModeMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void disableDarkMode(pl.leancode.patrol.contracts.Contracts.DarkModeRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getDisableDarkModeMethod(), getCallOptions()), request, responseObserver); - } - - /** - *
-     * notifications
-     * 
- */ - public void openNotifications(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getOpenNotificationsMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void closeNotifications(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getCloseNotificationsMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void closeHeadsUpNotification(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getCloseHeadsUpNotificationMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void getNotifications(pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getGetNotificationsMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void tapOnNotification(pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getTapOnNotificationMethod(), getCallOptions()), request, responseObserver); - } - - /** - *
-     * permissions
-     * 
- */ - public void isPermissionDialogVisible(pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getIsPermissionDialogVisibleMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void handlePermissionDialog(pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getHandlePermissionDialogMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void setLocationAccuracy(pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getSetLocationAccuracyMethod(), getCallOptions()), request, responseObserver); - } - - /** - *
-     * other
-     * 
- */ - public void debug(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getDebugMethod(), getCallOptions()), request, responseObserver); - } - - /** - *
-     * TODO(bartekpacia): Move this RPC into a new PatrolNativeTestService service because it doesn't fit here
-     * 
- */ - public void markPatrolAppServiceReady(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getMarkPatrolAppServiceReadyMethod(), getCallOptions()), request, responseObserver); - } - } - - /** - */ - public static final class NativeAutomatorBlockingStub extends io.grpc.stub.AbstractBlockingStub { - private NativeAutomatorBlockingStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected NativeAutomatorBlockingStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new NativeAutomatorBlockingStub(channel, callOptions); - } - - /** - */ - public pl.leancode.patrol.contracts.Contracts.Empty initialize(pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getInitializeMethod(), getCallOptions(), request); - } - - /** - */ - public pl.leancode.patrol.contracts.Contracts.Empty configure(pl.leancode.patrol.contracts.Contracts.ConfigureRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getConfigureMethod(), getCallOptions(), request); - } - - /** - *
-     * general
-     * 
- */ - public pl.leancode.patrol.contracts.Contracts.Empty pressHome(pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getPressHomeMethod(), getCallOptions(), request); - } - - /** - */ - public pl.leancode.patrol.contracts.Contracts.Empty pressBack(pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getPressBackMethod(), getCallOptions(), request); - } - - /** - */ - public pl.leancode.patrol.contracts.Contracts.Empty pressRecentApps(pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getPressRecentAppsMethod(), getCallOptions(), request); - } - - /** - */ - public pl.leancode.patrol.contracts.Contracts.Empty doublePressRecentApps(pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getDoublePressRecentAppsMethod(), getCallOptions(), request); - } - - /** - */ - public pl.leancode.patrol.contracts.Contracts.Empty openApp(pl.leancode.patrol.contracts.Contracts.OpenAppRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getOpenAppMethod(), getCallOptions(), request); - } - - /** - */ - public pl.leancode.patrol.contracts.Contracts.Empty openQuickSettings(pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getOpenQuickSettingsMethod(), getCallOptions(), request); - } - - /** - *
-     * general UI interaction
-     * 
- */ - public pl.leancode.patrol.contracts.Contracts.GetNativeViewsResponse getNativeViews(pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getGetNativeViewsMethod(), getCallOptions(), request); - } - - /** - */ - public pl.leancode.patrol.contracts.Contracts.Empty tap(pl.leancode.patrol.contracts.Contracts.TapRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getTapMethod(), getCallOptions(), request); - } - - /** - */ - public pl.leancode.patrol.contracts.Contracts.Empty doubleTap(pl.leancode.patrol.contracts.Contracts.TapRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getDoubleTapMethod(), getCallOptions(), request); - } - - /** - */ - public pl.leancode.patrol.contracts.Contracts.Empty enterText(pl.leancode.patrol.contracts.Contracts.EnterTextRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getEnterTextMethod(), getCallOptions(), request); - } - - /** - */ - public pl.leancode.patrol.contracts.Contracts.Empty swipe(pl.leancode.patrol.contracts.Contracts.SwipeRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getSwipeMethod(), getCallOptions(), request); - } - - /** - */ - public pl.leancode.patrol.contracts.Contracts.Empty waitUntilVisible(pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getWaitUntilVisibleMethod(), getCallOptions(), request); - } - - /** - *
-     * services
-     * 
- */ - public pl.leancode.patrol.contracts.Contracts.Empty enableAirplaneMode(pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getEnableAirplaneModeMethod(), getCallOptions(), request); - } - - /** - */ - public pl.leancode.patrol.contracts.Contracts.Empty disableAirplaneMode(pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getDisableAirplaneModeMethod(), getCallOptions(), request); - } - - /** - */ - public pl.leancode.patrol.contracts.Contracts.Empty enableWiFi(pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getEnableWiFiMethod(), getCallOptions(), request); - } - - /** - */ - public pl.leancode.patrol.contracts.Contracts.Empty disableWiFi(pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getDisableWiFiMethod(), getCallOptions(), request); - } - - /** - */ - public pl.leancode.patrol.contracts.Contracts.Empty enableCellular(pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getEnableCellularMethod(), getCallOptions(), request); - } - - /** - */ - public pl.leancode.patrol.contracts.Contracts.Empty disableCellular(pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getDisableCellularMethod(), getCallOptions(), request); - } - - /** - */ - public pl.leancode.patrol.contracts.Contracts.Empty enableBluetooth(pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getEnableBluetoothMethod(), getCallOptions(), request); - } - - /** - */ - public pl.leancode.patrol.contracts.Contracts.Empty disableBluetooth(pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getDisableBluetoothMethod(), getCallOptions(), request); - } - - /** - */ - public pl.leancode.patrol.contracts.Contracts.Empty enableDarkMode(pl.leancode.patrol.contracts.Contracts.DarkModeRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getEnableDarkModeMethod(), getCallOptions(), request); - } - - /** - */ - public pl.leancode.patrol.contracts.Contracts.Empty disableDarkMode(pl.leancode.patrol.contracts.Contracts.DarkModeRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getDisableDarkModeMethod(), getCallOptions(), request); - } - - /** - *
-     * notifications
-     * 
- */ - public pl.leancode.patrol.contracts.Contracts.Empty openNotifications(pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getOpenNotificationsMethod(), getCallOptions(), request); - } - - /** - */ - public pl.leancode.patrol.contracts.Contracts.Empty closeNotifications(pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getCloseNotificationsMethod(), getCallOptions(), request); - } - - /** - */ - public pl.leancode.patrol.contracts.Contracts.Empty closeHeadsUpNotification(pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getCloseHeadsUpNotificationMethod(), getCallOptions(), request); - } - - /** - */ - public pl.leancode.patrol.contracts.Contracts.GetNotificationsResponse getNotifications(pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getGetNotificationsMethod(), getCallOptions(), request); - } - - /** - */ - public pl.leancode.patrol.contracts.Contracts.Empty tapOnNotification(pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getTapOnNotificationMethod(), getCallOptions(), request); - } - - /** - *
-     * permissions
-     * 
- */ - public pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleResponse isPermissionDialogVisible(pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getIsPermissionDialogVisibleMethod(), getCallOptions(), request); - } - - /** - */ - public pl.leancode.patrol.contracts.Contracts.Empty handlePermissionDialog(pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getHandlePermissionDialogMethod(), getCallOptions(), request); - } - - /** - */ - public pl.leancode.patrol.contracts.Contracts.Empty setLocationAccuracy(pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getSetLocationAccuracyMethod(), getCallOptions(), request); - } - - /** - *
-     * other
-     * 
- */ - public pl.leancode.patrol.contracts.Contracts.Empty debug(pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getDebugMethod(), getCallOptions(), request); - } - - /** - *
-     * TODO(bartekpacia): Move this RPC into a new PatrolNativeTestService service because it doesn't fit here
-     * 
- */ - public pl.leancode.patrol.contracts.Contracts.Empty markPatrolAppServiceReady(pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getMarkPatrolAppServiceReadyMethod(), getCallOptions(), request); - } - } - - /** - */ - public static final class NativeAutomatorFutureStub extends io.grpc.stub.AbstractFutureStub { - private NativeAutomatorFutureStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected NativeAutomatorFutureStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new NativeAutomatorFutureStub(channel, callOptions); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture initialize( - pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getInitializeMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture configure( - pl.leancode.patrol.contracts.Contracts.ConfigureRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getConfigureMethod(), getCallOptions()), request); - } - - /** - *
-     * general
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture pressHome( - pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getPressHomeMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture pressBack( - pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getPressBackMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture pressRecentApps( - pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getPressRecentAppsMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture doublePressRecentApps( - pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getDoublePressRecentAppsMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture openApp( - pl.leancode.patrol.contracts.Contracts.OpenAppRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getOpenAppMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture openQuickSettings( - pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getOpenQuickSettingsMethod(), getCallOptions()), request); - } - - /** - *
-     * general UI interaction
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture getNativeViews( - pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getGetNativeViewsMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture tap( - pl.leancode.patrol.contracts.Contracts.TapRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getTapMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture doubleTap( - pl.leancode.patrol.contracts.Contracts.TapRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getDoubleTapMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture enterText( - pl.leancode.patrol.contracts.Contracts.EnterTextRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getEnterTextMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture swipe( - pl.leancode.patrol.contracts.Contracts.SwipeRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getSwipeMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture waitUntilVisible( - pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getWaitUntilVisibleMethod(), getCallOptions()), request); - } - - /** - *
-     * services
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture enableAirplaneMode( - pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getEnableAirplaneModeMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture disableAirplaneMode( - pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getDisableAirplaneModeMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture enableWiFi( - pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getEnableWiFiMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture disableWiFi( - pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getDisableWiFiMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture enableCellular( - pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getEnableCellularMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture disableCellular( - pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getDisableCellularMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture enableBluetooth( - pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getEnableBluetoothMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture disableBluetooth( - pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getDisableBluetoothMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture enableDarkMode( - pl.leancode.patrol.contracts.Contracts.DarkModeRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getEnableDarkModeMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture disableDarkMode( - pl.leancode.patrol.contracts.Contracts.DarkModeRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getDisableDarkModeMethod(), getCallOptions()), request); - } - - /** - *
-     * notifications
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture openNotifications( - pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getOpenNotificationsMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture closeNotifications( - pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getCloseNotificationsMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture closeHeadsUpNotification( - pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getCloseHeadsUpNotificationMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture getNotifications( - pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getGetNotificationsMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture tapOnNotification( - pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getTapOnNotificationMethod(), getCallOptions()), request); - } - - /** - *
-     * permissions
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture isPermissionDialogVisible( - pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getIsPermissionDialogVisibleMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture handlePermissionDialog( - pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getHandlePermissionDialogMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture setLocationAccuracy( - pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getSetLocationAccuracyMethod(), getCallOptions()), request); - } - - /** - *
-     * other
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture debug( - pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getDebugMethod(), getCallOptions()), request); - } - - /** - *
-     * TODO(bartekpacia): Move this RPC into a new PatrolNativeTestService service because it doesn't fit here
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture markPatrolAppServiceReady( - pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getMarkPatrolAppServiceReadyMethod(), getCallOptions()), request); - } - } - - private static final int METHODID_INITIALIZE = 0; - private static final int METHODID_CONFIGURE = 1; - private static final int METHODID_PRESS_HOME = 2; - private static final int METHODID_PRESS_BACK = 3; - private static final int METHODID_PRESS_RECENT_APPS = 4; - private static final int METHODID_DOUBLE_PRESS_RECENT_APPS = 5; - private static final int METHODID_OPEN_APP = 6; - private static final int METHODID_OPEN_QUICK_SETTINGS = 7; - private static final int METHODID_GET_NATIVE_VIEWS = 8; - private static final int METHODID_TAP = 9; - private static final int METHODID_DOUBLE_TAP = 10; - private static final int METHODID_ENTER_TEXT = 11; - private static final int METHODID_SWIPE = 12; - private static final int METHODID_WAIT_UNTIL_VISIBLE = 13; - private static final int METHODID_ENABLE_AIRPLANE_MODE = 14; - private static final int METHODID_DISABLE_AIRPLANE_MODE = 15; - private static final int METHODID_ENABLE_WI_FI = 16; - private static final int METHODID_DISABLE_WI_FI = 17; - private static final int METHODID_ENABLE_CELLULAR = 18; - private static final int METHODID_DISABLE_CELLULAR = 19; - private static final int METHODID_ENABLE_BLUETOOTH = 20; - private static final int METHODID_DISABLE_BLUETOOTH = 21; - private static final int METHODID_ENABLE_DARK_MODE = 22; - private static final int METHODID_DISABLE_DARK_MODE = 23; - private static final int METHODID_OPEN_NOTIFICATIONS = 24; - private static final int METHODID_CLOSE_NOTIFICATIONS = 25; - private static final int METHODID_CLOSE_HEADS_UP_NOTIFICATION = 26; - private static final int METHODID_GET_NOTIFICATIONS = 27; - private static final int METHODID_TAP_ON_NOTIFICATION = 28; - private static final int METHODID_IS_PERMISSION_DIALOG_VISIBLE = 29; - private static final int METHODID_HANDLE_PERMISSION_DIALOG = 30; - private static final int METHODID_SET_LOCATION_ACCURACY = 31; - private static final int METHODID_DEBUG = 32; - private static final int METHODID_MARK_PATROL_APP_SERVICE_READY = 33; - - private static final class MethodHandlers implements - io.grpc.stub.ServerCalls.UnaryMethod, - io.grpc.stub.ServerCalls.ServerStreamingMethod, - io.grpc.stub.ServerCalls.ClientStreamingMethod, - io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final NativeAutomatorImplBase serviceImpl; - private final int methodId; - - MethodHandlers(NativeAutomatorImplBase serviceImpl, int methodId) { - this.serviceImpl = serviceImpl; - this.methodId = methodId; - } - - @java.lang.Override - @java.lang.SuppressWarnings("unchecked") - public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { - switch (methodId) { - case METHODID_INITIALIZE: - serviceImpl.initialize((pl.leancode.patrol.contracts.Contracts.Empty) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_CONFIGURE: - serviceImpl.configure((pl.leancode.patrol.contracts.Contracts.ConfigureRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_PRESS_HOME: - serviceImpl.pressHome((pl.leancode.patrol.contracts.Contracts.Empty) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_PRESS_BACK: - serviceImpl.pressBack((pl.leancode.patrol.contracts.Contracts.Empty) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_PRESS_RECENT_APPS: - serviceImpl.pressRecentApps((pl.leancode.patrol.contracts.Contracts.Empty) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_DOUBLE_PRESS_RECENT_APPS: - serviceImpl.doublePressRecentApps((pl.leancode.patrol.contracts.Contracts.Empty) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_OPEN_APP: - serviceImpl.openApp((pl.leancode.patrol.contracts.Contracts.OpenAppRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_OPEN_QUICK_SETTINGS: - serviceImpl.openQuickSettings((pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_GET_NATIVE_VIEWS: - serviceImpl.getNativeViews((pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_TAP: - serviceImpl.tap((pl.leancode.patrol.contracts.Contracts.TapRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_DOUBLE_TAP: - serviceImpl.doubleTap((pl.leancode.patrol.contracts.Contracts.TapRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_ENTER_TEXT: - serviceImpl.enterText((pl.leancode.patrol.contracts.Contracts.EnterTextRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_SWIPE: - serviceImpl.swipe((pl.leancode.patrol.contracts.Contracts.SwipeRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_WAIT_UNTIL_VISIBLE: - serviceImpl.waitUntilVisible((pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_ENABLE_AIRPLANE_MODE: - serviceImpl.enableAirplaneMode((pl.leancode.patrol.contracts.Contracts.Empty) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_DISABLE_AIRPLANE_MODE: - serviceImpl.disableAirplaneMode((pl.leancode.patrol.contracts.Contracts.Empty) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_ENABLE_WI_FI: - serviceImpl.enableWiFi((pl.leancode.patrol.contracts.Contracts.Empty) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_DISABLE_WI_FI: - serviceImpl.disableWiFi((pl.leancode.patrol.contracts.Contracts.Empty) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_ENABLE_CELLULAR: - serviceImpl.enableCellular((pl.leancode.patrol.contracts.Contracts.Empty) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_DISABLE_CELLULAR: - serviceImpl.disableCellular((pl.leancode.patrol.contracts.Contracts.Empty) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_ENABLE_BLUETOOTH: - serviceImpl.enableBluetooth((pl.leancode.patrol.contracts.Contracts.Empty) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_DISABLE_BLUETOOTH: - serviceImpl.disableBluetooth((pl.leancode.patrol.contracts.Contracts.Empty) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_ENABLE_DARK_MODE: - serviceImpl.enableDarkMode((pl.leancode.patrol.contracts.Contracts.DarkModeRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_DISABLE_DARK_MODE: - serviceImpl.disableDarkMode((pl.leancode.patrol.contracts.Contracts.DarkModeRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_OPEN_NOTIFICATIONS: - serviceImpl.openNotifications((pl.leancode.patrol.contracts.Contracts.Empty) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_CLOSE_NOTIFICATIONS: - serviceImpl.closeNotifications((pl.leancode.patrol.contracts.Contracts.Empty) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_CLOSE_HEADS_UP_NOTIFICATION: - serviceImpl.closeHeadsUpNotification((pl.leancode.patrol.contracts.Contracts.Empty) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_GET_NOTIFICATIONS: - serviceImpl.getNotifications((pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_TAP_ON_NOTIFICATION: - serviceImpl.tapOnNotification((pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_IS_PERMISSION_DIALOG_VISIBLE: - serviceImpl.isPermissionDialogVisible((pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_HANDLE_PERMISSION_DIALOG: - serviceImpl.handlePermissionDialog((pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_SET_LOCATION_ACCURACY: - serviceImpl.setLocationAccuracy((pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_DEBUG: - serviceImpl.debug((pl.leancode.patrol.contracts.Contracts.Empty) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_MARK_PATROL_APP_SERVICE_READY: - serviceImpl.markPatrolAppServiceReady((pl.leancode.patrol.contracts.Contracts.Empty) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - default: - throw new AssertionError(); - } - } - - @java.lang.Override - @java.lang.SuppressWarnings("unchecked") - public io.grpc.stub.StreamObserver invoke( - io.grpc.stub.StreamObserver responseObserver) { - switch (methodId) { - default: - throw new AssertionError(); - } - } - } - - private static volatile io.grpc.ServiceDescriptor serviceDescriptor; - - public static io.grpc.ServiceDescriptor getServiceDescriptor() { - io.grpc.ServiceDescriptor result = serviceDescriptor; - if (result == null) { - synchronized (NativeAutomatorGrpc.class) { - result = serviceDescriptor; - if (result == null) { - serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) - .addMethod(getInitializeMethod()) - .addMethod(getConfigureMethod()) - .addMethod(getPressHomeMethod()) - .addMethod(getPressBackMethod()) - .addMethod(getPressRecentAppsMethod()) - .addMethod(getDoublePressRecentAppsMethod()) - .addMethod(getOpenAppMethod()) - .addMethod(getOpenQuickSettingsMethod()) - .addMethod(getGetNativeViewsMethod()) - .addMethod(getTapMethod()) - .addMethod(getDoubleTapMethod()) - .addMethod(getEnterTextMethod()) - .addMethod(getSwipeMethod()) - .addMethod(getWaitUntilVisibleMethod()) - .addMethod(getEnableAirplaneModeMethod()) - .addMethod(getDisableAirplaneModeMethod()) - .addMethod(getEnableWiFiMethod()) - .addMethod(getDisableWiFiMethod()) - .addMethod(getEnableCellularMethod()) - .addMethod(getDisableCellularMethod()) - .addMethod(getEnableBluetoothMethod()) - .addMethod(getDisableBluetoothMethod()) - .addMethod(getEnableDarkModeMethod()) - .addMethod(getDisableDarkModeMethod()) - .addMethod(getOpenNotificationsMethod()) - .addMethod(getCloseNotificationsMethod()) - .addMethod(getCloseHeadsUpNotificationMethod()) - .addMethod(getGetNotificationsMethod()) - .addMethod(getTapOnNotificationMethod()) - .addMethod(getIsPermissionDialogVisibleMethod()) - .addMethod(getHandlePermissionDialogMethod()) - .addMethod(getSetLocationAccuracyMethod()) - .addMethod(getDebugMethod()) - .addMethod(getMarkPatrolAppServiceReadyMethod()) - .build(); - } - } - } - return result; - } -} diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/NativeViewKt.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/NativeViewKt.kt deleted file mode 100644 index 504ff26c8..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/NativeViewKt.kt +++ /dev/null @@ -1,246 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: contracts.proto - -// Generated files should ignore deprecation warnings -@file:Suppress("DEPRECATION") -package pl.leancode.patrol.contracts; - -@kotlin.jvm.JvmName("-initializenativeView") -public inline fun nativeView(block: pl.leancode.patrol.contracts.NativeViewKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.NativeView = - pl.leancode.patrol.contracts.NativeViewKt.Dsl._create(pl.leancode.patrol.contracts.Contracts.NativeView.newBuilder()).apply { block() }._build() -/** - * ``` - * Represents a native UI control. - * - * On Android, this is `android.view.View`. - * ``` - * - * Protobuf type `patrol.NativeView` - */ -public object NativeViewKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - public class Dsl private constructor( - private val _builder: pl.leancode.patrol.contracts.Contracts.NativeView.Builder - ) { - public companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: pl.leancode.patrol.contracts.Contracts.NativeView.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): pl.leancode.patrol.contracts.Contracts.NativeView = _builder.build() - - /** - * `string className = 1;` - */ - public var className: kotlin.String - @JvmName("getClassName") - get() = _builder.getClassName() - @JvmName("setClassName") - set(value) { - _builder.setClassName(value) - } - /** - * `string className = 1;` - */ - public fun clearClassName() { - _builder.clearClassName() - } - - /** - * `string text = 2;` - */ - public var text: kotlin.String - @JvmName("getText") - get() = _builder.getText() - @JvmName("setText") - set(value) { - _builder.setText(value) - } - /** - * `string text = 2;` - */ - public fun clearText() { - _builder.clearText() - } - - /** - * `string contentDescription = 3;` - */ - public var contentDescription: kotlin.String - @JvmName("getContentDescription") - get() = _builder.getContentDescription() - @JvmName("setContentDescription") - set(value) { - _builder.setContentDescription(value) - } - /** - * `string contentDescription = 3;` - */ - public fun clearContentDescription() { - _builder.clearContentDescription() - } - - /** - * bool focused = 4; - */ - public var focused: kotlin.Boolean - @JvmName("getFocused") - get() = _builder.getFocused() - @JvmName("setFocused") - set(value) { - _builder.setFocused(value) - } - /** - * `bool focused = 4;` - */ - public fun clearFocused() { - _builder.clearFocused() - } - - /** - * bool enabled = 5; - */ - public var enabled: kotlin.Boolean - @JvmName("getEnabled") - get() = _builder.getEnabled() - @JvmName("setEnabled") - set(value) { - _builder.setEnabled(value) - } - /** - * `bool enabled = 5;` - */ - public fun clearEnabled() { - _builder.clearEnabled() - } - - /** - * int32 childCount = 6; - */ - public var childCount: kotlin.Int - @JvmName("getChildCount") - get() = _builder.getChildCount() - @JvmName("setChildCount") - set(value) { - _builder.setChildCount(value) - } - /** - * `int32 childCount = 6;` - */ - public fun clearChildCount() { - _builder.clearChildCount() - } - - /** - * `string resourceName = 7;` - */ - public var resourceName: kotlin.String - @JvmName("getResourceName") - get() = _builder.getResourceName() - @JvmName("setResourceName") - set(value) { - _builder.setResourceName(value) - } - /** - * `string resourceName = 7;` - */ - public fun clearResourceName() { - _builder.clearResourceName() - } - - /** - * `string applicationPackage = 8;` - */ - public var applicationPackage: kotlin.String - @JvmName("getApplicationPackage") - get() = _builder.getApplicationPackage() - @JvmName("setApplicationPackage") - set(value) { - _builder.setApplicationPackage(value) - } - /** - * `string applicationPackage = 8;` - */ - public fun clearApplicationPackage() { - _builder.clearApplicationPackage() - } - - /** - * An uninstantiable, behaviorless type to represent the field in - * generics. - */ - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - public class ChildrenProxy private constructor() : com.google.protobuf.kotlin.DslProxy() - /** - * `repeated .patrol.NativeView children = 9;` - */ - public val children: com.google.protobuf.kotlin.DslList - @kotlin.jvm.JvmSynthetic - get() = com.google.protobuf.kotlin.DslList( - _builder.getChildrenList() - ) - /** - * `repeated .patrol.NativeView children = 9;` - * @param value The children to add. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("addChildren") - public fun com.google.protobuf.kotlin.DslList.add(value: pl.leancode.patrol.contracts.Contracts.NativeView) { - _builder.addChildren(value) - } - /** - * `repeated .patrol.NativeView children = 9;` - * @param value The children to add. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("plusAssignChildren") - @Suppress("NOTHING_TO_INLINE") - public inline operator fun com.google.protobuf.kotlin.DslList.plusAssign(value: pl.leancode.patrol.contracts.Contracts.NativeView) { - add(value) - } - /** - * `repeated .patrol.NativeView children = 9;` - * @param values The children to add. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("addAllChildren") - public fun com.google.protobuf.kotlin.DslList.addAll(values: kotlin.collections.Iterable) { - _builder.addAllChildren(values) - } - /** - * `repeated .patrol.NativeView children = 9;` - * @param values The children to add. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("plusAssignAllChildren") - @Suppress("NOTHING_TO_INLINE") - public inline operator fun com.google.protobuf.kotlin.DslList.plusAssign(values: kotlin.collections.Iterable) { - addAll(values) - } - /** - * `repeated .patrol.NativeView children = 9;` - * @param index The index to set the value at. - * @param value The children to set. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("setChildren") - public operator fun com.google.protobuf.kotlin.DslList.set(index: kotlin.Int, value: pl.leancode.patrol.contracts.Contracts.NativeView) { - _builder.setChildren(index, value) - } - /** - * `repeated .patrol.NativeView children = 9;` - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("clearChildren") - public fun com.google.protobuf.kotlin.DslList.clear() { - _builder.clearChildren() - } - } -} -public inline fun pl.leancode.patrol.contracts.Contracts.NativeView.copy(block: pl.leancode.patrol.contracts.NativeViewKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.NativeView = - pl.leancode.patrol.contracts.NativeViewKt.Dsl._create(this.toBuilder()).apply { block() }._build() - diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/NotificationKt.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/NotificationKt.kt deleted file mode 100644 index 774b6401f..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/NotificationKt.kt +++ /dev/null @@ -1,112 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: contracts.proto - -// Generated files should ignore deprecation warnings -@file:Suppress("DEPRECATION") -package pl.leancode.patrol.contracts; - -@kotlin.jvm.JvmName("-initializenotification") -public inline fun notification(block: pl.leancode.patrol.contracts.NotificationKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.Notification = - pl.leancode.patrol.contracts.NotificationKt.Dsl._create(pl.leancode.patrol.contracts.Contracts.Notification.newBuilder()).apply { block() }._build() -/** - * ``` - * Represents a notification visible in the notification shade. - * ``` - * - * Protobuf type `patrol.Notification` - */ -public object NotificationKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - public class Dsl private constructor( - private val _builder: pl.leancode.patrol.contracts.Contracts.Notification.Builder - ) { - public companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: pl.leancode.patrol.contracts.Contracts.Notification.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): pl.leancode.patrol.contracts.Contracts.Notification = _builder.build() - - /** - * `optional string appName = 1;` - */ - public var appName: kotlin.String - @JvmName("getAppName") - get() = _builder.getAppName() - @JvmName("setAppName") - set(value) { - _builder.setAppName(value) - } - /** - * `optional string appName = 1;` - */ - public fun clearAppName() { - _builder.clearAppName() - } - /** - * `optional string appName = 1;` - * @return Whether the appName field is set. - */ - public fun hasAppName(): kotlin.Boolean { - return _builder.hasAppName() - } - - /** - * `string title = 2;` - */ - public var title: kotlin.String - @JvmName("getTitle") - get() = _builder.getTitle() - @JvmName("setTitle") - set(value) { - _builder.setTitle(value) - } - /** - * `string title = 2;` - */ - public fun clearTitle() { - _builder.clearTitle() - } - - /** - * `string content = 3;` - */ - public var content: kotlin.String - @JvmName("getContent") - get() = _builder.getContent() - @JvmName("setContent") - set(value) { - _builder.setContent(value) - } - /** - * `string content = 3;` - */ - public fun clearContent() { - _builder.clearContent() - } - - /** - * `string raw = 4;` - */ - public var raw: kotlin.String - @JvmName("getRaw") - get() = _builder.getRaw() - @JvmName("setRaw") - set(value) { - _builder.setRaw(value) - } - /** - * `string raw = 4;` - */ - public fun clearRaw() { - _builder.clearRaw() - } - } -} -public inline fun pl.leancode.patrol.contracts.Contracts.Notification.copy(block: pl.leancode.patrol.contracts.NotificationKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.Notification = - pl.leancode.patrol.contracts.NotificationKt.Dsl._create(this.toBuilder()).apply { block() }._build() - diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/OpenAppRequestKt.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/OpenAppRequestKt.kt deleted file mode 100644 index 07edbbe77..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/OpenAppRequestKt.kt +++ /dev/null @@ -1,50 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: contracts.proto - -// Generated files should ignore deprecation warnings -@file:Suppress("DEPRECATION") -package pl.leancode.patrol.contracts; - -@kotlin.jvm.JvmName("-initializeopenAppRequest") -public inline fun openAppRequest(block: pl.leancode.patrol.contracts.OpenAppRequestKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.OpenAppRequest = - pl.leancode.patrol.contracts.OpenAppRequestKt.Dsl._create(pl.leancode.patrol.contracts.Contracts.OpenAppRequest.newBuilder()).apply { block() }._build() -/** - * Protobuf type `patrol.OpenAppRequest` - */ -public object OpenAppRequestKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - public class Dsl private constructor( - private val _builder: pl.leancode.patrol.contracts.Contracts.OpenAppRequest.Builder - ) { - public companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: pl.leancode.patrol.contracts.Contracts.OpenAppRequest.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): pl.leancode.patrol.contracts.Contracts.OpenAppRequest = _builder.build() - - /** - * `string appId = 1;` - */ - public var appId: kotlin.String - @JvmName("getAppId") - get() = _builder.getAppId() - @JvmName("setAppId") - set(value) { - _builder.setAppId(value) - } - /** - * `string appId = 1;` - */ - public fun clearAppId() { - _builder.clearAppId() - } - } -} -public inline fun pl.leancode.patrol.contracts.Contracts.OpenAppRequest.copy(block: pl.leancode.patrol.contracts.OpenAppRequestKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.OpenAppRequest = - pl.leancode.patrol.contracts.OpenAppRequestKt.Dsl._create(this.toBuilder()).apply { block() }._build() - diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/OpenQuickSettingsRequestKt.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/OpenQuickSettingsRequestKt.kt deleted file mode 100644 index d53d15034..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/OpenQuickSettingsRequestKt.kt +++ /dev/null @@ -1,33 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: contracts.proto - -// Generated files should ignore deprecation warnings -@file:Suppress("DEPRECATION") -package pl.leancode.patrol.contracts; - -@kotlin.jvm.JvmName("-initializeopenQuickSettingsRequest") -public inline fun openQuickSettingsRequest(block: pl.leancode.patrol.contracts.OpenQuickSettingsRequestKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest = - pl.leancode.patrol.contracts.OpenQuickSettingsRequestKt.Dsl._create(pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest.newBuilder()).apply { block() }._build() -/** - * Protobuf type `patrol.OpenQuickSettingsRequest` - */ -public object OpenQuickSettingsRequestKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - public class Dsl private constructor( - private val _builder: pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest.Builder - ) { - public companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest = _builder.build() - } -} -public inline fun pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest.copy(block: pl.leancode.patrol.contracts.OpenQuickSettingsRequestKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest = - pl.leancode.patrol.contracts.OpenQuickSettingsRequestKt.Dsl._create(this.toBuilder()).apply { block() }._build() - diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/PatrolAppServiceGrpc.java b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/PatrolAppServiceGrpc.java deleted file mode 100644 index a9cfa643a..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/PatrolAppServiceGrpc.java +++ /dev/null @@ -1,312 +0,0 @@ -package pl.leancode.patrol.contracts; - -import static io.grpc.MethodDescriptor.generateFullMethodName; - -/** - */ -@javax.annotation.Generated( - value = "by gRPC proto compiler (version 1.49.1)", - comments = "Source: contracts.proto") -@io.grpc.stub.annotations.GrpcGenerated -public final class PatrolAppServiceGrpc { - - private PatrolAppServiceGrpc() {} - - public static final String SERVICE_NAME = "patrol.PatrolAppService"; - - // Static method descriptors that strictly reflect the proto. - private static volatile io.grpc.MethodDescriptor getListDartTestsMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "listDartTests", - requestType = pl.leancode.patrol.contracts.Contracts.Empty.class, - responseType = pl.leancode.patrol.contracts.Contracts.ListDartTestsResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getListDartTestsMethod() { - io.grpc.MethodDescriptor getListDartTestsMethod; - if ((getListDartTestsMethod = PatrolAppServiceGrpc.getListDartTestsMethod) == null) { - synchronized (PatrolAppServiceGrpc.class) { - if ((getListDartTestsMethod = PatrolAppServiceGrpc.getListDartTestsMethod) == null) { - PatrolAppServiceGrpc.getListDartTestsMethod = getListDartTestsMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "listDartTests")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.ListDartTestsResponse.getDefaultInstance())) - .build(); - } - } - } - return getListDartTestsMethod; - } - - private static volatile io.grpc.MethodDescriptor getRunDartTestMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "runDartTest", - requestType = pl.leancode.patrol.contracts.Contracts.RunDartTestRequest.class, - responseType = pl.leancode.patrol.contracts.Contracts.RunDartTestResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getRunDartTestMethod() { - io.grpc.MethodDescriptor getRunDartTestMethod; - if ((getRunDartTestMethod = PatrolAppServiceGrpc.getRunDartTestMethod) == null) { - synchronized (PatrolAppServiceGrpc.class) { - if ((getRunDartTestMethod = PatrolAppServiceGrpc.getRunDartTestMethod) == null) { - PatrolAppServiceGrpc.getRunDartTestMethod = getRunDartTestMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "runDartTest")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.RunDartTestRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.RunDartTestResponse.getDefaultInstance())) - .build(); - } - } - } - return getRunDartTestMethod; - } - - /** - * Creates a new async stub that supports all call types for the service - */ - public static PatrolAppServiceStub newStub(io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public PatrolAppServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new PatrolAppServiceStub(channel, callOptions); - } - }; - return PatrolAppServiceStub.newStub(factory, channel); - } - - /** - * Creates a new blocking-style stub that supports unary and streaming output calls on the service - */ - public static PatrolAppServiceBlockingStub newBlockingStub( - io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public PatrolAppServiceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new PatrolAppServiceBlockingStub(channel, callOptions); - } - }; - return PatrolAppServiceBlockingStub.newStub(factory, channel); - } - - /** - * Creates a new ListenableFuture-style stub that supports unary calls on the service - */ - public static PatrolAppServiceFutureStub newFutureStub( - io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public PatrolAppServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new PatrolAppServiceFutureStub(channel, callOptions); - } - }; - return PatrolAppServiceFutureStub.newStub(factory, channel); - } - - /** - */ - public static abstract class PatrolAppServiceImplBase implements io.grpc.BindableService { - - /** - */ - public void listDartTests(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListDartTestsMethod(), responseObserver); - } - - /** - */ - public void runDartTest(pl.leancode.patrol.contracts.Contracts.RunDartTestRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getRunDartTestMethod(), responseObserver); - } - - @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getListDartTestsMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.Empty, - pl.leancode.patrol.contracts.Contracts.ListDartTestsResponse>( - this, METHODID_LIST_DART_TESTS))) - .addMethod( - getRunDartTestMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.RunDartTestRequest, - pl.leancode.patrol.contracts.Contracts.RunDartTestResponse>( - this, METHODID_RUN_DART_TEST))) - .build(); - } - } - - /** - */ - public static final class PatrolAppServiceStub extends io.grpc.stub.AbstractAsyncStub { - private PatrolAppServiceStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected PatrolAppServiceStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new PatrolAppServiceStub(channel, callOptions); - } - - /** - */ - public void listDartTests(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getListDartTestsMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void runDartTest(pl.leancode.patrol.contracts.Contracts.RunDartTestRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getRunDartTestMethod(), getCallOptions()), request, responseObserver); - } - } - - /** - */ - public static final class PatrolAppServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub { - private PatrolAppServiceBlockingStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected PatrolAppServiceBlockingStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new PatrolAppServiceBlockingStub(channel, callOptions); - } - - /** - */ - public pl.leancode.patrol.contracts.Contracts.ListDartTestsResponse listDartTests(pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getListDartTestsMethod(), getCallOptions(), request); - } - - /** - */ - public pl.leancode.patrol.contracts.Contracts.RunDartTestResponse runDartTest(pl.leancode.patrol.contracts.Contracts.RunDartTestRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getRunDartTestMethod(), getCallOptions(), request); - } - } - - /** - */ - public static final class PatrolAppServiceFutureStub extends io.grpc.stub.AbstractFutureStub { - private PatrolAppServiceFutureStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected PatrolAppServiceFutureStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new PatrolAppServiceFutureStub(channel, callOptions); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture listDartTests( - pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getListDartTestsMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture runDartTest( - pl.leancode.patrol.contracts.Contracts.RunDartTestRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getRunDartTestMethod(), getCallOptions()), request); - } - } - - private static final int METHODID_LIST_DART_TESTS = 0; - private static final int METHODID_RUN_DART_TEST = 1; - - private static final class MethodHandlers implements - io.grpc.stub.ServerCalls.UnaryMethod, - io.grpc.stub.ServerCalls.ServerStreamingMethod, - io.grpc.stub.ServerCalls.ClientStreamingMethod, - io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final PatrolAppServiceImplBase serviceImpl; - private final int methodId; - - MethodHandlers(PatrolAppServiceImplBase serviceImpl, int methodId) { - this.serviceImpl = serviceImpl; - this.methodId = methodId; - } - - @java.lang.Override - @java.lang.SuppressWarnings("unchecked") - public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { - switch (methodId) { - case METHODID_LIST_DART_TESTS: - serviceImpl.listDartTests((pl.leancode.patrol.contracts.Contracts.Empty) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_RUN_DART_TEST: - serviceImpl.runDartTest((pl.leancode.patrol.contracts.Contracts.RunDartTestRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - default: - throw new AssertionError(); - } - } - - @java.lang.Override - @java.lang.SuppressWarnings("unchecked") - public io.grpc.stub.StreamObserver invoke( - io.grpc.stub.StreamObserver responseObserver) { - switch (methodId) { - default: - throw new AssertionError(); - } - } - } - - private static volatile io.grpc.ServiceDescriptor serviceDescriptor; - - public static io.grpc.ServiceDescriptor getServiceDescriptor() { - io.grpc.ServiceDescriptor result = serviceDescriptor; - if (result == null) { - synchronized (PatrolAppServiceGrpc.class) { - result = serviceDescriptor; - if (result == null) { - serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) - .addMethod(getListDartTestsMethod()) - .addMethod(getRunDartTestMethod()) - .build(); - } - } - } - return result; - } -} diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/PermissionDialogVisibleRequestKt.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/PermissionDialogVisibleRequestKt.kt deleted file mode 100644 index 835a01708..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/PermissionDialogVisibleRequestKt.kt +++ /dev/null @@ -1,50 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: contracts.proto - -// Generated files should ignore deprecation warnings -@file:Suppress("DEPRECATION") -package pl.leancode.patrol.contracts; - -@kotlin.jvm.JvmName("-initializepermissionDialogVisibleRequest") -public inline fun permissionDialogVisibleRequest(block: pl.leancode.patrol.contracts.PermissionDialogVisibleRequestKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest = - pl.leancode.patrol.contracts.PermissionDialogVisibleRequestKt.Dsl._create(pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest.newBuilder()).apply { block() }._build() -/** - * Protobuf type `patrol.PermissionDialogVisibleRequest` - */ -public object PermissionDialogVisibleRequestKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - public class Dsl private constructor( - private val _builder: pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest.Builder - ) { - public companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest = _builder.build() - - /** - * uint64 timeoutMillis = 1; - */ - public var timeoutMillis: kotlin.Long - @JvmName("getTimeoutMillis") - get() = _builder.getTimeoutMillis() - @JvmName("setTimeoutMillis") - set(value) { - _builder.setTimeoutMillis(value) - } - /** - * `uint64 timeoutMillis = 1;` - */ - public fun clearTimeoutMillis() { - _builder.clearTimeoutMillis() - } - } -} -public inline fun pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest.copy(block: pl.leancode.patrol.contracts.PermissionDialogVisibleRequestKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest = - pl.leancode.patrol.contracts.PermissionDialogVisibleRequestKt.Dsl._create(this.toBuilder()).apply { block() }._build() - diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/PermissionDialogVisibleResponseKt.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/PermissionDialogVisibleResponseKt.kt deleted file mode 100644 index 905f21ce2..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/PermissionDialogVisibleResponseKt.kt +++ /dev/null @@ -1,50 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: contracts.proto - -// Generated files should ignore deprecation warnings -@file:Suppress("DEPRECATION") -package pl.leancode.patrol.contracts; - -@kotlin.jvm.JvmName("-initializepermissionDialogVisibleResponse") -public inline fun permissionDialogVisibleResponse(block: pl.leancode.patrol.contracts.PermissionDialogVisibleResponseKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleResponse = - pl.leancode.patrol.contracts.PermissionDialogVisibleResponseKt.Dsl._create(pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleResponse.newBuilder()).apply { block() }._build() -/** - * Protobuf type `patrol.PermissionDialogVisibleResponse` - */ -public object PermissionDialogVisibleResponseKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - public class Dsl private constructor( - private val _builder: pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleResponse.Builder - ) { - public companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleResponse.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleResponse = _builder.build() - - /** - * bool visible = 1; - */ - public var visible: kotlin.Boolean - @JvmName("getVisible") - get() = _builder.getVisible() - @JvmName("setVisible") - set(value) { - _builder.setVisible(value) - } - /** - * `bool visible = 1;` - */ - public fun clearVisible() { - _builder.clearVisible() - } - } -} -public inline fun pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleResponse.copy(block: pl.leancode.patrol.contracts.PermissionDialogVisibleResponseKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleResponse = - pl.leancode.patrol.contracts.PermissionDialogVisibleResponseKt.Dsl._create(this.toBuilder()).apply { block() }._build() - diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/RunDartTestRequestKt.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/RunDartTestRequestKt.kt deleted file mode 100644 index 27d883142..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/RunDartTestRequestKt.kt +++ /dev/null @@ -1,50 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: contracts.proto - -// Generated files should ignore deprecation warnings -@file:Suppress("DEPRECATION") -package pl.leancode.patrol.contracts; - -@kotlin.jvm.JvmName("-initializerunDartTestRequest") -public inline fun runDartTestRequest(block: pl.leancode.patrol.contracts.RunDartTestRequestKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.RunDartTestRequest = - pl.leancode.patrol.contracts.RunDartTestRequestKt.Dsl._create(pl.leancode.patrol.contracts.Contracts.RunDartTestRequest.newBuilder()).apply { block() }._build() -/** - * Protobuf type `patrol.RunDartTestRequest` - */ -public object RunDartTestRequestKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - public class Dsl private constructor( - private val _builder: pl.leancode.patrol.contracts.Contracts.RunDartTestRequest.Builder - ) { - public companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: pl.leancode.patrol.contracts.Contracts.RunDartTestRequest.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): pl.leancode.patrol.contracts.Contracts.RunDartTestRequest = _builder.build() - - /** - * `string name = 1;` - */ - public var name: kotlin.String - @JvmName("getName") - get() = _builder.getName() - @JvmName("setName") - set(value) { - _builder.setName(value) - } - /** - * `string name = 1;` - */ - public fun clearName() { - _builder.clearName() - } - } -} -public inline fun pl.leancode.patrol.contracts.Contracts.RunDartTestRequest.copy(block: pl.leancode.patrol.contracts.RunDartTestRequestKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.RunDartTestRequest = - pl.leancode.patrol.contracts.RunDartTestRequestKt.Dsl._create(this.toBuilder()).apply { block() }._build() - diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/RunDartTestResponseKt.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/RunDartTestResponseKt.kt deleted file mode 100644 index 8ff168f8d..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/RunDartTestResponseKt.kt +++ /dev/null @@ -1,81 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: contracts.proto - -// Generated files should ignore deprecation warnings -@file:Suppress("DEPRECATION") -package pl.leancode.patrol.contracts; - -@kotlin.jvm.JvmName("-initializerunDartTestResponse") -public inline fun runDartTestResponse(block: pl.leancode.patrol.contracts.RunDartTestResponseKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.RunDartTestResponse = - pl.leancode.patrol.contracts.RunDartTestResponseKt.Dsl._create(pl.leancode.patrol.contracts.Contracts.RunDartTestResponse.newBuilder()).apply { block() }._build() -/** - * Protobuf type `patrol.RunDartTestResponse` - */ -public object RunDartTestResponseKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - public class Dsl private constructor( - private val _builder: pl.leancode.patrol.contracts.Contracts.RunDartTestResponse.Builder - ) { - public companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: pl.leancode.patrol.contracts.Contracts.RunDartTestResponse.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): pl.leancode.patrol.contracts.Contracts.RunDartTestResponse = _builder.build() - - /** - * `.patrol.RunDartTestResponse.Result result = 1;` - */ - public var result: pl.leancode.patrol.contracts.Contracts.RunDartTestResponse.Result - @JvmName("getResult") - get() = _builder.getResult() - @JvmName("setResult") - set(value) { - _builder.setResult(value) - } - public var resultValue: kotlin.Int - @JvmName("getResultValue") - get() = _builder.getResultValue() - @JvmName("setResultValue") - set(value) { - _builder.setResultValue(value) - } - /** - * `.patrol.RunDartTestResponse.Result result = 1;` - */ - public fun clearResult() { - _builder.clearResult() - } - - /** - * `optional string details = 2;` - */ - public var details: kotlin.String - @JvmName("getDetails") - get() = _builder.getDetails() - @JvmName("setDetails") - set(value) { - _builder.setDetails(value) - } - /** - * `optional string details = 2;` - */ - public fun clearDetails() { - _builder.clearDetails() - } - /** - * `optional string details = 2;` - * @return Whether the details field is set. - */ - public fun hasDetails(): kotlin.Boolean { - return _builder.hasDetails() - } - } -} -public inline fun pl.leancode.patrol.contracts.Contracts.RunDartTestResponse.copy(block: pl.leancode.patrol.contracts.RunDartTestResponseKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.RunDartTestResponse = - pl.leancode.patrol.contracts.RunDartTestResponseKt.Dsl._create(this.toBuilder()).apply { block() }._build() - diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/SelectorKt.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/SelectorKt.kt deleted file mode 100644 index 6929f62f5..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/SelectorKt.kt +++ /dev/null @@ -1,321 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: contracts.proto - -// Generated files should ignore deprecation warnings -@file:Suppress("DEPRECATION") -package pl.leancode.patrol.contracts; - -@kotlin.jvm.JvmName("-initializeselector") -public inline fun selector(block: pl.leancode.patrol.contracts.SelectorKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.Selector = - pl.leancode.patrol.contracts.SelectorKt.Dsl._create(pl.leancode.patrol.contracts.Contracts.Selector.newBuilder()).apply { block() }._build() -/** - * Protobuf type `patrol.Selector` - */ -public object SelectorKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - public class Dsl private constructor( - private val _builder: pl.leancode.patrol.contracts.Contracts.Selector.Builder - ) { - public companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: pl.leancode.patrol.contracts.Contracts.Selector.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): pl.leancode.patrol.contracts.Contracts.Selector = _builder.build() - - /** - * `optional string text = 1;` - */ - public var text: kotlin.String - @JvmName("getText") - get() = _builder.getText() - @JvmName("setText") - set(value) { - _builder.setText(value) - } - /** - * `optional string text = 1;` - */ - public fun clearText() { - _builder.clearText() - } - /** - * `optional string text = 1;` - * @return Whether the text field is set. - */ - public fun hasText(): kotlin.Boolean { - return _builder.hasText() - } - - /** - * `optional string textStartsWith = 2;` - */ - public var textStartsWith: kotlin.String - @JvmName("getTextStartsWith") - get() = _builder.getTextStartsWith() - @JvmName("setTextStartsWith") - set(value) { - _builder.setTextStartsWith(value) - } - /** - * `optional string textStartsWith = 2;` - */ - public fun clearTextStartsWith() { - _builder.clearTextStartsWith() - } - /** - * `optional string textStartsWith = 2;` - * @return Whether the textStartsWith field is set. - */ - public fun hasTextStartsWith(): kotlin.Boolean { - return _builder.hasTextStartsWith() - } - - /** - * `optional string textContains = 3;` - */ - public var textContains: kotlin.String - @JvmName("getTextContains") - get() = _builder.getTextContains() - @JvmName("setTextContains") - set(value) { - _builder.setTextContains(value) - } - /** - * `optional string textContains = 3;` - */ - public fun clearTextContains() { - _builder.clearTextContains() - } - /** - * `optional string textContains = 3;` - * @return Whether the textContains field is set. - */ - public fun hasTextContains(): kotlin.Boolean { - return _builder.hasTextContains() - } - - /** - * `optional string className = 4;` - */ - public var className: kotlin.String - @JvmName("getClassName") - get() = _builder.getClassName() - @JvmName("setClassName") - set(value) { - _builder.setClassName(value) - } - /** - * `optional string className = 4;` - */ - public fun clearClassName() { - _builder.clearClassName() - } - /** - * `optional string className = 4;` - * @return Whether the className field is set. - */ - public fun hasClassName(): kotlin.Boolean { - return _builder.hasClassName() - } - - /** - * `optional string contentDescription = 5;` - */ - public var contentDescription: kotlin.String - @JvmName("getContentDescription") - get() = _builder.getContentDescription() - @JvmName("setContentDescription") - set(value) { - _builder.setContentDescription(value) - } - /** - * `optional string contentDescription = 5;` - */ - public fun clearContentDescription() { - _builder.clearContentDescription() - } - /** - * `optional string contentDescription = 5;` - * @return Whether the contentDescription field is set. - */ - public fun hasContentDescription(): kotlin.Boolean { - return _builder.hasContentDescription() - } - - /** - * `optional string contentDescriptionStartsWith = 6;` - */ - public var contentDescriptionStartsWith: kotlin.String - @JvmName("getContentDescriptionStartsWith") - get() = _builder.getContentDescriptionStartsWith() - @JvmName("setContentDescriptionStartsWith") - set(value) { - _builder.setContentDescriptionStartsWith(value) - } - /** - * `optional string contentDescriptionStartsWith = 6;` - */ - public fun clearContentDescriptionStartsWith() { - _builder.clearContentDescriptionStartsWith() - } - /** - * `optional string contentDescriptionStartsWith = 6;` - * @return Whether the contentDescriptionStartsWith field is set. - */ - public fun hasContentDescriptionStartsWith(): kotlin.Boolean { - return _builder.hasContentDescriptionStartsWith() - } - - /** - * `optional string contentDescriptionContains = 7;` - */ - public var contentDescriptionContains: kotlin.String - @JvmName("getContentDescriptionContains") - get() = _builder.getContentDescriptionContains() - @JvmName("setContentDescriptionContains") - set(value) { - _builder.setContentDescriptionContains(value) - } - /** - * `optional string contentDescriptionContains = 7;` - */ - public fun clearContentDescriptionContains() { - _builder.clearContentDescriptionContains() - } - /** - * `optional string contentDescriptionContains = 7;` - * @return Whether the contentDescriptionContains field is set. - */ - public fun hasContentDescriptionContains(): kotlin.Boolean { - return _builder.hasContentDescriptionContains() - } - - /** - * `optional string resourceId = 8;` - */ - public var resourceId: kotlin.String - @JvmName("getResourceId") - get() = _builder.getResourceId() - @JvmName("setResourceId") - set(value) { - _builder.setResourceId(value) - } - /** - * `optional string resourceId = 8;` - */ - public fun clearResourceId() { - _builder.clearResourceId() - } - /** - * `optional string resourceId = 8;` - * @return Whether the resourceId field is set. - */ - public fun hasResourceId(): kotlin.Boolean { - return _builder.hasResourceId() - } - - /** - * optional uint32 instance = 9; - */ - public var instance: kotlin.Int - @JvmName("getInstance") - get() = _builder.getInstance() - @JvmName("setInstance") - set(value) { - _builder.setInstance(value) - } - /** - * `optional uint32 instance = 9;` - */ - public fun clearInstance() { - _builder.clearInstance() - } - /** - * `optional uint32 instance = 9;` - * @return Whether the instance field is set. - */ - public fun hasInstance(): kotlin.Boolean { - return _builder.hasInstance() - } - - /** - * optional bool enabled = 10; - */ - public var enabled: kotlin.Boolean - @JvmName("getEnabled") - get() = _builder.getEnabled() - @JvmName("setEnabled") - set(value) { - _builder.setEnabled(value) - } - /** - * `optional bool enabled = 10;` - */ - public fun clearEnabled() { - _builder.clearEnabled() - } - /** - * `optional bool enabled = 10;` - * @return Whether the enabled field is set. - */ - public fun hasEnabled(): kotlin.Boolean { - return _builder.hasEnabled() - } - - /** - * optional bool focused = 11; - */ - public var focused: kotlin.Boolean - @JvmName("getFocused") - get() = _builder.getFocused() - @JvmName("setFocused") - set(value) { - _builder.setFocused(value) - } - /** - * `optional bool focused = 11;` - */ - public fun clearFocused() { - _builder.clearFocused() - } - /** - * `optional bool focused = 11;` - * @return Whether the focused field is set. - */ - public fun hasFocused(): kotlin.Boolean { - return _builder.hasFocused() - } - - /** - * `optional string pkg = 12;` - */ - public var pkg: kotlin.String - @JvmName("getPkg") - get() = _builder.getPkg() - @JvmName("setPkg") - set(value) { - _builder.setPkg(value) - } - /** - * `optional string pkg = 12;` - */ - public fun clearPkg() { - _builder.clearPkg() - } - /** - * `optional string pkg = 12;` - * @return Whether the pkg field is set. - */ - public fun hasPkg(): kotlin.Boolean { - return _builder.hasPkg() - } - } -} -public inline fun pl.leancode.patrol.contracts.Contracts.Selector.copy(block: pl.leancode.patrol.contracts.SelectorKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.Selector = - pl.leancode.patrol.contracts.SelectorKt.Dsl._create(this.toBuilder()).apply { block() }._build() - diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/SetLocationAccuracyRequestKt.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/SetLocationAccuracyRequestKt.kt deleted file mode 100644 index 9fdff5df0..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/SetLocationAccuracyRequestKt.kt +++ /dev/null @@ -1,57 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: contracts.proto - -// Generated files should ignore deprecation warnings -@file:Suppress("DEPRECATION") -package pl.leancode.patrol.contracts; - -@kotlin.jvm.JvmName("-initializesetLocationAccuracyRequest") -public inline fun setLocationAccuracyRequest(block: pl.leancode.patrol.contracts.SetLocationAccuracyRequestKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest = - pl.leancode.patrol.contracts.SetLocationAccuracyRequestKt.Dsl._create(pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest.newBuilder()).apply { block() }._build() -/** - * Protobuf type `patrol.SetLocationAccuracyRequest` - */ -public object SetLocationAccuracyRequestKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - public class Dsl private constructor( - private val _builder: pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest.Builder - ) { - public companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest = _builder.build() - - /** - * `.patrol.SetLocationAccuracyRequest.LocationAccuracy locationAccuracy = 1;` - */ - public var locationAccuracy: pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest.LocationAccuracy - @JvmName("getLocationAccuracy") - get() = _builder.getLocationAccuracy() - @JvmName("setLocationAccuracy") - set(value) { - _builder.setLocationAccuracy(value) - } - public var locationAccuracyValue: kotlin.Int - @JvmName("getLocationAccuracyValue") - get() = _builder.getLocationAccuracyValue() - @JvmName("setLocationAccuracyValue") - set(value) { - _builder.setLocationAccuracyValue(value) - } - /** - * `.patrol.SetLocationAccuracyRequest.LocationAccuracy locationAccuracy = 1;` - */ - public fun clearLocationAccuracy() { - _builder.clearLocationAccuracy() - } - } -} -public inline fun pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest.copy(block: pl.leancode.patrol.contracts.SetLocationAccuracyRequestKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest = - pl.leancode.patrol.contracts.SetLocationAccuracyRequestKt.Dsl._create(this.toBuilder()).apply { block() }._build() - diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/SubmitTestResultsRequestKt.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/SubmitTestResultsRequestKt.kt deleted file mode 100644 index 426068eb9..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/SubmitTestResultsRequestKt.kt +++ /dev/null @@ -1,94 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: contracts.proto - -// Generated files should ignore deprecation warnings -@file:Suppress("DEPRECATION") -package pl.leancode.patrol.contracts; - -@kotlin.jvm.JvmName("-initializesubmitTestResultsRequest") -public inline fun submitTestResultsRequest(block: pl.leancode.patrol.contracts.SubmitTestResultsRequestKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.SubmitTestResultsRequest = - pl.leancode.patrol.contracts.SubmitTestResultsRequestKt.Dsl._create(pl.leancode.patrol.contracts.Contracts.SubmitTestResultsRequest.newBuilder()).apply { block() }._build() -/** - * Protobuf type `patrol.SubmitTestResultsRequest` - */ -public object SubmitTestResultsRequestKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - public class Dsl private constructor( - private val _builder: pl.leancode.patrol.contracts.Contracts.SubmitTestResultsRequest.Builder - ) { - public companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: pl.leancode.patrol.contracts.Contracts.SubmitTestResultsRequest.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): pl.leancode.patrol.contracts.Contracts.SubmitTestResultsRequest = _builder.build() - - /** - * An uninstantiable, behaviorless type to represent the field in - * generics. - */ - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - public class ResultsProxy private constructor() : com.google.protobuf.kotlin.DslProxy() - /** - * `map results = 1;` - */ - public val results: com.google.protobuf.kotlin.DslMap - @kotlin.jvm.JvmSynthetic - @JvmName("getResultsMap") - get() = com.google.protobuf.kotlin.DslMap( - _builder.getResultsMap() - ) - /** - * `map results = 1;` - */ - @JvmName("putResults") - public fun com.google.protobuf.kotlin.DslMap - .put(key: kotlin.String, value: kotlin.String) { - _builder.putResults(key, value) - } - /** - * `map results = 1;` - */ - @kotlin.jvm.JvmSynthetic - @JvmName("setResults") - @Suppress("NOTHING_TO_INLINE") - public inline operator fun com.google.protobuf.kotlin.DslMap - .set(key: kotlin.String, value: kotlin.String) { - put(key, value) - } - /** - * `map results = 1;` - */ - @kotlin.jvm.JvmSynthetic - @JvmName("removeResults") - public fun com.google.protobuf.kotlin.DslMap - .remove(key: kotlin.String) { - _builder.removeResults(key) - } - /** - * `map results = 1;` - */ - @kotlin.jvm.JvmSynthetic - @JvmName("putAllResults") - public fun com.google.protobuf.kotlin.DslMap - .putAll(map: kotlin.collections.Map) { - _builder.putAllResults(map) - } - /** - * `map results = 1;` - */ - @kotlin.jvm.JvmSynthetic - @JvmName("clearResults") - public fun com.google.protobuf.kotlin.DslMap - .clear() { - _builder.clearResults() - } - } -} -public inline fun pl.leancode.patrol.contracts.Contracts.SubmitTestResultsRequest.copy(block: pl.leancode.patrol.contracts.SubmitTestResultsRequestKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.SubmitTestResultsRequest = - pl.leancode.patrol.contracts.SubmitTestResultsRequestKt.Dsl._create(this.toBuilder()).apply { block() }._build() - diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/SwipeRequestKt.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/SwipeRequestKt.kt deleted file mode 100644 index 9a27c6879..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/SwipeRequestKt.kt +++ /dev/null @@ -1,135 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: contracts.proto - -// Generated files should ignore deprecation warnings -@file:Suppress("DEPRECATION") -package pl.leancode.patrol.contracts; - -@kotlin.jvm.JvmName("-initializeswipeRequest") -public inline fun swipeRequest(block: pl.leancode.patrol.contracts.SwipeRequestKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.SwipeRequest = - pl.leancode.patrol.contracts.SwipeRequestKt.Dsl._create(pl.leancode.patrol.contracts.Contracts.SwipeRequest.newBuilder()).apply { block() }._build() -/** - * Protobuf type `patrol.SwipeRequest` - */ -public object SwipeRequestKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - public class Dsl private constructor( - private val _builder: pl.leancode.patrol.contracts.Contracts.SwipeRequest.Builder - ) { - public companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: pl.leancode.patrol.contracts.Contracts.SwipeRequest.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): pl.leancode.patrol.contracts.Contracts.SwipeRequest = _builder.build() - - /** - * float startX = 1; - */ - public var startX: kotlin.Float - @JvmName("getStartX") - get() = _builder.getStartX() - @JvmName("setStartX") - set(value) { - _builder.setStartX(value) - } - /** - * `float startX = 1;` - */ - public fun clearStartX() { - _builder.clearStartX() - } - - /** - * float startY = 2; - */ - public var startY: kotlin.Float - @JvmName("getStartY") - get() = _builder.getStartY() - @JvmName("setStartY") - set(value) { - _builder.setStartY(value) - } - /** - * `float startY = 2;` - */ - public fun clearStartY() { - _builder.clearStartY() - } - - /** - * float endX = 3; - */ - public var endX: kotlin.Float - @JvmName("getEndX") - get() = _builder.getEndX() - @JvmName("setEndX") - set(value) { - _builder.setEndX(value) - } - /** - * `float endX = 3;` - */ - public fun clearEndX() { - _builder.clearEndX() - } - - /** - * float endY = 4; - */ - public var endY: kotlin.Float - @JvmName("getEndY") - get() = _builder.getEndY() - @JvmName("setEndY") - set(value) { - _builder.setEndY(value) - } - /** - * `float endY = 4;` - */ - public fun clearEndY() { - _builder.clearEndY() - } - - /** - * uint32 steps = 5; - */ - public var steps: kotlin.Int - @JvmName("getSteps") - get() = _builder.getSteps() - @JvmName("setSteps") - set(value) { - _builder.setSteps(value) - } - /** - * `uint32 steps = 5;` - */ - public fun clearSteps() { - _builder.clearSteps() - } - - /** - * `string appId = 6;` - */ - public var appId: kotlin.String - @JvmName("getAppId") - get() = _builder.getAppId() - @JvmName("setAppId") - set(value) { - _builder.setAppId(value) - } - /** - * `string appId = 6;` - */ - public fun clearAppId() { - _builder.clearAppId() - } - } -} -public inline fun pl.leancode.patrol.contracts.Contracts.SwipeRequest.copy(block: pl.leancode.patrol.contracts.SwipeRequestKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.SwipeRequest = - pl.leancode.patrol.contracts.SwipeRequestKt.Dsl._create(this.toBuilder()).apply { block() }._build() - diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/TapOnNotificationRequestKt.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/TapOnNotificationRequestKt.kt deleted file mode 100644 index 6ce546637..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/TapOnNotificationRequestKt.kt +++ /dev/null @@ -1,91 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: contracts.proto - -// Generated files should ignore deprecation warnings -@file:Suppress("DEPRECATION") -package pl.leancode.patrol.contracts; - -@kotlin.jvm.JvmName("-initializetapOnNotificationRequest") -public inline fun tapOnNotificationRequest(block: pl.leancode.patrol.contracts.TapOnNotificationRequestKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest = - pl.leancode.patrol.contracts.TapOnNotificationRequestKt.Dsl._create(pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest.newBuilder()).apply { block() }._build() -/** - * Protobuf type `patrol.TapOnNotificationRequest` - */ -public object TapOnNotificationRequestKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - public class Dsl private constructor( - private val _builder: pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest.Builder - ) { - public companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest = _builder.build() - - /** - * uint32 index = 1; - */ - public var index: kotlin.Int - @JvmName("getIndex") - get() = _builder.getIndex() - @JvmName("setIndex") - set(value) { - _builder.setIndex(value) - } - /** - * `uint32 index = 1;` - */ - public fun clearIndex() { - _builder.clearIndex() - } - /** - * `uint32 index = 1;` - * @return Whether the index field is set. - */ - public fun hasIndex(): kotlin.Boolean { - return _builder.hasIndex() - } - - /** - * `.patrol.Selector selector = 2;` - */ - public var selector: pl.leancode.patrol.contracts.Contracts.Selector - @JvmName("getSelector") - get() = _builder.getSelector() - @JvmName("setSelector") - set(value) { - _builder.setSelector(value) - } - /** - * `.patrol.Selector selector = 2;` - */ - public fun clearSelector() { - _builder.clearSelector() - } - /** - * `.patrol.Selector selector = 2;` - * @return Whether the selector field is set. - */ - public fun hasSelector(): kotlin.Boolean { - return _builder.hasSelector() - } - public val findByCase: pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest.FindByCase - @JvmName("getFindByCase") - get() = _builder.getFindByCase() - - public fun clearFindBy() { - _builder.clearFindBy() - } - } -} -public inline fun pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest.copy(block: pl.leancode.patrol.contracts.TapOnNotificationRequestKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest = - pl.leancode.patrol.contracts.TapOnNotificationRequestKt.Dsl._create(this.toBuilder()).apply { block() }._build() - -public val pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequestOrBuilder.selectorOrNull: pl.leancode.patrol.contracts.Contracts.Selector? - get() = if (hasSelector()) getSelector() else null - diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/TapRequestKt.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/TapRequestKt.kt deleted file mode 100644 index be945fdbf..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/TapRequestKt.kt +++ /dev/null @@ -1,77 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: contracts.proto - -// Generated files should ignore deprecation warnings -@file:Suppress("DEPRECATION") -package pl.leancode.patrol.contracts; - -@kotlin.jvm.JvmName("-initializetapRequest") -public inline fun tapRequest(block: pl.leancode.patrol.contracts.TapRequestKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.TapRequest = - pl.leancode.patrol.contracts.TapRequestKt.Dsl._create(pl.leancode.patrol.contracts.Contracts.TapRequest.newBuilder()).apply { block() }._build() -/** - * Protobuf type `patrol.TapRequest` - */ -public object TapRequestKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - public class Dsl private constructor( - private val _builder: pl.leancode.patrol.contracts.Contracts.TapRequest.Builder - ) { - public companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: pl.leancode.patrol.contracts.Contracts.TapRequest.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): pl.leancode.patrol.contracts.Contracts.TapRequest = _builder.build() - - /** - * `.patrol.Selector selector = 1;` - */ - public var selector: pl.leancode.patrol.contracts.Contracts.Selector - @JvmName("getSelector") - get() = _builder.getSelector() - @JvmName("setSelector") - set(value) { - _builder.setSelector(value) - } - /** - * `.patrol.Selector selector = 1;` - */ - public fun clearSelector() { - _builder.clearSelector() - } - /** - * `.patrol.Selector selector = 1;` - * @return Whether the selector field is set. - */ - public fun hasSelector(): kotlin.Boolean { - return _builder.hasSelector() - } - - /** - * `string appId = 2;` - */ - public var appId: kotlin.String - @JvmName("getAppId") - get() = _builder.getAppId() - @JvmName("setAppId") - set(value) { - _builder.setAppId(value) - } - /** - * `string appId = 2;` - */ - public fun clearAppId() { - _builder.clearAppId() - } - } -} -public inline fun pl.leancode.patrol.contracts.Contracts.TapRequest.copy(block: pl.leancode.patrol.contracts.TapRequestKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.TapRequest = - pl.leancode.patrol.contracts.TapRequestKt.Dsl._create(this.toBuilder()).apply { block() }._build() - -public val pl.leancode.patrol.contracts.Contracts.TapRequestOrBuilder.selectorOrNull: pl.leancode.patrol.contracts.Contracts.Selector? - get() = if (hasSelector()) getSelector() else null - diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/WaitUntilVisibleRequestKt.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/WaitUntilVisibleRequestKt.kt deleted file mode 100644 index 0b0e2be9a..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/WaitUntilVisibleRequestKt.kt +++ /dev/null @@ -1,77 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: contracts.proto - -// Generated files should ignore deprecation warnings -@file:Suppress("DEPRECATION") -package pl.leancode.patrol.contracts; - -@kotlin.jvm.JvmName("-initializewaitUntilVisibleRequest") -public inline fun waitUntilVisibleRequest(block: pl.leancode.patrol.contracts.WaitUntilVisibleRequestKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest = - pl.leancode.patrol.contracts.WaitUntilVisibleRequestKt.Dsl._create(pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest.newBuilder()).apply { block() }._build() -/** - * Protobuf type `patrol.WaitUntilVisibleRequest` - */ -public object WaitUntilVisibleRequestKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - public class Dsl private constructor( - private val _builder: pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest.Builder - ) { - public companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest = _builder.build() - - /** - * `.patrol.Selector selector = 1;` - */ - public var selector: pl.leancode.patrol.contracts.Contracts.Selector - @JvmName("getSelector") - get() = _builder.getSelector() - @JvmName("setSelector") - set(value) { - _builder.setSelector(value) - } - /** - * `.patrol.Selector selector = 1;` - */ - public fun clearSelector() { - _builder.clearSelector() - } - /** - * `.patrol.Selector selector = 1;` - * @return Whether the selector field is set. - */ - public fun hasSelector(): kotlin.Boolean { - return _builder.hasSelector() - } - - /** - * `string appId = 2;` - */ - public var appId: kotlin.String - @JvmName("getAppId") - get() = _builder.getAppId() - @JvmName("setAppId") - set(value) { - _builder.setAppId(value) - } - /** - * `string appId = 2;` - */ - public fun clearAppId() { - _builder.clearAppId() - } - } -} -public inline fun pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest.copy(block: pl.leancode.patrol.contracts.WaitUntilVisibleRequestKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest = - pl.leancode.patrol.contracts.WaitUntilVisibleRequestKt.Dsl._create(this.toBuilder()).apply { block() }._build() - -public val pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequestOrBuilder.selectorOrNull: pl.leancode.patrol.contracts.Contracts.Selector? - get() = if (hasSelector()) getSelector() else null - From 2c6c4e43a5b89eadef30816c8d79dff56b232340 Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Mon, 28 Aug 2023 18:46:00 +0200 Subject: [PATCH 043/110] Add contracts generator --- .../pl/leancode/patrol/contracts/Contracts.kt | 362 +++++++++--------- .../android/android_contracts_generator.dart | 20 +- 2 files changed, 193 insertions(+), 189 deletions(-) diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/Contracts.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/Contracts.kt index dd5ba068c..f88b65906 100644 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/Contracts.kt +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/Contracts.kt @@ -7,185 +7,187 @@ package pl.leancode.patrol.contracts; import kotlinx.serialization.Serializable -@Serializable -enum class RunDartTestResponseResult { - success, - skipped, - failure, -} - -@Serializable -enum class HandlePermissionRequestCode { - whileUsing, - onlyThisTime, - denied, -} +class Contracts { + @Serializable + enum class RunDartTestResponseResult { + success, + skipped, + failure, + } + + @Serializable + enum class HandlePermissionRequestCode { + whileUsing, + onlyThisTime, + denied, + } + + @Serializable + enum class SetLocationAccuracyRequestLocationAccuracy { + coarse, + fine, + } + + @Serializable + data class DartTestCase ( + val name: String + ) + + @Serializable + data class DartTestGroup ( + val name: String, + val tests: List, + val groups: List + ) + + @Serializable + data class ListDartTestsResponse ( + val group: DartTestGroup + ) + + @Serializable + data class RunDartTestRequest ( + val name: String + ) + + @Serializable + data class RunDartTestResponse ( + val result: RunDartTestResponseResult, + val details: String? + ) + + @Serializable + data class ConfigureRequest ( + val findTimeoutMillis: Int + ) + + @Serializable + data class OpenAppRequest ( + val appId: String + ) + + @Serializable + class OpenQuickSettingsRequest ( + + ) + + @Serializable + data class Selector ( + val text: String?, + val textStartsWith: String?, + val textContains: String?, + val className: String?, + val contentDescription: String?, + val contentDescriptionStartsWith: String?, + val contentDescriptionContains: String?, + val resourceId: String?, + val instance: Int?, + val enabled: Boolean?, + val focused: Boolean?, + val pkg: String? + ) + + @Serializable + data class GetNativeViewsRequest ( + val selector: Selector, + val appId: String + ) + + @Serializable + data class NativeView ( + val className: String, + val text: String, + val contentDescription: String, + val focused: Boolean, + val enabled: Boolean, + val childCount: Int, + val resourceName: String, + val applicationPackage: String, + val children: List + ) + + @Serializable + data class GetNativeViewsResponse ( + val nativeViews: List + ) + + @Serializable + data class TapRequest ( + val selector: Selector, + val appId: String + ) + + @Serializable + data class EnterTextRequest ( + val data: String, + val appId: String, + val index: Int?, + val selector: Selector?, + val showKeyboard: Boolean? + ) + + @Serializable + data class SwipeRequest ( + val startX: Double, + val startY: Double, + val endX: Double, + val endY: Double, + val steps: Int + ) + + @Serializable + data class WaitUntilVisibleRequest ( + val selector: Selector, + val appId: String + ) + + @Serializable + data class DarkModeRequest ( + val appId: String + ) + + @Serializable + data class Notification ( + val appName: String?, + val title: String, + val content: String, + val raw: String + ) + + @Serializable + data class GetNotificationsResponse ( + val notifications: List + ) + + @Serializable + class GetNotificationsRequest ( + + ) + + @Serializable + data class TapOnNotificationRequest ( + val index: Int?, + val selector: Selector? + ) + + @Serializable + data class PermissionDialogVisibleResponse ( + val visible: Boolean + ) + + @Serializable + data class PermissionDialogVisibleRequest ( + val timeoutMillis: Int + ) + + @Serializable + data class HandlePermissionRequest ( + val code: HandlePermissionRequestCode + ) + + @Serializable + data class SetLocationAccuracyRequest ( + val locationAccuracy: SetLocationAccuracyRequestLocationAccuracy + ) -@Serializable -enum class SetLocationAccuracyRequestLocationAccuracy { - coarse, - fine, } - -@Serializable -data class DartTestCase ( - val name: String -) - -@Serializable -data class DartTestGroup ( - val name: String, - val tests: List, - val groups: List -) - -@Serializable -data class ListDartTestsResponse ( - val group: DartTestGroup -) - -@Serializable -data class RunDartTestRequest ( - val name: String -) - -@Serializable -data class RunDartTestResponse ( - val result: RunDartTestResponseResult, - val details: String? -) - -@Serializable -data class ConfigureRequest ( - val findTimeoutMillis: Int -) - -@Serializable -data class OpenAppRequest ( - val appId: String -) - -@Serializable -class OpenQuickSettingsRequest ( - -) - -@Serializable -data class Selector ( - val text: String?, - val textStartsWith: String?, - val textContains: String?, - val className: String?, - val contentDescription: String?, - val contentDescriptionStartsWith: String?, - val contentDescriptionContains: String?, - val resourceId: String?, - val instance: Int?, - val enabled: Boolean?, - val focused: Boolean?, - val pkg: String? -) - -@Serializable -data class GetNativeViewsRequest ( - val selector: Selector, - val appId: String -) - -@Serializable -data class NativeView ( - val className: String, - val text: String, - val contentDescription: String, - val focused: Boolean, - val enabled: Boolean, - val childCount: Int, - val resourceName: String, - val applicationPackage: String, - val children: List -) - -@Serializable -data class GetNativeViewsResponse ( - val nativeViews: List -) - -@Serializable -data class TapRequest ( - val selector: Selector, - val appId: String -) - -@Serializable -data class EnterTextRequest ( - val data: String, - val appId: String, - val index: Int?, - val selector: Selector?, - val showKeyboard: Boolean? -) - -@Serializable -data class SwipeRequest ( - val startX: Double, - val startY: Double, - val endX: Double, - val endY: Double, - val steps: Int -) - -@Serializable -data class WaitUntilVisibleRequest ( - val selector: Selector, - val appId: String -) - -@Serializable -data class DarkModeRequest ( - val appId: String -) - -@Serializable -data class Notification ( - val appName: String?, - val title: String, - val content: String, - val raw: String -) - -@Serializable -data class GetNotificationsResponse ( - val notifications: List -) - -@Serializable -class GetNotificationsRequest ( - -) - -@Serializable -data class TapOnNotificationRequest ( - val index: Int?, - val selector: Selector? -) - -@Serializable -data class PermissionDialogVisibleResponse ( - val visible: Boolean -) - -@Serializable -data class PermissionDialogVisibleRequest ( - val timeoutMillis: Int -) - -@Serializable -data class HandlePermissionRequest ( - val code: HandlePermissionRequestCode -) - -@Serializable -data class SetLocationAccuracyRequest ( - val locationAccuracy: SetLocationAccuracyRequestLocationAccuracy -) - diff --git a/packages/patrol_gen/lib/src/generators/android/android_contracts_generator.dart b/packages/patrol_gen/lib/src/generators/android/android_contracts_generator.dart index 4d95b005a..456341146 100644 --- a/packages/patrol_gen/lib/src/generators/android/android_contracts_generator.dart +++ b/packages/patrol_gen/lib/src/generators/android/android_contracts_generator.dart @@ -6,8 +6,10 @@ class AndroidContractsGenerator { OutputFile generate(Schema schema, AndroidConfig config) { final buffer = StringBuffer()..write(_contentPrefix(config)); + buffer.writeln("class Contracts {"); schema.enums.forEach((e) => buffer.writeln(_createEnum(e))); schema.messages.forEach((e) => buffer.writeln(_createMessage(e))); + buffer.writeln("}"); return OutputFile( filename: config.contractsFilename, @@ -33,28 +35,28 @@ import kotlinx.serialization.Serializable final fields = message.fields.map((e) { final optional = e.isOptional ? '?' : ''; return e.isList - ? ' val ${e.name}: List<${_transformType(e.type)}>$optional' - : ' val ${e.name}: ${_transformType(e.type)}$optional'; + ? ' val ${e.name}: List<${_transformType(e.type)}>$optional' + : ' val ${e.name}: ${_transformType(e.type)}$optional'; }).join(',\n'); final dataKeyword = fields.isNotEmpty ? 'data ' : ''; return ''' -@Serializable -${dataKeyword}class ${message.name} ( + @Serializable + ${dataKeyword}class ${message.name} ( $fields -) + ) '''; } String _createEnum(Enum enumDefinition) { - final cases = enumDefinition.fields.map((e) => ' ${e},').join('\n'); + final cases = enumDefinition.fields.map((e) => ' ${e},').join('\n'); return ''' -@Serializable -enum class ${enumDefinition.name} { + @Serializable + enum class ${enumDefinition.name} { $cases -} + } '''; } From 279e42dfba94173b8c39c537e3d847af81edbe8f Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Mon, 28 Aug 2023 18:50:05 +0200 Subject: [PATCH 044/110] Add http4k server generator --- .../pl/leancode/patrol/AutomatorServer.kt | 164 ++++++-------- .../pl/leancode/patrol/ContractsExtensions.kt | 14 +- .../kotlin/pl/leancode/patrol/PatrolServer.kt | 7 +- .../pl/leancode/patrol/contracts/Contracts.kt | 86 ++++++- .../patrol/contracts/NativeAutomatorServer.kt | 209 ++++++++++++++++++ .../android/android_contracts_generator.dart | 20 +- .../generators/android/android_generator.dart | 9 + .../android_http4k_server_generator.dart | 88 ++++++++ packages/patrol_gen/lib/src/utils.dart | 6 + 9 files changed, 478 insertions(+), 125 deletions(-) create mode 100644 packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/NativeAutomatorServer.kt create mode 100644 packages/patrol_gen/lib/src/generators/android/android_http4k_server_generator.dart diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/AutomatorServer.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/AutomatorServer.kt index 1a6c930de..5a336698f 100644 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/AutomatorServer.kt +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/AutomatorServer.kt @@ -1,158 +1,121 @@ package pl.leancode.patrol import pl.leancode.patrol.contracts.Contracts -import pl.leancode.patrol.contracts.Contracts.EnterTextRequest.FindByCase.INDEX -import pl.leancode.patrol.contracts.Contracts.EnterTextRequest.FindByCase.SELECTOR -import pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest.Code.DENIED -import pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest.Code.ONLY_THIS_TIME -import pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest.Code.WHILE_USING -import pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest.LocationAccuracy.COARSE -import pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest.LocationAccuracy.FINE -import pl.leancode.patrol.contracts.NativeAutomatorGrpcKt -import pl.leancode.patrol.contracts.empty -import pl.leancode.patrol.contracts.getNativeViewsResponse -import pl.leancode.patrol.contracts.getNotificationsResponse -import pl.leancode.patrol.contracts.permissionDialogVisibleResponse - -typealias Empty = Contracts.Empty - -class AutomatorServer(private val automation: Automator) : NativeAutomatorGrpcKt.NativeAutomatorCoroutineImplBase() { - - override suspend fun initialize(request: Empty): Empty { +import pl.leancode.patrol.contracts.NativeAutomatorServer + +class AutomatorServer(private val automation: Automator) : NativeAutomatorServer() { + + override fun initialize() { automation.initialize() - return empty { } } - override suspend fun configure(request: Contracts.ConfigureRequest): Empty { + override fun configure(request: Contracts.ConfigureRequest) { automation.configure(waitForSelectorTimeout = request.findTimeoutMillis) - return empty { } } - override suspend fun pressHome(request: Empty): Empty { + override fun pressHome() { automation.pressHome() - return empty { } } - override suspend fun pressBack(request: Empty): Empty { + override fun pressBack() { automation.pressBack() - return empty { } } - override suspend fun pressRecentApps(request: Empty): Empty { + override fun pressRecentApps() { automation.pressRecentApps() - return empty { } } - override suspend fun doublePressRecentApps(request: Empty): Empty { + override fun doublePressRecentApps() { automation.pressDoubleRecentApps() - return empty { } } - override suspend fun openApp(request: Contracts.OpenAppRequest): Empty { + override fun openApp(request: Contracts.OpenAppRequest) { automation.openApp(request.appId) - return empty { } } - override suspend fun openNotifications(request: Empty): Empty { + override fun openNotifications() { automation.openNotifications() - return empty { } } - override suspend fun closeNotifications(request: Empty): Empty { + override fun closeNotifications() { automation.closeNotifications() - return empty { } } - override suspend fun openQuickSettings(request: Contracts.OpenQuickSettingsRequest): Empty { + override fun openQuickSettings(request: Contracts.OpenQuickSettingsRequest) { automation.openQuickSettings() - return empty { } } - override suspend fun enableDarkMode(request: Contracts.DarkModeRequest): Empty { + override fun enableDarkMode(request: Contracts.DarkModeRequest) { automation.enableDarkMode() - return empty { } } - override suspend fun disableDarkMode(request: Contracts.DarkModeRequest): Empty { + override fun disableDarkMode(request: Contracts.DarkModeRequest) { automation.disableDarkMode() - return empty { } } - override suspend fun enableAirplaneMode(request: Empty): Empty { + override fun enableAirplaneMode() { automation.enableAirplaneMode() - return empty {} } - override suspend fun disableAirplaneMode(request: Empty): Empty { + override fun disableAirplaneMode() { automation.disableAirplaneMode() - return empty {} } - override suspend fun enableCellular(request: Empty): Empty { + override fun enableCellular() { automation.enableCellular() - return empty { } } - override suspend fun disableCellular(request: Empty): Empty { + override fun disableCellular() { automation.disableCellular() - return empty { } } - override suspend fun enableWiFi(request: Empty): Empty { + override fun enableWiFi() { automation.enableWifi() - return empty { } } - override suspend fun disableWiFi(request: Empty): Empty { + override fun disableWiFi() { automation.disableWifi() - return empty { } } - override suspend fun enableBluetooth(request: Empty): Empty { + override fun enableBluetooth() { automation.enableBluetooth() - return empty { } } - override suspend fun disableBluetooth(request: Empty): Empty { + override fun disableBluetooth() { automation.disableBluetooth() - return empty { } } - override suspend fun getNativeViews(request: Contracts.GetNativeViewsRequest): Contracts.GetNativeViewsResponse { + override fun getNativeViews(request: Contracts.GetNativeViewsRequest): Contracts.GetNativeViewsResponse { val views = automation.getNativeViews(request.selector.toBySelector()) return getNativeViewsResponse { nativeViews.addAll(views) } } - override suspend fun getNotifications(request: Contracts.GetNotificationsRequest): Contracts.GetNotificationsResponse { + override fun getNotifications(request: Contracts.GetNotificationsRequest): Contracts.GetNotificationsResponse { val notifs = automation.getNotifications() return getNotificationsResponse { notifications.addAll(notifs) } } - override suspend fun tap(request: Contracts.TapRequest): Empty { + override fun tap(request: Contracts.TapRequest) { automation.tap( uiSelector = request.selector.toUiSelector(), bySelector = request.selector.toBySelector(), - index = request.selector.instance + index = request.selector.instance?.toInt() ?: 0 ) - - return empty { } } - override suspend fun doubleTap(request: Contracts.TapRequest): Empty { + override fun doubleTap(request: Contracts.TapRequest) { automation.doubleTap( uiSelector = request.selector.toUiSelector(), bySelector = request.selector.toBySelector(), - index = request.selector.instance + index = request.selector.instance?.toInt() ?: 0 ) - - return empty { } } - override suspend fun enterText(request: Contracts.EnterTextRequest): Empty { + override fun enterText(request: Contracts.EnterTextRequest) { when (request.findByCase) { INDEX -> automation.enterText( text = request.data, - index = request.index, + index = request.index?.toInt() ?: 0, showKeyboard = request.showKeyboard ) @@ -166,65 +129,68 @@ class AutomatorServer(private val automation: Automator) : NativeAutomatorGrpcKt else -> throw PatrolException("enterText(): neither index nor selector are set") } - - return empty { } } - override suspend fun swipe(request: Contracts.SwipeRequest): Empty { + override fun swipe(request: Contracts.SwipeRequest) { automation.swipe( - startX = request.startX, - startY = request.startY, - endX = request.endX, - endY = request.endY, - steps = request.steps + startX = request.startX.toFloat(), + startY = request.startY.toFloat(), + endX = request.endX.toFloat(), + endY = request.endY.toFloat(), + steps = request.steps.toInt() ) - return empty { } } - override suspend fun waitUntilVisible(request: Contracts.WaitUntilVisibleRequest): Empty { + override fun waitUntilVisible(request: Contracts.WaitUntilVisibleRequest) { automation.waitUntilVisible( uiSelector = request.selector.toUiSelector(), bySelector = request.selector.toBySelector(), - index = request.selector.instance + index = request.selector.instance?.toInt() ?: 0 ) - return empty { } } - override suspend fun isPermissionDialogVisible(request: Contracts.PermissionDialogVisibleRequest): Contracts.PermissionDialogVisibleResponse { + override fun isPermissionDialogVisible(request: Contracts.PermissionDialogVisibleRequest): Contracts.PermissionDialogVisibleResponse { val visible = automation.isPermissionDialogVisible(timeout = request.timeoutMillis) return permissionDialogVisibleResponse { this.visible = visible } } - override suspend fun handlePermissionDialog(request: Contracts.HandlePermissionRequest): Empty { + override fun handlePermissionDialog(request: Contracts.HandlePermissionRequest) { when (request.code) { - WHILE_USING -> automation.allowPermissionWhileUsingApp() - ONLY_THIS_TIME -> automation.allowPermissionOnce() - DENIED -> automation.denyPermission() - else -> throw PatrolException("handlePermissionDialog(): bad permission code") + Contracts.HandlePermissionRequestCode.whileUsing + -> automation.allowPermissionWhileUsingApp() + Contracts.HandlePermissionRequestCode.onlyThisTime + -> automation.allowPermissionOnce() + Contracts.HandlePermissionRequestCode.denied + -> automation.denyPermission() } - return empty { } } - override suspend fun setLocationAccuracy(request: Contracts.SetLocationAccuracyRequest): Empty { + override fun setLocationAccuracy(request: Contracts.SetLocationAccuracyRequest) { when (request.locationAccuracy) { - COARSE -> automation.selectCoarseLocation() - FINE -> automation.selectFineLocation() - else -> throw PatrolException("setLocationAccuracy(): bad location accuracy") + Contracts.SetLocationAccuracyRequestLocationAccuracy.coarse + -> automation.selectCoarseLocation() + Contracts.SetLocationAccuracyRequestLocationAccuracy.fine + -> automation.selectFineLocation() } - return empty { } } - override suspend fun tapOnNotification(request: Contracts.TapOnNotificationRequest): Empty { + override fun tapOnNotification(request: Contracts.TapOnNotificationRequest) { when (request.findByCase) { - Contracts.TapOnNotificationRequest.FindByCase.INDEX -> automation.tapOnNotification(request.index) - Contracts.TapOnNotificationRequest.FindByCase.SELECTOR -> automation.tapOnNotification(request.selector.toUiSelector()) + Contracts.TapOnNotificationRequest.FindByCase.INDEX -> automation.tapOnNotification( + request.index + ) + + Contracts.TapOnNotificationRequest.FindByCase.SELECTOR -> automation.tapOnNotification( + request.selector.toUiSelector() + ) + else -> throw PatrolException("tapOnNotification(): neither index nor selector are set") } - return empty { } + } - override suspend fun markPatrolAppServiceReady(request: Empty): Empty { + override fun markPatrolAppServiceReady() { PatrolServer.appReady.set(true) - return empty { } + } } diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/ContractsExtensions.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/ContractsExtensions.kt index 30d74952e..6d5af5982 100644 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/ContractsExtensions.kt +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/ContractsExtensions.kt @@ -59,15 +59,15 @@ fun Contracts.Selector.toUiSelector(): UiSelector { } if (hasInstance()) { - selector = selector.instance(instance) + selector = selector.instance(instance!!.toInt()) } if (hasEnabled()) { - selector = selector.enabled(enabled) + selector = selector.enabled(enabled!!) } if (hasFocused()) { - selector = selector.focused(focused) + selector = selector.focused(focused!!) } if (hasPkg()) { @@ -122,10 +122,10 @@ fun Contracts.Selector.toBySelector(): BySelector { throw IllegalArgumentException("instance() argument is not supported for BySelector") } else if (hasEnabled()) { matchedEnabled = true - By.enabled(enabled) + By.enabled(enabled!!) } else if (hasFocused()) { matchedFocused = true - By.focused(focused) + By.focused(focused!!) } else if (hasPkg()) { matchedPkg = true By.pkg(pkg) @@ -170,11 +170,11 @@ fun Contracts.Selector.toBySelector(): BySelector { } if (!matchedEnabled && hasEnabled()) { - bySelector = bySelector.enabled(enabled) + bySelector = bySelector.enabled(enabled!!) } if (!matchedFocused && hasFocused()) { - bySelector = bySelector.focused(focused) + bySelector = bySelector.focused(focused!!) } if (!matchedPkg && hasPkg()) { diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolServer.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolServer.kt index c09d48a1b..5c5d99901 100644 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolServer.kt +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolServer.kt @@ -1,16 +1,13 @@ package pl.leancode.patrol import androidx.test.platform.app.InstrumentationRegistry -import com.google.common.util.concurrent.SettableFuture -import io.grpc.InsecureServerCredentials -import io.grpc.Server -import io.grpc.okhttp.OkHttpServerBuilder +import org.http4k.server.Http4kServer import java.util.concurrent.Future class PatrolServer { private val envPortKey = "PATROL_PORT" private val port: Int - private var server: Server? = null + private var server: Http4kServer? = null init { port = arguments.getString(envPortKey)?.toInt() ?: 8081 diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/Contracts.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/Contracts.kt index f88b65906..fb093068c 100644 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/Contracts.kt +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/Contracts.kt @@ -54,11 +54,15 @@ class Contracts { data class RunDartTestResponse ( val result: RunDartTestResponseResult, val details: String? - ) + ){ + fun hasDetails(): Boolean { + return details != null + } + } @Serializable data class ConfigureRequest ( - val findTimeoutMillis: Int + val findTimeoutMillis: Long ) @Serializable @@ -81,11 +85,48 @@ class Contracts { val contentDescriptionStartsWith: String?, val contentDescriptionContains: String?, val resourceId: String?, - val instance: Int?, + val instance: Long?, val enabled: Boolean?, val focused: Boolean?, val pkg: String? - ) + ){ + fun hasText(): Boolean { + return text != null + } + fun hasTextStartsWith(): Boolean { + return textStartsWith != null + } + fun hasTextContains(): Boolean { + return textContains != null + } + fun hasClassName(): Boolean { + return className != null + } + fun hasContentDescription(): Boolean { + return contentDescription != null + } + fun hasContentDescriptionStartsWith(): Boolean { + return contentDescriptionStartsWith != null + } + fun hasContentDescriptionContains(): Boolean { + return contentDescriptionContains != null + } + fun hasResourceId(): Boolean { + return resourceId != null + } + fun hasInstance(): Boolean { + return instance != null + } + fun hasEnabled(): Boolean { + return enabled != null + } + fun hasFocused(): Boolean { + return focused != null + } + fun hasPkg(): Boolean { + return pkg != null + } + } @Serializable data class GetNativeViewsRequest ( @@ -100,7 +141,7 @@ class Contracts { val contentDescription: String, val focused: Boolean, val enabled: Boolean, - val childCount: Int, + val childCount: Long, val resourceName: String, val applicationPackage: String, val children: List @@ -121,10 +162,20 @@ class Contracts { data class EnterTextRequest ( val data: String, val appId: String, - val index: Int?, + val index: Long?, val selector: Selector?, val showKeyboard: Boolean? - ) + ){ + fun hasIndex(): Boolean { + return index != null + } + fun hasSelector(): Boolean { + return selector != null + } + fun hasShowKeyboard(): Boolean { + return showKeyboard != null + } + } @Serializable data class SwipeRequest ( @@ -132,7 +183,7 @@ class Contracts { val startY: Double, val endX: Double, val endY: Double, - val steps: Int + val steps: Long ) @Serializable @@ -152,7 +203,11 @@ class Contracts { val title: String, val content: String, val raw: String - ) + ){ + fun hasAppName(): Boolean { + return appName != null + } + } @Serializable data class GetNotificationsResponse ( @@ -166,9 +221,16 @@ class Contracts { @Serializable data class TapOnNotificationRequest ( - val index: Int?, + val index: Long?, val selector: Selector? - ) + ){ + fun hasIndex(): Boolean { + return index != null + } + fun hasSelector(): Boolean { + return selector != null + } + } @Serializable data class PermissionDialogVisibleResponse ( @@ -177,7 +239,7 @@ class Contracts { @Serializable data class PermissionDialogVisibleRequest ( - val timeoutMillis: Int + val timeoutMillis: Long ) @Serializable diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/NativeAutomatorServer.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/NativeAutomatorServer.kt new file mode 100644 index 000000000..a61c499a9 --- /dev/null +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/NativeAutomatorServer.kt @@ -0,0 +1,209 @@ +/// +// Generated code. Do not modify. +// source: schema.dart +// + +package pl.leancode.patrol.contracts; + +import org.http4k.core.Response +import org.http4k.core.Method.POST +import org.http4k.routing.bind +import org.http4k.core.Status.Companion.OK +import org.http4k.routing.routes +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json + +abstract class NativeAutomatorServer { + abstract fun initialize() + abstract fun configure(request: Contracts.ConfigureRequest) + abstract fun pressHome() + abstract fun pressBack() + abstract fun pressRecentApps() + abstract fun doublePressRecentApps() + abstract fun openApp(request: Contracts.OpenAppRequest) + abstract fun openQuickSettings(request: Contracts.OpenQuickSettingsRequest) + abstract fun getNativeViews(request: Contracts.GetNativeViewsRequest): Contracts.GetNativeViewsResponse + abstract fun tap(request: Contracts.TapRequest) + abstract fun doubleTap(request: Contracts.TapRequest) + abstract fun enterText(request: Contracts.EnterTextRequest) + abstract fun swipe(request: Contracts.SwipeRequest) + abstract fun waitUntilVisible(request: Contracts.WaitUntilVisibleRequest) + abstract fun enableAirplaneMode() + abstract fun disableAirplaneMode() + abstract fun enableWiFi() + abstract fun disableWiFi() + abstract fun enableCellular() + abstract fun disableCellular() + abstract fun enableBluetooth() + abstract fun disableBluetooth() + abstract fun enableDarkMode(request: Contracts.DarkModeRequest) + abstract fun disableDarkMode(request: Contracts.DarkModeRequest) + abstract fun openNotifications() + abstract fun closeNotifications() + abstract fun closeHeadsUpNotification() + abstract fun getNotifications(request: Contracts.GetNotificationsRequest): Contracts.GetNotificationsResponse + abstract fun tapOnNotification(request: Contracts.TapOnNotificationRequest) + abstract fun isPermissionDialogVisible(request: Contracts.PermissionDialogVisibleRequest): Contracts.PermissionDialogVisibleResponse + abstract fun handlePermissionDialog(request: Contracts.HandlePermissionRequest) + abstract fun setLocationAccuracy(request: Contracts.SetLocationAccuracyRequest) + abstract fun debug() + abstract fun markPatrolAppServiceReady() + + val router = routes( + "initialize" bind POST to { + initialize() + Response(OK) + }, + "configure" bind POST to { + val body = json.decodeFromString(it.bodyString()) + configure(body) + Response(OK) + }, + "pressHome" bind POST to { + pressHome() + Response(OK) + }, + "pressBack" bind POST to { + pressBack() + Response(OK) + }, + "pressRecentApps" bind POST to { + pressRecentApps() + Response(OK) + }, + "doublePressRecentApps" bind POST to { + doublePressRecentApps() + Response(OK) + }, + "openApp" bind POST to { + val body = json.decodeFromString(it.bodyString()) + openApp(body) + Response(OK) + }, + "openQuickSettings" bind POST to { + val body = json.decodeFromString(it.bodyString()) + openQuickSettings(body) + Response(OK) + }, + "getNativeViews" bind POST to { + val body = json.decodeFromString(it.bodyString()) + val response = getNativeViews(body) + Response(OK).body(json.encodeToString(response)) + }, + "tap" bind POST to { + val body = json.decodeFromString(it.bodyString()) + tap(body) + Response(OK) + }, + "doubleTap" bind POST to { + val body = json.decodeFromString(it.bodyString()) + doubleTap(body) + Response(OK) + }, + "enterText" bind POST to { + val body = json.decodeFromString(it.bodyString()) + enterText(body) + Response(OK) + }, + "swipe" bind POST to { + val body = json.decodeFromString(it.bodyString()) + swipe(body) + Response(OK) + }, + "waitUntilVisible" bind POST to { + val body = json.decodeFromString(it.bodyString()) + waitUntilVisible(body) + Response(OK) + }, + "enableAirplaneMode" bind POST to { + enableAirplaneMode() + Response(OK) + }, + "disableAirplaneMode" bind POST to { + disableAirplaneMode() + Response(OK) + }, + "enableWiFi" bind POST to { + enableWiFi() + Response(OK) + }, + "disableWiFi" bind POST to { + disableWiFi() + Response(OK) + }, + "enableCellular" bind POST to { + enableCellular() + Response(OK) + }, + "disableCellular" bind POST to { + disableCellular() + Response(OK) + }, + "enableBluetooth" bind POST to { + enableBluetooth() + Response(OK) + }, + "disableBluetooth" bind POST to { + disableBluetooth() + Response(OK) + }, + "enableDarkMode" bind POST to { + val body = json.decodeFromString(it.bodyString()) + enableDarkMode(body) + Response(OK) + }, + "disableDarkMode" bind POST to { + val body = json.decodeFromString(it.bodyString()) + disableDarkMode(body) + Response(OK) + }, + "openNotifications" bind POST to { + openNotifications() + Response(OK) + }, + "closeNotifications" bind POST to { + closeNotifications() + Response(OK) + }, + "closeHeadsUpNotification" bind POST to { + closeHeadsUpNotification() + Response(OK) + }, + "getNotifications" bind POST to { + val body = json.decodeFromString(it.bodyString()) + val response = getNotifications(body) + Response(OK).body(json.encodeToString(response)) + }, + "tapOnNotification" bind POST to { + val body = json.decodeFromString(it.bodyString()) + tapOnNotification(body) + Response(OK) + }, + "isPermissionDialogVisible" bind POST to { + val body = json.decodeFromString(it.bodyString()) + val response = isPermissionDialogVisible(body) + Response(OK).body(json.encodeToString(response)) + }, + "handlePermissionDialog" bind POST to { + val body = json.decodeFromString(it.bodyString()) + handlePermissionDialog(body) + Response(OK) + }, + "setLocationAccuracy" bind POST to { + val body = json.decodeFromString(it.bodyString()) + setLocationAccuracy(body) + Response(OK) + }, + "debug" bind POST to { + debug() + Response(OK) + }, + "markPatrolAppServiceReady" bind POST to { + markPatrolAppServiceReady() + Response(OK) + } + ) + + private val json = Json { ignoreUnknownKeys = true } +} + diff --git a/packages/patrol_gen/lib/src/generators/android/android_contracts_generator.dart b/packages/patrol_gen/lib/src/generators/android/android_contracts_generator.dart index 456341146..3b071f162 100644 --- a/packages/patrol_gen/lib/src/generators/android/android_contracts_generator.dart +++ b/packages/patrol_gen/lib/src/generators/android/android_contracts_generator.dart @@ -1,6 +1,7 @@ import 'package:patrol_gen/src/generators/android/android_config.dart'; import 'package:patrol_gen/src/generators/output_file.dart'; import 'package:patrol_gen/src/schema.dart'; +import 'package:patrol_gen/src/utils.dart'; class AndroidContractsGenerator { OutputFile generate(Schema schema, AndroidConfig config) { @@ -41,14 +42,29 @@ import kotlinx.serialization.Serializable final dataKeyword = fields.isNotEmpty ? 'data ' : ''; + final optionalFields = message.fields.where((e) => e.isOptional).toList(); + var optionalFieldUtils = optionalFields.map(_optionalFieldUtil).join('\n'); + if (optionalFields.isNotEmpty) { + optionalFieldUtils = '''{ +$optionalFieldUtils + }'''; + } + return ''' @Serializable ${dataKeyword}class ${message.name} ( $fields - ) + )$optionalFieldUtils '''; } + String _optionalFieldUtil(MessageField field) { + return ''' + fun has${field.name.capitalize()}(): Boolean { + return ${field.name} != null + }'''; + } + String _createEnum(Enum enumDefinition) { final cases = enumDefinition.fields.map((e) => ' ${e},').join('\n'); @@ -63,7 +79,7 @@ $cases String _transformType(String type) { switch (type) { case 'int': - return 'Int'; + return 'Long'; case 'double': return 'Double'; case 'bool': diff --git a/packages/patrol_gen/lib/src/generators/android/android_generator.dart b/packages/patrol_gen/lib/src/generators/android/android_generator.dart index 61dc86f24..bfc8e3dc4 100644 --- a/packages/patrol_gen/lib/src/generators/android/android_generator.dart +++ b/packages/patrol_gen/lib/src/generators/android/android_generator.dart @@ -1,5 +1,6 @@ import 'package:patrol_gen/src/generators/android/android_config.dart'; import 'package:patrol_gen/src/generators/android/android_contracts_generator.dart'; +import 'package:patrol_gen/src/generators/android/android_http4k_server_generator.dart'; import 'package:patrol_gen/src/generators/output_file.dart'; import 'package:patrol_gen/src/schema.dart'; @@ -9,6 +10,14 @@ class AndroidGenerator { AndroidContractsGenerator().generate(schema, config), ]; + final serverGenerator = AndroidHttp4kServerGenerator(); + + for (var service in schema.services) { + if (service.android.needsServer) { + result.add(serverGenerator.generate(service, config)); + } + } + return result; } } diff --git a/packages/patrol_gen/lib/src/generators/android/android_http4k_server_generator.dart b/packages/patrol_gen/lib/src/generators/android/android_http4k_server_generator.dart new file mode 100644 index 000000000..f320ac8fc --- /dev/null +++ b/packages/patrol_gen/lib/src/generators/android/android_http4k_server_generator.dart @@ -0,0 +1,88 @@ +import 'package:patrol_gen/src/generators/android/android_config.dart'; +import 'package:patrol_gen/src/generators/output_file.dart'; +import 'package:patrol_gen/src/schema.dart'; + +class AndroidHttp4kServerGenerator { + OutputFile generate(Service service, AndroidConfig config) { + final buffer = StringBuffer()..write(_contentPrefix(config)); + + buffer.writeln(_createServerClass(service)); + + return OutputFile( + filename: config.serverFileName(service.name), + content: buffer.toString(), + ); + } + + String _contentPrefix(AndroidConfig config) { + return ''' +/// +// Generated code. Do not modify. +// source: schema.dart +// + +package ${config.package}; + +import org.http4k.core.Response +import org.http4k.core.Method.POST +import org.http4k.routing.bind +import org.http4k.core.Status.Companion.OK +import org.http4k.routing.routes +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json + +'''; + } + + String _createServerClass(Service service) { + final handlers = _generateHandlers(service); + final routes = _generateRoutes(service); + + return ''' +abstract class ${service.name}Server { +$handlers + + val router = routes( +$routes + ) + + private val json = Json { ignoreUnknownKeys = true } +} +'''; + } + + String _generateRoutes(Service service) { + return service.endpoints.map((e) { + final requestDeserialization = e.request != null + ? ''' + + val body = json.decodeFromString(it.bodyString())''' + : ''; + final requestArg = e.request != null ? 'body' : ''; + + final responseSerialization = + e.response != null ? '.body(json.encodeToString(response))' : ''; + + final responseVariable = e.response != null ? 'val response = ' : ''; + + return ''' + "${e.name}" bind POST to {$requestDeserialization + $responseVariable${e.name}($requestArg) + Response(OK)${responseSerialization} + }'''; + }).join(',\n'); + } + + String _generateHandlers(Service service) { + return service.endpoints.map((endpoint) { + final response = endpoint.response != null + ? ': Contracts.${endpoint.response!.name}' + : ''; + final request = endpoint.request != null + ? 'request: Contracts.${endpoint.request!.name}' + : ''; + + return ' abstract fun ${endpoint.name}($request)$response'; + }).join('\n'); + } +} diff --git a/packages/patrol_gen/lib/src/utils.dart b/packages/patrol_gen/lib/src/utils.dart index 46ca82447..f010b1a17 100644 --- a/packages/patrol_gen/lib/src/utils.dart +++ b/packages/patrol_gen/lib/src/utils.dart @@ -1,3 +1,9 @@ import 'package:path/path.dart' as p; String normalizePath(String path) => p.normalize(p.absolute(path)); + +extension StringExtension on String { + String capitalize() { + return "${this[0].toUpperCase()}${this.substring(1)}"; + } +} From 6d1285495ae102928fb1e2833345c7e04d186c22 Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Tue, 29 Aug 2023 11:29:55 +0200 Subject: [PATCH 045/110] Update schema --- .../main/kotlin/pl/leancode/patrol/contracts/Contracts.kt | 5 +---- packages/patrol/ios/Classes/AutomatorServer/Contracts.swift | 2 +- packages/patrol/lib/src/native/contracts/contracts.dart | 4 ++-- packages/patrol/lib/src/native/contracts/contracts.g.dart | 2 +- schema.dart | 2 +- 5 files changed, 6 insertions(+), 9 deletions(-) diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/Contracts.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/Contracts.kt index fb093068c..b53ae2bd4 100644 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/Contracts.kt +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/Contracts.kt @@ -164,7 +164,7 @@ class Contracts { val appId: String, val index: Long?, val selector: Selector?, - val showKeyboard: Boolean? + val showKeyboard: Boolean ){ fun hasIndex(): Boolean { return index != null @@ -172,9 +172,6 @@ class Contracts { fun hasSelector(): Boolean { return selector != null } - fun hasShowKeyboard(): Boolean { - return showKeyboard != null - } } @Serializable diff --git a/packages/patrol/ios/Classes/AutomatorServer/Contracts.swift b/packages/patrol/ios/Classes/AutomatorServer/Contracts.swift index 95aff74f8..3df3d01c9 100644 --- a/packages/patrol/ios/Classes/AutomatorServer/Contracts.swift +++ b/packages/patrol/ios/Classes/AutomatorServer/Contracts.swift @@ -101,7 +101,7 @@ struct EnterTextRequest: Codable { var appId: String var index: Int? var selector: Selector? - var showKeyboard: Bool? + var showKeyboard: Bool } struct SwipeRequest: Codable { diff --git a/packages/patrol/lib/src/native/contracts/contracts.dart b/packages/patrol/lib/src/native/contracts/contracts.dart index 7f36b024f..3c1347a72 100644 --- a/packages/patrol/lib/src/native/contracts/contracts.dart +++ b/packages/patrol/lib/src/native/contracts/contracts.dart @@ -266,7 +266,7 @@ class EnterTextRequest { required this.appId, this.index, this.selector, - this.showKeyboard, + required this.showKeyboard, }); factory EnterTextRequest.fromJson(Map json) => @@ -276,7 +276,7 @@ class EnterTextRequest { final String appId; final int? index; final Selector? selector; - final bool? showKeyboard; + final bool showKeyboard; Map toJson() => _$EnterTextRequestToJson(this); } diff --git a/packages/patrol/lib/src/native/contracts/contracts.g.dart b/packages/patrol/lib/src/native/contracts/contracts.g.dart index 053d7dbfd..67daf7c5f 100644 --- a/packages/patrol/lib/src/native/contracts/contracts.g.dart +++ b/packages/patrol/lib/src/native/contracts/contracts.g.dart @@ -207,7 +207,7 @@ EnterTextRequest _$EnterTextRequestFromJson(Map json) => selector: json['selector'] == null ? null : Selector.fromJson(json['selector'] as Map), - showKeyboard: json['showKeyboard'] as bool?, + showKeyboard: json['showKeyboard'] as bool, ); Map _$EnterTextRequestToJson(EnterTextRequest instance) => diff --git a/schema.dart b/schema.dart index 744b6eb0d..01838d74c 100644 --- a/schema.dart +++ b/schema.dart @@ -88,7 +88,7 @@ class EnterTextRequest { late String appId; int? index; Selector? selector; - bool? showKeyboard; + late bool showKeyboard; } class SwipeRequest { From 22d061d62a3f4e775d93e92723045e5bad4c6d7d Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Tue, 29 Aug 2023 12:15:00 +0200 Subject: [PATCH 046/110] Migrate AutomatorServer and ContractsExtensions --- .../pl/leancode/patrol/AutomatorServer.kt | 51 +++++++++++-------- .../pl/leancode/patrol/ContractsExtensions.kt | 10 ++-- 2 files changed, 36 insertions(+), 25 deletions(-) diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/AutomatorServer.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/AutomatorServer.kt index 5a336698f..f0021e65a 100644 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/AutomatorServer.kt +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/AutomatorServer.kt @@ -41,6 +41,10 @@ class AutomatorServer(private val automation: Automator) : NativeAutomatorServer automation.closeNotifications() } + override fun closeHeadsUpNotification() { + // iOS only + } + override fun openQuickSettings(request: Contracts.OpenQuickSettingsRequest) { automation.openQuickSettings() } @@ -87,12 +91,14 @@ class AutomatorServer(private val automation: Automator) : NativeAutomatorServer override fun getNativeViews(request: Contracts.GetNativeViewsRequest): Contracts.GetNativeViewsResponse { val views = automation.getNativeViews(request.selector.toBySelector()) - return getNativeViewsResponse { nativeViews.addAll(views) } + return Contracts.GetNativeViewsResponse( + nativeViews = views + ) } override fun getNotifications(request: Contracts.GetNotificationsRequest): Contracts.GetNotificationsResponse { val notifs = automation.getNotifications() - return getNotificationsResponse { notifications.addAll(notifs) } + return Contracts.GetNotificationsResponse(notifs) } override fun tap(request: Contracts.TapRequest) { @@ -112,22 +118,22 @@ class AutomatorServer(private val automation: Automator) : NativeAutomatorServer } override fun enterText(request: Contracts.EnterTextRequest) { - when (request.findByCase) { - INDEX -> automation.enterText( + if (request.index != null) { + automation.enterText( text = request.data, - index = request.index?.toInt() ?: 0, + index = request.index!!.toInt(), showKeyboard = request.showKeyboard ) - - SELECTOR -> automation.enterText( + } else if (request.selector != null) { + automation.enterText( text = request.data, uiSelector = request.selector.toUiSelector(), bySelector = request.selector.toBySelector(), - index = request.selector.instance, + index = request.selector.instance?.toInt() ?: 0, showKeyboard = request.showKeyboard ) - - else -> throw PatrolException("enterText(): neither index nor selector are set") + } else { + throw PatrolException("enterText(): neither index nor selector are set") } } @@ -151,15 +157,17 @@ class AutomatorServer(private val automation: Automator) : NativeAutomatorServer override fun isPermissionDialogVisible(request: Contracts.PermissionDialogVisibleRequest): Contracts.PermissionDialogVisibleResponse { val visible = automation.isPermissionDialogVisible(timeout = request.timeoutMillis) - return permissionDialogVisibleResponse { this.visible = visible } + return Contracts.PermissionDialogVisibleResponse(visible) } override fun handlePermissionDialog(request: Contracts.HandlePermissionRequest) { when (request.code) { Contracts.HandlePermissionRequestCode.whileUsing -> automation.allowPermissionWhileUsingApp() + Contracts.HandlePermissionRequestCode.onlyThisTime -> automation.allowPermissionOnce() + Contracts.HandlePermissionRequestCode.denied -> automation.denyPermission() } @@ -169,28 +177,31 @@ class AutomatorServer(private val automation: Automator) : NativeAutomatorServer when (request.locationAccuracy) { Contracts.SetLocationAccuracyRequestLocationAccuracy.coarse -> automation.selectCoarseLocation() + Contracts.SetLocationAccuracyRequestLocationAccuracy.fine -> automation.selectFineLocation() } } + override fun debug() { + // iOS only + } + override fun tapOnNotification(request: Contracts.TapOnNotificationRequest) { - when (request.findByCase) { - Contracts.TapOnNotificationRequest.FindByCase.INDEX -> automation.tapOnNotification( - request.index + if (request.index != null) { + automation.tapOnNotification( + request.index.toInt() ) - - Contracts.TapOnNotificationRequest.FindByCase.SELECTOR -> automation.tapOnNotification( + } else if (request.selector != null) { + automation.tapOnNotification( request.selector.toUiSelector() ) - - else -> throw PatrolException("tapOnNotification(): neither index nor selector are set") + } else { + throw PatrolException("tapOnNotification(): neither index nor selector are set") } - } override fun markPatrolAppServiceReady() { PatrolServer.appReady.set(true) - } } diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/ContractsExtensions.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/ContractsExtensions.kt index 6d5af5982..95674a929 100644 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/ContractsExtensions.kt +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/ContractsExtensions.kt @@ -186,7 +186,7 @@ fun Contracts.Selector.toBySelector(): BySelector { fun DartTestGroup.listFlatDartFiles(): List { val files = mutableListOf() - for (group in groupsList) { + for (group in groups) { files.addAll(group.listGroups()) } @@ -195,10 +195,10 @@ fun DartTestGroup.listFlatDartFiles(): List { // Recursively lists groups in this group. private fun DartTestGroup.listGroups(): List { - val groups = mutableListOf(this.name) - for (group in groupsList) { - groups.addAll(group.listGroups()) + val outGroups = mutableListOf(this.name) + for (group in groups) { + outGroups.addAll(group.listGroups()) } - return groups + return outGroups } From ddf551dc35c716c78c1c226a2125023b2328759b Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Tue, 29 Aug 2023 12:48:03 +0200 Subject: [PATCH 047/110] Update schema, migrate automator --- .../kotlin/pl/leancode/patrol/Automator.kt | 85 ++++++++----------- .../pl/leancode/patrol/ContractsExtensions.kt | 4 +- .../pl/leancode/patrol/contracts/Contracts.kt | 69 +++++++++------ .../Classes/AutomatorServer/Automator.swift | 3 +- .../Classes/AutomatorServer/Contracts.swift | 12 +-- .../lib/src/native/contracts/contracts.dart | 24 +++--- .../lib/src/native/contracts/contracts.g.dart | 12 +-- .../android/android_contracts_generator.dart | 3 +- schema.dart | 12 +-- 9 files changed, 113 insertions(+), 111 deletions(-) diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/Automator.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/Automator.kt index c96530eda..83f4b11aa 100644 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/Automator.kt +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/Automator.kt @@ -16,38 +16,20 @@ import androidx.test.uiautomator.UiObject2 import androidx.test.uiautomator.UiObjectNotFoundException import androidx.test.uiautomator.UiSelector import pl.leancode.patrol.contracts.Contracts -import pl.leancode.patrol.contracts.nativeView -import pl.leancode.patrol.contracts.notification import kotlin.math.roundToInt private fun fromUiObject2(obj: UiObject2): Contracts.NativeView { - return nativeView { - if (obj.className != null) { - className = obj.className - } - - if (obj.text != null) { - text = obj.text - } - - if (obj.contentDescription != null) { - contentDescription = obj.contentDescription - } - - focused = obj.isFocused - enabled = obj.isEnabled - childCount = obj.childCount - - if (obj.resourceName != null) { - resourceName = obj.resourceName - } - - if (obj.applicationPackage != null) { - applicationPackage = obj.applicationPackage - } - - children.addAll(obj.children?.map { fromUiObject2(it) } ?: listOf()) - } + return Contracts.NativeView( + className = obj.className, + text = obj.text, + contentDescription = obj.contentDescription, + focused = obj.isFocused, + enabled = obj.isEnabled, + childCount = obj.childCount.toLong(), + resourceName = obj.resourceName, + applicationPackage = obj.applicationPackage, + children = obj.children?.map { fromUiObject2(it) } ?: listOf() + ) } class Automator private constructor() { @@ -327,29 +309,28 @@ class Automator private constructor() { val notifications = mutableListOf() for (notificationContainer in notificationContainers) { - val notification = notification { - val appName = notificationContainer.findObject(By.res("android:id/app_name_text"))?.text - if (appName != null) { - this.appName = appName - } + val appName = notificationContainer.findObject(By.res("android:id/app_name_text"))?.text - val title = notificationContainer.findObject(By.res("android:id/title"))?.text - ?: notificationContainer.findObject(By.res("com.android.systemui:id/notification_title"))?.text - if (title != null) { - this.title = title - } else { - Logger.e("Could not find title text") - } + val content = notificationContainer.findObject(By.res("android:id/text"))?.text + ?: notificationContainer.findObject(By.res("android:id/big_text"))?.text + ?: notificationContainer.findObject(By.res("com.android.systemui:id/notification_text"))?.text + if (content == null) { + Logger.e("Could not find content text") + } - val content = notificationContainer.findObject(By.res("android:id/text"))?.text - ?: notificationContainer.findObject(By.res("android:id/big_text"))?.text - ?: notificationContainer.findObject(By.res("com.android.systemui:id/notification_text"))?.text - if (content != null) { - this.content = content - } else { - Logger.e("Could not find content text") - } + val title = notificationContainer.findObject(By.res("android:id/title"))?.text + ?: notificationContainer.findObject(By.res("com.android.systemui:id/notification_title"))?.text + if (title == null) { + Logger.e("Could not find title text") } + + val notification = Contracts.Notification( + appName = appName, + content = content ?: "", + title = title ?: "", + raw = "" // Should it be optional ? + ) + notifications.add(notification) } @@ -360,8 +341,10 @@ class Automator private constructor() { Logger.d("tapOnNotification($index)") try { - val query = Contracts.Selector.newBuilder().setResourceId("android:id/status_bar_latest_event_content") - .setInstance(index).build() + val query = Contracts.Selector( + resourceId = "android:id/status_bar_latest_event_content", + instance = index.toLong() + ) val obj = uiDevice.findObject(query.toUiSelector()) obj.click() } catch (err: UiObjectNotFoundException) { diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/ContractsExtensions.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/ContractsExtensions.kt index 95674a929..c0f9eae0d 100644 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/ContractsExtensions.kt +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/ContractsExtensions.kt @@ -8,7 +8,7 @@ import pl.leancode.patrol.contracts.Contracts.DartTestGroup private fun Contracts.Selector.isEmpty(): Boolean { return ( - !hasText() && + !hasText() && !hasTextStartsWith() && !hasTextContains() && !hasClassName() && @@ -20,7 +20,7 @@ private fun Contracts.Selector.isEmpty(): Boolean { !hasEnabled() && !hasFocused() && !hasPkg() - ) + ) } fun Contracts.Selector.toUiSelector(): UiSelector { diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/Contracts.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/Contracts.kt index b53ae2bd4..90e8e3110 100644 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/Contracts.kt +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/Contracts.kt @@ -53,7 +53,7 @@ class Contracts { @Serializable data class RunDartTestResponse ( val result: RunDartTestResponseResult, - val details: String? + val details: String? = null ){ fun hasDetails(): Boolean { return details != null @@ -77,18 +77,18 @@ class Contracts { @Serializable data class Selector ( - val text: String?, - val textStartsWith: String?, - val textContains: String?, - val className: String?, - val contentDescription: String?, - val contentDescriptionStartsWith: String?, - val contentDescriptionContains: String?, - val resourceId: String?, - val instance: Long?, - val enabled: Boolean?, - val focused: Boolean?, - val pkg: String? + val text: String? = null, + val textStartsWith: String? = null, + val textContains: String? = null, + val className: String? = null, + val contentDescription: String? = null, + val contentDescriptionStartsWith: String? = null, + val contentDescriptionContains: String? = null, + val resourceId: String? = null, + val instance: Long? = null, + val enabled: Boolean? = null, + val focused: Boolean? = null, + val pkg: String? = null ){ fun hasText(): Boolean { return text != null @@ -136,16 +136,35 @@ class Contracts { @Serializable data class NativeView ( - val className: String, - val text: String, - val contentDescription: String, + val className: String? = null, + val text: String? = null, + val contentDescription: String? = null, val focused: Boolean, val enabled: Boolean, - val childCount: Long, - val resourceName: String, - val applicationPackage: String, + val childCount: Long? = null, + val resourceName: String? = null, + val applicationPackage: String? = null, val children: List - ) + ){ + fun hasClassName(): Boolean { + return className != null + } + fun hasText(): Boolean { + return text != null + } + fun hasContentDescription(): Boolean { + return contentDescription != null + } + fun hasChildCount(): Boolean { + return childCount != null + } + fun hasResourceName(): Boolean { + return resourceName != null + } + fun hasApplicationPackage(): Boolean { + return applicationPackage != null + } + } @Serializable data class GetNativeViewsResponse ( @@ -162,8 +181,8 @@ class Contracts { data class EnterTextRequest ( val data: String, val appId: String, - val index: Long?, - val selector: Selector?, + val index: Long? = null, + val selector: Selector? = null, val showKeyboard: Boolean ){ fun hasIndex(): Boolean { @@ -196,7 +215,7 @@ class Contracts { @Serializable data class Notification ( - val appName: String?, + val appName: String? = null, val title: String, val content: String, val raw: String @@ -218,8 +237,8 @@ class Contracts { @Serializable data class TapOnNotificationRequest ( - val index: Long?, - val selector: Selector? + val index: Long? = null, + val selector: Selector? = null ){ fun hasIndex(): Boolean { return index != null diff --git a/packages/patrol/ios/Classes/AutomatorServer/Automator.swift b/packages/patrol/ios/Classes/AutomatorServer/Automator.swift index a72cf44d2..f2dd5c264 100644 --- a/packages/patrol/ios/Classes/AutomatorServer/Automator.swift +++ b/packages/patrol/ios/Classes/AutomatorServer/Automator.swift @@ -799,10 +799,9 @@ return NativeView( className: String(xcuielement.elementType.rawValue), // TODO: Provide mapping for names text: xcuielement.label, - contentDescription: xcuielement.accessibilityLabel ?? String(), + contentDescription: xcuielement.accessibilityLabel, focused: xcuielement.hasFocus, enabled: xcuielement.isEnabled, - childCount: 0, //TODO nullable? resourceName: xcuielement.identifier, applicationPackage: bundleId, children: xcuielement.children(matching: .any).allElementsBoundByIndex.map { child in diff --git a/packages/patrol/ios/Classes/AutomatorServer/Contracts.swift b/packages/patrol/ios/Classes/AutomatorServer/Contracts.swift index 3df3d01c9..6d8d61108 100644 --- a/packages/patrol/ios/Classes/AutomatorServer/Contracts.swift +++ b/packages/patrol/ios/Classes/AutomatorServer/Contracts.swift @@ -76,14 +76,14 @@ struct GetNativeViewsRequest: Codable { } struct NativeView: Codable { - var className: String - var text: String - var contentDescription: String + var className: String? + var text: String? + var contentDescription: String? var focused: Bool var enabled: Bool - var childCount: Int - var resourceName: String - var applicationPackage: String + var childCount: Int? + var resourceName: String? + var applicationPackage: String? var children: [NativeView] } diff --git a/packages/patrol/lib/src/native/contracts/contracts.dart b/packages/patrol/lib/src/native/contracts/contracts.dart index 3c1347a72..48e062632 100644 --- a/packages/patrol/lib/src/native/contracts/contracts.dart +++ b/packages/patrol/lib/src/native/contracts/contracts.dart @@ -202,28 +202,28 @@ class GetNativeViewsRequest { @JsonSerializable() class NativeView { NativeView({ - required this.className, - required this.text, - required this.contentDescription, + this.className, + this.text, + this.contentDescription, required this.focused, required this.enabled, - required this.childCount, - required this.resourceName, - required this.applicationPackage, + this.childCount, + this.resourceName, + this.applicationPackage, required this.children, }); factory NativeView.fromJson(Map json) => _$NativeViewFromJson(json); - final String className; - final String text; - final String contentDescription; + final String? className; + final String? text; + final String? contentDescription; final bool focused; final bool enabled; - final int childCount; - final String resourceName; - final String applicationPackage; + final int? childCount; + final String? resourceName; + final String? applicationPackage; final List children; Map toJson() => _$NativeViewToJson(this); diff --git a/packages/patrol/lib/src/native/contracts/contracts.g.dart b/packages/patrol/lib/src/native/contracts/contracts.g.dart index 67daf7c5f..28ca15712 100644 --- a/packages/patrol/lib/src/native/contracts/contracts.g.dart +++ b/packages/patrol/lib/src/native/contracts/contracts.g.dart @@ -148,14 +148,14 @@ Map _$GetNativeViewsRequestToJson( }; NativeView _$NativeViewFromJson(Map json) => NativeView( - className: json['className'] as String, - text: json['text'] as String, - contentDescription: json['contentDescription'] as String, + className: json['className'] as String?, + text: json['text'] as String?, + contentDescription: json['contentDescription'] as String?, focused: json['focused'] as bool, enabled: json['enabled'] as bool, - childCount: json['childCount'] as int, - resourceName: json['resourceName'] as String, - applicationPackage: json['applicationPackage'] as String, + childCount: json['childCount'] as int?, + resourceName: json['resourceName'] as String?, + applicationPackage: json['applicationPackage'] as String?, children: (json['children'] as List) .map((e) => NativeView.fromJson(e as Map)) .toList(), diff --git a/packages/patrol_gen/lib/src/generators/android/android_contracts_generator.dart b/packages/patrol_gen/lib/src/generators/android/android_contracts_generator.dart index 3b071f162..eee3f5ba3 100644 --- a/packages/patrol_gen/lib/src/generators/android/android_contracts_generator.dart +++ b/packages/patrol_gen/lib/src/generators/android/android_contracts_generator.dart @@ -34,7 +34,7 @@ import kotlinx.serialization.Serializable String _createMessage(Message message) { final fields = message.fields.map((e) { - final optional = e.isOptional ? '?' : ''; + final optional = e.isOptional ? '? = null' : ''; return e.isList ? ' val ${e.name}: List<${_transformType(e.type)}>$optional' : ' val ${e.name}: ${_transformType(e.type)}$optional'; @@ -43,6 +43,7 @@ import kotlinx.serialization.Serializable final dataKeyword = fields.isNotEmpty ? 'data ' : ''; final optionalFields = message.fields.where((e) => e.isOptional).toList(); + var optionalFieldUtils = optionalFields.map(_optionalFieldUtil).join('\n'); if (optionalFields.isNotEmpty) { optionalFieldUtils = '''{ diff --git a/schema.dart b/schema.dart index 01838d74c..95955ea9e 100644 --- a/schema.dart +++ b/schema.dart @@ -63,14 +63,14 @@ class GetNativeViewsRequest { } class NativeView { - late String className; - late String text; - late String contentDescription; + String? className; + String? text; + String? contentDescription; late bool focused; late bool enabled; - late int childCount; - late String resourceName; - late String applicationPackage; + int? childCount; + String? resourceName; + String? applicationPackage; late List children; } From 5ee8c414cab073fc65a62259f160e2b3bc6d7c37 Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Tue, 29 Aug 2023 19:07:49 +0200 Subject: [PATCH 048/110] Generate client and setup PatrolServer --- packages/patrol/android/build.gradle | 6 ++ .../patrol/BrowserstackPatrolJUnitRunner.java | 6 +- .../pl/leancode/patrol/LoggerInterceptor.kt | 66 ------------ .../patrol/PatrolAppServiceClient.java | 42 -------- .../leancode/patrol/PatrolAppServiceClient.kt | 36 +++++++ .../pl/leancode/patrol/PatrolJUnitRunner.java | 14 +-- .../kotlin/pl/leancode/patrol/PatrolServer.kt | 26 +++-- .../pl/leancode/patrol/PatrolServerFilters.kt | 45 ++++++++ .../contracts/PatrolAppServiceClient.kt | 48 +++++++++ .../generators/android/android_generator.dart | 5 + .../android_http4k_client_generator.dart | 100 ++++++++++++++++++ 11 files changed, 267 insertions(+), 127 deletions(-) delete mode 100644 packages/patrol/android/src/main/kotlin/pl/leancode/patrol/LoggerInterceptor.kt delete mode 100644 packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolAppServiceClient.java create mode 100644 packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolAppServiceClient.kt create mode 100644 packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolServerFilters.kt create mode 100644 packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/PatrolAppServiceClient.kt create mode 100644 packages/patrol_gen/lib/src/generators/android/android_http4k_client_generator.dart diff --git a/packages/patrol/android/build.gradle b/packages/patrol/android/build.gradle index 4ef52d6a4..f6c837932 100644 --- a/packages/patrol/android/build.gradle +++ b/packages/patrol/android/build.gradle @@ -64,7 +64,13 @@ android { api "androidx.test.uiautomator:uiautomator:2.2.0" implementation "javax.annotation:javax.annotation-api:1.3.2" + + implementation platform("org.http4k:http4k-bom:4.25.14.0") + implementation "org.http4k:http4k-core" + implementation "org.http4k:http4k-server-netty" implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.0" + implementation "org.http4k:http4k-client-apache" + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-guava:1.6.0") testImplementation "org.jetbrains.kotlin:kotlin-test" } diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/BrowserstackPatrolJUnitRunner.java b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/BrowserstackPatrolJUnitRunner.java index 7149b1395..ace3d41e0 100644 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/BrowserstackPatrolJUnitRunner.java +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/BrowserstackPatrolJUnitRunner.java @@ -1,7 +1,7 @@ package pl.leancode.patrol; import android.util.Log; -import io.grpc.StatusRuntimeException; +import pl.leancode.patrol.contracts.PatrolAppServiceClientException; import java.net.Inet4Address; import java.net.NetworkInterface; @@ -18,7 +18,7 @@ public PatrolAppServiceClient createAppServiceClient() { try { client.listDartTests(); - } catch (StatusRuntimeException ex) { + } catch (PatrolAppServiceClientException ex) {//TODO ex.printStackTrace(); // If the client on localhost:8082 fails, let's apply the wokraround Logger.INSTANCE.i("StatusRuntimeException in createAppServiceClient " + ex.getMessage()); @@ -38,7 +38,7 @@ public String getLoopback() { if (Objects.equals(i.getDisplayName(), "tun0")) { for (java.net.InterfaceAddress a : i.getInterfaceAddresses()) { if (a.getAddress() instanceof Inet4Address) { - return a.getAddress().toString().substring(1) + ":8082"; + return a.getAddress().toString().substring(1); } } } diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/LoggerInterceptor.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/LoggerInterceptor.kt deleted file mode 100644 index 815ee49b3..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/LoggerInterceptor.kt +++ /dev/null @@ -1,66 +0,0 @@ -package pl.leancode.patrol - -import androidx.test.uiautomator.UiObjectNotFoundException -import io.grpc.ForwardingServerCall -import io.grpc.Metadata -import io.grpc.ServerCall -import io.grpc.ServerCallHandler -import io.grpc.ServerInterceptor -import io.grpc.Status - -class LoggerInterceptor : ServerInterceptor { - - private class ExceptionTranslatingServerCall( - delegate: ServerCall - ) : ForwardingServerCall.SimpleForwardingServerCall(delegate) { - - private fun handleErrorStatus(exception: Throwable?): Status { - val newStatus = when (exception) { - is UiObjectNotFoundException -> { - Status - .NOT_FOUND - .withDescription("selector ${exception.message} found nothing") - } - - is NotImplementedError -> { - Status - .UNIMPLEMENTED - .withDescription("method ${exception.message}() is not implemented on Android") - } - - else -> { - Status - .UNKNOWN - .withDescription("unknown error has occurred") - .augmentDescription(exception?.stackTraceToString()) - } - } - - return newStatus.withCause(exception) - } - - override fun close(status: Status, trailers: Metadata) { - if (status.isOk) { - return super.close(status, trailers) - } - val cause = status.cause - - val newStatus = if (status.code == Status.Code.UNKNOWN) { - Logger.e("Error handling gRPC endpoint", cause) - handleErrorStatus(cause) - } else { - status - } - - super.close(newStatus, trailers) - } - } - - override fun interceptCall( - call: ServerCall, - headers: Metadata, - next: ServerCallHandler - ): ServerCall.Listener { - return next.startCall(ExceptionTranslatingServerCall(call), headers) - } -} diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolAppServiceClient.java b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolAppServiceClient.java deleted file mode 100644 index 68caee0b4..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolAppServiceClient.java +++ /dev/null @@ -1,42 +0,0 @@ -package pl.leancode.patrol; - -import io.grpc.Grpc; -import io.grpc.InsecureChannelCredentials; -import io.grpc.ManagedChannel; -import io.grpc.StatusRuntimeException; -import pl.leancode.patrol.contracts.PatrolAppServiceGrpc; - -import static pl.leancode.patrol.contracts.Contracts.*; - -/** - * Enables querying Dart tests, running them, waiting for them to finish, and getting their results - */ -public class PatrolAppServiceClient { - - private final PatrolAppServiceGrpc.PatrolAppServiceBlockingStub blockingStub; - - public PatrolAppServiceClient() { - String target = "localhost:8082"; // TODO: Document this value better - Logger.INSTANCE.i("Created PatrolAppServiceClient with default target: " + target); - ManagedChannel channel = Grpc.newChannelBuilder(target, InsecureChannelCredentials.create()).build(); - blockingStub = PatrolAppServiceGrpc.newBlockingStub(channel); - } - - public PatrolAppServiceClient(String target) { - Logger.INSTANCE.i("Created PatrolAppServiceClient, target: " + target); - ManagedChannel channel = Grpc.newChannelBuilder(target, InsecureChannelCredentials.create()).build(); - blockingStub = PatrolAppServiceGrpc.newBlockingStub(channel); - } - - public DartTestGroup listDartTests() throws StatusRuntimeException { - Empty request = Empty.newBuilder().build(); - ListDartTestsResponse response = blockingStub.listDartTests(request); - - return response.getGroup(); - } - - public RunDartTestResponse runDartTest(String name) throws StatusRuntimeException { - RunDartTestRequest request = RunDartTestRequest.newBuilder().setName(name).build(); - return blockingStub.runDartTest(request); - } -} diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolAppServiceClient.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolAppServiceClient.kt new file mode 100644 index 000000000..10e33c7eb --- /dev/null +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolAppServiceClient.kt @@ -0,0 +1,36 @@ +package pl.leancode.patrol; + +import pl.leancode.patrol.contracts.Contracts +import pl.leancode.patrol.contracts.PatrolAppServiceClientException +import pl.leancode.patrol.contracts.PatrolAppServiceClient as Client + +/** + * Enables querying Dart tests, running them, waiting for them to finish, and getting their results + */ +class PatrolAppServiceClient { + + private var client: Client + + constructor() { + client = Client(address = "localhost", port = 8082) + Logger.i("Created PatrolAppServiceClient: ${client.serverUrl}") + } + + constructor(address: String) { + client = Client(address = address, port = 8082) + Logger.i("Created PatrolAppServiceClient: ${client.serverUrl}") + } + + @Throws(PatrolAppServiceClientException::class) + fun listDartTests(): Contracts.DartTestGroup { + Logger.i("PatrolAppServiceClient.listDartTests()") + val result = client.listDartTests() + return result.group + } + + @Throws(PatrolAppServiceClientException::class) + fun runDartTest(name: String): Contracts.RunDartTestResponse { + Logger.i("PatrolAppServiceClient.runDartTest($name)") + return client.runDartTest(Contracts.RunDartTestRequest(name)) + } +} \ No newline at end of file diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolJUnitRunner.java b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolJUnitRunner.java index fffe13014..29d14077f 100644 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolJUnitRunner.java +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolJUnitRunner.java @@ -10,8 +10,10 @@ import android.os.Bundle; import androidx.test.platform.app.InstrumentationRegistry; import androidx.test.runner.AndroidJUnitRunner; -import io.grpc.StatusRuntimeException; + +import pl.leancode.patrol.contracts.Contracts; import pl.leancode.patrol.contracts.Contracts.DartTestGroup; +import pl.leancode.patrol.contracts.PatrolAppServiceClientException; import java.util.Arrays; import java.util.concurrent.ExecutionException; @@ -102,7 +104,7 @@ public void waitForPatrolAppService() { Logger.INSTANCE.i(TAG + "PatrolAppService is ready to report Dart tests"); } - public Object[] listDartTests() { + public Object[] listDartTests() throws PatrolAppServiceClientException { final String TAG = "PatrolJUnitRunner.listDartTests(): "; try { @@ -110,7 +112,7 @@ public Object[] listDartTests() { Object[] dartTestFiles = ContractsExtensionsKt.listFlatDartFiles(dartTestGroup).toArray(); Logger.INSTANCE.i(TAG + "Got Dart tests: " + Arrays.toString(dartTestFiles)); return dartTestFiles; - } catch (StatusRuntimeException e) { + } catch (PatrolAppServiceClientException e) { Logger.INSTANCE.e(TAG + "Failed to list Dart tests: ", e); throw e; } @@ -120,17 +122,17 @@ public Object[] listDartTests() { * Requests execution of a Dart test and waits for it to finish. * Throws AssertionError if the test fails. */ - public RunDartTestResponse runDartTest(String name) { + public RunDartTestResponse runDartTest(String name) throws PatrolAppServiceClientException { final String TAG = "PatrolJUnitRunner.runDartTest(" + name + "): "; try { Logger.INSTANCE.i(TAG + "Requested execution"); RunDartTestResponse response = patrolAppServiceClient.runDartTest(name); - if (response.getResult() == RunDartTestResponse.Result.FAILURE) { + if (response.getResult() == Contracts.RunDartTestResponseResult.failure) { throw new AssertionError("Dart test failed: " + name + "\n" + response.getDetails()); } return response; - } catch (StatusRuntimeException e) { + } catch (PatrolAppServiceClientException e) { Logger.INSTANCE.e(TAG + e.getMessage(), e.getCause()); throw e; } diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolServer.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolServer.kt index 5c5d99901..dbc84e44f 100644 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolServer.kt +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolServer.kt @@ -1,42 +1,48 @@ package pl.leancode.patrol import androidx.test.platform.app.InstrumentationRegistry +import org.http4k.core.ContentType +import org.http4k.filter.ServerFilters import org.http4k.server.Http4kServer +import org.http4k.server.Netty +import org.http4k.server.asServer import java.util.concurrent.Future +import com.google.common.util.concurrent.SettableFuture; class PatrolServer { private val envPortKey = "PATROL_PORT" private val port: Int private var server: Http4kServer? = null + private var automatorServer: AutomatorServer? = null init { port = arguments.getString(envPortKey)?.toInt() ?: 8081 - server = OkHttpServerBuilder - .forPort(port, InsecureServerCredentials.create()) - .intercept(LoggerInterceptor()) - .addService(AutomatorServer(automation = Automator.instance)) - .build() } private val arguments get() = InstrumentationRegistry.getArguments() fun start() { + Logger.i("Starting server...") + + automatorServer = AutomatorServer(Automator.instance) + server = automatorServer!!.router + .withFilter(catcher) + .withFilter(printer) + .withFilter(ServerFilters.SetContentType(ContentType.TEXT_PLAIN)) + .asServer(Netty(port)) + server?.start() Logger.i("Created and started PatrolServer, port: $port") Runtime.getRuntime().addShutdownHook( Thread { Logger.i("Stopping server...") - server?.shutdown() + server?.close() Logger.i("Server stopped") } ) } - fun blockUntilShutdown() { - server?.awaitTermination() - } - companion object { val appReady: SettableFuture = SettableFuture.create() val appReadyFuture: Future diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolServerFilters.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolServerFilters.kt new file mode 100644 index 000000000..d29e62f7b --- /dev/null +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolServerFilters.kt @@ -0,0 +1,45 @@ +package pl.leancode.patrol + +import androidx.test.uiautomator.UiObjectNotFoundException +import kotlinx.serialization.SerializationException +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json +import org.http4k.core.Filter +import org.http4k.core.MemoryBody +import org.http4k.core.Response +import org.http4k.core.Status +import org.http4k.core.Status.Companion.BAD_REQUEST +import org.http4k.core.Status.Companion.INTERNAL_SERVER_ERROR +import org.http4k.core.Status.Companion.NOT_FOUND +import org.http4k.core.Status.Companion.NOT_IMPLEMENTED + +private val json = Json { ignoreUnknownKeys = true } + +val printer = Filter { next -> + { request -> + val requestName = "${request.method} ${request.uri}" + Logger.i("$requestName started") + val startTime = System.currentTimeMillis() + val response = next(request) + val latency = System.currentTimeMillis() - startTime + Logger.i("$requestName took $latency ms") + response + } +} + +val catcher = Filter { next -> + { request -> + try { + next(request) + } catch (err: UiObjectNotFoundException) { + Logger.e("caught UiObjectNotFoundException", err) + val msg = "selector ${err.message} found nothing" + Response(NOT_FOUND).body(msg) + } catch (err: NotImplementedError) { + Response(NOT_IMPLEMENTED).body("method ${err.message}() is not implemented on Android") + } catch (err: Exception) { + Logger.e("caught Exception", err) + Response(INTERNAL_SERVER_ERROR).body(err.stackTraceToString()) + } + } +} diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/PatrolAppServiceClient.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/PatrolAppServiceClient.kt new file mode 100644 index 000000000..5d0111361 --- /dev/null +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/PatrolAppServiceClient.kt @@ -0,0 +1,48 @@ +/// +// Generated code. Do not modify. +// source: schema.dart +// + +package pl.leancode.patrol.contracts; + +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json +import org.http4k.client.ApacheClient +import org.http4k.core.Method +import org.http4k.core.Request +import org.http4k.core.Status + +class PatrolAppServiceClient(private val address: String, private val port: Int) { + + fun listDartTests() : Contracts.ListDartTestsResponse { + val response = performRequest() + return json.decodeFromString(response) + } + + fun runDartTest(request: Contracts.RunDartTestRequest) : Contracts.RunDartTestResponse { + val response = performRequest(json.encodeToString(request)) + return json.decodeFromString(response) + } + + private fun performRequest(requestBody: String? = null): String { + var request = Request(Method.POST, serverUrl) + if (requestBody != null) { + request = request.body(requestBody) + } + + val client = ApacheClient() + val response = client(request) + + if (response.status != Status.OK) { + throw PatrolAppServiceClientException("Invalid response ${response.status}") + } + + return response.bodyString() + } + + val serverUrl = "http://$address:$port" + + private val json = Json { ignoreUnknownKeys = true } +} + +class PatrolAppServiceClientException(message: String) : Exception(message) diff --git a/packages/patrol_gen/lib/src/generators/android/android_generator.dart b/packages/patrol_gen/lib/src/generators/android/android_generator.dart index bfc8e3dc4..0928fec57 100644 --- a/packages/patrol_gen/lib/src/generators/android/android_generator.dart +++ b/packages/patrol_gen/lib/src/generators/android/android_generator.dart @@ -1,5 +1,6 @@ import 'package:patrol_gen/src/generators/android/android_config.dart'; import 'package:patrol_gen/src/generators/android/android_contracts_generator.dart'; +import 'package:patrol_gen/src/generators/android/android_http4k_client_generator.dart'; import 'package:patrol_gen/src/generators/android/android_http4k_server_generator.dart'; import 'package:patrol_gen/src/generators/output_file.dart'; import 'package:patrol_gen/src/schema.dart'; @@ -11,11 +12,15 @@ class AndroidGenerator { ]; final serverGenerator = AndroidHttp4kServerGenerator(); + final clientGenerator = AndroidHttp4kClientGenerator(); for (var service in schema.services) { if (service.android.needsServer) { result.add(serverGenerator.generate(service, config)); } + if (service.android.needsClient) { + result.add(clientGenerator.generate(service, config)); + } } return result; diff --git a/packages/patrol_gen/lib/src/generators/android/android_http4k_client_generator.dart b/packages/patrol_gen/lib/src/generators/android/android_http4k_client_generator.dart new file mode 100644 index 000000000..172eb2812 --- /dev/null +++ b/packages/patrol_gen/lib/src/generators/android/android_http4k_client_generator.dart @@ -0,0 +1,100 @@ +import 'package:patrol_gen/src/generators/android/android_config.dart'; +import 'package:patrol_gen/src/generators/output_file.dart'; +import 'package:patrol_gen/src/schema.dart'; + +class AndroidHttp4kClientGenerator { + OutputFile generate(Service service, AndroidConfig config) { + final buffer = StringBuffer()..write(_contentPrefix(config)); + + buffer + ..writeln(_generateClientClass(service)) + ..writeln() + ..writeln(_generateExceptionClass(service)); + + return OutputFile( + filename: config.clientFileName(service.name), + content: buffer.toString(), + ); + } + + String _contentPrefix(AndroidConfig config) { + return ''' +/// +// Generated code. Do not modify. +// source: schema.dart +// + +package ${config.package}; + +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json +import org.http4k.client.ApacheClient +import org.http4k.core.Method +import org.http4k.core.Request +import org.http4k.core.Status + +'''; + } + + String _generateClientClass(Service service) { + final url = r'"http://$address:$port"'; + final endpoints = service.endpoints.map(_createEndpoint).join('\n\n'); + final throwException = + r'throw PatrolAppServiceClientException("Invalid response ${response.status}")'; + + return ''' +class ${service.name}Client(private val address: String, private val port: Int) { + +$endpoints + + private fun performRequest(requestBody: String? = null): String { + var request = Request(Method.POST, serverUrl) + if (requestBody != null) { + request = request.body(requestBody) + } + + val client = ApacheClient() + val response = client(request) + + if (response.status != Status.OK) { + $throwException + } + + return response.bodyString() + } + + val serverUrl = $url + + private val json = Json { ignoreUnknownKeys = true } +}'''; + } + + String _createEndpoint(Endpoint endpoint) { + final parameterDef = endpoint.request != null + ? 'request: Contracts.${endpoint.request!.name}' + : ''; + final returnDef = endpoint.response != null + ? ': Contracts.${endpoint.response!.name}' + : ''; + + final serializeParameter = + endpoint.request != null ? 'json.encodeToString(request)' : ''; + + final body = endpoint.response != null + ? ''' + val response = performRequest($serializeParameter) + return json.decodeFromString(response)''' + : ''' + return performRequest($serializeParameter)'''; + + return ''' + fun ${endpoint.name}($parameterDef) $returnDef { +$body + }'''; + } + + String _generateExceptionClass(Service service) { + return ''' +class ${service.name}ClientException(message: String) : Exception(message)'''; + } +} From 41d774e6bee476e18a5ccfdfeb4de32f35372823 Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Wed, 30 Aug 2023 11:28:43 +0200 Subject: [PATCH 049/110] Remove gradlewrapper --- packages/patrol/android/build.gradle | 12 +- .../android/gradle/wrapper/gradle-wrapper.jar | Bin 60756 -> 0 bytes .../gradle/wrapper/gradle-wrapper.properties | 5 - packages/patrol/android/gradlew | 240 ------------------ packages/patrol/android/gradlew.bat | 91 ------- 5 files changed, 6 insertions(+), 342 deletions(-) delete mode 100644 packages/patrol/android/gradle/wrapper/gradle-wrapper.jar delete mode 100644 packages/patrol/android/gradle/wrapper/gradle-wrapper.properties delete mode 100755 packages/patrol/android/gradlew delete mode 100644 packages/patrol/android/gradlew.bat diff --git a/packages/patrol/android/build.gradle b/packages/patrol/android/build.gradle index f6c837932..ebd6b4afd 100644 --- a/packages/patrol/android/build.gradle +++ b/packages/patrol/android/build.gradle @@ -65,12 +65,12 @@ android { implementation "javax.annotation:javax.annotation-api:1.3.2" - implementation platform("org.http4k:http4k-bom:4.25.14.0") - implementation "org.http4k:http4k-core" - implementation "org.http4k:http4k-server-netty" - implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.0" - implementation "org.http4k:http4k-client-apache" - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-guava:1.6.0") + // implementation(platform("org.http4k:http4k-bom:5.7.4.0")) + // implementation "org.http4k:http4k-core" + // implementation "org.http4k:http4k-server-netty" + // implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.0" + // implementation "org.http4k:http4k-client-apache" + // implementation("org.jetbrains.kotlinx:kotlinx-coroutines-guava:1.5.2") testImplementation "org.jetbrains.kotlin:kotlin-test" } diff --git a/packages/patrol/android/gradle/wrapper/gradle-wrapper.jar b/packages/patrol/android/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index 249e5832f090a2944b7473328c07c9755baa3196..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 60756 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 '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac -done - -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" -APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum - -warn () { - echo "$*" -} >&2 - -die () { - echo - echo "$*" - echo - exit 1 -} >&2 - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; -esac - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac -fi - -# Collect all arguments for the java command, stacking in reverse order: -# * args from the command line -# * the main class name -# * -classpath -# * -D...appname settings -# * --module-path (only if needed) -# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. - -# For Cygwin or MSYS, switch paths to Windows format before running java -if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - - JAVACMD=$( cygpath --unix "$JAVACMD" ) - - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done -fi - -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. - -set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" - -# Stop when "xargs" is not available. -if ! command -v xargs >/dev/null 2>&1 -then - die "xargs is not available" -fi - -# Use "xargs" to parse quoted args. -# -# With -n1 it outputs one arg per line, with the quotes and backslashes removed. -# -# In Bash we could simply go: -# -# readarray ARGS < <( xargs -n1 <<<"$var" ) && -# set -- "${ARGS[@]}" "$@" -# -# but POSIX shell has neither arrays nor command substitution, so instead we -# post-process each arg (as a line of input to sed) to backslash-escape any -# character that might be a shell metacharacter, then use eval to reverse -# that process (while maintaining the separation between arguments), and wrap -# the whole thing up as a single "set" statement. -# -# This will of course break if any of these variables contains a newline or -# an unmatched quote. -# - -eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' - -exec "$JAVACMD" "$@" diff --git a/packages/patrol/android/gradlew.bat b/packages/patrol/android/gradlew.bat deleted file mode 100644 index 53a6b238d..000000000 --- a/packages/patrol/android/gradlew.bat +++ /dev/null @@ -1,91 +0,0 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega From 9a3edb5b0c3d5230e88d9016c6ded51b89768850 Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Wed, 30 Aug 2023 18:02:49 +0200 Subject: [PATCH 050/110] Fix build and runtimes problems --- packages/patrol/android/build.gradle | 14 +++++---- .../contracts/PatrolAppServiceClient.kt | 25 +++++++++++----- .../patrol/example/android/app/build.gradle | 7 +++++ .../patrol/example/MainActivityTest.java | 7 +++-- .../android_http4k_client_generator.dart | 29 ++++++++++++++----- 5 files changed, 58 insertions(+), 24 deletions(-) diff --git a/packages/patrol/android/build.gradle b/packages/patrol/android/build.gradle index ebd6b4afd..770fcd25b 100644 --- a/packages/patrol/android/build.gradle +++ b/packages/patrol/android/build.gradle @@ -13,12 +13,14 @@ buildscript { classpath "com.android.tools.build:gradle:7.4.2" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jlleitschuh.gradle:ktlint-gradle:11.5.0" + classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version" } } apply plugin: "com.android.library" apply plugin: "kotlin-android" apply plugin: "org.jlleitschuh.gradle.ktlint" +apply plugin: "kotlinx-serialization" ktlint { filter { @@ -65,12 +67,12 @@ android { implementation "javax.annotation:javax.annotation-api:1.3.2" - // implementation(platform("org.http4k:http4k-bom:5.7.4.0")) - // implementation "org.http4k:http4k-core" - // implementation "org.http4k:http4k-server-netty" - // implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.0" - // implementation "org.http4k:http4k-client-apache" - // implementation("org.jetbrains.kotlinx:kotlinx-coroutines-guava:1.5.2") + implementation(platform("org.http4k:http4k-bom:5.7.4.0")) + implementation 'org.http4k:http4k-core:5.7.4.0' + implementation "org.http4k:http4k-client-apache" + implementation("org.http4k:http4k-server-netty") + implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.0" + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-guava:1.5.2") testImplementation "org.jetbrains.kotlin:kotlin-test" } diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/PatrolAppServiceClient.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/PatrolAppServiceClient.kt index 5d0111361..3e29dfb1f 100644 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/PatrolAppServiceClient.kt +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/PatrolAppServiceClient.kt @@ -7,6 +7,9 @@ package pl.leancode.patrol.contracts; import kotlinx.serialization.encodeToString import kotlinx.serialization.json.Json +import org.apache.hc.client5.http.config.RequestConfig +import org.apache.hc.client5.http.impl.classic.HttpClients +import org.apache.hc.core5.util.Timeout import org.http4k.client.ApacheClient import org.http4k.core.Method import org.http4k.core.Request @@ -15,32 +18,40 @@ import org.http4k.core.Status class PatrolAppServiceClient(private val address: String, private val port: Int) { fun listDartTests() : Contracts.ListDartTestsResponse { - val response = performRequest() + val response = performRequest("listDartTests") return json.decodeFromString(response) } fun runDartTest(request: Contracts.RunDartTestRequest) : Contracts.RunDartTestResponse { - val response = performRequest(json.encodeToString(request)) + val response = performRequest("runDartTest", json.encodeToString(request)) return json.decodeFromString(response) } - private fun performRequest(requestBody: String? = null): String { - var request = Request(Method.POST, serverUrl) + private fun performRequest(path: String, requestBody: String? = null): String { + var request = Request(Method.POST, "$serverUrl$path") if (requestBody != null) { request = request.body(requestBody) } - val client = ApacheClient() + val client = ApacheClient( + HttpClients.custom().setDefaultRequestConfig( + RequestConfig + .copy(RequestConfig.DEFAULT) + .setResponseTimeout(Timeout.ofSeconds(300)) + .setConnectionRequestTimeout(Timeout.ofSeconds(300)) + .build() + ).build()) + val response = client(request) if (response.status != Status.OK) { - throw PatrolAppServiceClientException("Invalid response ${response.status}") + throw PatrolAppServiceClientException("Invalid response ${response.status}, ${response.bodyString()}") } return response.bodyString() } - val serverUrl = "http://$address:$port" + val serverUrl = "http://$address:$port/" private val json = Json { ignoreUnknownKeys = true } } diff --git a/packages/patrol/example/android/app/build.gradle b/packages/patrol/example/android/app/build.gradle index cb9dd3f5c..55bba1cac 100644 --- a/packages/patrol/example/android/app/build.gradle +++ b/packages/patrol/example/android/app/build.gradle @@ -32,6 +32,13 @@ android { kotlinOptions { jvmTarget = "1.8" } + + //TODO verify + packagingOptions { + pickFirst "META-INF/INDEX.LIST" + pickFirst "META-INF/io.netty.versions.properties" + pickFirst "META-INF/DEPENDENCIES" + } sourceSets { main.java.srcDirs += "src/main/kotlin" diff --git a/packages/patrol/example/android/app/src/androidTest/java/pl/leancode/patrol/example/MainActivityTest.java b/packages/patrol/example/android/app/src/androidTest/java/pl/leancode/patrol/example/MainActivityTest.java index 675e46464..dd86393c7 100644 --- a/packages/patrol/example/android/app/src/androidTest/java/pl/leancode/patrol/example/MainActivityTest.java +++ b/packages/patrol/example/android/app/src/androidTest/java/pl/leancode/patrol/example/MainActivityTest.java @@ -6,11 +6,12 @@ import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameters; import pl.leancode.patrol.PatrolJUnitRunner; +import pl.leancode.patrol.contracts.PatrolAppServiceClientException; @RunWith(Parameterized.class) public class MainActivityTest { @Parameters(name = "{0}") - public static Object[] testCases() { + public static Object[] testCases() throws PatrolAppServiceClientException { PatrolJUnitRunner instrumentation = (PatrolJUnitRunner) InstrumentationRegistry.getInstrumentation(); instrumentation.setUp(MainActivity.class); instrumentation.waitForPatrolAppService(); @@ -24,8 +25,8 @@ public MainActivityTest(String dartTestName) { private final String dartTestName; @Test - public void runDartTest() { + public void runDartTest() throws PatrolAppServiceClientException { PatrolJUnitRunner instrumentation = (PatrolJUnitRunner) InstrumentationRegistry.getInstrumentation(); - instrumentation.runDartTest(dartTestName); + instrumentation.runDartTest(dartTestName); } } diff --git a/packages/patrol_gen/lib/src/generators/android/android_http4k_client_generator.dart b/packages/patrol_gen/lib/src/generators/android/android_http4k_client_generator.dart index 172eb2812..58cc0b730 100644 --- a/packages/patrol_gen/lib/src/generators/android/android_http4k_client_generator.dart +++ b/packages/patrol_gen/lib/src/generators/android/android_http4k_client_generator.dart @@ -28,6 +28,9 @@ package ${config.package}; import kotlinx.serialization.encodeToString import kotlinx.serialization.json.Json +import org.apache.hc.client5.http.config.RequestConfig +import org.apache.hc.client5.http.impl.classic.HttpClients +import org.apache.hc.core5.util.Timeout import org.http4k.client.ApacheClient import org.http4k.core.Method import org.http4k.core.Request @@ -37,23 +40,33 @@ import org.http4k.core.Status } String _generateClientClass(Service service) { - final url = r'"http://$address:$port"'; + final url = r'"http://$address:$port/"'; final endpoints = service.endpoints.map(_createEndpoint).join('\n\n'); final throwException = - r'throw PatrolAppServiceClientException("Invalid response ${response.status}")'; + r'throw PatrolAppServiceClientException("Invalid response ${response.status}, ${response.bodyString()}")'; + + final urlWithPath = r'"$serverUrl$path"'; return ''' class ${service.name}Client(private val address: String, private val port: Int) { $endpoints - private fun performRequest(requestBody: String? = null): String { - var request = Request(Method.POST, serverUrl) + private fun performRequest(path: String, requestBody: String? = null): String { + var request = Request(Method.POST, $urlWithPath) if (requestBody != null) { request = request.body(requestBody) } - val client = ApacheClient() + val client = ApacheClient( + HttpClients.custom().setDefaultRequestConfig( + RequestConfig + .copy(RequestConfig.DEFAULT) + .setResponseTimeout(Timeout.ofSeconds(300)) + .setConnectionRequestTimeout(Timeout.ofSeconds(300)) + .build() + ).build()) + val response = client(request) if (response.status != Status.OK) { @@ -78,14 +91,14 @@ $endpoints : ''; final serializeParameter = - endpoint.request != null ? 'json.encodeToString(request)' : ''; + endpoint.request != null ? ', json.encodeToString(request)' : ''; final body = endpoint.response != null ? ''' - val response = performRequest($serializeParameter) + val response = performRequest("${endpoint.name}"$serializeParameter) return json.decodeFromString(response)''' : ''' - return performRequest($serializeParameter)'''; + return performRequest("${endpoint.name}"$serializeParameter)'''; return ''' fun ${endpoint.name}($parameterDef) $returnDef { From de946850584ca023f32caa23c83dd48e73e1c276 Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Tue, 5 Sep 2023 13:30:22 +0200 Subject: [PATCH 051/110] Add generator --- .../dart/dart_http_client_generator.dart | 12 +- .../ios/ios_flying_fox_server_generator.dart | 124 ++++++++++++++++++ .../lib/src/generators/ios/ios_generator.dart | 4 +- 3 files changed, 135 insertions(+), 5 deletions(-) create mode 100644 packages/patrol_gen/lib/src/generators/ios/ios_flying_fox_server_generator.dart diff --git a/packages/patrol_gen/lib/src/generators/dart/dart_http_client_generator.dart b/packages/patrol_gen/lib/src/generators/dart/dart_http_client_generator.dart index 5975364ac..efaf3e581 100644 --- a/packages/patrol_gen/lib/src/generators/dart/dart_http_client_generator.dart +++ b/packages/patrol_gen/lib/src/generators/dart/dart_http_client_generator.dart @@ -37,17 +37,23 @@ import '${path.basename(config.contractsFilename)}'; String _generateClientClass(Service service) { final endpoints = service.endpoints.map(_createEndpoint).join('\n\n'); + final headers = r'''_headers = { + 'Connection': 'keep-alive', + 'Keep-Alive': 'timeout=${timeout.inSeconds}' + }'''; + return ''' class ${service.name}Client { - const ${service.name}Client( + ${service.name}Client( this._client, this._apiUri, { Duration timeout = const Duration(seconds: 300), - }) : _timeout = timeout; + }) : _timeout = timeout, $headers; final Duration _timeout; final http.Client _client; final Uri _apiUri; + final Map _headers; $endpoints @@ -56,7 +62,7 @@ $endpoints Map? request, ]) async { final response = await _client - .post(_apiUri.resolve(requestName), body: jsonEncode(request)) + .post(_apiUri.resolve(requestName), body: jsonEncode(request), headers: _headers,) .timeout(_timeout); if (response.statusCode != 200) { diff --git a/packages/patrol_gen/lib/src/generators/ios/ios_flying_fox_server_generator.dart b/packages/patrol_gen/lib/src/generators/ios/ios_flying_fox_server_generator.dart new file mode 100644 index 000000000..8081fda30 --- /dev/null +++ b/packages/patrol_gen/lib/src/generators/ios/ios_flying_fox_server_generator.dart @@ -0,0 +1,124 @@ +import 'package:patrol_gen/src/generators/ios/ios_config.dart'; +import 'package:patrol_gen/src/generators/output_file.dart'; +import 'package:patrol_gen/src/schema.dart'; + +class IOSFlyingFoxServerGenerator { + OutputFile generate(Service service, IOSConfig config) { + final buffer = StringBuffer() + ..write(_contentPrefix(config)) + ..write(_generateServerProtocol(service)) + ..writeln() + ..write(_generateHandlers(service)) + ..writeln() + ..write(_generateSetupRoutes(service)) + ..writeln() + ..write(_generateUtils()); + + return OutputFile( + filename: config.serverFileName(service.name), + content: buffer.toString(), + ); + } + + String _contentPrefix(IOSConfig config) { + return ''' +/// +// Generated code. Do not modify. +// source: schema.dart +// + +import FlyingFox + +'''; + } + + String _generateServerProtocol(Service service) { + final endpoints = service.endpoints.map(_generateProtocolMethod).join('\n'); + + return ''' +protocol ${service.name}Server { +$endpoints +} +'''; + } + + String _generateProtocolMethod(Endpoint endpoint) { + final request = + endpoint.request != null ? 'request: ${endpoint.request!.name}' : ''; + final response = + endpoint.response != null ? ' -> ${endpoint.response!.name}' : ''; + return ' func ${endpoint.name}($request) async throws$response'; + } + + String _generateHandlers(Service service) { + final handlers = service.endpoints.map(_generateHandler).join('\n\n'); + return ''' +extension ${service.name}Server { +$handlers +} +'''; + } + + String _generateHandler(Endpoint endpoint) { + final requestArg = endpoint.request != null + ? ''' + + let requestArg = try await JSONDecoder().decode(${endpoint.request!.name}.self, from: request.bodyData)''' + : ''; + + final responseVariable = endpoint.response != null ? 'let response = ' : ''; + final response = endpoint.response != null + ? ''' + let body = try JSONEncoder().encode(response) + return HTTPResponse(statusCode: .ok, body: body)''' + : ' return HTTPResponse(statusCode: .ok)'; + + return ''' + private func ${endpoint.name}Handler(request: HTTPRequest) async throws -> HTTPResponse {$requestArg + ${responseVariable}try await ${endpoint.name}(${requestArg.isNotEmpty ? 'request: requestArg' : ''}) +$response + }'''; + } + + String _generateSetupRoutes(Service service) { + final routes = service.endpoints.map(_generateRoute).join('\n'); + + return ''' +extension ${service.name}Server { + func setupRoutes(server: HTTPServer) async { +$routes + } +} +'''; + } + + String _generateRoute(Endpoint endpoint) { + return ''' + await server.appendRoute("/${endpoint.name}") { request in + return await handleRequest( + request: request, + handler: ${endpoint.name}Handler) + }'''; + } + + String _generateUtils() { + // https://forums.swift.org/t/using-async-functions-from-synchronous-functions-and-breaking-all-the-rules/59782 + return ''' +extension NativeAutomatorServer { + private func handleRequest(request: HTTPRequest, handler: @escaping (HTTPRequest) async throws -> HTTPResponse) async -> HTTPResponse { + do { + return try await handler(request) + } catch let err { + return HTTPResponse(statusCode: .badRequest, headers: [:], body: err.localizedDescription.utf8Data) + } + } +} + +extension String { + var utf8Data: Data { + return data(using: .utf8)! + } +} +'''; + } +} diff --git a/packages/patrol_gen/lib/src/generators/ios/ios_generator.dart b/packages/patrol_gen/lib/src/generators/ios/ios_generator.dart index 49e758b95..ccf43e67b 100644 --- a/packages/patrol_gen/lib/src/generators/ios/ios_generator.dart +++ b/packages/patrol_gen/lib/src/generators/ios/ios_generator.dart @@ -1,6 +1,6 @@ import 'package:patrol_gen/src/generators/ios/ios_config.dart'; import 'package:patrol_gen/src/generators/ios/ios_contracts_generator.dart'; -import 'package:patrol_gen/src/generators/ios/ios_telegraph_server_generator.dart'; +import 'package:patrol_gen/src/generators/ios/ios_flying_fox_server_generator.dart'; import 'package:patrol_gen/src/generators/ios/ios_url_session_client_generator.dart'; import 'package:patrol_gen/src/generators/output_file.dart'; import 'package:patrol_gen/src/schema.dart'; @@ -11,7 +11,7 @@ class IOSGenerator { IOSContractsGenerator().generate(schema, config), ]; - final serverGenerator = IOSTelegraphServerGenerator(); + final serverGenerator = IOSFlyingFoxServerGenerator(); final clientGenerator = IOSURLSessionClientGenerator(); for (var service in schema.services) { From cdf408ca6da1e5884e6435ed469c79cb977f0d46 Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Tue, 5 Sep 2023 13:44:58 +0200 Subject: [PATCH 052/110] Update generated client --- .../native/contracts/native_automator_client.dart | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/packages/patrol/lib/src/native/contracts/native_automator_client.dart b/packages/patrol/lib/src/native/contracts/native_automator_client.dart index ce312a41d..f9aa3b891 100644 --- a/packages/patrol/lib/src/native/contracts/native_automator_client.dart +++ b/packages/patrol/lib/src/native/contracts/native_automator_client.dart @@ -24,15 +24,20 @@ class NativeAutomatorClientException implements Exception { } class NativeAutomatorClient { - const NativeAutomatorClient( + NativeAutomatorClient( this._client, this._apiUri, { Duration timeout = const Duration(seconds: 300), - }) : _timeout = timeout; + }) : _timeout = timeout, + _headers = { + 'Connection': 'keep-alive', + 'Keep-Alive': 'timeout=${timeout.inSeconds}' + }; final Duration _timeout; final http.Client _client; final Uri _apiUri; + final Map _headers; Future initialize() { return _sendRequest( @@ -294,7 +299,11 @@ class NativeAutomatorClient { Map? request, ]) async { final response = await _client - .post(_apiUri.resolve(requestName), body: jsonEncode(request)) + .post( + _apiUri.resolve(requestName), + body: jsonEncode(request), + headers: _headers, + ) .timeout(_timeout); if (response.statusCode != 200) { From 79d388718641bc4e295c01fe275e6555e1c223b9 Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Tue, 5 Sep 2023 13:55:18 +0200 Subject: [PATCH 053/110] Switch server --- packages/patrol/example/ios/Podfile.lock | 22 +- .../NativeAutomatorServer.swift | 274 +++++++++--------- .../AutomatorServer/PatrolServer.swift | 16 +- packages/patrol/ios/patrol.podspec | 2 +- 4 files changed, 148 insertions(+), 166 deletions(-) diff --git a/packages/patrol/example/ios/Podfile.lock b/packages/patrol/example/ios/Podfile.lock index 79b1ff61b..7a3b7c88f 100644 --- a/packages/patrol/example/ios/Podfile.lock +++ b/packages/patrol/example/ios/Podfile.lock @@ -1,23 +1,21 @@ PODS: - - CocoaAsyncSocket (7.6.5) - Flutter (1.0.0) - flutter_local_notifications (0.0.1): - Flutter - flutter_timezone (0.0.1): - Flutter + - FlyingFox (0.12.2): + - FlyingSocks (~> 0.12.2) + - FlyingSocks (0.12.2) - geolocator_apple (1.2.0): - Flutter - - HTTPParserC (2.9.4) - integration_test (0.0.1): - Flutter - patrol (0.0.1): - Flutter - - Telegraph (~> 0.30.0) + - FlyingFox (~> 0.12.0) - permission_handler_apple (9.1.1): - Flutter - - Telegraph (0.30.0): - - CocoaAsyncSocket (~> 7.6) - - HTTPParserC (~> 2.9) - webview_flutter_wkwebview (0.0.1): - Flutter @@ -33,9 +31,8 @@ DEPENDENCIES: SPEC REPOS: trunk: - - CocoaAsyncSocket - - HTTPParserC - - Telegraph + - FlyingFox + - FlyingSocks EXTERNAL SOURCES: Flutter: @@ -56,16 +53,15 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/webview_flutter_wkwebview/ios" SPEC CHECKSUMS: - CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99 Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 flutter_local_notifications: 0c0b1ae97e741e1521e4c1629a459d04b9aec743 flutter_timezone: ffb07bdad3c6276af8dada0f11978d8a1f8a20bb + FlyingFox: 64c3302f81bd8690514a8988dafc9ff951781e7d + FlyingSocks: 7b2a722af4be5cf74499c0a5a94d3f31f028a4f7 geolocator_apple: cc556e6844d508c95df1e87e3ea6fa4e58c50401 - HTTPParserC: aea14c3d2d4ac5beb3988781daa36dfa62e0d9ef integration_test: 13825b8a9334a850581300559b8839134b124670 - patrol: 0966206ac7e717e0ee4d9b6b4e86c8aab62acbfc + patrol: 8726a57cd3859ed03bc0b5217784b58bbdbf57c5 permission_handler_apple: e76247795d700c14ea09e3a2d8855d41ee80a2e6 - Telegraph: 12576b119324138e4929792af9e5a1085c2ecbc1 webview_flutter_wkwebview: 2e2d318f21a5e036e2c3f26171342e95908bd60a PODFILE CHECKSUM: 0976da911d4a3d1a369deaf59f82a1c7d01a40d5 diff --git a/packages/patrol/ios/Classes/AutomatorServer/NativeAutomatorServer.swift b/packages/patrol/ios/Classes/AutomatorServer/NativeAutomatorServer.swift index 9d49edb63..933c9d93e 100644 --- a/packages/patrol/ios/Classes/AutomatorServer/NativeAutomatorServer.swift +++ b/packages/patrol/ios/Classes/AutomatorServer/NativeAutomatorServer.swift @@ -3,7 +3,7 @@ // source: schema.dart // -import Telegraph +import FlyingFox protocol NativeAutomatorServer { func initialize() async throws @@ -45,397 +45,381 @@ protocol NativeAutomatorServer { extension NativeAutomatorServer { private func initializeHandler(request: HTTPRequest) async throws -> HTTPResponse { try await initialize() - return HTTPResponse(.ok) + return HTTPResponse(statusCode: .ok) } private func configureHandler(request: HTTPRequest) async throws -> HTTPResponse { - let requestArg = try JSONDecoder().decode(ConfigureRequest.self, from: request.body) + let requestArg = try await JSONDecoder().decode(ConfigureRequest.self, from: request.bodyData) try await configure(request: requestArg) - return HTTPResponse(.ok) + return HTTPResponse(statusCode: .ok) } private func pressHomeHandler(request: HTTPRequest) async throws -> HTTPResponse { try await pressHome() - return HTTPResponse(.ok) + return HTTPResponse(statusCode: .ok) } private func pressBackHandler(request: HTTPRequest) async throws -> HTTPResponse { try await pressBack() - return HTTPResponse(.ok) + return HTTPResponse(statusCode: .ok) } private func pressRecentAppsHandler(request: HTTPRequest) async throws -> HTTPResponse { try await pressRecentApps() - return HTTPResponse(.ok) + return HTTPResponse(statusCode: .ok) } private func doublePressRecentAppsHandler(request: HTTPRequest) async throws -> HTTPResponse { try await doublePressRecentApps() - return HTTPResponse(.ok) + return HTTPResponse(statusCode: .ok) } private func openAppHandler(request: HTTPRequest) async throws -> HTTPResponse { - let requestArg = try JSONDecoder().decode(OpenAppRequest.self, from: request.body) + let requestArg = try await JSONDecoder().decode(OpenAppRequest.self, from: request.bodyData) try await openApp(request: requestArg) - return HTTPResponse(.ok) + return HTTPResponse(statusCode: .ok) } private func openQuickSettingsHandler(request: HTTPRequest) async throws -> HTTPResponse { - let requestArg = try JSONDecoder().decode(OpenQuickSettingsRequest.self, from: request.body) + let requestArg = try await JSONDecoder().decode(OpenQuickSettingsRequest.self, from: request.bodyData) try await openQuickSettings(request: requestArg) - return HTTPResponse(.ok) + return HTTPResponse(statusCode: .ok) } private func getNativeViewsHandler(request: HTTPRequest) async throws -> HTTPResponse { - let requestArg = try JSONDecoder().decode(GetNativeViewsRequest.self, from: request.body) + let requestArg = try await JSONDecoder().decode(GetNativeViewsRequest.self, from: request.bodyData) let response = try await getNativeViews(request: requestArg) let body = try JSONEncoder().encode(response) - return HTTPResponse(.ok, body: body) + return HTTPResponse(statusCode: .ok, body: body) } private func tapHandler(request: HTTPRequest) async throws -> HTTPResponse { - let requestArg = try JSONDecoder().decode(TapRequest.self, from: request.body) + let requestArg = try await JSONDecoder().decode(TapRequest.self, from: request.bodyData) try await tap(request: requestArg) - return HTTPResponse(.ok) + return HTTPResponse(statusCode: .ok) } private func doubleTapHandler(request: HTTPRequest) async throws -> HTTPResponse { - let requestArg = try JSONDecoder().decode(TapRequest.self, from: request.body) + let requestArg = try await JSONDecoder().decode(TapRequest.self, from: request.bodyData) try await doubleTap(request: requestArg) - return HTTPResponse(.ok) + return HTTPResponse(statusCode: .ok) } private func enterTextHandler(request: HTTPRequest) async throws -> HTTPResponse { - let requestArg = try JSONDecoder().decode(EnterTextRequest.self, from: request.body) + let requestArg = try await JSONDecoder().decode(EnterTextRequest.self, from: request.bodyData) try await enterText(request: requestArg) - return HTTPResponse(.ok) + return HTTPResponse(statusCode: .ok) } private func swipeHandler(request: HTTPRequest) async throws -> HTTPResponse { - let requestArg = try JSONDecoder().decode(SwipeRequest.self, from: request.body) + let requestArg = try await JSONDecoder().decode(SwipeRequest.self, from: request.bodyData) try await swipe(request: requestArg) - return HTTPResponse(.ok) + return HTTPResponse(statusCode: .ok) } private func waitUntilVisibleHandler(request: HTTPRequest) async throws -> HTTPResponse { - let requestArg = try JSONDecoder().decode(WaitUntilVisibleRequest.self, from: request.body) + let requestArg = try await JSONDecoder().decode(WaitUntilVisibleRequest.self, from: request.bodyData) try await waitUntilVisible(request: requestArg) - return HTTPResponse(.ok) + return HTTPResponse(statusCode: .ok) } private func enableAirplaneModeHandler(request: HTTPRequest) async throws -> HTTPResponse { try await enableAirplaneMode() - return HTTPResponse(.ok) + return HTTPResponse(statusCode: .ok) } private func disableAirplaneModeHandler(request: HTTPRequest) async throws -> HTTPResponse { try await disableAirplaneMode() - return HTTPResponse(.ok) + return HTTPResponse(statusCode: .ok) } private func enableWiFiHandler(request: HTTPRequest) async throws -> HTTPResponse { try await enableWiFi() - return HTTPResponse(.ok) + return HTTPResponse(statusCode: .ok) } private func disableWiFiHandler(request: HTTPRequest) async throws -> HTTPResponse { try await disableWiFi() - return HTTPResponse(.ok) + return HTTPResponse(statusCode: .ok) } private func enableCellularHandler(request: HTTPRequest) async throws -> HTTPResponse { try await enableCellular() - return HTTPResponse(.ok) + return HTTPResponse(statusCode: .ok) } private func disableCellularHandler(request: HTTPRequest) async throws -> HTTPResponse { try await disableCellular() - return HTTPResponse(.ok) + return HTTPResponse(statusCode: .ok) } private func enableBluetoothHandler(request: HTTPRequest) async throws -> HTTPResponse { try await enableBluetooth() - return HTTPResponse(.ok) + return HTTPResponse(statusCode: .ok) } private func disableBluetoothHandler(request: HTTPRequest) async throws -> HTTPResponse { try await disableBluetooth() - return HTTPResponse(.ok) + return HTTPResponse(statusCode: .ok) } private func enableDarkModeHandler(request: HTTPRequest) async throws -> HTTPResponse { - let requestArg = try JSONDecoder().decode(DarkModeRequest.self, from: request.body) + let requestArg = try await JSONDecoder().decode(DarkModeRequest.self, from: request.bodyData) try await enableDarkMode(request: requestArg) - return HTTPResponse(.ok) + return HTTPResponse(statusCode: .ok) } private func disableDarkModeHandler(request: HTTPRequest) async throws -> HTTPResponse { - let requestArg = try JSONDecoder().decode(DarkModeRequest.self, from: request.body) + let requestArg = try await JSONDecoder().decode(DarkModeRequest.self, from: request.bodyData) try await disableDarkMode(request: requestArg) - return HTTPResponse(.ok) + return HTTPResponse(statusCode: .ok) } private func openNotificationsHandler(request: HTTPRequest) async throws -> HTTPResponse { try await openNotifications() - return HTTPResponse(.ok) + return HTTPResponse(statusCode: .ok) } private func closeNotificationsHandler(request: HTTPRequest) async throws -> HTTPResponse { try await closeNotifications() - return HTTPResponse(.ok) + return HTTPResponse(statusCode: .ok) } private func closeHeadsUpNotificationHandler(request: HTTPRequest) async throws -> HTTPResponse { try await closeHeadsUpNotification() - return HTTPResponse(.ok) + return HTTPResponse(statusCode: .ok) } private func getNotificationsHandler(request: HTTPRequest) async throws -> HTTPResponse { - let requestArg = try JSONDecoder().decode(GetNotificationsRequest.self, from: request.body) + let requestArg = try await JSONDecoder().decode(GetNotificationsRequest.self, from: request.bodyData) let response = try await getNotifications(request: requestArg) let body = try JSONEncoder().encode(response) - return HTTPResponse(.ok, body: body) + return HTTPResponse(statusCode: .ok, body: body) } private func tapOnNotificationHandler(request: HTTPRequest) async throws -> HTTPResponse { - let requestArg = try JSONDecoder().decode(TapOnNotificationRequest.self, from: request.body) + let requestArg = try await JSONDecoder().decode(TapOnNotificationRequest.self, from: request.bodyData) try await tapOnNotification(request: requestArg) - return HTTPResponse(.ok) + return HTTPResponse(statusCode: .ok) } private func isPermissionDialogVisibleHandler(request: HTTPRequest) async throws -> HTTPResponse { - let requestArg = try JSONDecoder().decode(PermissionDialogVisibleRequest.self, from: request.body) + let requestArg = try await JSONDecoder().decode(PermissionDialogVisibleRequest.self, from: request.bodyData) let response = try await isPermissionDialogVisible(request: requestArg) let body = try JSONEncoder().encode(response) - return HTTPResponse(.ok, body: body) + return HTTPResponse(statusCode: .ok, body: body) } private func handlePermissionDialogHandler(request: HTTPRequest) async throws -> HTTPResponse { - let requestArg = try JSONDecoder().decode(HandlePermissionRequest.self, from: request.body) + let requestArg = try await JSONDecoder().decode(HandlePermissionRequest.self, from: request.bodyData) try await handlePermissionDialog(request: requestArg) - return HTTPResponse(.ok) + return HTTPResponse(statusCode: .ok) } private func setLocationAccuracyHandler(request: HTTPRequest) async throws -> HTTPResponse { - let requestArg = try JSONDecoder().decode(SetLocationAccuracyRequest.self, from: request.body) + let requestArg = try await JSONDecoder().decode(SetLocationAccuracyRequest.self, from: request.bodyData) try await setLocationAccuracy(request: requestArg) - return HTTPResponse(.ok) + return HTTPResponse(statusCode: .ok) } private func debugHandler(request: HTTPRequest) async throws -> HTTPResponse { try await debug() - return HTTPResponse(.ok) + return HTTPResponse(statusCode: .ok) } private func markPatrolAppServiceReadyHandler(request: HTTPRequest) async throws -> HTTPResponse { try await markPatrolAppServiceReady() - return HTTPResponse(.ok) + return HTTPResponse(statusCode: .ok) } } extension NativeAutomatorServer { - func setupRoutes(server: Server) { - server.route(.POST, "initialize") { - request in handleRequest( + func setupRoutes(server: HTTPServer) async { + await server.appendRoute("/initialize") { request in + return await handleRequest( request: request, handler: initializeHandler) } - server.route(.POST, "configure") { - request in handleRequest( + await server.appendRoute("/configure") { request in + return await handleRequest( request: request, handler: configureHandler) } - server.route(.POST, "pressHome") { - request in handleRequest( + await server.appendRoute("/pressHome") { request in + return await handleRequest( request: request, handler: pressHomeHandler) } - server.route(.POST, "pressBack") { - request in handleRequest( + await server.appendRoute("/pressBack") { request in + return await handleRequest( request: request, handler: pressBackHandler) } - server.route(.POST, "pressRecentApps") { - request in handleRequest( + await server.appendRoute("/pressRecentApps") { request in + return await handleRequest( request: request, handler: pressRecentAppsHandler) } - server.route(.POST, "doublePressRecentApps") { - request in handleRequest( + await server.appendRoute("/doublePressRecentApps") { request in + return await handleRequest( request: request, handler: doublePressRecentAppsHandler) } - server.route(.POST, "openApp") { - request in handleRequest( + await server.appendRoute("/openApp") { request in + return await handleRequest( request: request, handler: openAppHandler) } - server.route(.POST, "openQuickSettings") { - request in handleRequest( + await server.appendRoute("/openQuickSettings") { request in + return await handleRequest( request: request, handler: openQuickSettingsHandler) } - server.route(.POST, "getNativeViews") { - request in handleRequest( + await server.appendRoute("/getNativeViews") { request in + return await handleRequest( request: request, handler: getNativeViewsHandler) } - server.route(.POST, "tap") { - request in handleRequest( + await server.appendRoute("/tap") { request in + return await handleRequest( request: request, handler: tapHandler) } - server.route(.POST, "doubleTap") { - request in handleRequest( + await server.appendRoute("/doubleTap") { request in + return await handleRequest( request: request, handler: doubleTapHandler) } - server.route(.POST, "enterText") { - request in handleRequest( + await server.appendRoute("/enterText") { request in + return await handleRequest( request: request, handler: enterTextHandler) } - server.route(.POST, "swipe") { - request in handleRequest( + await server.appendRoute("/swipe") { request in + return await handleRequest( request: request, handler: swipeHandler) } - server.route(.POST, "waitUntilVisible") { - request in handleRequest( + await server.appendRoute("/waitUntilVisible") { request in + return await handleRequest( request: request, handler: waitUntilVisibleHandler) } - server.route(.POST, "enableAirplaneMode") { - request in handleRequest( + await server.appendRoute("/enableAirplaneMode") { request in + return await handleRequest( request: request, handler: enableAirplaneModeHandler) } - server.route(.POST, "disableAirplaneMode") { - request in handleRequest( + await server.appendRoute("/disableAirplaneMode") { request in + return await handleRequest( request: request, handler: disableAirplaneModeHandler) } - server.route(.POST, "enableWiFi") { - request in handleRequest( + await server.appendRoute("/enableWiFi") { request in + return await handleRequest( request: request, handler: enableWiFiHandler) } - server.route(.POST, "disableWiFi") { - request in handleRequest( + await server.appendRoute("/disableWiFi") { request in + return await handleRequest( request: request, handler: disableWiFiHandler) } - server.route(.POST, "enableCellular") { - request in handleRequest( + await server.appendRoute("/enableCellular") { request in + return await handleRequest( request: request, handler: enableCellularHandler) } - server.route(.POST, "disableCellular") { - request in handleRequest( + await server.appendRoute("/disableCellular") { request in + return await handleRequest( request: request, handler: disableCellularHandler) } - server.route(.POST, "enableBluetooth") { - request in handleRequest( + await server.appendRoute("/enableBluetooth") { request in + return await handleRequest( request: request, handler: enableBluetoothHandler) } - server.route(.POST, "disableBluetooth") { - request in handleRequest( + await server.appendRoute("/disableBluetooth") { request in + return await handleRequest( request: request, handler: disableBluetoothHandler) } - server.route(.POST, "enableDarkMode") { - request in handleRequest( + await server.appendRoute("/enableDarkMode") { request in + return await handleRequest( request: request, handler: enableDarkModeHandler) } - server.route(.POST, "disableDarkMode") { - request in handleRequest( + await server.appendRoute("/disableDarkMode") { request in + return await handleRequest( request: request, handler: disableDarkModeHandler) } - server.route(.POST, "openNotifications") { - request in handleRequest( + await server.appendRoute("/openNotifications") { request in + return await handleRequest( request: request, handler: openNotificationsHandler) } - server.route(.POST, "closeNotifications") { - request in handleRequest( + await server.appendRoute("/closeNotifications") { request in + return await handleRequest( request: request, handler: closeNotificationsHandler) } - server.route(.POST, "closeHeadsUpNotification") { - request in handleRequest( + await server.appendRoute("/closeHeadsUpNotification") { request in + return await handleRequest( request: request, handler: closeHeadsUpNotificationHandler) } - server.route(.POST, "getNotifications") { - request in handleRequest( + await server.appendRoute("/getNotifications") { request in + return await handleRequest( request: request, handler: getNotificationsHandler) } - server.route(.POST, "tapOnNotification") { - request in handleRequest( + await server.appendRoute("/tapOnNotification") { request in + return await handleRequest( request: request, handler: tapOnNotificationHandler) } - server.route(.POST, "isPermissionDialogVisible") { - request in handleRequest( + await server.appendRoute("/isPermissionDialogVisible") { request in + return await handleRequest( request: request, handler: isPermissionDialogVisibleHandler) } - server.route(.POST, "handlePermissionDialog") { - request in handleRequest( + await server.appendRoute("/handlePermissionDialog") { request in + return await handleRequest( request: request, handler: handlePermissionDialogHandler) } - server.route(.POST, "setLocationAccuracy") { - request in handleRequest( + await server.appendRoute("/setLocationAccuracy") { request in + return await handleRequest( request: request, handler: setLocationAccuracyHandler) } - server.route(.POST, "debug") { - request in handleRequest( + await server.appendRoute("/debug") { request in + return await handleRequest( request: request, handler: debugHandler) } - server.route(.POST, "markPatrolAppServiceReady") { - request in handleRequest( + await server.appendRoute("/markPatrolAppServiceReady") { request in + return await handleRequest( request: request, handler: markPatrolAppServiceReadyHandler) } } } -fileprivate class Box { - var result: Result? = nil -} - extension NativeAutomatorServer { - private func handleRequest(request: HTTPRequest, handler: @escaping (HTTPRequest) async throws -> HTTPResponse) -> HTTPResponse { + private func handleRequest(request: HTTPRequest, handler: @escaping (HTTPRequest) async throws -> HTTPResponse) async -> HTTPResponse { do { - return try unsafeWait { - return try await handler(request) - } + return try await handler(request) } catch let err { - return HTTPResponse(.badRequest, headers: [:], error: err) - } - } - - private func unsafeWait(_ f: @escaping () async throws -> ResultType) throws -> ResultType { - let box = Box() - let sema = DispatchSemaphore(value: 0) - Task { - do { - let val = try await f() - box.result = .success(val) - } catch { - box.result = .failure(error) - } - sema.signal() + return HTTPResponse(statusCode: .badRequest, headers: [:], body: err.localizedDescription.utf8Data) } - sema.wait() - return try box.result!.get() } } + +extension String { + var utf8Data: Data { + return data(using: .utf8)! + } +} diff --git a/packages/patrol/ios/Classes/AutomatorServer/PatrolServer.swift b/packages/patrol/ios/Classes/AutomatorServer/PatrolServer.swift index 671096898..30e6f515e 100644 --- a/packages/patrol/ios/Classes/AutomatorServer/PatrolServer.swift +++ b/packages/patrol/ios/Classes/AutomatorServer/PatrolServer.swift @@ -1,5 +1,5 @@ import Foundation -import Telegraph +import FlyingFox @objc public class PatrolServer: NSObject { private static let envPortKey = "PATROL_PORT" @@ -9,7 +9,7 @@ import Telegraph #if PATROL_ENABLED private let port: Int private let automator: Automator - private let server: Server + private let server: HTTPServer // private let dispatchGroup = DispatchGroup() #endif @@ -39,7 +39,7 @@ import Telegraph Logger.shared.i("PATROL_ENABLED flag is defined") self.port = passedPort self.automator = Automator() - self.server = Server() + self.server = HTTPServer(address: .loopback(port: UInt16(self.port))) #else Logger.shared.i("Fatal error: PATROL_ENABLED flag is not defined") #endif @@ -54,11 +54,13 @@ import Telegraph self.appReady = appReady } - try server.start(port: port) + await provider.setupRoutes(server: server) - Logger.shared.i("Server started on http://0.0.0.0:\(port)") - - provider.setupRoutes(server: server) + Task { try await server.start() } + try await server.waitUntilListening() + let address = await server.listeningAddress + + Logger.shared.i("Server started on :\(address)") // dispatchGroup.enter() // dispatchGroup.wait() diff --git a/packages/patrol/ios/patrol.podspec b/packages/patrol/ios/patrol.podspec index 15af13f7c..d82722cf0 100644 --- a/packages/patrol/ios/patrol.podspec +++ b/packages/patrol/ios/patrol.podspec @@ -24,5 +24,5 @@ Runs tests that use flutter_test and patrol APIs as native iOS integration tests s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' } s.swift_version = '5.0' - s.dependency 'Telegraph', '~> 0.30.0' + s.dependency 'FlyingFox', '~> 0.12.0' end From 5689bdf6bf37e8cac99d1209defa3c0bb450c000 Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Tue, 12 Sep 2023 13:04:19 +0200 Subject: [PATCH 054/110] Fix errors arising from merging master to branch --- .../src/main/kotlin/pl/leancode/patrol/Automator.kt | 12 ++++++------ .../kotlin/pl/leancode/patrol/AutomatorServer.kt | 2 +- .../kotlin/pl/leancode/patrol/contracts/Contracts.kt | 8 +++++++- .../ios/Classes/AutomatorServer/Contracts.swift | 7 ++++++- .../patrol/lib/src/native/contracts/contracts.dart | 11 +++++++++-- .../patrol/lib/src/native/contracts/contracts.g.dart | 10 ++++++++-- packages/patrol/lib/src/native/native_automator.dart | 11 ++++++----- schema.dart | 7 ++++++- 8 files changed, 49 insertions(+), 19 deletions(-) diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/Automator.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/Automator.kt index 91154593d..11c2306cc 100644 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/Automator.kt +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/Automator.kt @@ -174,7 +174,7 @@ class Automator private constructor() { delay() } - fun enterText(text: String, index: Int, keyboardBehavior: KeyboardBehavior) { + fun enterText(text: String, index: Int, keyboardBehavior: Contracts.KeyboardBehavior) { Logger.d("enterText(text: $text, index: $index)") val selector = By.clazz(EditText::class.java) @@ -187,13 +187,13 @@ class Automator private constructor() { val uiSelector = UiSelector().className(EditText::class.java).instance(index) val uiObject = uiDevice.findObject(uiSelector) - if (keyboardBehavior == KeyboardBehavior.SHOW_AND_DISMISS) { + if (keyboardBehavior == Contracts.KeyboardBehavior.showAndDismiss) { uiObject.click() } uiObject.text = text - if (keyboardBehavior == KeyboardBehavior.SHOW_AND_DISMISS) { + if (keyboardBehavior == Contracts.KeyboardBehavior.showAndDismiss) { pressBack() // Hide keyboard. } } @@ -203,7 +203,7 @@ class Automator private constructor() { uiSelector: UiSelector, bySelector: BySelector, index: Int, - keyboardBehavior: KeyboardBehavior + keyboardBehavior: Contracts.KeyboardBehavior ) { Logger.d("enterText($text): $uiSelector, $bySelector") @@ -213,13 +213,13 @@ class Automator private constructor() { val uiObject = uiDevice.findObject(uiSelector).getFromParent(UiSelector().className(EditText::class.java)) - if (keyboardBehavior == KeyboardBehavior.SHOW_AND_DISMISS) { + if (keyboardBehavior == Contracts.KeyboardBehavior.showAndDismiss) { uiObject.click() } uiObject.text = text - if (keyboardBehavior == KeyboardBehavior.SHOW_AND_DISMISS) { + if (keyboardBehavior == Contracts.KeyboardBehavior.showAndDismiss) { pressBack() // Hide keyboard. } } diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/AutomatorServer.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/AutomatorServer.kt index fb407c922..aaeaa51cc 100644 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/AutomatorServer.kt +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/AutomatorServer.kt @@ -121,7 +121,7 @@ class AutomatorServer(private val automation: Automator) : NativeAutomatorServer if (request.index != null) { automation.enterText( text = request.data, - index = request.index!!.toInt(), + index = request.index.toInt(), keyboardBehavior = request.keyboardBehavior ) } else if (request.selector != null) { diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/Contracts.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/Contracts.kt index 90e8e3110..674a47101 100644 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/Contracts.kt +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/Contracts.kt @@ -15,6 +15,12 @@ class Contracts { failure, } + @Serializable + enum class KeyboardBehavior { + showAndDismiss, + alternative, + } + @Serializable enum class HandlePermissionRequestCode { whileUsing, @@ -183,7 +189,7 @@ class Contracts { val appId: String, val index: Long? = null, val selector: Selector? = null, - val showKeyboard: Boolean + val keyboardBehavior: KeyboardBehavior ){ fun hasIndex(): Boolean { return index != null diff --git a/packages/patrol/ios/Classes/AutomatorServer/Contracts.swift b/packages/patrol/ios/Classes/AutomatorServer/Contracts.swift index 6d8d61108..7a3bf355a 100644 --- a/packages/patrol/ios/Classes/AutomatorServer/Contracts.swift +++ b/packages/patrol/ios/Classes/AutomatorServer/Contracts.swift @@ -9,6 +9,11 @@ enum RunDartTestResponseResult: String, Codable { case failure } +enum KeyboardBehavior: String, Codable { + case showAndDismiss + case alternative +} + enum HandlePermissionRequestCode: String, Codable { case whileUsing case onlyThisTime @@ -101,7 +106,7 @@ struct EnterTextRequest: Codable { var appId: String var index: Int? var selector: Selector? - var showKeyboard: Bool + var keyboardBehavior: KeyboardBehavior } struct SwipeRequest: Codable { diff --git a/packages/patrol/lib/src/native/contracts/contracts.dart b/packages/patrol/lib/src/native/contracts/contracts.dart index 48e062632..2255f43ff 100644 --- a/packages/patrol/lib/src/native/contracts/contracts.dart +++ b/packages/patrol/lib/src/native/contracts/contracts.dart @@ -17,6 +17,13 @@ enum RunDartTestResponseResult { failure } +enum KeyboardBehavior { + @JsonValue('showAndDismiss') + showAndDismiss, + @JsonValue('alternative') + alternative +} + enum HandlePermissionRequestCode { @JsonValue('whileUsing') whileUsing, @@ -266,7 +273,7 @@ class EnterTextRequest { required this.appId, this.index, this.selector, - required this.showKeyboard, + required this.keyboardBehavior, }); factory EnterTextRequest.fromJson(Map json) => @@ -276,7 +283,7 @@ class EnterTextRequest { final String appId; final int? index; final Selector? selector; - final bool showKeyboard; + final KeyboardBehavior keyboardBehavior; Map toJson() => _$EnterTextRequestToJson(this); } diff --git a/packages/patrol/lib/src/native/contracts/contracts.g.dart b/packages/patrol/lib/src/native/contracts/contracts.g.dart index 28ca15712..08eaa6a31 100644 --- a/packages/patrol/lib/src/native/contracts/contracts.g.dart +++ b/packages/patrol/lib/src/native/contracts/contracts.g.dart @@ -207,7 +207,8 @@ EnterTextRequest _$EnterTextRequestFromJson(Map json) => selector: json['selector'] == null ? null : Selector.fromJson(json['selector'] as Map), - showKeyboard: json['showKeyboard'] as bool, + keyboardBehavior: + $enumDecode(_$KeyboardBehaviorEnumMap, json['keyboardBehavior']), ); Map _$EnterTextRequestToJson(EnterTextRequest instance) => @@ -216,9 +217,14 @@ Map _$EnterTextRequestToJson(EnterTextRequest instance) => 'appId': instance.appId, 'index': instance.index, 'selector': instance.selector, - 'showKeyboard': instance.showKeyboard, + 'keyboardBehavior': _$KeyboardBehaviorEnumMap[instance.keyboardBehavior]!, }; +const _$KeyboardBehaviorEnumMap = { + KeyboardBehavior.showAndDismiss: 'showAndDismiss', + KeyboardBehavior.alternative: 'alternative', +}; + SwipeRequest _$SwipeRequestFromJson(Map json) => SwipeRequest( startX: (json['startX'] as num).toDouble(), startY: (json['startY'] as num).toDouble(), diff --git a/packages/patrol/lib/src/native/native_automator.dart b/packages/patrol/lib/src/native/native_automator.dart index 5d563e408..e4d014564 100644 --- a/packages/patrol/lib/src/native/native_automator.dart +++ b/packages/patrol/lib/src/native/native_automator.dart @@ -6,6 +6,7 @@ import 'package:integration_test/integration_test.dart'; import 'package:meta/meta.dart'; import 'package:patrol/src/binding.dart'; import 'package:patrol/src/native/contracts/contracts.dart'; +import 'package:patrol/src/native/contracts/contracts.dart' as contracts; import 'package:patrol/src/native/contracts/native_automator_client.dart'; /// Thrown when a native action fails. @@ -51,12 +52,12 @@ enum KeyboardBehavior { } extension on KeyboardBehavior { - EnterTextRequest_KeyboardBehavior get toProtoEnum { + contracts.KeyboardBehavior get toContractsEnum { switch (this) { case KeyboardBehavior.showAndDismiss: - return EnterTextRequest_KeyboardBehavior.SHOW_AND_DISMISS; + return contracts.KeyboardBehavior.showAndDismiss; case KeyboardBehavior.alternative: - return EnterTextRequest_KeyboardBehavior.ALTERNATIVE; + return contracts.KeyboardBehavior.alternative; } } } @@ -547,7 +548,7 @@ class NativeAutomator { appId: appId ?? resolvedAppId, selector: selector, keyboardBehavior: - (keyboardBehavior ?? _config.keyboardBehavior).toProtoEnum, + (keyboardBehavior ?? _config.keyboardBehavior).toContractsEnum, ), ), ); @@ -581,7 +582,7 @@ class NativeAutomator { appId: appId ?? resolvedAppId, index: index, keyboardBehavior: - (keyboardBehavior ?? _config.keyboardBehavior).toProtoEnum, + (keyboardBehavior ?? _config.keyboardBehavior).toContractsEnum, ), ), ); diff --git a/schema.dart b/schema.dart index 95955ea9e..d44f437c7 100644 --- a/schema.dart +++ b/schema.dart @@ -83,12 +83,17 @@ class TapRequest { late String appId; } +enum KeyboardBehavior { + showAndDismiss, + alternative, +} + class EnterTextRequest { late String data; late String appId; int? index; Selector? selector; - late bool showKeyboard; + late KeyboardBehavior keyboardBehavior; } class SwipeRequest { From 3c1e1bea2b98dd7ab71013bcab907082a4c15654 Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Tue, 12 Sep 2023 16:18:48 +0200 Subject: [PATCH 055/110] Improve timeouts --- .../pl/leancode/patrol/PatrolAppServiceClient.kt | 7 +++++-- .../patrol/contracts/PatrolAppServiceClient.kt | 6 +++--- .../AutomatorServer/PatrolAppServiceClient.swift | 10 ++++++---- .../ios/Classes/ObjCPatrolAppServiceClient.swift | 4 +++- .../src/native/contracts/native_automator_client.dart | 2 +- packages/patrol/lib/src/native/patrol_app_service.dart | 3 ++- .../android/android_http4k_client_generator.dart | 6 +++--- .../generators/dart/dart_http_client_generator.dart | 2 +- .../ios/ios_url_session_client_generator.dart | 10 ++++++---- 9 files changed, 30 insertions(+), 20 deletions(-) diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolAppServiceClient.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolAppServiceClient.kt index 10e33c7eb..e5db7780d 100644 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolAppServiceClient.kt +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolAppServiceClient.kt @@ -1,5 +1,6 @@ package pl.leancode.patrol; +import org.apache.hc.core5.util.Timeout import pl.leancode.patrol.contracts.Contracts import pl.leancode.patrol.contracts.PatrolAppServiceClientException import pl.leancode.patrol.contracts.PatrolAppServiceClient as Client @@ -10,14 +11,16 @@ import pl.leancode.patrol.contracts.PatrolAppServiceClient as Client class PatrolAppServiceClient { private var client: Client + // https://github.com/leancodepl/patrol/issues/1683 + private val timeout = Timeout.ofHours(2) constructor() { - client = Client(address = "localhost", port = 8082) + client = Client(address = "localhost", port = 8082, timeout = timeout) Logger.i("Created PatrolAppServiceClient: ${client.serverUrl}") } constructor(address: String) { - client = Client(address = address, port = 8082) + client = Client(address = address, port = 8082, timeout = timeout) Logger.i("Created PatrolAppServiceClient: ${client.serverUrl}") } diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/PatrolAppServiceClient.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/PatrolAppServiceClient.kt index 3e29dfb1f..f1a9b8c7a 100644 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/PatrolAppServiceClient.kt +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/PatrolAppServiceClient.kt @@ -15,7 +15,7 @@ import org.http4k.core.Method import org.http4k.core.Request import org.http4k.core.Status -class PatrolAppServiceClient(private val address: String, private val port: Int) { +class PatrolAppServiceClient(private val address: String, private val port: Int, private val timeout: Timeout) { fun listDartTests() : Contracts.ListDartTestsResponse { val response = performRequest("listDartTests") @@ -37,8 +37,8 @@ class PatrolAppServiceClient(private val address: String, private val port: Int) HttpClients.custom().setDefaultRequestConfig( RequestConfig .copy(RequestConfig.DEFAULT) - .setResponseTimeout(Timeout.ofSeconds(300)) - .setConnectionRequestTimeout(Timeout.ofSeconds(300)) + .setResponseTimeout(timeout) + .setConnectionRequestTimeout(timeout) .build() ).build()) diff --git a/packages/patrol/ios/Classes/AutomatorServer/PatrolAppServiceClient.swift b/packages/patrol/ios/Classes/AutomatorServer/PatrolAppServiceClient.swift index 321fc2d86..a7bc419ad 100644 --- a/packages/patrol/ios/Classes/AutomatorServer/PatrolAppServiceClient.swift +++ b/packages/patrol/ios/Classes/AutomatorServer/PatrolAppServiceClient.swift @@ -6,10 +6,12 @@ class PatrolAppServiceClient { private let port: Int private let address: String + private let timeout: TimeInterval - init(port: Int, address: String) { + init(port: Int, address: String, timeout: TimeInterval) { self.port = port self.address = address + self.timeout = timeout } func listDartTests() async throws -> ListDartTestsResponse { @@ -25,13 +27,13 @@ class PatrolAppServiceClient { let url = URL(string: "http://\(address):\(port)/\(requestName)")! let urlconfig = URLSessionConfiguration.default - urlconfig.timeoutIntervalForRequest = TimeInterval(300) - urlconfig.timeoutIntervalForResource = TimeInterval(300) + urlconfig.timeoutIntervalForRequest = timeout + urlconfig.timeoutIntervalForResource = timeout var request = URLRequest(url: url) request.httpMethod = "POST" request.httpBody = body - request.timeoutInterval = TimeInterval(300) + request.timeoutInterval = timeout let (data, response) = try await URLSession(configuration: urlconfig).data(for: request) guard (response as? HTTPURLResponse)?.statusCode == 200 else { diff --git a/packages/patrol/ios/Classes/ObjCPatrolAppServiceClient.swift b/packages/patrol/ios/Classes/ObjCPatrolAppServiceClient.swift index e16546de8..1b5fa086a 100644 --- a/packages/patrol/ios/Classes/ObjCPatrolAppServiceClient.swift +++ b/packages/patrol/ios/Classes/ObjCPatrolAppServiceClient.swift @@ -21,10 +21,12 @@ /// Construct client for accessing PatrolAppService server using the existing channel. @objc public override init() { let port = 8082 // TODO: Document this value better + // https://github.com/leancodepl/patrol/issues/1683 + let timeout = TimeInterval(2*60*60) NSLog("PatrolAppServiceClient: created, port: \(port)") - client = PatrolAppServiceClient(port: port, address: "localhost") + client = PatrolAppServiceClient(port: port, address: "localhost", timeout: timeout) } @objc public func listDartTests() async throws -> [String] { diff --git a/packages/patrol/lib/src/native/contracts/native_automator_client.dart b/packages/patrol/lib/src/native/contracts/native_automator_client.dart index f9aa3b891..0956fe8d8 100644 --- a/packages/patrol/lib/src/native/contracts/native_automator_client.dart +++ b/packages/patrol/lib/src/native/contracts/native_automator_client.dart @@ -27,7 +27,7 @@ class NativeAutomatorClient { NativeAutomatorClient( this._client, this._apiUri, { - Duration timeout = const Duration(seconds: 300), + Duration timeout = const Duration(seconds: 30), }) : _timeout = timeout, _headers = { 'Connection': 'keep-alive', diff --git a/packages/patrol/lib/src/native/patrol_app_service.dart b/packages/patrol/lib/src/native/patrol_app_service.dart index a487da014..bfb315f4f 100644 --- a/packages/patrol/lib/src/native/patrol_app_service.dart +++ b/packages/patrol/lib/src/native/patrol_app_service.dart @@ -11,6 +11,7 @@ import 'package:shelf/shelf.dart' as shelf; import 'package:shelf/shelf_io.dart' as shelf_io; const _port = 8082; +const _idleTimeout = Duration(hours: 2); class _TestExecutionResult { const _TestExecutionResult({required this.passed, required this.details}); @@ -32,7 +33,7 @@ Future runAppService(PatrolAppService service) async { poweredByHeader: null, ); - server.idleTimeout = const Duration(seconds: 300); + server.idleTimeout = _idleTimeout; final address = server.address; diff --git a/packages/patrol_gen/lib/src/generators/android/android_http4k_client_generator.dart b/packages/patrol_gen/lib/src/generators/android/android_http4k_client_generator.dart index 58cc0b730..0bf666f0f 100644 --- a/packages/patrol_gen/lib/src/generators/android/android_http4k_client_generator.dart +++ b/packages/patrol_gen/lib/src/generators/android/android_http4k_client_generator.dart @@ -48,7 +48,7 @@ import org.http4k.core.Status final urlWithPath = r'"$serverUrl$path"'; return ''' -class ${service.name}Client(private val address: String, private val port: Int) { +class ${service.name}Client(private val address: String, private val port: Int, private val timeout: Timeout) { $endpoints @@ -62,8 +62,8 @@ $endpoints HttpClients.custom().setDefaultRequestConfig( RequestConfig .copy(RequestConfig.DEFAULT) - .setResponseTimeout(Timeout.ofSeconds(300)) - .setConnectionRequestTimeout(Timeout.ofSeconds(300)) + .setResponseTimeout(timeout) + .setConnectionRequestTimeout(timeout) .build() ).build()) diff --git a/packages/patrol_gen/lib/src/generators/dart/dart_http_client_generator.dart b/packages/patrol_gen/lib/src/generators/dart/dart_http_client_generator.dart index efaf3e581..8606ed668 100644 --- a/packages/patrol_gen/lib/src/generators/dart/dart_http_client_generator.dart +++ b/packages/patrol_gen/lib/src/generators/dart/dart_http_client_generator.dart @@ -47,7 +47,7 @@ class ${service.name}Client { ${service.name}Client( this._client, this._apiUri, { - Duration timeout = const Duration(seconds: 300), + Duration timeout = const Duration(seconds: 30), }) : _timeout = timeout, $headers; final Duration _timeout; diff --git a/packages/patrol_gen/lib/src/generators/ios/ios_url_session_client_generator.dart b/packages/patrol_gen/lib/src/generators/ios/ios_url_session_client_generator.dart index 09bdf6cfe..35cd091ee 100644 --- a/packages/patrol_gen/lib/src/generators/ios/ios_url_session_client_generator.dart +++ b/packages/patrol_gen/lib/src/generators/ios/ios_url_session_client_generator.dart @@ -36,10 +36,12 @@ class IOSURLSessionClientGenerator { class ${service.name}Client { private let port: Int private let address: String + private let timeout: TimeInterval - init(port: Int, address: String) { + init(port: Int, address: String, timeout: TimeInterval) { self.port = port self.address = address + self.timeout = timeout } $endpoints @@ -48,13 +50,13 @@ $endpoints let url = URL(string: "$url")! let urlconfig = URLSessionConfiguration.default - urlconfig.timeoutIntervalForRequest = TimeInterval(300) - urlconfig.timeoutIntervalForResource = TimeInterval(300) + urlconfig.timeoutIntervalForRequest = timeout + urlconfig.timeoutIntervalForResource = timeout var request = URLRequest(url: url) request.httpMethod = "POST" request.httpBody = body - request.timeoutInterval = TimeInterval(300) + request.timeoutInterval = timeout let (data, response) = try await URLSession(configuration: urlconfig).data(for: request) guard (response as? HTTPURLResponse)?.statusCode == 200 else { From f2ed04af3298afd1eb4f1c2777b36229d192472a Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Tue, 12 Sep 2023 16:33:22 +0200 Subject: [PATCH 056/110] Remove comments --- .../patrol/ios/Classes/AutomatorServer/PatrolServer.swift | 4 ---- packages/patrol/ios/Classes/PatrolIntegrationTestRunner.h | 3 +-- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/packages/patrol/ios/Classes/AutomatorServer/PatrolServer.swift b/packages/patrol/ios/Classes/AutomatorServer/PatrolServer.swift index 30e6f515e..03f60fd01 100644 --- a/packages/patrol/ios/Classes/AutomatorServer/PatrolServer.swift +++ b/packages/patrol/ios/Classes/AutomatorServer/PatrolServer.swift @@ -10,7 +10,6 @@ import FlyingFox private let port: Int private let automator: Automator private let server: HTTPServer -// private let dispatchGroup = DispatchGroup() #endif @objc @@ -61,9 +60,6 @@ import FlyingFox let address = await server.listeningAddress Logger.shared.i("Server started on :\(address)") - -// dispatchGroup.enter() -// dispatchGroup.wait() #endif } } diff --git a/packages/patrol/ios/Classes/PatrolIntegrationTestRunner.h b/packages/patrol/ios/Classes/PatrolIntegrationTestRunner.h index e5cb72e1b..07993aabb 100644 --- a/packages/patrol/ios/Classes/PatrolIntegrationTestRunner.h +++ b/packages/patrol/ios/Classes/PatrolIntegrationTestRunner.h @@ -64,8 +64,7 @@ \ /* Spin the runloop waiting until the app reports the Dart tests it contains */ \ while (!dartTestFiles) { \ - [NSRunLoop.currentRunLoop runUntilDate:[NSDate dateWithTimeIntervalSinceNow:5.0]]; \ - /* @throw [NSException exceptionWithName:@"TODO exception1234" reason:@"Test" userInfo:nil]; */ \ + [NSRunLoop.currentRunLoop runUntilDate:[NSDate dateWithTimeIntervalSinceNow:1.0]]; \ } \ \ NSLog(@"Got %lu Dart tests: %@", dartTestFiles.count, dartTestFiles); \ From 7dfea5c32fc5dc7f1d0ce8ca211f22fd53894077 Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Tue, 12 Sep 2023 16:57:35 +0200 Subject: [PATCH 057/110] Remove throws from MainActivityTest --- .../main/kotlin/pl/leancode/patrol/PatrolJUnitRunner.java | 8 ++++---- .../java/pl/leancode/patrol/example/MainActivityTest.java | 7 +++---- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolJUnitRunner.java b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolJUnitRunner.java index 29d14077f..f1658a11e 100644 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolJUnitRunner.java +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolJUnitRunner.java @@ -104,7 +104,7 @@ public void waitForPatrolAppService() { Logger.INSTANCE.i(TAG + "PatrolAppService is ready to report Dart tests"); } - public Object[] listDartTests() throws PatrolAppServiceClientException { + public Object[] listDartTests() { final String TAG = "PatrolJUnitRunner.listDartTests(): "; try { @@ -114,7 +114,7 @@ public Object[] listDartTests() throws PatrolAppServiceClientException { return dartTestFiles; } catch (PatrolAppServiceClientException e) { Logger.INSTANCE.e(TAG + "Failed to list Dart tests: ", e); - throw e; + throw new RuntimeException(e); } } @@ -122,7 +122,7 @@ public Object[] listDartTests() throws PatrolAppServiceClientException { * Requests execution of a Dart test and waits for it to finish. * Throws AssertionError if the test fails. */ - public RunDartTestResponse runDartTest(String name) throws PatrolAppServiceClientException { + public RunDartTestResponse runDartTest(String name) { final String TAG = "PatrolJUnitRunner.runDartTest(" + name + "): "; try { @@ -134,7 +134,7 @@ public RunDartTestResponse runDartTest(String name) throws PatrolAppServiceClien return response; } catch (PatrolAppServiceClientException e) { Logger.INSTANCE.e(TAG + e.getMessage(), e.getCause()); - throw e; + throw new RuntimeException(e); } } } diff --git a/packages/patrol/example/android/app/src/androidTest/java/pl/leancode/patrol/example/MainActivityTest.java b/packages/patrol/example/android/app/src/androidTest/java/pl/leancode/patrol/example/MainActivityTest.java index dd86393c7..675e46464 100644 --- a/packages/patrol/example/android/app/src/androidTest/java/pl/leancode/patrol/example/MainActivityTest.java +++ b/packages/patrol/example/android/app/src/androidTest/java/pl/leancode/patrol/example/MainActivityTest.java @@ -6,12 +6,11 @@ import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameters; import pl.leancode.patrol.PatrolJUnitRunner; -import pl.leancode.patrol.contracts.PatrolAppServiceClientException; @RunWith(Parameterized.class) public class MainActivityTest { @Parameters(name = "{0}") - public static Object[] testCases() throws PatrolAppServiceClientException { + public static Object[] testCases() { PatrolJUnitRunner instrumentation = (PatrolJUnitRunner) InstrumentationRegistry.getInstrumentation(); instrumentation.setUp(MainActivity.class); instrumentation.waitForPatrolAppService(); @@ -25,8 +24,8 @@ public MainActivityTest(String dartTestName) { private final String dartTestName; @Test - public void runDartTest() throws PatrolAppServiceClientException { + public void runDartTest() { PatrolJUnitRunner instrumentation = (PatrolJUnitRunner) InstrumentationRegistry.getInstrumentation(); - instrumentation.runDartTest(dartTestName); + instrumentation.runDartTest(dartTestName); } } From fd79cc34f7d84d86d074613a4c98ea1309db75bc Mon Sep 17 00:00:00 2001 From: Bartek Pacia Date: Wed, 13 Sep 2023 11:51:34 +0200 Subject: [PATCH 058/110] Add support for Dart-side `group()`s (#1634) --- .github/workflows/patrol-prepare.yaml | 3 +- contracts.proto | 15 +- dev/cli_tests/patrol_develop_test.dart | 2 +- .../pl/leancode/patrol/ContractsExtensions.kt | 52 +- .../patrol/PatrolAppServiceClient.java | 2 +- .../pl/leancode/patrol/PatrolJUnitRunner.java | 20 +- .../leancode/patrol/contracts/Contracts.java | 1068 ++++++----------- .../patrol/contracts/DartGroupEntryKt.kt | 145 +++ .../patrol/contracts/DartTestCaseKt.kt | 50 - .../patrol/contracts/DartTestGroupKt.kt | 192 --- .../contracts/ListDartTestsResponseKt.kt | 10 +- .../patrol/ContractsExtensionsTest.kt | 101 +- .../example/integration_test/internal/README | 2 + .../integration_test/internal/group_test.dart | 45 + .../integration_test/open_app_test.dart | 42 +- .../{ => permissions}/notifications_test.dart | 2 +- .../permissions_location_test.dart | 2 +- .../permissions_many_test.dart | 2 +- .../example/integration_test/swipe_test.dart | 4 +- .../ios/Runner.xcodeproj/project.pbxproj | 2 +- .../xcshareddata/xcschemes/Runner.xcscheme | 2 +- .../example/ios/RunnerTests/RunnerTests.swift | 78 +- .../AutomatorServer/contracts.pb.swift | 137 +-- .../ios/Classes/PatrolAppServiceClient.swift | 37 +- .../ios/Classes/PatrolIntegrationTestRunner.h | 196 +-- packages/patrol/ios/Classes/PatrolUtils.h | 2 + packages/patrol/ios/Classes/PatrolUtils.m | 78 +- packages/patrol/lib/src/binding.dart | 46 +- packages/patrol/lib/src/common.dart | 89 +- packages/patrol/lib/src/extensions.dart | 16 + .../src/native/contracts/contracts.pb.dart | 156 +-- .../native/contracts/contracts.pbenum.dart | 29 + .../native/contracts/contracts.pbjson.dart | 49 +- .../lib/src/native/patrol_app_service.dart | 34 +- packages/patrol/test/internals_test.dart | 169 ++- .../lib/src/crossplatform/flutter_tool.dart | 2 +- packages/patrol_cli/lib/src/test_bundler.dart | 6 +- .../test/crossplatform/app_options_test.dart | 4 +- 38 files changed, 1470 insertions(+), 1421 deletions(-) create mode 100644 packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/DartGroupEntryKt.kt delete mode 100644 packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/DartTestCaseKt.kt delete mode 100644 packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/DartTestGroupKt.kt create mode 100644 packages/patrol/example/integration_test/internal/README create mode 100644 packages/patrol/example/integration_test/internal/group_test.dart rename packages/patrol/example/integration_test/{ => permissions}/notifications_test.dart (96%) rename packages/patrol/example/integration_test/{ => permissions}/permissions_location_test.dart (98%) rename packages/patrol/example/integration_test/{ => permissions}/permissions_many_test.dart (98%) create mode 100644 packages/patrol/lib/src/extensions.dart diff --git a/.github/workflows/patrol-prepare.yaml b/.github/workflows/patrol-prepare.yaml index 02fc0231c..817b2fc53 100644 --- a/.github/workflows/patrol-prepare.yaml +++ b/.github/workflows/patrol-prepare.yaml @@ -155,13 +155,14 @@ jobs: - name: Run unit tests working-directory: packages/patrol/example/ios run: | + set -o pipefail xcodebuild test \ -workspace Runner.xcworkspace \ -scheme Runner \ -only-testing RunnerTests \ -configuration Debug \ -sdk iphoneos -destination 'platform=iOS Simulator,name=iPhone 14' \ - -derivedDataPath ../build/ios_unit | xcbeautify + -derivedDataPath ../build/ios_unit | xcbeautify --renderer github-actions prepare-flutter: name: Flutter ${{ matrix.flutter-version }} diff --git a/contracts.proto b/contracts.proto index 58842f1ec..27d2e105c 100644 --- a/contracts.proto +++ b/contracts.proto @@ -9,17 +9,18 @@ service PatrolAppService { } message ListDartTestsResponse { - DartTestGroup group = 1; + DartGroupEntry group = 1; } -message DartTestGroup { +message DartGroupEntry { string name = 1; - repeated DartTestCase tests = 2; - repeated DartTestGroup groups = 3; -} + GroupEntryType type = 3; + repeated DartGroupEntry entries = 4; -message DartTestCase { - string name = 1; + enum GroupEntryType { + GROUP = 0; + TEST = 1; + } } message RunDartTestRequest { diff --git a/dev/cli_tests/patrol_develop_test.dart b/dev/cli_tests/patrol_develop_test.dart index 5f7cdcfb9..45feec394 100644 --- a/dev/cli_tests/patrol_develop_test.dart +++ b/dev/cli_tests/patrol_develop_test.dart @@ -58,7 +58,7 @@ void main(List args) async { [ 'develop', ...['--target', 'integration_test/example_test.dart'], - ...args + ...args, ], runInShell: true, workingDirectory: exampleAppDirectory.path, diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/ContractsExtensions.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/ContractsExtensions.kt index 30d74952e..69100a636 100644 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/ContractsExtensions.kt +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/ContractsExtensions.kt @@ -3,10 +3,11 @@ package pl.leancode.patrol import androidx.test.uiautomator.By import androidx.test.uiautomator.BySelector import androidx.test.uiautomator.UiSelector -import pl.leancode.patrol.contracts.Contracts -import pl.leancode.patrol.contracts.Contracts.DartTestGroup +import pl.leancode.patrol.contracts.Contracts.DartGroupEntry +import pl.leancode.patrol.contracts.Contracts.Selector +import pl.leancode.patrol.contracts.copy -private fun Contracts.Selector.isEmpty(): Boolean { +private fun Selector.isEmpty(): Boolean { return ( !hasText() && !hasTextStartsWith() && @@ -23,7 +24,7 @@ private fun Contracts.Selector.isEmpty(): Boolean { ) } -fun Contracts.Selector.toUiSelector(): UiSelector { +fun Selector.toUiSelector(): UiSelector { var selector = UiSelector() if (hasText()) { @@ -77,7 +78,7 @@ fun Contracts.Selector.toUiSelector(): UiSelector { return selector } -fun Contracts.Selector.toBySelector(): BySelector { +fun Selector.toBySelector(): BySelector { if (isEmpty()) { throw PatrolException("Selector is empty") } @@ -184,21 +185,28 @@ fun Contracts.Selector.toBySelector(): BySelector { return bySelector } -fun DartTestGroup.listFlatDartFiles(): List { - val files = mutableListOf() - for (group in groupsList) { - files.addAll(group.listGroups()) - } - - return files -} - -// Recursively lists groups in this group. -private fun DartTestGroup.listGroups(): List { - val groups = mutableListOf(this.name) - for (group in groupsList) { - groups.addAll(group.listGroups()) - } - - return groups +/** + * Flattens the structure of a DartTestSuite into a flat list of tests. + */ +fun DartGroupEntry.listTestsFlat(parentGroupName: String = ""): List { + val tests = mutableListOf() + + for (test in entriesList) { + if (test.type == DartGroupEntry.GroupEntryType.TEST) { + if (parentGroupName.isEmpty()) { + // This case is invalid, because every test will have at least 1 named group - its filename. + throw IllegalStateException("Invariant violated: test $test has no named parent group") + } + + tests.add(test.copy { name = "$parentGroupName ${test.name}" }) + } else if (test.type == DartGroupEntry.GroupEntryType.GROUP) { + if (parentGroupName.isEmpty()) { + tests.addAll(test.listTestsFlat(parentGroupName = test.name)) + } else { + tests.addAll(test.listTestsFlat(parentGroupName = "$parentGroupName ${test.name}")) + } + } + } + + return tests } diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolAppServiceClient.java b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolAppServiceClient.java index 68caee0b4..880d1e2ee 100644 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolAppServiceClient.java +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolAppServiceClient.java @@ -28,7 +28,7 @@ public PatrolAppServiceClient(String target) { blockingStub = PatrolAppServiceGrpc.newBlockingStub(channel); } - public DartTestGroup listDartTests() throws StatusRuntimeException { + public DartGroupEntry listDartTests() throws StatusRuntimeException { Empty request = Empty.newBuilder().build(); ListDartTestsResponse response = blockingStub.listDartTests(request); diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolJUnitRunner.java b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolJUnitRunner.java index fffe13014..e5802e57b 100644 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolJUnitRunner.java +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolJUnitRunner.java @@ -11,11 +11,13 @@ import androidx.test.platform.app.InstrumentationRegistry; import androidx.test.runner.AndroidJUnitRunner; import io.grpc.StatusRuntimeException; -import pl.leancode.patrol.contracts.Contracts.DartTestGroup; +import java.util.ArrayList; import java.util.Arrays; +import java.util.List; import java.util.concurrent.ExecutionException; +import static pl.leancode.patrol.contracts.Contracts.DartGroupEntry; import static pl.leancode.patrol.contracts.Contracts.RunDartTestResponse; /** @@ -53,7 +55,8 @@ public void onCreate(Bundle arguments) { * This default behavior doesn't work with Flutter apps. That's because in Flutter * apps, the tests are in the app itself, so running only the instrumentation * during the initial run is not enough. - * The app must also be run, and queried for Dart tests That's what this method does. + * The app must also be run, and queried for Dart tests. + * That's what this method does. *

*/ public void setUp(Class activityClass) { @@ -106,10 +109,15 @@ public Object[] listDartTests() { final String TAG = "PatrolJUnitRunner.listDartTests(): "; try { - final DartTestGroup dartTestGroup = patrolAppServiceClient.listDartTests(); - Object[] dartTestFiles = ContractsExtensionsKt.listFlatDartFiles(dartTestGroup).toArray(); - Logger.INSTANCE.i(TAG + "Got Dart tests: " + Arrays.toString(dartTestFiles)); - return dartTestFiles; + final DartGroupEntry dartTestGroup = patrolAppServiceClient.listDartTests(); + List dartTestCases = ContractsExtensionsKt.listTestsFlat(dartTestGroup, ""); + List dartTestCaseNamesList = new ArrayList<>(); + for (DartGroupEntry dartTestCase : dartTestCases) { + dartTestCaseNamesList.add(dartTestCase.getName()); + } + Object[] dartTestCaseNames = dartTestCaseNamesList.toArray(); + Logger.INSTANCE.i(TAG + "Got Dart tests: " + Arrays.toString(dartTestCaseNames)); + return dartTestCaseNames; } catch (StatusRuntimeException e) { Logger.INSTANCE.e(TAG + "Failed to list Dart tests: ", e); throw e; diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/Contracts.java b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/Contracts.java index 22199865b..a05cc7707 100644 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/Contracts.java +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/Contracts.java @@ -13,15 +13,15 @@ public interface ListDartTestsResponseOrBuilder extends com.google.protobuf.MessageLiteOrBuilder { /** - * .patrol.DartTestGroup group = 1; + * .patrol.DartGroupEntry group = 1; * @return Whether the group field is set. */ boolean hasGroup(); /** - * .patrol.DartTestGroup group = 1; + * .patrol.DartGroupEntry group = 1; * @return The group. */ - pl.leancode.patrol.contracts.Contracts.DartTestGroup getGroup(); + pl.leancode.patrol.contracts.Contracts.DartGroupEntry getGroup(); } /** * Protobuf type {@code patrol.ListDartTestsResponse} @@ -33,50 +33,51 @@ public static final class ListDartTestsResponse extends ListDartTestsResponseOrBuilder { private ListDartTestsResponse() { } + private int bitField0_; public static final int GROUP_FIELD_NUMBER = 1; - private pl.leancode.patrol.contracts.Contracts.DartTestGroup group_; + private pl.leancode.patrol.contracts.Contracts.DartGroupEntry group_; /** - * .patrol.DartTestGroup group = 1; + * .patrol.DartGroupEntry group = 1; */ @java.lang.Override public boolean hasGroup() { - return group_ != null; + return ((bitField0_ & 0x00000001) != 0); } /** - * .patrol.DartTestGroup group = 1; + * .patrol.DartGroupEntry group = 1; */ @java.lang.Override - public pl.leancode.patrol.contracts.Contracts.DartTestGroup getGroup() { - return group_ == null ? pl.leancode.patrol.contracts.Contracts.DartTestGroup.getDefaultInstance() : group_; + public pl.leancode.patrol.contracts.Contracts.DartGroupEntry getGroup() { + return group_ == null ? pl.leancode.patrol.contracts.Contracts.DartGroupEntry.getDefaultInstance() : group_; } /** - * .patrol.DartTestGroup group = 1; + * .patrol.DartGroupEntry group = 1; */ - private void setGroup(pl.leancode.patrol.contracts.Contracts.DartTestGroup value) { + private void setGroup(pl.leancode.patrol.contracts.Contracts.DartGroupEntry value) { value.getClass(); group_ = value; - + bitField0_ |= 0x00000001; } /** - * .patrol.DartTestGroup group = 1; + * .patrol.DartGroupEntry group = 1; */ @java.lang.SuppressWarnings({"ReferenceEquality"}) - private void mergeGroup(pl.leancode.patrol.contracts.Contracts.DartTestGroup value) { + private void mergeGroup(pl.leancode.patrol.contracts.Contracts.DartGroupEntry value) { value.getClass(); if (group_ != null && - group_ != pl.leancode.patrol.contracts.Contracts.DartTestGroup.getDefaultInstance()) { + group_ != pl.leancode.patrol.contracts.Contracts.DartGroupEntry.getDefaultInstance()) { group_ = - pl.leancode.patrol.contracts.Contracts.DartTestGroup.newBuilder(group_).mergeFrom(value).buildPartial(); + pl.leancode.patrol.contracts.Contracts.DartGroupEntry.newBuilder(group_).mergeFrom(value).buildPartial(); } else { group_ = value; } - + bitField0_ |= 0x00000001; } /** - * .patrol.DartTestGroup group = 1; + * .patrol.DartGroupEntry group = 1; */ private void clearGroup() { group_ = null; - + bitField0_ = (bitField0_ & ~0x00000001); } public static pl.leancode.patrol.contracts.Contracts.ListDartTestsResponse parseFrom( @@ -159,7 +160,7 @@ public static Builder newBuilder() { return (Builder) DEFAULT_INSTANCE.createBuilder(); } public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.ListDartTestsResponse prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + return DEFAULT_INSTANCE.createBuilder(prototype); } /** @@ -177,46 +178,46 @@ private Builder() { /** - * .patrol.DartTestGroup group = 1; + * .patrol.DartGroupEntry group = 1; */ @java.lang.Override public boolean hasGroup() { return instance.hasGroup(); } /** - * .patrol.DartTestGroup group = 1; + * .patrol.DartGroupEntry group = 1; */ @java.lang.Override - public pl.leancode.patrol.contracts.Contracts.DartTestGroup getGroup() { + public pl.leancode.patrol.contracts.Contracts.DartGroupEntry getGroup() { return instance.getGroup(); } /** - * .patrol.DartTestGroup group = 1; + * .patrol.DartGroupEntry group = 1; */ - public Builder setGroup(pl.leancode.patrol.contracts.Contracts.DartTestGroup value) { + public Builder setGroup(pl.leancode.patrol.contracts.Contracts.DartGroupEntry value) { copyOnWrite(); instance.setGroup(value); return this; } /** - * .patrol.DartTestGroup group = 1; + * .patrol.DartGroupEntry group = 1; */ public Builder setGroup( - pl.leancode.patrol.contracts.Contracts.DartTestGroup.Builder builderForValue) { + pl.leancode.patrol.contracts.Contracts.DartGroupEntry.Builder builderForValue) { copyOnWrite(); instance.setGroup(builderForValue.build()); return this; } /** - * .patrol.DartTestGroup group = 1; + * .patrol.DartGroupEntry group = 1; */ - public Builder mergeGroup(pl.leancode.patrol.contracts.Contracts.DartTestGroup value) { + public Builder mergeGroup(pl.leancode.patrol.contracts.Contracts.DartGroupEntry value) { copyOnWrite(); instance.mergeGroup(value); return this; } /** - * .patrol.DartTestGroup group = 1; + * .patrol.DartGroupEntry group = 1; */ public Builder clearGroup() { copyOnWrite(); instance.clearGroup(); @@ -239,10 +240,11 @@ protected final java.lang.Object dynamicMethod( } case BUILD_MESSAGE_INFO: { java.lang.Object[] objects = new java.lang.Object[] { + "bitField0_", "group_", }; java.lang.String info = - "\u0000\u0001\u0000\u0000\u0001\u0001\u0001\u0000\u0000\u0000\u0001\t"; + "\u0000\u0001\u0000\u0001\u0001\u0001\u0001\u0000\u0000\u0000\u0001\u1009\u0000"; return newMessageInfo(DEFAULT_INSTANCE, info, objects); } // fall through @@ -297,8 +299,8 @@ public static com.google.protobuf.Parser parser() { } } - public interface DartTestGroupOrBuilder extends - // @@protoc_insertion_point(interface_extends:patrol.DartTestGroup) + public interface DartGroupEntryOrBuilder extends + // @@protoc_insertion_point(interface_extends:patrol.DartGroupEntry) com.google.protobuf.MessageLiteOrBuilder { /** @@ -314,46 +316,131 @@ public interface DartTestGroupOrBuilder extends getNameBytes(); /** - * repeated .patrol.DartTestCase tests = 2; - */ - java.util.List - getTestsList(); - /** - * repeated .patrol.DartTestCase tests = 2; + * .patrol.DartGroupEntry.GroupEntryType type = 3; + * @return The enum numeric value on the wire for type. */ - pl.leancode.patrol.contracts.Contracts.DartTestCase getTests(int index); + int getTypeValue(); /** - * repeated .patrol.DartTestCase tests = 2; + * .patrol.DartGroupEntry.GroupEntryType type = 3; + * @return The type. */ - int getTestsCount(); + pl.leancode.patrol.contracts.Contracts.DartGroupEntry.GroupEntryType getType(); /** - * repeated .patrol.DartTestGroup groups = 3; + * repeated .patrol.DartGroupEntry entries = 4; */ - java.util.List - getGroupsList(); + java.util.List + getEntriesList(); /** - * repeated .patrol.DartTestGroup groups = 3; + * repeated .patrol.DartGroupEntry entries = 4; */ - pl.leancode.patrol.contracts.Contracts.DartTestGroup getGroups(int index); + pl.leancode.patrol.contracts.Contracts.DartGroupEntry getEntries(int index); /** - * repeated .patrol.DartTestGroup groups = 3; + * repeated .patrol.DartGroupEntry entries = 4; */ - int getGroupsCount(); + int getEntriesCount(); } /** - * Protobuf type {@code patrol.DartTestGroup} + * Protobuf type {@code patrol.DartGroupEntry} */ - public static final class DartTestGroup extends + public static final class DartGroupEntry extends com.google.protobuf.GeneratedMessageLite< - DartTestGroup, DartTestGroup.Builder> implements - // @@protoc_insertion_point(message_implements:patrol.DartTestGroup) - DartTestGroupOrBuilder { - private DartTestGroup() { + DartGroupEntry, DartGroupEntry.Builder> implements + // @@protoc_insertion_point(message_implements:patrol.DartGroupEntry) + DartGroupEntryOrBuilder { + private DartGroupEntry() { name_ = ""; - tests_ = emptyProtobufList(); - groups_ = emptyProtobufList(); + entries_ = emptyProtobufList(); } + /** + * Protobuf enum {@code patrol.DartGroupEntry.GroupEntryType} + */ + public enum GroupEntryType + implements com.google.protobuf.Internal.EnumLite { + /** + * GROUP = 0; + */ + GROUP(0), + /** + * TEST = 1; + */ + TEST(1), + UNRECOGNIZED(-1), + ; + + /** + * GROUP = 0; + */ + public static final int GROUP_VALUE = 0; + /** + * TEST = 1; + */ + public static final int TEST_VALUE = 1; + + + @java.lang.Override + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static GroupEntryType valueOf(int value) { + return forNumber(value); + } + + public static GroupEntryType forNumber(int value) { + switch (value) { + case 0: return GROUP; + case 1: return TEST; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + GroupEntryType> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + @java.lang.Override + public GroupEntryType findValueByNumber(int number) { + return GroupEntryType.forNumber(number); + } + }; + + public static com.google.protobuf.Internal.EnumVerifier + internalGetVerifier() { + return GroupEntryTypeVerifier.INSTANCE; + } + + private static final class GroupEntryTypeVerifier implements + com.google.protobuf.Internal.EnumVerifier { + static final com.google.protobuf.Internal.EnumVerifier INSTANCE = new GroupEntryTypeVerifier(); + @java.lang.Override + public boolean isInRange(int number) { + return GroupEntryType.forNumber(number) != null; + } + }; + + private final int value; + + private GroupEntryType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:patrol.DartGroupEntry.GroupEntryType) + } + public static final int NAME_FIELD_NUMBER = 1; private java.lang.String name_; /** @@ -401,238 +488,186 @@ private void setNameBytes( } - public static final int TESTS_FIELD_NUMBER = 2; - private com.google.protobuf.Internal.ProtobufList tests_; + public static final int TYPE_FIELD_NUMBER = 3; + private int type_; /** - * repeated .patrol.DartTestCase tests = 2; + * .patrol.DartGroupEntry.GroupEntryType type = 3; + * @return The enum numeric value on the wire for type. */ @java.lang.Override - public java.util.List getTestsList() { - return tests_; + public int getTypeValue() { + return type_; } /** - * repeated .patrol.DartTestCase tests = 2; - */ - public java.util.List - getTestsOrBuilderList() { - return tests_; - } - /** - * repeated .patrol.DartTestCase tests = 2; + * .patrol.DartGroupEntry.GroupEntryType type = 3; + * @return The type. */ @java.lang.Override - public int getTestsCount() { - return tests_.size(); + public pl.leancode.patrol.contracts.Contracts.DartGroupEntry.GroupEntryType getType() { + pl.leancode.patrol.contracts.Contracts.DartGroupEntry.GroupEntryType result = pl.leancode.patrol.contracts.Contracts.DartGroupEntry.GroupEntryType.forNumber(type_); + return result == null ? pl.leancode.patrol.contracts.Contracts.DartGroupEntry.GroupEntryType.UNRECOGNIZED : result; } /** - * repeated .patrol.DartTestCase tests = 2; + * .patrol.DartGroupEntry.GroupEntryType type = 3; + * @param value The enum numeric value on the wire for type to set. */ - @java.lang.Override - public pl.leancode.patrol.contracts.Contracts.DartTestCase getTests(int index) { - return tests_.get(index); + private void setTypeValue(int value) { + type_ = value; } /** - * repeated .patrol.DartTestCase tests = 2; + * .patrol.DartGroupEntry.GroupEntryType type = 3; + * @param value The type to set. */ - public pl.leancode.patrol.contracts.Contracts.DartTestCaseOrBuilder getTestsOrBuilder( - int index) { - return tests_.get(index); - } - private void ensureTestsIsMutable() { - com.google.protobuf.Internal.ProtobufList tmp = tests_; - if (!tmp.isModifiable()) { - tests_ = - com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp); - } - } + private void setType(pl.leancode.patrol.contracts.Contracts.DartGroupEntry.GroupEntryType value) { + type_ = value.getNumber(); - /** - * repeated .patrol.DartTestCase tests = 2; - */ - private void setTests( - int index, pl.leancode.patrol.contracts.Contracts.DartTestCase value) { - value.getClass(); - ensureTestsIsMutable(); - tests_.set(index, value); - } - /** - * repeated .patrol.DartTestCase tests = 2; - */ - private void addTests(pl.leancode.patrol.contracts.Contracts.DartTestCase value) { - value.getClass(); - ensureTestsIsMutable(); - tests_.add(value); - } - /** - * repeated .patrol.DartTestCase tests = 2; - */ - private void addTests( - int index, pl.leancode.patrol.contracts.Contracts.DartTestCase value) { - value.getClass(); - ensureTestsIsMutable(); - tests_.add(index, value); } /** - * repeated .patrol.DartTestCase tests = 2; + * .patrol.DartGroupEntry.GroupEntryType type = 3; */ - private void addAllTests( - java.lang.Iterable values) { - ensureTestsIsMutable(); - com.google.protobuf.AbstractMessageLite.addAll( - values, tests_); - } - /** - * repeated .patrol.DartTestCase tests = 2; - */ - private void clearTests() { - tests_ = emptyProtobufList(); - } - /** - * repeated .patrol.DartTestCase tests = 2; - */ - private void removeTests(int index) { - ensureTestsIsMutable(); - tests_.remove(index); + private void clearType() { + + type_ = 0; } - public static final int GROUPS_FIELD_NUMBER = 3; - private com.google.protobuf.Internal.ProtobufList groups_; + public static final int ENTRIES_FIELD_NUMBER = 4; + private com.google.protobuf.Internal.ProtobufList entries_; /** - * repeated .patrol.DartTestGroup groups = 3; + * repeated .patrol.DartGroupEntry entries = 4; */ @java.lang.Override - public java.util.List getGroupsList() { - return groups_; + public java.util.List getEntriesList() { + return entries_; } /** - * repeated .patrol.DartTestGroup groups = 3; + * repeated .patrol.DartGroupEntry entries = 4; */ - public java.util.List - getGroupsOrBuilderList() { - return groups_; + public java.util.List + getEntriesOrBuilderList() { + return entries_; } /** - * repeated .patrol.DartTestGroup groups = 3; + * repeated .patrol.DartGroupEntry entries = 4; */ @java.lang.Override - public int getGroupsCount() { - return groups_.size(); + public int getEntriesCount() { + return entries_.size(); } /** - * repeated .patrol.DartTestGroup groups = 3; + * repeated .patrol.DartGroupEntry entries = 4; */ @java.lang.Override - public pl.leancode.patrol.contracts.Contracts.DartTestGroup getGroups(int index) { - return groups_.get(index); + public pl.leancode.patrol.contracts.Contracts.DartGroupEntry getEntries(int index) { + return entries_.get(index); } /** - * repeated .patrol.DartTestGroup groups = 3; + * repeated .patrol.DartGroupEntry entries = 4; */ - public pl.leancode.patrol.contracts.Contracts.DartTestGroupOrBuilder getGroupsOrBuilder( + public pl.leancode.patrol.contracts.Contracts.DartGroupEntryOrBuilder getEntriesOrBuilder( int index) { - return groups_.get(index); + return entries_.get(index); } - private void ensureGroupsIsMutable() { - com.google.protobuf.Internal.ProtobufList tmp = groups_; + private void ensureEntriesIsMutable() { + com.google.protobuf.Internal.ProtobufList tmp = entries_; if (!tmp.isModifiable()) { - groups_ = + entries_ = com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp); } } /** - * repeated .patrol.DartTestGroup groups = 3; + * repeated .patrol.DartGroupEntry entries = 4; */ - private void setGroups( - int index, pl.leancode.patrol.contracts.Contracts.DartTestGroup value) { + private void setEntries( + int index, pl.leancode.patrol.contracts.Contracts.DartGroupEntry value) { value.getClass(); - ensureGroupsIsMutable(); - groups_.set(index, value); + ensureEntriesIsMutable(); + entries_.set(index, value); } /** - * repeated .patrol.DartTestGroup groups = 3; + * repeated .patrol.DartGroupEntry entries = 4; */ - private void addGroups(pl.leancode.patrol.contracts.Contracts.DartTestGroup value) { + private void addEntries(pl.leancode.patrol.contracts.Contracts.DartGroupEntry value) { value.getClass(); - ensureGroupsIsMutable(); - groups_.add(value); + ensureEntriesIsMutable(); + entries_.add(value); } /** - * repeated .patrol.DartTestGroup groups = 3; + * repeated .patrol.DartGroupEntry entries = 4; */ - private void addGroups( - int index, pl.leancode.patrol.contracts.Contracts.DartTestGroup value) { + private void addEntries( + int index, pl.leancode.patrol.contracts.Contracts.DartGroupEntry value) { value.getClass(); - ensureGroupsIsMutable(); - groups_.add(index, value); + ensureEntriesIsMutable(); + entries_.add(index, value); } /** - * repeated .patrol.DartTestGroup groups = 3; + * repeated .patrol.DartGroupEntry entries = 4; */ - private void addAllGroups( - java.lang.Iterable values) { - ensureGroupsIsMutable(); + private void addAllEntries( + java.lang.Iterable values) { + ensureEntriesIsMutable(); com.google.protobuf.AbstractMessageLite.addAll( - values, groups_); + values, entries_); } /** - * repeated .patrol.DartTestGroup groups = 3; + * repeated .patrol.DartGroupEntry entries = 4; */ - private void clearGroups() { - groups_ = emptyProtobufList(); + private void clearEntries() { + entries_ = emptyProtobufList(); } /** - * repeated .patrol.DartTestGroup groups = 3; + * repeated .patrol.DartGroupEntry entries = 4; */ - private void removeGroups(int index) { - ensureGroupsIsMutable(); - groups_.remove(index); + private void removeEntries(int index) { + ensureEntriesIsMutable(); + entries_.remove(index); } - public static pl.leancode.patrol.contracts.Contracts.DartTestGroup parseFrom( + public static pl.leancode.patrol.contracts.Contracts.DartGroupEntry parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, data); } - public static pl.leancode.patrol.contracts.Contracts.DartTestGroup parseFrom( + public static pl.leancode.patrol.contracts.Contracts.DartGroupEntry parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, data, extensionRegistry); } - public static pl.leancode.patrol.contracts.Contracts.DartTestGroup parseFrom( + public static pl.leancode.patrol.contracts.Contracts.DartGroupEntry parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, data); } - public static pl.leancode.patrol.contracts.Contracts.DartTestGroup parseFrom( + public static pl.leancode.patrol.contracts.Contracts.DartGroupEntry parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, data, extensionRegistry); } - public static pl.leancode.patrol.contracts.Contracts.DartTestGroup parseFrom(byte[] data) + public static pl.leancode.patrol.contracts.Contracts.DartGroupEntry parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, data); } - public static pl.leancode.patrol.contracts.Contracts.DartTestGroup parseFrom( + public static pl.leancode.patrol.contracts.Contracts.DartGroupEntry parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, data, extensionRegistry); } - public static pl.leancode.patrol.contracts.Contracts.DartTestGroup parseFrom(java.io.InputStream input) + public static pl.leancode.patrol.contracts.Contracts.DartGroupEntry parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, input); } - public static pl.leancode.patrol.contracts.Contracts.DartTestGroup parseFrom( + public static pl.leancode.patrol.contracts.Contracts.DartGroupEntry parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -640,24 +675,24 @@ public static pl.leancode.patrol.contracts.Contracts.DartTestGroup parseFrom( DEFAULT_INSTANCE, input, extensionRegistry); } - public static pl.leancode.patrol.contracts.Contracts.DartTestGroup parseDelimitedFrom(java.io.InputStream input) + public static pl.leancode.patrol.contracts.Contracts.DartGroupEntry parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return parseDelimitedFrom(DEFAULT_INSTANCE, input); } - public static pl.leancode.patrol.contracts.Contracts.DartTestGroup parseDelimitedFrom( + public static pl.leancode.patrol.contracts.Contracts.DartGroupEntry parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); } - public static pl.leancode.patrol.contracts.Contracts.DartTestGroup parseFrom( + public static pl.leancode.patrol.contracts.Contracts.DartGroupEntry parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageLite.parseFrom( DEFAULT_INSTANCE, input); } - public static pl.leancode.patrol.contracts.Contracts.DartTestGroup parseFrom( + public static pl.leancode.patrol.contracts.Contracts.DartGroupEntry parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -668,19 +703,19 @@ public static pl.leancode.patrol.contracts.Contracts.DartTestGroup parseFrom( public static Builder newBuilder() { return (Builder) DEFAULT_INSTANCE.createBuilder(); } - public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.DartTestGroup prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.DartGroupEntry prototype) { + return DEFAULT_INSTANCE.createBuilder(prototype); } /** - * Protobuf type {@code patrol.DartTestGroup} + * Protobuf type {@code patrol.DartGroupEntry} */ public static final class Builder extends com.google.protobuf.GeneratedMessageLite.Builder< - pl.leancode.patrol.contracts.Contracts.DartTestGroup, Builder> implements - // @@protoc_insertion_point(builder_implements:patrol.DartTestGroup) - pl.leancode.patrol.contracts.Contracts.DartTestGroupOrBuilder { - // Construct using pl.leancode.patrol.contracts.Contracts.DartTestGroup.newBuilder() + pl.leancode.patrol.contracts.Contracts.DartGroupEntry, Builder> implements + // @@protoc_insertion_point(builder_implements:patrol.DartGroupEntry) + pl.leancode.patrol.contracts.Contracts.DartGroupEntryOrBuilder { + // Construct using pl.leancode.patrol.contracts.Contracts.DartGroupEntry.newBuilder() private Builder() { super(DEFAULT_INSTANCE); } @@ -736,210 +771,154 @@ public Builder setNameBytes( } /** - * repeated .patrol.DartTestCase tests = 2; - */ - @java.lang.Override - public java.util.List getTestsList() { - return java.util.Collections.unmodifiableList( - instance.getTestsList()); - } - /** - * repeated .patrol.DartTestCase tests = 2; + * .patrol.DartGroupEntry.GroupEntryType type = 3; + * @return The enum numeric value on the wire for type. */ @java.lang.Override - public int getTestsCount() { - return instance.getTestsCount(); - }/** - * repeated .patrol.DartTestCase tests = 2; - */ - @java.lang.Override - public pl.leancode.patrol.contracts.Contracts.DartTestCase getTests(int index) { - return instance.getTests(index); - } - /** - * repeated .patrol.DartTestCase tests = 2; - */ - public Builder setTests( - int index, pl.leancode.patrol.contracts.Contracts.DartTestCase value) { - copyOnWrite(); - instance.setTests(index, value); - return this; - } - /** - * repeated .patrol.DartTestCase tests = 2; - */ - public Builder setTests( - int index, pl.leancode.patrol.contracts.Contracts.DartTestCase.Builder builderForValue) { - copyOnWrite(); - instance.setTests(index, - builderForValue.build()); - return this; - } - /** - * repeated .patrol.DartTestCase tests = 2; - */ - public Builder addTests(pl.leancode.patrol.contracts.Contracts.DartTestCase value) { - copyOnWrite(); - instance.addTests(value); - return this; - } - /** - * repeated .patrol.DartTestCase tests = 2; - */ - public Builder addTests( - int index, pl.leancode.patrol.contracts.Contracts.DartTestCase value) { - copyOnWrite(); - instance.addTests(index, value); - return this; - } - /** - * repeated .patrol.DartTestCase tests = 2; - */ - public Builder addTests( - pl.leancode.patrol.contracts.Contracts.DartTestCase.Builder builderForValue) { - copyOnWrite(); - instance.addTests(builderForValue.build()); - return this; + public int getTypeValue() { + return instance.getTypeValue(); } /** - * repeated .patrol.DartTestCase tests = 2; + * .patrol.DartGroupEntry.GroupEntryType type = 3; + * @param value The type to set. + * @return This builder for chaining. */ - public Builder addTests( - int index, pl.leancode.patrol.contracts.Contracts.DartTestCase.Builder builderForValue) { + public Builder setTypeValue(int value) { copyOnWrite(); - instance.addTests(index, - builderForValue.build()); + instance.setTypeValue(value); return this; } /** - * repeated .patrol.DartTestCase tests = 2; + * .patrol.DartGroupEntry.GroupEntryType type = 3; + * @return The type. */ - public Builder addAllTests( - java.lang.Iterable values) { - copyOnWrite(); - instance.addAllTests(values); - return this; + @java.lang.Override + public pl.leancode.patrol.contracts.Contracts.DartGroupEntry.GroupEntryType getType() { + return instance.getType(); } /** - * repeated .patrol.DartTestCase tests = 2; + * .patrol.DartGroupEntry.GroupEntryType type = 3; + * @param value The enum numeric value on the wire for type to set. + * @return This builder for chaining. */ - public Builder clearTests() { + public Builder setType(pl.leancode.patrol.contracts.Contracts.DartGroupEntry.GroupEntryType value) { copyOnWrite(); - instance.clearTests(); + instance.setType(value); return this; } /** - * repeated .patrol.DartTestCase tests = 2; + * .patrol.DartGroupEntry.GroupEntryType type = 3; + * @return This builder for chaining. */ - public Builder removeTests(int index) { + public Builder clearType() { copyOnWrite(); - instance.removeTests(index); + instance.clearType(); return this; } /** - * repeated .patrol.DartTestGroup groups = 3; + * repeated .patrol.DartGroupEntry entries = 4; */ @java.lang.Override - public java.util.List getGroupsList() { + public java.util.List getEntriesList() { return java.util.Collections.unmodifiableList( - instance.getGroupsList()); + instance.getEntriesList()); } /** - * repeated .patrol.DartTestGroup groups = 3; + * repeated .patrol.DartGroupEntry entries = 4; */ @java.lang.Override - public int getGroupsCount() { - return instance.getGroupsCount(); + public int getEntriesCount() { + return instance.getEntriesCount(); }/** - * repeated .patrol.DartTestGroup groups = 3; + * repeated .patrol.DartGroupEntry entries = 4; */ @java.lang.Override - public pl.leancode.patrol.contracts.Contracts.DartTestGroup getGroups(int index) { - return instance.getGroups(index); + public pl.leancode.patrol.contracts.Contracts.DartGroupEntry getEntries(int index) { + return instance.getEntries(index); } /** - * repeated .patrol.DartTestGroup groups = 3; + * repeated .patrol.DartGroupEntry entries = 4; */ - public Builder setGroups( - int index, pl.leancode.patrol.contracts.Contracts.DartTestGroup value) { + public Builder setEntries( + int index, pl.leancode.patrol.contracts.Contracts.DartGroupEntry value) { copyOnWrite(); - instance.setGroups(index, value); + instance.setEntries(index, value); return this; } /** - * repeated .patrol.DartTestGroup groups = 3; + * repeated .patrol.DartGroupEntry entries = 4; */ - public Builder setGroups( - int index, pl.leancode.patrol.contracts.Contracts.DartTestGroup.Builder builderForValue) { + public Builder setEntries( + int index, pl.leancode.patrol.contracts.Contracts.DartGroupEntry.Builder builderForValue) { copyOnWrite(); - instance.setGroups(index, + instance.setEntries(index, builderForValue.build()); return this; } /** - * repeated .patrol.DartTestGroup groups = 3; + * repeated .patrol.DartGroupEntry entries = 4; */ - public Builder addGroups(pl.leancode.patrol.contracts.Contracts.DartTestGroup value) { + public Builder addEntries(pl.leancode.patrol.contracts.Contracts.DartGroupEntry value) { copyOnWrite(); - instance.addGroups(value); + instance.addEntries(value); return this; } /** - * repeated .patrol.DartTestGroup groups = 3; + * repeated .patrol.DartGroupEntry entries = 4; */ - public Builder addGroups( - int index, pl.leancode.patrol.contracts.Contracts.DartTestGroup value) { + public Builder addEntries( + int index, pl.leancode.patrol.contracts.Contracts.DartGroupEntry value) { copyOnWrite(); - instance.addGroups(index, value); + instance.addEntries(index, value); return this; } /** - * repeated .patrol.DartTestGroup groups = 3; + * repeated .patrol.DartGroupEntry entries = 4; */ - public Builder addGroups( - pl.leancode.patrol.contracts.Contracts.DartTestGroup.Builder builderForValue) { + public Builder addEntries( + pl.leancode.patrol.contracts.Contracts.DartGroupEntry.Builder builderForValue) { copyOnWrite(); - instance.addGroups(builderForValue.build()); + instance.addEntries(builderForValue.build()); return this; } /** - * repeated .patrol.DartTestGroup groups = 3; + * repeated .patrol.DartGroupEntry entries = 4; */ - public Builder addGroups( - int index, pl.leancode.patrol.contracts.Contracts.DartTestGroup.Builder builderForValue) { + public Builder addEntries( + int index, pl.leancode.patrol.contracts.Contracts.DartGroupEntry.Builder builderForValue) { copyOnWrite(); - instance.addGroups(index, + instance.addEntries(index, builderForValue.build()); return this; } /** - * repeated .patrol.DartTestGroup groups = 3; + * repeated .patrol.DartGroupEntry entries = 4; */ - public Builder addAllGroups( - java.lang.Iterable values) { + public Builder addAllEntries( + java.lang.Iterable values) { copyOnWrite(); - instance.addAllGroups(values); + instance.addAllEntries(values); return this; } /** - * repeated .patrol.DartTestGroup groups = 3; + * repeated .patrol.DartGroupEntry entries = 4; */ - public Builder clearGroups() { + public Builder clearEntries() { copyOnWrite(); - instance.clearGroups(); + instance.clearEntries(); return this; } /** - * repeated .patrol.DartTestGroup groups = 3; + * repeated .patrol.DartGroupEntry entries = 4; */ - public Builder removeGroups(int index) { + public Builder removeEntries(int index) { copyOnWrite(); - instance.removeGroups(index); + instance.removeEntries(index); return this; } - // @@protoc_insertion_point(builder_scope:patrol.DartTestGroup) + // @@protoc_insertion_point(builder_scope:patrol.DartGroupEntry) } @java.lang.Override @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) @@ -948,7 +927,7 @@ protected final java.lang.Object dynamicMethod( java.lang.Object arg0, java.lang.Object arg1) { switch (method) { case NEW_MUTABLE_INSTANCE: { - return new pl.leancode.patrol.contracts.Contracts.DartTestGroup(); + return new pl.leancode.patrol.contracts.Contracts.DartGroupEntry(); } case NEW_BUILDER: { return new Builder(); @@ -956,14 +935,13 @@ protected final java.lang.Object dynamicMethod( case BUILD_MESSAGE_INFO: { java.lang.Object[] objects = new java.lang.Object[] { "name_", - "tests_", - pl.leancode.patrol.contracts.Contracts.DartTestCase.class, - "groups_", - pl.leancode.patrol.contracts.Contracts.DartTestGroup.class, + "type_", + "entries_", + pl.leancode.patrol.contracts.Contracts.DartGroupEntry.class, }; java.lang.String info = - "\u0000\u0003\u0000\u0000\u0001\u0003\u0003\u0000\u0002\u0000\u0001\u0208\u0002\u001b" + - "\u0003\u001b"; + "\u0000\u0003\u0000\u0000\u0001\u0004\u0003\u0000\u0001\u0000\u0001\u0208\u0003\f" + + "\u0004\u001b"; return newMessageInfo(DEFAULT_INSTANCE, info, objects); } // fall through @@ -971,13 +949,13 @@ protected final java.lang.Object dynamicMethod( return DEFAULT_INSTANCE; } case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; + com.google.protobuf.Parser parser = PARSER; if (parser == null) { - synchronized (pl.leancode.patrol.contracts.Contracts.DartTestGroup.class) { + synchronized (pl.leancode.patrol.contracts.Contracts.DartGroupEntry.class) { parser = PARSER; if (parser == null) { parser = - new DefaultInstanceBasedParser( + new DefaultInstanceBasedParser( DEFAULT_INSTANCE); PARSER = parser; } @@ -996,318 +974,24 @@ protected final java.lang.Object dynamicMethod( } - // @@protoc_insertion_point(class_scope:patrol.DartTestGroup) - private static final pl.leancode.patrol.contracts.Contracts.DartTestGroup DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:patrol.DartGroupEntry) + private static final pl.leancode.patrol.contracts.Contracts.DartGroupEntry DEFAULT_INSTANCE; static { - DartTestGroup defaultInstance = new DartTestGroup(); + DartGroupEntry defaultInstance = new DartGroupEntry(); // New instances are implicitly immutable so no need to make // immutable. DEFAULT_INSTANCE = defaultInstance; com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - DartTestGroup.class, defaultInstance); + DartGroupEntry.class, defaultInstance); } - public static pl.leancode.patrol.contracts.Contracts.DartTestGroup getDefaultInstance() { + public static pl.leancode.patrol.contracts.Contracts.DartGroupEntry getDefaultInstance() { return DEFAULT_INSTANCE; } - private static volatile com.google.protobuf.Parser PARSER; + private static volatile com.google.protobuf.Parser PARSER; - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface DartTestCaseOrBuilder extends - // @@protoc_insertion_point(interface_extends:patrol.DartTestCase) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * string name = 1; - * @return The name. - */ - java.lang.String getName(); - /** - * string name = 1; - * @return The bytes for name. - */ - com.google.protobuf.ByteString - getNameBytes(); - } - /** - * Protobuf type {@code patrol.DartTestCase} - */ - public static final class DartTestCase extends - com.google.protobuf.GeneratedMessageLite< - DartTestCase, DartTestCase.Builder> implements - // @@protoc_insertion_point(message_implements:patrol.DartTestCase) - DartTestCaseOrBuilder { - private DartTestCase() { - name_ = ""; - } - public static final int NAME_FIELD_NUMBER = 1; - private java.lang.String name_; - /** - * string name = 1; - * @return The name. - */ - @java.lang.Override - public java.lang.String getName() { - return name_; - } - /** - * string name = 1; - * @return The bytes for name. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getNameBytes() { - return com.google.protobuf.ByteString.copyFromUtf8(name_); - } - /** - * string name = 1; - * @param value The name to set. - */ - private void setName( - java.lang.String value) { - java.lang.Class valueClass = value.getClass(); - - name_ = value; - } - /** - * string name = 1; - */ - private void clearName() { - - name_ = getDefaultInstance().getName(); - } - /** - * string name = 1; - * @param value The bytes for name to set. - */ - private void setNameBytes( - com.google.protobuf.ByteString value) { - checkByteStringIsUtf8(value); - name_ = value.toStringUtf8(); - - } - - public static pl.leancode.patrol.contracts.Contracts.DartTestCase parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.DartTestCase parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.DartTestCase parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.DartTestCase parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.DartTestCase parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.DartTestCase parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.DartTestCase parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.DartTestCase parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static pl.leancode.patrol.contracts.Contracts.DartTestCase parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - - public static pl.leancode.patrol.contracts.Contracts.DartTestCase parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.DartTestCase parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.DartTestCase parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.DartTestCase prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - * Protobuf type {@code patrol.DartTestCase} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - pl.leancode.patrol.contracts.Contracts.DartTestCase, Builder> implements - // @@protoc_insertion_point(builder_implements:patrol.DartTestCase) - pl.leancode.patrol.contracts.Contracts.DartTestCaseOrBuilder { - // Construct using pl.leancode.patrol.contracts.Contracts.DartTestCase.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - * string name = 1; - * @return The name. - */ - @java.lang.Override - public java.lang.String getName() { - return instance.getName(); - } - /** - * string name = 1; - * @return The bytes for name. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getNameBytes() { - return instance.getNameBytes(); - } - /** - * string name = 1; - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName( - java.lang.String value) { - copyOnWrite(); - instance.setName(value); - return this; - } - /** - * string name = 1; - * @return This builder for chaining. - */ - public Builder clearName() { - copyOnWrite(); - instance.clearName(); - return this; - } - /** - * string name = 1; - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setNameBytes(value); - return this; - } - - // @@protoc_insertion_point(builder_scope:patrol.DartTestCase) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new pl.leancode.patrol.contracts.Contracts.DartTestCase(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "name_", - }; - java.lang.String info = - "\u0000\u0001\u0000\u0000\u0001\u0001\u0001\u0000\u0000\u0000\u0001\u0208"; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (pl.leancode.patrol.contracts.Contracts.DartTestCase.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:patrol.DartTestCase) - private static final pl.leancode.patrol.contracts.Contracts.DartTestCase DEFAULT_INSTANCE; - static { - DartTestCase defaultInstance = new DartTestCase(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - DartTestCase.class, defaultInstance); - } - - public static pl.leancode.patrol.contracts.Contracts.DartTestCase getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return DEFAULT_INSTANCE.getParserForType(); } } @@ -1466,7 +1150,7 @@ public static Builder newBuilder() { return (Builder) DEFAULT_INSTANCE.createBuilder(); } public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.RunDartTestRequest prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + return DEFAULT_INSTANCE.createBuilder(prototype); } /** @@ -1925,7 +1609,7 @@ public static Builder newBuilder() { return (Builder) DEFAULT_INSTANCE.createBuilder(); } public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.RunDartTestResponse prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + return DEFAULT_INSTANCE.createBuilder(prototype); } /** @@ -2248,7 +1932,7 @@ public static Builder newBuilder() { return (Builder) DEFAULT_INSTANCE.createBuilder(); } public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.ConfigureRequest prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + return DEFAULT_INSTANCE.createBuilder(prototype); } /** @@ -2521,7 +2205,7 @@ public static Builder newBuilder() { return (Builder) DEFAULT_INSTANCE.createBuilder(); } public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.OpenAppRequest prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + return DEFAULT_INSTANCE.createBuilder(prototype); } /** @@ -2910,7 +2594,7 @@ public static Builder newBuilder() { return (Builder) DEFAULT_INSTANCE.createBuilder(); } public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + return DEFAULT_INSTANCE.createBuilder(prototype); } /** @@ -3202,7 +2886,7 @@ public static Builder newBuilder() { return (Builder) DEFAULT_INSTANCE.createBuilder(); } public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.Empty prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + return DEFAULT_INSTANCE.createBuilder(prototype); } /** @@ -3392,7 +3076,7 @@ public static Builder newBuilder() { return (Builder) DEFAULT_INSTANCE.createBuilder(); } public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + return DEFAULT_INSTANCE.createBuilder(prototype); } /** @@ -3634,7 +3318,7 @@ public static Builder newBuilder() { return (Builder) DEFAULT_INSTANCE.createBuilder(); } public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.DarkModeRequest prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + return DEFAULT_INSTANCE.createBuilder(prototype); } /** @@ -3812,6 +3496,7 @@ public static final class GetNativeViewsRequest extends private GetNativeViewsRequest() { appId_ = ""; } + private int bitField0_; public static final int SELECTOR_FIELD_NUMBER = 1; private pl.leancode.patrol.contracts.Contracts.Selector selector_; /** @@ -3819,7 +3504,7 @@ private GetNativeViewsRequest() { */ @java.lang.Override public boolean hasSelector() { - return selector_ != null; + return ((bitField0_ & 0x00000001) != 0); } /** * .patrol.Selector selector = 1; @@ -3834,7 +3519,7 @@ public pl.leancode.patrol.contracts.Contracts.Selector getSelector() { private void setSelector(pl.leancode.patrol.contracts.Contracts.Selector value) { value.getClass(); selector_ = value; - + bitField0_ |= 0x00000001; } /** * .patrol.Selector selector = 1; @@ -3849,13 +3534,13 @@ private void mergeSelector(pl.leancode.patrol.contracts.Contracts.Selector value } else { selector_ = value; } - + bitField0_ |= 0x00000001; } /** * .patrol.Selector selector = 1; */ private void clearSelector() { selector_ = null; - + bitField0_ = (bitField0_ & ~0x00000001); } public static final int APPID_FIELD_NUMBER = 2; @@ -3985,7 +3670,7 @@ public static Builder newBuilder() { return (Builder) DEFAULT_INSTANCE.createBuilder(); } public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + return DEFAULT_INSTANCE.createBuilder(prototype); } /** @@ -4114,12 +3799,13 @@ protected final java.lang.Object dynamicMethod( } case BUILD_MESSAGE_INFO: { java.lang.Object[] objects = new java.lang.Object[] { + "bitField0_", "selector_", "appId_", }; java.lang.String info = - "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001\t\u0002\u0208" + - ""; + "\u0000\u0002\u0000\u0001\u0001\u0002\u0002\u0000\u0000\u0000\u0001\u1009\u0000\u0002" + + "\u0208"; return newMessageInfo(DEFAULT_INSTANCE, info, objects); } // fall through @@ -4377,7 +4063,7 @@ public static Builder newBuilder() { return (Builder) DEFAULT_INSTANCE.createBuilder(); } public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.GetNativeViewsResponse prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + return DEFAULT_INSTANCE.createBuilder(prototype); } /** @@ -4665,7 +4351,7 @@ public static Builder newBuilder() { return (Builder) DEFAULT_INSTANCE.createBuilder(); } public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + return DEFAULT_INSTANCE.createBuilder(prototype); } /** @@ -4956,7 +4642,7 @@ public static Builder newBuilder() { return (Builder) DEFAULT_INSTANCE.createBuilder(); } public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.GetNotificationsResponse prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + return DEFAULT_INSTANCE.createBuilder(prototype); } /** @@ -5188,6 +4874,7 @@ public static final class TapRequest extends private TapRequest() { appId_ = ""; } + private int bitField0_; public static final int SELECTOR_FIELD_NUMBER = 1; private pl.leancode.patrol.contracts.Contracts.Selector selector_; /** @@ -5195,7 +4882,7 @@ private TapRequest() { */ @java.lang.Override public boolean hasSelector() { - return selector_ != null; + return ((bitField0_ & 0x00000001) != 0); } /** * .patrol.Selector selector = 1; @@ -5210,7 +4897,7 @@ public pl.leancode.patrol.contracts.Contracts.Selector getSelector() { private void setSelector(pl.leancode.patrol.contracts.Contracts.Selector value) { value.getClass(); selector_ = value; - + bitField0_ |= 0x00000001; } /** * .patrol.Selector selector = 1; @@ -5225,13 +4912,13 @@ private void mergeSelector(pl.leancode.patrol.contracts.Contracts.Selector value } else { selector_ = value; } - + bitField0_ |= 0x00000001; } /** * .patrol.Selector selector = 1; */ private void clearSelector() { selector_ = null; - + bitField0_ = (bitField0_ & ~0x00000001); } public static final int APPID_FIELD_NUMBER = 2; @@ -5361,7 +5048,7 @@ public static Builder newBuilder() { return (Builder) DEFAULT_INSTANCE.createBuilder(); } public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.TapRequest prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + return DEFAULT_INSTANCE.createBuilder(prototype); } /** @@ -5490,12 +5177,13 @@ protected final java.lang.Object dynamicMethod( } case BUILD_MESSAGE_INFO: { java.lang.Object[] objects = new java.lang.Object[] { + "bitField0_", "selector_", "appId_", }; java.lang.String info = - "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001\t\u0002\u0208" + - ""; + "\u0000\u0002\u0000\u0001\u0001\u0002\u0002\u0000\u0000\u0000\u0001\u1009\u0000\u0002" + + "\u0208"; return newMessageInfo(DEFAULT_INSTANCE, info, objects); } // fall through @@ -5631,26 +5319,10 @@ private EnterTextRequest() { public enum KeyboardBehavior implements com.google.protobuf.Internal.EnumLite { /** - *
-       * The default keyboard behavior.
-       *
-       * Keyboard will be shown when entering text starts, and will be
-       * automatically dismissed afterwards.
-       * 
- * * SHOW_AND_DISMISS = 0; */ SHOW_AND_DISMISS(0), /** - *
-       * The alternative keyboard behavior.
-       *
-       * On Android, no keyboard will be shown at all. The text will simply appear
-       * inside the TextField.
-       *
-       * On iOS, the keyboard will not be dismissed after entering text.
-       * 
- * * ALTERNATIVE = 1; */ ALTERNATIVE(1), @@ -5658,26 +5330,10 @@ public enum KeyboardBehavior ; /** - *
-       * The default keyboard behavior.
-       *
-       * Keyboard will be shown when entering text starts, and will be
-       * automatically dismissed afterwards.
-       * 
- * * SHOW_AND_DISMISS = 0; */ public static final int SHOW_AND_DISMISS_VALUE = 0; /** - *
-       * The alternative keyboard behavior.
-       *
-       * On Android, no keyboard will be shown at all. The text will simply appear
-       * inside the TextField.
-       *
-       * On iOS, the keyboard will not be dismissed after entering text.
-       * 
- * * ALTERNATIVE = 1; */ public static final int ALTERNATIVE_VALUE = 1; @@ -6093,7 +5749,7 @@ public static Builder newBuilder() { return (Builder) DEFAULT_INSTANCE.createBuilder(); } public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.EnterTextRequest prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + return DEFAULT_INSTANCE.createBuilder(prototype); } /** @@ -6744,7 +6400,7 @@ public static Builder newBuilder() { return (Builder) DEFAULT_INSTANCE.createBuilder(); } public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.SwipeRequest prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + return DEFAULT_INSTANCE.createBuilder(prototype); } /** @@ -7068,6 +6724,7 @@ public static final class WaitUntilVisibleRequest extends private WaitUntilVisibleRequest() { appId_ = ""; } + private int bitField0_; public static final int SELECTOR_FIELD_NUMBER = 1; private pl.leancode.patrol.contracts.Contracts.Selector selector_; /** @@ -7075,7 +6732,7 @@ private WaitUntilVisibleRequest() { */ @java.lang.Override public boolean hasSelector() { - return selector_ != null; + return ((bitField0_ & 0x00000001) != 0); } /** * .patrol.Selector selector = 1; @@ -7090,7 +6747,7 @@ public pl.leancode.patrol.contracts.Contracts.Selector getSelector() { private void setSelector(pl.leancode.patrol.contracts.Contracts.Selector value) { value.getClass(); selector_ = value; - + bitField0_ |= 0x00000001; } /** * .patrol.Selector selector = 1; @@ -7105,13 +6762,13 @@ private void mergeSelector(pl.leancode.patrol.contracts.Contracts.Selector value } else { selector_ = value; } - + bitField0_ |= 0x00000001; } /** * .patrol.Selector selector = 1; */ private void clearSelector() { selector_ = null; - + bitField0_ = (bitField0_ & ~0x00000001); } public static final int APPID_FIELD_NUMBER = 2; @@ -7241,7 +6898,7 @@ public static Builder newBuilder() { return (Builder) DEFAULT_INSTANCE.createBuilder(); } public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + return DEFAULT_INSTANCE.createBuilder(prototype); } /** @@ -7370,12 +7027,13 @@ protected final java.lang.Object dynamicMethod( } case BUILD_MESSAGE_INFO: { java.lang.Object[] objects = new java.lang.Object[] { + "bitField0_", "selector_", "appId_", }; java.lang.String info = - "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001\t\u0002\u0208" + - ""; + "\u0000\u0002\u0000\u0001\u0001\u0002\u0002\u0000\u0000\u0000\u0001\u1009\u0000\u0002" + + "\u0208"; return newMessageInfo(DEFAULT_INSTANCE, info, objects); } // fall through @@ -7675,7 +7333,7 @@ public static Builder newBuilder() { return (Builder) DEFAULT_INSTANCE.createBuilder(); } public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + return DEFAULT_INSTANCE.createBuilder(prototype); } /** @@ -8048,7 +7706,7 @@ public static Builder newBuilder() { return (Builder) DEFAULT_INSTANCE.createBuilder(); } public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + return DEFAULT_INSTANCE.createBuilder(prototype); } /** @@ -8311,7 +7969,7 @@ public static Builder newBuilder() { return (Builder) DEFAULT_INSTANCE.createBuilder(); } public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + return DEFAULT_INSTANCE.createBuilder(prototype); } /** @@ -8556,7 +8214,7 @@ public static Builder newBuilder() { return (Builder) DEFAULT_INSTANCE.createBuilder(); } public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleResponse prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + return DEFAULT_INSTANCE.createBuilder(prototype); } /** @@ -9562,7 +9220,7 @@ public static Builder newBuilder() { return (Builder) DEFAULT_INSTANCE.createBuilder(); } public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.Selector prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + return DEFAULT_INSTANCE.createBuilder(prototype); } /** @@ -10893,7 +10551,7 @@ public static Builder newBuilder() { return (Builder) DEFAULT_INSTANCE.createBuilder(); } public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.NativeView prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + return DEFAULT_INSTANCE.createBuilder(prototype); } /** @@ -11783,7 +11441,7 @@ public static Builder newBuilder() { return (Builder) DEFAULT_INSTANCE.createBuilder(); } public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.Notification prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + return DEFAULT_INSTANCE.createBuilder(prototype); } /** @@ -12312,7 +11970,7 @@ public static Builder newBuilder() { return (Builder) DEFAULT_INSTANCE.createBuilder(); } public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.SubmitTestResultsRequest prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); + return DEFAULT_INSTANCE.createBuilder(prototype); } /** diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/DartGroupEntryKt.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/DartGroupEntryKt.kt new file mode 100644 index 000000000..e3f6f7fab --- /dev/null +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/DartGroupEntryKt.kt @@ -0,0 +1,145 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: contracts.proto + +// Generated files should ignore deprecation warnings +@file:Suppress("DEPRECATION") +package pl.leancode.patrol.contracts; + +@kotlin.jvm.JvmName("-initializedartGroupEntry") +public inline fun dartGroupEntry(block: pl.leancode.patrol.contracts.DartGroupEntryKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.DartGroupEntry = + pl.leancode.patrol.contracts.DartGroupEntryKt.Dsl._create(pl.leancode.patrol.contracts.Contracts.DartGroupEntry.newBuilder()).apply { block() }._build() +/** + * Protobuf type `patrol.DartGroupEntry` + */ +public object DartGroupEntryKt { + @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) + @com.google.protobuf.kotlin.ProtoDslMarker + public class Dsl private constructor( + private val _builder: pl.leancode.patrol.contracts.Contracts.DartGroupEntry.Builder + ) { + public companion object { + @kotlin.jvm.JvmSynthetic + @kotlin.PublishedApi + internal fun _create(builder: pl.leancode.patrol.contracts.Contracts.DartGroupEntry.Builder): Dsl = Dsl(builder) + } + + @kotlin.jvm.JvmSynthetic + @kotlin.PublishedApi + internal fun _build(): pl.leancode.patrol.contracts.Contracts.DartGroupEntry = _builder.build() + + /** + * `string name = 1;` + */ + public var name: kotlin.String + @JvmName("getName") + get() = _builder.getName() + @JvmName("setName") + set(value) { + _builder.setName(value) + } + /** + * `string name = 1;` + */ + public fun clearName() { + _builder.clearName() + } + + /** + * `.patrol.DartGroupEntry.GroupEntryType type = 3;` + */ + public var type: pl.leancode.patrol.contracts.Contracts.DartGroupEntry.GroupEntryType + @JvmName("getType") + get() = _builder.getType() + @JvmName("setType") + set(value) { + _builder.setType(value) + } + public var typeValue: kotlin.Int + @JvmName("getTypeValue") + get() = _builder.getTypeValue() + @JvmName("setTypeValue") + set(value) { + _builder.setTypeValue(value) + } + /** + * `.patrol.DartGroupEntry.GroupEntryType type = 3;` + */ + public fun clearType() { + _builder.clearType() + } + + /** + * An uninstantiable, behaviorless type to represent the field in + * generics. + */ + @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) + public class EntriesProxy private constructor() : com.google.protobuf.kotlin.DslProxy() + /** + * `repeated .patrol.DartGroupEntry entries = 4;` + */ + public val entries: com.google.protobuf.kotlin.DslList + @kotlin.jvm.JvmSynthetic + get() = com.google.protobuf.kotlin.DslList( + _builder.getEntriesList() + ) + /** + * `repeated .patrol.DartGroupEntry entries = 4;` + * @param value The entries to add. + */ + @kotlin.jvm.JvmSynthetic + @kotlin.jvm.JvmName("addEntries") + public fun com.google.protobuf.kotlin.DslList.add(value: pl.leancode.patrol.contracts.Contracts.DartGroupEntry) { + _builder.addEntries(value) + } + /** + * `repeated .patrol.DartGroupEntry entries = 4;` + * @param value The entries to add. + */ + @kotlin.jvm.JvmSynthetic + @kotlin.jvm.JvmName("plusAssignEntries") + @Suppress("NOTHING_TO_INLINE") + public inline operator fun com.google.protobuf.kotlin.DslList.plusAssign(value: pl.leancode.patrol.contracts.Contracts.DartGroupEntry) { + add(value) + } + /** + * `repeated .patrol.DartGroupEntry entries = 4;` + * @param values The entries to add. + */ + @kotlin.jvm.JvmSynthetic + @kotlin.jvm.JvmName("addAllEntries") + public fun com.google.protobuf.kotlin.DslList.addAll(values: kotlin.collections.Iterable) { + _builder.addAllEntries(values) + } + /** + * `repeated .patrol.DartGroupEntry entries = 4;` + * @param values The entries to add. + */ + @kotlin.jvm.JvmSynthetic + @kotlin.jvm.JvmName("plusAssignAllEntries") + @Suppress("NOTHING_TO_INLINE") + public inline operator fun com.google.protobuf.kotlin.DslList.plusAssign(values: kotlin.collections.Iterable) { + addAll(values) + } + /** + * `repeated .patrol.DartGroupEntry entries = 4;` + * @param index The index to set the value at. + * @param value The entries to set. + */ + @kotlin.jvm.JvmSynthetic + @kotlin.jvm.JvmName("setEntries") + public operator fun com.google.protobuf.kotlin.DslList.set(index: kotlin.Int, value: pl.leancode.patrol.contracts.Contracts.DartGroupEntry) { + _builder.setEntries(index, value) + } + /** + * `repeated .patrol.DartGroupEntry entries = 4;` + */ + @kotlin.jvm.JvmSynthetic + @kotlin.jvm.JvmName("clearEntries") + public fun com.google.protobuf.kotlin.DslList.clear() { + _builder.clearEntries() + } + } +} +public inline fun pl.leancode.patrol.contracts.Contracts.DartGroupEntry.copy(block: pl.leancode.patrol.contracts.DartGroupEntryKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.DartGroupEntry = + pl.leancode.patrol.contracts.DartGroupEntryKt.Dsl._create(this.toBuilder()).apply { block() }._build() + diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/DartTestCaseKt.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/DartTestCaseKt.kt deleted file mode 100644 index d9213b71c..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/DartTestCaseKt.kt +++ /dev/null @@ -1,50 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: contracts.proto - -// Generated files should ignore deprecation warnings -@file:Suppress("DEPRECATION") -package pl.leancode.patrol.contracts; - -@kotlin.jvm.JvmName("-initializedartTestCase") -public inline fun dartTestCase(block: pl.leancode.patrol.contracts.DartTestCaseKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.DartTestCase = - pl.leancode.patrol.contracts.DartTestCaseKt.Dsl._create(pl.leancode.patrol.contracts.Contracts.DartTestCase.newBuilder()).apply { block() }._build() -/** - * Protobuf type `patrol.DartTestCase` - */ -public object DartTestCaseKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - public class Dsl private constructor( - private val _builder: pl.leancode.patrol.contracts.Contracts.DartTestCase.Builder - ) { - public companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: pl.leancode.patrol.contracts.Contracts.DartTestCase.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): pl.leancode.patrol.contracts.Contracts.DartTestCase = _builder.build() - - /** - * `string name = 1;` - */ - public var name: kotlin.String - @JvmName("getName") - get() = _builder.getName() - @JvmName("setName") - set(value) { - _builder.setName(value) - } - /** - * `string name = 1;` - */ - public fun clearName() { - _builder.clearName() - } - } -} -public inline fun pl.leancode.patrol.contracts.Contracts.DartTestCase.copy(block: pl.leancode.patrol.contracts.DartTestCaseKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.DartTestCase = - pl.leancode.patrol.contracts.DartTestCaseKt.Dsl._create(this.toBuilder()).apply { block() }._build() - diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/DartTestGroupKt.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/DartTestGroupKt.kt deleted file mode 100644 index 2bf1e489c..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/DartTestGroupKt.kt +++ /dev/null @@ -1,192 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: contracts.proto - -// Generated files should ignore deprecation warnings -@file:Suppress("DEPRECATION") -package pl.leancode.patrol.contracts; - -@kotlin.jvm.JvmName("-initializedartTestGroup") -public inline fun dartTestGroup(block: pl.leancode.patrol.contracts.DartTestGroupKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.DartTestGroup = - pl.leancode.patrol.contracts.DartTestGroupKt.Dsl._create(pl.leancode.patrol.contracts.Contracts.DartTestGroup.newBuilder()).apply { block() }._build() -/** - * Protobuf type `patrol.DartTestGroup` - */ -public object DartTestGroupKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - public class Dsl private constructor( - private val _builder: pl.leancode.patrol.contracts.Contracts.DartTestGroup.Builder - ) { - public companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: pl.leancode.patrol.contracts.Contracts.DartTestGroup.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): pl.leancode.patrol.contracts.Contracts.DartTestGroup = _builder.build() - - /** - * `string name = 1;` - */ - public var name: kotlin.String - @JvmName("getName") - get() = _builder.getName() - @JvmName("setName") - set(value) { - _builder.setName(value) - } - /** - * `string name = 1;` - */ - public fun clearName() { - _builder.clearName() - } - - /** - * An uninstantiable, behaviorless type to represent the field in - * generics. - */ - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - public class TestsProxy private constructor() : com.google.protobuf.kotlin.DslProxy() - /** - * `repeated .patrol.DartTestCase tests = 2;` - */ - public val tests: com.google.protobuf.kotlin.DslList - @kotlin.jvm.JvmSynthetic - get() = com.google.protobuf.kotlin.DslList( - _builder.getTestsList() - ) - /** - * `repeated .patrol.DartTestCase tests = 2;` - * @param value The tests to add. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("addTests") - public fun com.google.protobuf.kotlin.DslList.add(value: pl.leancode.patrol.contracts.Contracts.DartTestCase) { - _builder.addTests(value) - } - /** - * `repeated .patrol.DartTestCase tests = 2;` - * @param value The tests to add. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("plusAssignTests") - @Suppress("NOTHING_TO_INLINE") - public inline operator fun com.google.protobuf.kotlin.DslList.plusAssign(value: pl.leancode.patrol.contracts.Contracts.DartTestCase) { - add(value) - } - /** - * `repeated .patrol.DartTestCase tests = 2;` - * @param values The tests to add. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("addAllTests") - public fun com.google.protobuf.kotlin.DslList.addAll(values: kotlin.collections.Iterable) { - _builder.addAllTests(values) - } - /** - * `repeated .patrol.DartTestCase tests = 2;` - * @param values The tests to add. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("plusAssignAllTests") - @Suppress("NOTHING_TO_INLINE") - public inline operator fun com.google.protobuf.kotlin.DslList.plusAssign(values: kotlin.collections.Iterable) { - addAll(values) - } - /** - * `repeated .patrol.DartTestCase tests = 2;` - * @param index The index to set the value at. - * @param value The tests to set. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("setTests") - public operator fun com.google.protobuf.kotlin.DslList.set(index: kotlin.Int, value: pl.leancode.patrol.contracts.Contracts.DartTestCase) { - _builder.setTests(index, value) - } - /** - * `repeated .patrol.DartTestCase tests = 2;` - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("clearTests") - public fun com.google.protobuf.kotlin.DslList.clear() { - _builder.clearTests() - } - - /** - * An uninstantiable, behaviorless type to represent the field in - * generics. - */ - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - public class GroupsProxy private constructor() : com.google.protobuf.kotlin.DslProxy() - /** - * `repeated .patrol.DartTestGroup groups = 3;` - */ - public val groups: com.google.protobuf.kotlin.DslList - @kotlin.jvm.JvmSynthetic - get() = com.google.protobuf.kotlin.DslList( - _builder.getGroupsList() - ) - /** - * `repeated .patrol.DartTestGroup groups = 3;` - * @param value The groups to add. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("addGroups") - public fun com.google.protobuf.kotlin.DslList.add(value: pl.leancode.patrol.contracts.Contracts.DartTestGroup) { - _builder.addGroups(value) - } - /** - * `repeated .patrol.DartTestGroup groups = 3;` - * @param value The groups to add. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("plusAssignGroups") - @Suppress("NOTHING_TO_INLINE") - public inline operator fun com.google.protobuf.kotlin.DslList.plusAssign(value: pl.leancode.patrol.contracts.Contracts.DartTestGroup) { - add(value) - } - /** - * `repeated .patrol.DartTestGroup groups = 3;` - * @param values The groups to add. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("addAllGroups") - public fun com.google.protobuf.kotlin.DslList.addAll(values: kotlin.collections.Iterable) { - _builder.addAllGroups(values) - } - /** - * `repeated .patrol.DartTestGroup groups = 3;` - * @param values The groups to add. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("plusAssignAllGroups") - @Suppress("NOTHING_TO_INLINE") - public inline operator fun com.google.protobuf.kotlin.DslList.plusAssign(values: kotlin.collections.Iterable) { - addAll(values) - } - /** - * `repeated .patrol.DartTestGroup groups = 3;` - * @param index The index to set the value at. - * @param value The groups to set. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("setGroups") - public operator fun com.google.protobuf.kotlin.DslList.set(index: kotlin.Int, value: pl.leancode.patrol.contracts.Contracts.DartTestGroup) { - _builder.setGroups(index, value) - } - /** - * `repeated .patrol.DartTestGroup groups = 3;` - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("clearGroups") - public fun com.google.protobuf.kotlin.DslList.clear() { - _builder.clearGroups() - } - } -} -public inline fun pl.leancode.patrol.contracts.Contracts.DartTestGroup.copy(block: pl.leancode.patrol.contracts.DartTestGroupKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.DartTestGroup = - pl.leancode.patrol.contracts.DartTestGroupKt.Dsl._create(this.toBuilder()).apply { block() }._build() - diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/ListDartTestsResponseKt.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/ListDartTestsResponseKt.kt index b40a14ecc..cc52ba79d 100644 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/ListDartTestsResponseKt.kt +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/ListDartTestsResponseKt.kt @@ -28,9 +28,9 @@ public object ListDartTestsResponseKt { internal fun _build(): pl.leancode.patrol.contracts.Contracts.ListDartTestsResponse = _builder.build() /** - * `.patrol.DartTestGroup group = 1;` + * `.patrol.DartGroupEntry group = 1;` */ - public var group: pl.leancode.patrol.contracts.Contracts.DartTestGroup + public var group: pl.leancode.patrol.contracts.Contracts.DartGroupEntry @JvmName("getGroup") get() = _builder.getGroup() @JvmName("setGroup") @@ -38,13 +38,13 @@ public object ListDartTestsResponseKt { _builder.setGroup(value) } /** - * `.patrol.DartTestGroup group = 1;` + * `.patrol.DartGroupEntry group = 1;` */ public fun clearGroup() { _builder.clearGroup() } /** - * `.patrol.DartTestGroup group = 1;` + * `.patrol.DartGroupEntry group = 1;` * @return Whether the group field is set. */ public fun hasGroup(): kotlin.Boolean { @@ -55,6 +55,6 @@ public object ListDartTestsResponseKt { public inline fun pl.leancode.patrol.contracts.Contracts.ListDartTestsResponse.copy(block: pl.leancode.patrol.contracts.ListDartTestsResponseKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.ListDartTestsResponse = pl.leancode.patrol.contracts.ListDartTestsResponseKt.Dsl._create(this.toBuilder()).apply { block() }._build() -public val pl.leancode.patrol.contracts.Contracts.ListDartTestsResponseOrBuilder.groupOrNull: pl.leancode.patrol.contracts.Contracts.DartTestGroup? +public val pl.leancode.patrol.contracts.Contracts.ListDartTestsResponseOrBuilder.groupOrNull: pl.leancode.patrol.contracts.Contracts.DartGroupEntry? get() = if (hasGroup()) getGroup() else null diff --git a/packages/patrol/android/src/test/kotlin/pl/leancode/patrol/ContractsExtensionsTest.kt b/packages/patrol/android/src/test/kotlin/pl/leancode/patrol/ContractsExtensionsTest.kt index c8c553380..bd7c491f6 100644 --- a/packages/patrol/android/src/test/kotlin/pl/leancode/patrol/ContractsExtensionsTest.kt +++ b/packages/patrol/android/src/test/kotlin/pl/leancode/patrol/ContractsExtensionsTest.kt @@ -1,37 +1,118 @@ package pl.leancode.patrol import org.junit.Test -import pl.leancode.patrol.contracts.dartTestGroup +import pl.leancode.patrol.contracts.Contracts.DartGroupEntry +import pl.leancode.patrol.contracts.DartGroupEntryKt +import pl.leancode.patrol.contracts.copy +import pl.leancode.patrol.contracts.dartGroupEntry import kotlin.test.assertContentEquals -// TODO: Make sure these tests are run on CI +fun dartTestGroup(block: DartGroupEntryKt.Dsl.() -> Unit): DartGroupEntry { + return dartGroupEntry(block).copy { type = DartGroupEntry.GroupEntryType.GROUP } +} + +fun dartTestCase(block: DartGroupEntryKt.Dsl.() -> Unit): DartGroupEntry { + return dartGroupEntry(block).copy { type = DartGroupEntry.GroupEntryType.TEST } +} class DartTestGroupExtensionsTest { + @Test - fun `listDartFilesFlat() litmus test`() { + fun `listTestsFlat() handles simple hierarchy`() { // given val dartTestGroup = dartTestGroup { - name = "root" - groups += listOf( + name = "" + entries += listOf( dartTestGroup { name = "example_test" + entries += listOf(dartTestCase { name = "increments counter, exits the app, and comes back" }) }, dartTestGroup { - name = "example.example_test" + name = "open_app_test" + entries += listOf(dartTestCase { name = "open maps" }) }, + dartTestGroup { + name = "webview_test" + entries += listOf(dartTestCase { name = "interacts with the LeanCode website in a webview" }) + } ) } // when - val dartTestFiles = dartTestGroup.listFlatDartFiles() + val dartTests = dartTestGroup.listTestsFlat() + + // then + assertContentEquals( + listOf( + dartTestCase { name = "example_test increments counter, exits the app, and comes back" }, + dartTestCase { name = "open_app_test open maps" }, + dartTestCase { name = "webview_test interacts with the LeanCode website in a webview" }, + ), + dartTests, + ) + } + + @Test + fun `listTestsFlat() handles nested hierarchy`() { + // given + val exampleTest = dartTestGroup { + name = "example_test" + entries += listOf( + dartTestCase { name = "the first test" }, + dartTestGroup { + name = "top level group in file" + entries += listOf( + dartTestGroup { + name = "alpha" + entries += listOf( + dartTestCase { name = "first" }, + dartTestCase { name = "second" }, + ) + }, + dartTestCase { name = "test between groups" }, + dartTestGroup { + name = "bravo" + entries += listOf( + dartTestCase { name = "first" }, + dartTestCase { name = "second" }, + ) + }, + ) + } + ) + } + + val openAppTest = dartTestGroup { + name = "open_app_test" + entries += listOf( + dartTestCase { name = "open maps" }, + dartTestCase { name = "open browser" }, + ) + } + + val rootDartTestGroup = dartTestGroup { + name = "" + entries += listOf(exampleTest, openAppTest) + } + + // when + val dartTests = rootDartTestGroup.listTestsFlat() // then assertContentEquals( - dartTestFiles, listOf( - "example_test", - "example.example_test", + // example_test + dartTestCase { name = "example_test the first test" }, + dartTestCase { name = "example_test top level group in file alpha first" }, + dartTestCase { name = "example_test top level group in file alpha second" }, + dartTestCase { name = "example_test top level group in file test between groups" }, + dartTestCase { name = "example_test top level group in file bravo first" }, + dartTestCase { name = "example_test top level group in file bravo second" }, + // open_app_test + dartTestCase { name = "open_app_test open maps" }, + dartTestCase { name = "open_app_test open browser" }, ), + dartTests, ) } } diff --git a/packages/patrol/example/integration_test/internal/README b/packages/patrol/example/integration_test/internal/README new file mode 100644 index 000000000..b708d68e8 --- /dev/null +++ b/packages/patrol/example/integration_test/internal/README @@ -0,0 +1,2 @@ +Tests in this directory are used for developing & testing Patrol itself, not for +demonstrating the API. diff --git a/packages/patrol/example/integration_test/internal/group_test.dart b/packages/patrol/example/integration_test/internal/group_test.dart new file mode 100644 index 000000000..4acbc78ca --- /dev/null +++ b/packages/patrol/example/integration_test/internal/group_test.dart @@ -0,0 +1,45 @@ +import 'package:patrol/src/extensions.dart'; +// ignore: depend_on_referenced_packages +import 'package:test_api/src/backend/invoker.dart'; + +import '../common.dart'; + +void main() { + patrol('at the beginning', ($) async { + await _testBody($); + }); + + group('top level group in file', () { + group('alpha', () { + patrol('first', ($) async { + await _testBody($); + }); + patrol('second', ($) async { + await _testBody($); + }); + }); + + patrol('in the middle', ($) async { + await _testBody($); + }); + + group('bravo', () { + patrol('first', ($) async { + await _testBody($); + }); + patrol('second', ($) async { + await _testBody($); + }); + }); + }); +} + +Future _testBody(PatrolTester $) async { + await createApp($); + + final testName = Invoker.current!.fullCurrentTestName(); + await $(#textField).enterText(testName); + + await $.native.pressHome(); + await $.native.openApp(); +} diff --git a/packages/patrol/example/integration_test/open_app_test.dart b/packages/patrol/example/integration_test/open_app_test.dart index be33a8011..c52a7a13c 100644 --- a/packages/patrol/example/integration_test/open_app_test.dart +++ b/packages/patrol/example/integration_test/open_app_test.dart @@ -5,14 +5,16 @@ import 'package:flutter/material.dart'; import 'common.dart'; void main() { - late String mapsId; - if (Platform.isIOS) { - mapsId = 'com.apple.Maps'; - } else if (Platform.isAndroid) { - mapsId = 'com.google.android.apps.maps'; - } - - patrol('counter state is the same after switching apps', ($) async { + patrol('open maps', ($) async { + final String mapsId; + if (Platform.isIOS) { + mapsId = 'com.apple.Maps'; + } else if (Platform.isAndroid) { + mapsId = 'com.google.android.apps.maps'; + } else { + throw UnsupportedError('Unsupported platform'); + } + await createApp($); expect($(#counterText).text, '0'); @@ -26,4 +28,28 @@ void main() { expect($(#counterText).text, '1'); }); + + patrol('open browser', ($) async { + final String browserId; + if (Platform.isIOS) { + browserId = 'com.apple.mobilesafari'; + } else if (Platform.isAndroid) { + browserId = 'com.android.chrome'; + } else { + throw UnsupportedError('Unsupported platform'); + } + + await createApp($); + + expect($(#counterText).text, '0'); + + await $(FloatingActionButton).tap(); + + await $.native.pressHome(); + await $.native.openApp(appId: browserId); + await $.native.pressHome(); + await $.native.openApp(); + + expect($(#counterText).text, '1'); + }); } diff --git a/packages/patrol/example/integration_test/notifications_test.dart b/packages/patrol/example/integration_test/permissions/notifications_test.dart similarity index 96% rename from packages/patrol/example/integration_test/notifications_test.dart rename to packages/patrol/example/integration_test/permissions/notifications_test.dart index c51ad1099..27758ce71 100644 --- a/packages/patrol/example/integration_test/notifications_test.dart +++ b/packages/patrol/example/integration_test/permissions/notifications_test.dart @@ -1,4 +1,4 @@ -import 'common.dart'; +import '../common.dart'; void main() { patrol( diff --git a/packages/patrol/example/integration_test/permissions_location_test.dart b/packages/patrol/example/integration_test/permissions/permissions_location_test.dart similarity index 98% rename from packages/patrol/example/integration_test/permissions_location_test.dart rename to packages/patrol/example/integration_test/permissions/permissions_location_test.dart index 172df4cb7..cc312b023 100644 --- a/packages/patrol/example/integration_test/permissions_location_test.dart +++ b/packages/patrol/example/integration_test/permissions/permissions_location_test.dart @@ -3,7 +3,7 @@ import 'dart:io' as io; import 'package:permission_handler/permission_handler.dart'; -import 'common.dart'; +import '../common.dart'; const _timeout = Duration(seconds: 5); // to avoid timeouts on CI diff --git a/packages/patrol/example/integration_test/permissions_many_test.dart b/packages/patrol/example/integration_test/permissions/permissions_many_test.dart similarity index 98% rename from packages/patrol/example/integration_test/permissions_many_test.dart rename to packages/patrol/example/integration_test/permissions/permissions_many_test.dart index f1e5941b2..e9d1c97b5 100644 --- a/packages/patrol/example/integration_test/permissions_many_test.dart +++ b/packages/patrol/example/integration_test/permissions/permissions_many_test.dart @@ -1,6 +1,6 @@ import 'package:permission_handler/permission_handler.dart'; -import 'common.dart'; +import '../common.dart'; const _timeout = Duration(seconds: 5); // to avoid timeouts on CI diff --git a/packages/patrol/example/integration_test/swipe_test.dart b/packages/patrol/example/integration_test/swipe_test.dart index ef959d108..370223659 100644 --- a/packages/patrol/example/integration_test/swipe_test.dart +++ b/packages/patrol/example/integration_test/swipe_test.dart @@ -3,11 +3,13 @@ import 'dart:io' show Platform; import 'common.dart'; void main() { - late String appId; + final String appId; if (Platform.isIOS) { appId = 'com.apple.Preferences'; } else if (Platform.isAndroid) { appId = 'com.android.settings'; + } else { + throw UnsupportedError('Unsupported platform'); } patrol('scrolls the Settings app', ($) async { diff --git a/packages/patrol/example/ios/Runner.xcodeproj/project.pbxproj b/packages/patrol/example/ios/Runner.xcodeproj/project.pbxproj index 13a049c99..db11d1e62 100644 --- a/packages/patrol/example/ios/Runner.xcodeproj/project.pbxproj +++ b/packages/patrol/example/ios/Runner.xcodeproj/project.pbxproj @@ -265,7 +265,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 1430; - LastUpgradeCheck = 1300; + LastUpgradeCheck = 1430; ORGANIZATIONNAME = ""; TargetAttributes = { 97C146ED1CF9000F007C117D = { diff --git a/packages/patrol/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/packages/patrol/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 327fff847..05552f28c 100644 --- a/packages/patrol/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/packages/patrol/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ =4.2) + +extension Patrol_DartGroupEntry.GroupEntryType: CaseIterable { + // The compiler won't synthesize support with the UNRECOGNIZED case. + public static let allCases: [Patrol_DartGroupEntry.GroupEntryType] = [ + .group, + .test, + ] +} + +#endif // swift(>=4.2) + public struct Patrol_RunDartTestRequest { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -139,7 +167,7 @@ public struct Patrol_RunDartTestResponse { extension Patrol_RunDartTestResponse.Result: CaseIterable { // The compiler won't synthesize support with the UNRECOGNIZED case. - public static var allCases: [Patrol_RunDartTestResponse.Result] = [ + public static let allCases: [Patrol_RunDartTestResponse.Result] = [ .success, .skipped, .failure, @@ -398,19 +426,7 @@ public struct Patrol_EnterTextRequest { public enum KeyboardBehavior: SwiftProtobuf.Enum { public typealias RawValue = Int - - /// The default keyboard behavior. - /// - /// Keyboard will be shown when entering text starts, and will be - /// automatically dismissed afterwards. case showAndDismiss // = 0 - - /// The alternative keyboard behavior. - /// - /// On Android, no keyboard will be shown at all. The text will simply appear - /// inside the TextField. - /// - /// On iOS, the keyboard will not be dismissed after entering text. case alternative // = 1 case UNRECOGNIZED(Int) @@ -443,7 +459,7 @@ public struct Patrol_EnterTextRequest { extension Patrol_EnterTextRequest.KeyboardBehavior: CaseIterable { // The compiler won't synthesize support with the UNRECOGNIZED case. - public static var allCases: [Patrol_EnterTextRequest.KeyboardBehavior] = [ + public static let allCases: [Patrol_EnterTextRequest.KeyboardBehavior] = [ .showAndDismiss, .alternative, ] @@ -543,7 +559,7 @@ public struct Patrol_HandlePermissionRequest { extension Patrol_HandlePermissionRequest.Code: CaseIterable { // The compiler won't synthesize support with the UNRECOGNIZED case. - public static var allCases: [Patrol_HandlePermissionRequest.Code] = [ + public static let allCases: [Patrol_HandlePermissionRequest.Code] = [ .whileUsing, .onlyThisTime, .denied, @@ -596,7 +612,7 @@ public struct Patrol_SetLocationAccuracyRequest { extension Patrol_SetLocationAccuracyRequest.LocationAccuracy: CaseIterable { // The compiler won't synthesize support with the UNRECOGNIZED case. - public static var allCases: [Patrol_SetLocationAccuracyRequest.LocationAccuracy] = [ + public static let allCases: [Patrol_SetLocationAccuracyRequest.LocationAccuracy] = [ .coarse, .fine, ] @@ -832,8 +848,8 @@ public struct Patrol_SubmitTestResultsRequest { #if swift(>=5.5) && canImport(_Concurrency) extension Patrol_ListDartTestsResponse: @unchecked Sendable {} -extension Patrol_DartTestGroup: @unchecked Sendable {} -extension Patrol_DartTestCase: @unchecked Sendable {} +extension Patrol_DartGroupEntry: @unchecked Sendable {} +extension Patrol_DartGroupEntry.GroupEntryType: @unchecked Sendable {} extension Patrol_RunDartTestRequest: @unchecked Sendable {} extension Patrol_RunDartTestResponse: @unchecked Sendable {} extension Patrol_RunDartTestResponse.Result: @unchecked Sendable {} @@ -906,12 +922,12 @@ extension Patrol_ListDartTestsResponse: SwiftProtobuf.Message, SwiftProtobuf._Me } } -extension Patrol_DartTestGroup: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".DartTestGroup" +extension Patrol_DartGroupEntry: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".DartGroupEntry" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "name"), - 2: .same(proto: "tests"), - 3: .same(proto: "groups"), + 3: .same(proto: "type"), + 4: .same(proto: "entries"), ] public mutating func decodeMessage(decoder: inout D) throws { @@ -921,8 +937,8 @@ extension Patrol_DartTestGroup: SwiftProtobuf.Message, SwiftProtobuf._MessageImp // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { case 1: try { try decoder.decodeSingularStringField(value: &self.name) }() - case 2: try { try decoder.decodeRepeatedMessageField(value: &self.tests) }() - case 3: try { try decoder.decodeRepeatedMessageField(value: &self.groups) }() + case 3: try { try decoder.decodeSingularEnumField(value: &self.type) }() + case 4: try { try decoder.decodeRepeatedMessageField(value: &self.entries) }() default: break } } @@ -932,54 +948,29 @@ extension Patrol_DartTestGroup: SwiftProtobuf.Message, SwiftProtobuf._MessageImp if !self.name.isEmpty { try visitor.visitSingularStringField(value: self.name, fieldNumber: 1) } - if !self.tests.isEmpty { - try visitor.visitRepeatedMessageField(value: self.tests, fieldNumber: 2) + if self.type != .group { + try visitor.visitSingularEnumField(value: self.type, fieldNumber: 3) } - if !self.groups.isEmpty { - try visitor.visitRepeatedMessageField(value: self.groups, fieldNumber: 3) + if !self.entries.isEmpty { + try visitor.visitRepeatedMessageField(value: self.entries, fieldNumber: 4) } try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: Patrol_DartTestGroup, rhs: Patrol_DartTestGroup) -> Bool { + public static func ==(lhs: Patrol_DartGroupEntry, rhs: Patrol_DartGroupEntry) -> Bool { if lhs.name != rhs.name {return false} - if lhs.tests != rhs.tests {return false} - if lhs.groups != rhs.groups {return false} + if lhs.type != rhs.type {return false} + if lhs.entries != rhs.entries {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension Patrol_DartTestCase: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".DartTestCase" +extension Patrol_DartGroupEntry.GroupEntryType: SwiftProtobuf._ProtoNameProviding { public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "name"), + 0: .same(proto: "GROUP"), + 1: .same(proto: "TEST"), ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.name) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.name.isEmpty { - try visitor.visitSingularStringField(value: self.name, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Patrol_DartTestCase, rhs: Patrol_DartTestCase) -> Bool { - if lhs.name != rhs.name {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } } extension Patrol_RunDartTestRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { diff --git a/packages/patrol/ios/Classes/PatrolAppServiceClient.swift b/packages/patrol/ios/Classes/PatrolAppServiceClient.swift index b344b7f79..d70dd9c46 100644 --- a/packages/patrol/ios/Classes/PatrolAppServiceClient.swift +++ b/packages/patrol/ios/Classes/PatrolAppServiceClient.swift @@ -41,7 +41,9 @@ import NIO let request = Patrol_Empty() let response = try await client.listDartTests(request) - return response.group.groups.map { $0.name } + return response.group.listTestsFlat(parentGroupName: "").map { + $0.name + } } @objc public func runDartTest(name: String) async throws -> RunDartTestResponse { @@ -55,3 +57,36 @@ import NIO ) } } + +extension Patrol_DartGroupEntry { + + func listTestsFlat(parentGroupName: String) -> [Patrol_DartGroupEntry] { + var tests = [Patrol_DartGroupEntry]() + + for test in self.entries { + var test = test + + if test.type == Patrol_DartGroupEntry.GroupEntryType.test { + if parentGroupName.isEmpty { + // This case is invalid, because every test will have at least + // 1 named group - its filename. + + fatalError("Invariant violated: test \(test.name) has no named parent group") + } + + test.name = "\(parentGroupName) \(test.name)" + tests.append(test) + } else if test.type == Patrol_DartGroupEntry.GroupEntryType.group { + if parentGroupName.isEmpty { + tests.append(contentsOf: test.listTestsFlat(parentGroupName: test.name)) + } else { + tests.append( + contentsOf: test.listTestsFlat(parentGroupName: "\(parentGroupName) \(test.name)") + ) + } + } + } + + return tests + } +} diff --git a/packages/patrol/ios/Classes/PatrolIntegrationTestRunner.h b/packages/patrol/ios/Classes/PatrolIntegrationTestRunner.h index b5a123da6..d376cedb8 100644 --- a/packages/patrol/ios/Classes/PatrolIntegrationTestRunner.h +++ b/packages/patrol/ios/Classes/PatrolIntegrationTestRunner.h @@ -9,102 +9,102 @@ // For every Flutter dart test, dynamically generate an Objective-C method mirroring the test results // so it is reported as a native XCTest run result. -#define PATROL_INTEGRATION_TEST_IOS_RUNNER(__test_class) \ - @interface __test_class : XCTestCase \ - @end \ - \ - @implementation __test_class \ - \ - +(NSArray *)testInvocations { \ - /* Start native automation gRPC server */ \ - PatrolServer *server = [[PatrolServer alloc] init]; \ - [server startWithCompletionHandler:^(NSError * err) { \ - NSLog(@"Server loop done, error: %@", err); \ - }]; \ - \ - /* Create a client for PatrolAppService, which lets us list and run Dart tests */ \ - __block PatrolAppServiceClient *appServiceClient = [[PatrolAppServiceClient alloc] init]; \ - \ - /* Allow the Local Network permission required by Dart Observatory */ \ - XCUIApplication *springboard = [[XCUIApplication alloc] initWithBundleIdentifier:@"com.apple.springboard"]; \ - XCUIElementQuery *systemAlerts = springboard.alerts; \ - if (systemAlerts.buttons[@"Allow"].exists) { \ - [systemAlerts.buttons[@"Allow"] tap]; \ - } \ - \ - /* Run the app for the first time to gather Dart tests */ \ - [[[XCUIApplication alloc] init] launch]; \ - \ - /* Spin the runloop waiting until the app reports that it is ready to report Dart tests */ \ - while (!server.appReady) { \ - [NSRunLoop.currentRunLoop runUntilDate:[NSDate dateWithTimeIntervalSinceNow:1.0]]; \ - } \ - \ - __block NSArray *dartTestFiles = NULL; \ - [appServiceClient \ - listDartTestsWithCompletionHandler:^(NSArray *_Nullable dartTests, NSError *_Nullable err) { \ - if (err != NULL) { \ - NSLog(@"listDartTests(): failed, err: %@", err); \ - } \ - \ - dartTestFiles = dartTests; \ - }]; \ - \ - /* Spin the runloop waiting until the app reports the Dart tests it contains */ \ - while (!dartTestFiles) { \ - [NSRunLoop.currentRunLoop runUntilDate:[NSDate dateWithTimeIntervalSinceNow:1.0]]; \ - } \ - \ - NSLog(@"Got %lu Dart tests: %@", dartTestFiles.count, dartTestFiles); \ - \ - NSMutableArray *invocations = [[NSMutableArray alloc] init]; \ - \ - /** \ - * Once Dart tests are available, we: \ - * \ - * Step 1. Dynamically add test case methods that request execution of an individual Dart test file. \ - * \ - * Step 2. Create invocations to the generated methods and return them \ - */ \ - \ - for (NSString * dartTestFile in dartTestFiles) { \ - /* Step 1 - dynamically create test cases */ \ - \ - IMP implementation = imp_implementationWithBlock(^(id _self) { \ - [[[XCUIApplication alloc] init] launch]; \ - \ - __block RunDartTestResponse *response = NULL; \ - [appServiceClient runDartTestWithName:dartTestFile \ - completionHandler:^(RunDartTestResponse *_Nullable r, NSError *_Nullable err) { \ - if (err != NULL) { \ - NSLog(@"runDartTestWithName(%@): failed, err: %@", dartTestFile, err); \ - } \ - \ - response = r; \ - }]; \ - \ - /* Wait until Dart test finishes */ \ - while (!response) { \ - [NSRunLoop.currentRunLoop runUntilDate:[NSDate dateWithTimeIntervalSinceNow:1.0]]; \ - } \ - \ - XCTAssertTrue(response.passed, @"%@", response.details); \ - }); \ - NSString *selectorName = [PatrolUtils createMethodNameFromPatrolGeneratedGroup:dartTestFile]; \ - SEL selector = NSSelectorFromString(selectorName); \ - class_addMethod(self, selector, implementation, "v@:"); \ - \ - /* Step 2 – create invocations to the dynamically created methods */ \ - NSMethodSignature *signature = [self instanceMethodSignatureForSelector:selector]; \ - NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature]; \ - invocation.selector = selector; \ - \ - NSLog(@"RunnerUITests.testInvocations(): selectorName = %@, signature: %@", selectorName, signature); \ - \ - [invocations addObject:invocation]; \ - } \ - \ - return invocations; \ - } \ - \ +#define PATROL_INTEGRATION_TEST_IOS_RUNNER(__test_class) \ + @interface __test_class : XCTestCase \ + @end \ + \ + @implementation __test_class \ + \ + +(NSArray *)testInvocations { \ + /* Start native automation gRPC server */ \ + PatrolServer *server = [[PatrolServer alloc] init]; \ + [server startWithCompletionHandler:^(NSError * err) { \ + NSLog(@"Server loop done, error: %@", err); \ + }]; \ + \ + /* Create a client for PatrolAppService, which lets us list and run Dart tests */ \ + __block PatrolAppServiceClient *appServiceClient = [[PatrolAppServiceClient alloc] init]; \ + \ + /* Allow the Local Network permission required by Dart Observatory */ \ + XCUIApplication *springboard = [[XCUIApplication alloc] initWithBundleIdentifier:@"com.apple.springboard"]; \ + XCUIElementQuery *systemAlerts = springboard.alerts; \ + if (systemAlerts.buttons[@"Allow"].exists) { \ + [systemAlerts.buttons[@"Allow"] tap]; \ + } \ + \ + /* Run the app for the first time to gather Dart tests */ \ + [[[XCUIApplication alloc] init] launch]; \ + \ + /* Spin the runloop waiting until the app reports that it is ready to report Dart tests */ \ + while (!server.appReady) { \ + [NSRunLoop.currentRunLoop runUntilDate:[NSDate dateWithTimeIntervalSinceNow:1.0]]; \ + } \ + \ + __block NSArray *dartTests = NULL; \ + [appServiceClient \ + listDartTestsWithCompletionHandler:^(NSArray *_Nullable tests, NSError *_Nullable err) { \ + if (err != NULL) { \ + NSLog(@"listDartTests(): failed, err: %@", err); \ + } \ + \ + dartTests = tests; \ + }]; \ + \ + /* Spin the runloop waiting until the app reports the Dart tests it contains */ \ + while (!dartTests) { \ + [NSRunLoop.currentRunLoop runUntilDate:[NSDate dateWithTimeIntervalSinceNow:1.0]]; \ + } \ + \ + NSLog(@"Got %lu Dart tests: %@", dartTests.count, dartTests); \ + \ + NSMutableArray *invocations = [[NSMutableArray alloc] init]; \ + \ + /** \ + * Once Dart tests are available, we: \ + * \ + * Step 1. Dynamically add test case methods that request execution of an individual Dart test file. \ + * \ + * Step 2. Create invocations to the generated methods and return them \ + */ \ + \ + for (NSString * dartTest in dartTests) { \ + /* Step 1 - dynamically create test cases */ \ + \ + IMP implementation = imp_implementationWithBlock(^(id _self) { \ + [[[XCUIApplication alloc] init] launch]; \ + \ + __block RunDartTestResponse *response = NULL; \ + [appServiceClient runDartTestWithName:dartTest \ + completionHandler:^(RunDartTestResponse *_Nullable r, NSError *_Nullable err) { \ + if (err != NULL) { \ + NSLog(@"runDartTestWithName(%@): failed, err: %@", dartTest, err); \ + } \ + \ + response = r; \ + }]; \ + \ + /* Wait until Dart test finishes */ \ + while (!response) { \ + [NSRunLoop.currentRunLoop runUntilDate:[NSDate dateWithTimeIntervalSinceNow:1.0]]; \ + } \ + \ + XCTAssertTrue(response.passed, @"%@", response.details); \ + }); \ + NSString *selectorName = [PatrolUtils createMethodNameFromPatrolGeneratedGroup:dartTest]; \ + SEL selector = NSSelectorFromString(selectorName); \ + class_addMethod(self, selector, implementation, "v@:"); \ + \ + /* Step 2 – create invocations to the dynamically created methods */ \ + NSMethodSignature *signature = [self instanceMethodSignatureForSelector:selector]; \ + NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature]; \ + invocation.selector = selector; \ + \ + NSLog(@"RunnerUITests.testInvocations(): selectorName = %@, signature: %@", selectorName, signature); \ + \ + [invocations addObject:invocation]; \ + } \ + \ + return invocations; \ + } \ + \ @end\ diff --git a/packages/patrol/ios/Classes/PatrolUtils.h b/packages/patrol/ios/Classes/PatrolUtils.h index 76c93ba18..2ae389146 100644 --- a/packages/patrol/ios/Classes/PatrolUtils.h +++ b/packages/patrol/ios/Classes/PatrolUtils.h @@ -6,6 +6,8 @@ NS_ASSUME_NONNULL_BEGIN /// Converts test group names in Dart (generated by Patrol CLI) into a valid Objective-C method name. + (NSString *)createMethodNameFromPatrolGeneratedGroup:(NSString *)dartTestGroup; ++ (NSString *)convertFirstPart:(NSString *)filePath; ++ (NSString *)convertSecondPart:(NSString *)filePath; @end NS_ASSUME_NONNULL_END diff --git a/packages/patrol/ios/Classes/PatrolUtils.m b/packages/patrol/ios/Classes/PatrolUtils.m index 5dc802099..6e778dc36 100644 --- a/packages/patrol/ios/Classes/PatrolUtils.m +++ b/packages/patrol/ios/Classes/PatrolUtils.m @@ -6,10 +6,36 @@ @implementation PatrolUtils + (NSString *)createMethodNameFromPatrolGeneratedGroup:(NSString *)dartGroupName { - NSMutableString *temp = [NSMutableString stringWithString:dartGroupName]; + // Let's assume dartGroupName is "examples.example_test completes main flow". + // It consists of two parts. + // + // The first part, "examples.example_test", reflects the location of the Dart + // test file in the filesystem at integration_test/examples/example_test. + // For the first part of this name to be a valid Objective-C identifier, we convert + // it to "examples_exampleTest" + // + // The second part, "completes main flow" is the name of the test. For it to be a + // valid Objective-C identifier, we convert it to "completesMainFlow". + // + // Then both parts are concatenated together with a "___", resulting in + // "examples_exampleTest___completesMainFlow" + NSArray *parts = [[self class] splitIntoParts:dartGroupName]; + + NSString *firstPart = [[self class] convertFirstPart:parts[0]]; + NSString *secondPart = [[self class] convertSecondPart:parts[1]]; + + NSString *result = @""; + result = [result stringByAppendingString:firstPart]; + result = [result stringByAppendingString:@"___"]; + result = [result stringByAppendingString:secondPart]; + + return result; +} + ++ (NSString *)convertFirstPart:(NSString *)filePath { // Split the string by dot - NSArray *components = [[temp componentsSeparatedByString:@"."] mutableCopy]; + NSArray *components = [[filePath componentsSeparatedByString:@"."] mutableCopy]; // Convert the filename from snake_case to camelCase NSMutableString *fileName = [components.lastObject mutableCopy]; @@ -23,14 +49,52 @@ + (NSString *)createMethodNameFromPatrolGeneratedGroup:(NSString *)dartGroupName [fileName appendString:camelCaseWord]; } - NSMutableArray *pathComponents = - [[components subarrayWithRange:NSMakeRange(0, components.count - 1)] mutableCopy]; + NSRange range = NSMakeRange(0, components.count - 1); + NSMutableArray *pathComponents = [[components subarrayWithRange:range] mutableCopy]; if (pathComponents.count > 0) { NSString *path = [pathComponents componentsJoinedByString:@"_"]; - return [NSString stringWithFormat:@"%@_%@", path, fileName]; - } else { - return fileName; + [fileName setString:[NSString stringWithFormat:@"%@_%@", path, fileName]]; + } + + return fileName; +} + ++ (NSString *)convertSecondPart:(NSString *)testName { + // Convert the filename from "space delimeted words" to camelCasedWords + // NSString.capitalizedString could be used here as well. + + NSArray *words = [testName componentsSeparatedByString:@" "]; + NSMutableString *capitalizedTestName = [words.firstObject mutableCopy]; + [capitalizedTestName setString:words[0]]; + for (NSUInteger i = 1; i < words.count; i++) { + NSString *word = words[i]; + NSString *firstLetter = [[word substringToIndex:1] capitalizedString]; + NSString *restOfWord = [word substringFromIndex:1]; + NSString *camelCaseWord = [firstLetter stringByAppendingString:restOfWord]; + [capitalizedTestName appendString:camelCaseWord]; } + + // Objective-C method names must be alphanumeric. + NSMutableCharacterSet *allowedCharacters = [NSMutableCharacterSet alphanumericCharacterSet]; // invertedSet + [allowedCharacters addCharactersInString:@"_"]; + NSCharacterSet *disallowedCharacters = allowedCharacters.invertedSet; + + // Remove disallowed characters. + NSString *filteredTestName = + [[capitalizedTestName componentsSeparatedByCharactersInSet:disallowedCharacters] componentsJoinedByString:@""]; + return filteredTestName; +} + ++ (NSArray *)splitIntoParts:(NSString *)testName { + // The first space in the original dartGroupName is a good separator for the 2 parts. + NSArray *parts = [[testName componentsSeparatedByString:@" "] mutableCopy]; + NSString *firstPart = parts[0]; + NSString *secondPart = [[parts subarrayWithRange:NSMakeRange(1, parts.count - 1)] componentsJoinedByString:@" "]; + + NSMutableArray *result = [[NSMutableArray alloc] init]; + [result addObject:firstPart]; + [result addObject:secondPart]; + return result; } @end diff --git a/packages/patrol/lib/src/binding.dart b/packages/patrol/lib/src/binding.dart index c8ec6fb30..02a61d8b7 100644 --- a/packages/patrol/lib/src/binding.dart +++ b/packages/patrol/lib/src/binding.dart @@ -8,10 +8,11 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:integration_test/common.dart'; import 'package:integration_test/integration_test.dart'; import 'package:patrol/patrol.dart'; +import 'package:patrol/src/extensions.dart'; // ignore: implementation_imports, depend_on_referenced_packages import 'package:test_api/src/backend/invoker.dart'; + // ignore: implementation_imports, depend_on_referenced_packages -import 'package:test_api/src/backend/live_test.dart'; import 'constants.dart' as constants; @@ -45,11 +46,10 @@ class PatrolBinding extends IntegrationTestWidgetsFlutterBinding { PatrolBinding() { final oldTestExceptionReporter = reportTestException; reportTestException = (details, testDescription) { - final currentDartTestFile = _currentDartTestFile; - if (currentDartTestFile != null) { + final currentDartTest = _currentDartTest; + if (currentDartTest != null) { assert(!constants.hotRestartEnabled); - _testResults[currentDartTestFile] = - Failure(testDescription, '$details'); + _testResults[currentDartTest] = Failure(testDescription, '$details'); } oldTestExceptionReporter(details, testDescription); }; @@ -60,7 +60,7 @@ class PatrolBinding extends IntegrationTestWidgetsFlutterBinding { return; } - _currentDartTestFile = Invoker.current!.liveTest.parentGroupName; + _currentDartTest = Invoker.current!.fullCurrentTestName(); }); tearDown(() async { @@ -82,18 +82,27 @@ class PatrolBinding extends IntegrationTestWidgetsFlutterBinding { final invoker = Invoker.current!; final nameOfRequestedTest = await patrolAppService.testExecutionRequested; - if (nameOfRequestedTest == _currentDartTestFile) { + + if (nameOfRequestedTest == _currentDartTest) { + logger( + 'finished test $_currentDartTest. Will report its status back to the native side', + ); + final passed = invoker.liveTest.state.result.isPassing; logger( - 'tearDown(): test "$testName" in group "$_currentDartTestFile", passed: $passed', + 'tearDown(): test "$testName" in group "$_currentDartTest", passed: $passed', ); await patrolAppService.markDartTestAsCompleted( - dartFileName: _currentDartTestFile!, + dartFileName: _currentDartTest!, passed: passed, - details: _testResults[_currentDartTestFile!] is Failure - ? (_testResults[_currentDartTestFile!] as Failure?)?.details + details: _testResults[_currentDartTest!] is Failure + ? (_testResults[_currentDartTest!] as Failure?)?.details : null, ); + } else { + logger( + 'finished test $_currentDartTest, but it was not requested, so its status will not be reported back to the native side', + ); } }); } @@ -127,7 +136,7 @@ class PatrolBinding extends IntegrationTestWidgetsFlutterBinding { static PatrolBinding get instance => BindingBase.checkInstance(_instance); static PatrolBinding? _instance; - String? _currentDartTestFile; + String? _currentDartTest; /// Keys are the test descriptions, and values are either [_success] or /// a [Failure]. @@ -164,8 +173,8 @@ class PatrolBinding extends IntegrationTestWidgetsFlutterBinding { @override void attachRootWidget(Widget rootWidget) { assert( - (_currentDartTestFile != null) != (constants.hotRestartEnabled), - '_currentDartTestFile can be null if and only if Hot Restart is enabled', + (_currentDartTest != null) != (constants.hotRestartEnabled), + '_currentDartTest can be null if and only if Hot Restart is enabled', ); const testLabelEnabled = bool.fromEnvironment('PATROL_TEST_LABEL_ENABLED'); @@ -185,7 +194,7 @@ class PatrolBinding extends IntegrationTestWidgetsFlutterBinding { left: 4, ), child: Text( - _currentDartTestFile!, + _currentDartTest!, textDirection: TextDirection.ltr, style: const TextStyle(color: Colors.red), ), @@ -197,10 +206,3 @@ class PatrolBinding extends IntegrationTestWidgetsFlutterBinding { } } } - -extension on LiveTest { - /// Get the direct parent group of the currently running test. - /// - /// The group's name is the name of the Dart test file the test is defined in. - String get parentGroupName => groups.last.name; -} diff --git a/packages/patrol/lib/src/common.dart b/packages/patrol/lib/src/common.dart index 71d101390..34907ab33 100644 --- a/packages/patrol/lib/src/common.dart +++ b/packages/patrol/lib/src/common.dart @@ -7,6 +7,7 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:integration_test/integration_test.dart'; import 'package:meta/meta.dart'; import 'package:patrol/src/binding.dart'; +import 'package:patrol/src/extensions.dart'; import 'package:patrol/src/native/contracts/contracts.pb.dart'; import 'package:patrol/src/native/contracts/contracts.pbgrpc.dart'; import 'package:patrol/src/native/native.dart'; @@ -116,9 +117,10 @@ void patrolTest( // "integration_test/examples" directory, we assume that the name of the // immediate parent group is "examples.example_test". - final parentGroupName = Invoker.current!.liveTest.groups.last.name; + final testName = Invoker.current!.fullCurrentTestName(); + final requestedToExecute = await patrolBinding.patrolAppService - .waitForExecutionRequest(parentGroupName); + .waitForExecutionRequest(testName); if (!requestedToExecute) { return; @@ -161,24 +163,83 @@ void patrolTest( ); } -/// Creates a DartTestGroup by visiting the subgroups of [topLevelGroup]. +/// Creates a DartGroupEntry by visiting the subgroups of [parentGroup]. +/// +/// The initial [parentGroup] is the implicit, unnamed top-level [Group] present +/// in every test case. @internal -DartTestGroup createDartTestGroup( - Group topLevelGroup, { - String prefix = '', +DartGroupEntry createDartTestGroup( + Group parentGroup, { + String name = '', + int level = 0, }) { - final groupName = topLevelGroup.name.replaceFirst(prefix, '').trim(); - final group = DartTestGroup(name: groupName); + final groupDTO = DartGroupEntry( + name: name, + type: DartGroupEntry_GroupEntryType.GROUP, + ); - for (final entry in topLevelGroup.entries) { - if (entry is Group) { - group.groups.add(DartTestGroup(name: entry.name)); + for (final entry in parentGroup.entries) { + // Trim names of current groups + + var name = entry.name; + if (parentGroup.name.isNotEmpty) { + name = deduplicateGroupEntryName(parentGroup.name, entry.name); } - if (entry is Test && entry.name != 'patrol_test_explorer') { - throw StateError('Expected group, got test: ${entry.name}'); + if (entry is Group) { + groupDTO.entries.add( + createDartTestGroup( + entry, + name: name, + level: level + 1, + ), + ); + } else if (entry is Test) { + if (entry.name == 'patrol_test_explorer') { + // throw StateError('Expected group, got test: ${entry.name}'); + // Ignore the bogus test that is used to discover the test structure. + continue; + } + + if (level < 1) { + throw StateError('Test is not allowed to be defined at level $level'); + } + + groupDTO.entries.add( + DartGroupEntry(name: name, type: DartGroupEntry_GroupEntryType.TEST), + ); + } else { + // This should really never happen, because Group and Test are the only + // subclasses of GroupEntry. + throw StateError('invalid state'); } } - return group; + return groupDTO; +} + +/// Allows for retrieving the name of a GroupEntry by stripping the names of all ancestor groups. +@internal +String deduplicateGroupEntryName(String parentName, String currentName) { + return currentName.substring( + parentName.length + 1, + currentName.length, + ); +} + +/// Recursively prints the structure of the test suite. +@internal +void printGroupStructure(DartGroupEntry group, {int indentation = 0}) { + final indent = ' ' * indentation; + debugPrint("$indent-- group: '${group.name}'"); + + for (final entry in group.entries) { + if (entry.type == DartGroupEntry_GroupEntryType.TEST) { + debugPrint("$indent -- test: '${entry.name}'"); + } else { + for (final subgroup in entry.entries) { + printGroupStructure(subgroup, indentation: indentation + 5); + } + } + } } diff --git a/packages/patrol/lib/src/extensions.dart b/packages/patrol/lib/src/extensions.dart new file mode 100644 index 000000000..0f241bec9 --- /dev/null +++ b/packages/patrol/lib/src/extensions.dart @@ -0,0 +1,16 @@ +import 'package:meta/meta.dart'; +// ignore: implementation_imports +import 'package:test_api/src/backend/invoker.dart'; + +/// Provides convenience methods for [Invoker]. +@internal +extension InvokerX on Invoker { + /// Returns the full name of the current test (names of all ancestor groups + + /// name of the current test). + String fullCurrentTestName() { + final parentGroupName = liveTest.groups.last.name; + final testName = liveTest.individualName; + + return '$parentGroupName $testName'; + } +} diff --git a/packages/patrol/lib/src/native/contracts/contracts.pb.dart b/packages/patrol/lib/src/native/contracts/contracts.pb.dart index 46006cdef..e027abda5 100644 --- a/packages/patrol/lib/src/native/contracts/contracts.pb.dart +++ b/packages/patrol/lib/src/native/contracts/contracts.pb.dart @@ -24,17 +24,17 @@ class ListDartTestsResponse extends $pb.GeneratedMessage { ? '' : 'patrol'), createEmptyInstance: create) - ..aOM( + ..aOM( 1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'group', - subBuilder: DartTestGroup.create) + subBuilder: DartGroupEntry.create) ..hasRequiredFields = false; ListDartTestsResponse._() : super(); factory ListDartTestsResponse({ - DartTestGroup? group, + DartGroupEntry? group, }) { final _result = create(); if (group != null) { @@ -72,9 +72,9 @@ class ListDartTestsResponse extends $pb.GeneratedMessage { static ListDartTestsResponse? _defaultInstance; @$pb.TagNumber(1) - DartTestGroup get group => $_getN(0); + DartGroupEntry get group => $_getN(0); @$pb.TagNumber(1) - set group(DartTestGroup v) { + set group(DartGroupEntry v) { setField(1, v); } @@ -83,14 +83,14 @@ class ListDartTestsResponse extends $pb.GeneratedMessage { @$pb.TagNumber(1) void clearGroup() => clearField(1); @$pb.TagNumber(1) - DartTestGroup ensureGroup() => $_ensure(0); + DartGroupEntry ensureGroup() => $_ensure(0); } -class DartTestGroup extends $pb.GeneratedMessage { +class DartGroupEntry extends $pb.GeneratedMessage { static final $pb.BuilderInfo _i = $pb.BuilderInfo( const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' - : 'DartTestGroup', + : 'DartGroupEntry', package: const $pb.PackageName( const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' @@ -101,66 +101,68 @@ class DartTestGroup extends $pb.GeneratedMessage { const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'name') - ..pc( - 2, + ..e( + 3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' - : 'tests', - $pb.PbFieldType.PM, - subBuilder: DartTestCase.create) - ..pc( - 3, + : 'type', + $pb.PbFieldType.OE, + defaultOrMaker: DartGroupEntry_GroupEntryType.GROUP, + valueOf: DartGroupEntry_GroupEntryType.valueOf, + enumValues: DartGroupEntry_GroupEntryType.values) + ..pc( + 4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' - : 'groups', + : 'entries', $pb.PbFieldType.PM, - subBuilder: DartTestGroup.create) + subBuilder: DartGroupEntry.create) ..hasRequiredFields = false; - DartTestGroup._() : super(); - factory DartTestGroup({ + DartGroupEntry._() : super(); + factory DartGroupEntry({ $core.String? name, - $core.Iterable? tests, - $core.Iterable? groups, + DartGroupEntry_GroupEntryType? type, + $core.Iterable? entries, }) { final _result = create(); if (name != null) { _result.name = name; } - if (tests != null) { - _result.tests.addAll(tests); + if (type != null) { + _result.type = type; } - if (groups != null) { - _result.groups.addAll(groups); + if (entries != null) { + _result.entries.addAll(entries); } return _result; } - factory DartTestGroup.fromBuffer($core.List<$core.int> i, + factory DartGroupEntry.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory DartTestGroup.fromJson($core.String i, + factory DartGroupEntry.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); @$core.Deprecated('Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' 'Will be removed in next major version') - DartTestGroup clone() => DartTestGroup()..mergeFromMessage(this); + DartGroupEntry clone() => DartGroupEntry()..mergeFromMessage(this); @$core.Deprecated('Using this can add significant overhead to your binary. ' 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' 'Will be removed in next major version') - DartTestGroup copyWith(void Function(DartTestGroup) updates) => - super.copyWith((message) => updates(message as DartTestGroup)) - as DartTestGroup; // ignore: deprecated_member_use + DartGroupEntry copyWith(void Function(DartGroupEntry) updates) => + super.copyWith((message) => updates(message as DartGroupEntry)) + as DartGroupEntry; // ignore: deprecated_member_use $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') - static DartTestGroup create() => DartTestGroup._(); - DartTestGroup createEmptyInstance() => create(); - static $pb.PbList createRepeated() => - $pb.PbList(); + static DartGroupEntry create() => DartGroupEntry._(); + DartGroupEntry createEmptyInstance() => create(); + static $pb.PbList createRepeated() => + $pb.PbList(); @$core.pragma('dart2js:noInline') - static DartTestGroup getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor(create); - static DartTestGroup? _defaultInstance; + static DartGroupEntry getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); + static DartGroupEntry? _defaultInstance; @$pb.TagNumber(1) $core.String get name => $_getSZ(0); @@ -174,78 +176,20 @@ class DartTestGroup extends $pb.GeneratedMessage { @$pb.TagNumber(1) void clearName() => clearField(1); - @$pb.TagNumber(2) - $core.List get tests => $_getList(1); - @$pb.TagNumber(3) - $core.List get groups => $_getList(2); -} - -class DartTestCase extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'DartTestCase', - package: const $pb.PackageName( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'patrol'), - createEmptyInstance: create) - ..aOS( - 1, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'name') - ..hasRequiredFields = false; - - DartTestCase._() : super(); - factory DartTestCase({ - $core.String? name, - }) { - final _result = create(); - if (name != null) { - _result.name = name; - } - return _result; + DartGroupEntry_GroupEntryType get type => $_getN(1); + @$pb.TagNumber(3) + set type(DartGroupEntry_GroupEntryType v) { + setField(3, v); } - factory DartTestCase.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - factory DartTestCase.fromJson($core.String i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromJson(i, r); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - DartTestCase clone() => DartTestCase()..mergeFromMessage(this); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - DartTestCase copyWith(void Function(DartTestCase) updates) => - super.copyWith((message) => updates(message as DartTestCase)) - as DartTestCase; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static DartTestCase create() => DartTestCase._(); - DartTestCase createEmptyInstance() => create(); - static $pb.PbList createRepeated() => - $pb.PbList(); - @$core.pragma('dart2js:noInline') - static DartTestCase getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor(create); - static DartTestCase? _defaultInstance; - @$pb.TagNumber(1) - $core.String get name => $_getSZ(0); - @$pb.TagNumber(1) - set name($core.String v) { - $_setString(0, v); - } + @$pb.TagNumber(3) + $core.bool hasType() => $_has(1); + @$pb.TagNumber(3) + void clearType() => clearField(3); - @$pb.TagNumber(1) - $core.bool hasName() => $_has(0); - @$pb.TagNumber(1) - void clearName() => clearField(1); + @$pb.TagNumber(4) + $core.List get entries => $_getList(2); } class RunDartTestRequest extends $pb.GeneratedMessage { diff --git a/packages/patrol/lib/src/native/contracts/contracts.pbenum.dart b/packages/patrol/lib/src/native/contracts/contracts.pbenum.dart index 463f042de..322d18dc1 100644 --- a/packages/patrol/lib/src/native/contracts/contracts.pbenum.dart +++ b/packages/patrol/lib/src/native/contracts/contracts.pbenum.dart @@ -9,6 +9,35 @@ import 'dart:core' as $core; import 'package:protobuf/protobuf.dart' as $pb; +class DartGroupEntry_GroupEntryType extends $pb.ProtobufEnum { + static const DartGroupEntry_GroupEntryType GROUP = + DartGroupEntry_GroupEntryType._( + 0, + const $core.bool.fromEnvironment('protobuf.omit_enum_names') + ? '' + : 'GROUP'); + static const DartGroupEntry_GroupEntryType TEST = + DartGroupEntry_GroupEntryType._( + 1, + const $core.bool.fromEnvironment('protobuf.omit_enum_names') + ? '' + : 'TEST'); + + static const $core.List values = + [ + GROUP, + TEST, + ]; + + static final $core.Map<$core.int, DartGroupEntry_GroupEntryType> _byValue = + $pb.ProtobufEnum.initByValue(values); + static DartGroupEntry_GroupEntryType? valueOf($core.int value) => + _byValue[value]; + + const DartGroupEntry_GroupEntryType._($core.int v, $core.String n) + : super(v, n); +} + class RunDartTestResponse_Result extends $pb.ProtobufEnum { static const RunDartTestResponse_Result SUCCESS = RunDartTestResponse_Result._( diff --git a/packages/patrol/lib/src/native/contracts/contracts.pbjson.dart b/packages/patrol/lib/src/native/contracts/contracts.pbjson.dart index f9e2e9434..cd6e12490 100644 --- a/packages/patrol/lib/src/native/contracts/contracts.pbjson.dart +++ b/packages/patrol/lib/src/native/contracts/contracts.pbjson.dart @@ -18,7 +18,7 @@ const ListDartTestsResponse$json = const { '3': 1, '4': 1, '5': 11, - '6': '.patrol.DartTestGroup', + '6': '.patrol.DartGroupEntry', '10': 'group' }, ], @@ -26,45 +26,44 @@ const ListDartTestsResponse$json = const { /// Descriptor for `ListDartTestsResponse`. Decode as a `google.protobuf.DescriptorProto`. final $typed_data.Uint8List listDartTestsResponseDescriptor = $convert.base64Decode( - 'ChVMaXN0RGFydFRlc3RzUmVzcG9uc2USKwoFZ3JvdXAYASABKAsyFS5wYXRyb2wuRGFydFRlc3RHcm91cFIFZ3JvdXA='); -@$core.Deprecated('Use dartTestGroupDescriptor instead') -const DartTestGroup$json = const { - '1': 'DartTestGroup', + 'ChVMaXN0RGFydFRlc3RzUmVzcG9uc2USLAoFZ3JvdXAYASABKAsyFi5wYXRyb2wuRGFydEdyb3VwRW50cnlSBWdyb3Vw'); +@$core.Deprecated('Use dartGroupEntryDescriptor instead') +const DartGroupEntry$json = const { + '1': 'DartGroupEntry', '2': const [ const {'1': 'name', '3': 1, '4': 1, '5': 9, '10': 'name'}, const { - '1': 'tests', - '3': 2, - '4': 3, - '5': 11, - '6': '.patrol.DartTestCase', - '10': 'tests' + '1': 'type', + '3': 3, + '4': 1, + '5': 14, + '6': '.patrol.DartGroupEntry.GroupEntryType', + '10': 'type' }, const { - '1': 'groups', - '3': 3, + '1': 'entries', + '3': 4, '4': 3, '5': 11, - '6': '.patrol.DartTestGroup', - '10': 'groups' + '6': '.patrol.DartGroupEntry', + '10': 'entries' }, ], + '4': const [DartGroupEntry_GroupEntryType$json], }; -/// Descriptor for `DartTestGroup`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List dartTestGroupDescriptor = $convert.base64Decode( - 'Cg1EYXJ0VGVzdEdyb3VwEhIKBG5hbWUYASABKAlSBG5hbWUSKgoFdGVzdHMYAiADKAsyFC5wYXRyb2wuRGFydFRlc3RDYXNlUgV0ZXN0cxItCgZncm91cHMYAyADKAsyFS5wYXRyb2wuRGFydFRlc3RHcm91cFIGZ3JvdXBz'); -@$core.Deprecated('Use dartTestCaseDescriptor instead') -const DartTestCase$json = const { - '1': 'DartTestCase', +@$core.Deprecated('Use dartGroupEntryDescriptor instead') +const DartGroupEntry_GroupEntryType$json = const { + '1': 'GroupEntryType', '2': const [ - const {'1': 'name', '3': 1, '4': 1, '5': 9, '10': 'name'}, + const {'1': 'GROUP', '2': 0}, + const {'1': 'TEST', '2': 1}, ], }; -/// Descriptor for `DartTestCase`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List dartTestCaseDescriptor = - $convert.base64Decode('CgxEYXJ0VGVzdENhc2USEgoEbmFtZRgBIAEoCVIEbmFtZQ=='); +/// Descriptor for `DartGroupEntry`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List dartGroupEntryDescriptor = $convert.base64Decode( + 'Cg5EYXJ0R3JvdXBFbnRyeRISCgRuYW1lGAEgASgJUgRuYW1lEjkKBHR5cGUYAyABKA4yJS5wYXRyb2wuRGFydEdyb3VwRW50cnkuR3JvdXBFbnRyeVR5cGVSBHR5cGUSMAoHZW50cmllcxgEIAMoCzIWLnBhdHJvbC5EYXJ0R3JvdXBFbnRyeVIHZW50cmllcyIlCg5Hcm91cEVudHJ5VHlwZRIJCgVHUk9VUBAAEggKBFRFU1QQAQ=='); @$core.Deprecated('Use runDartTestRequestDescriptor instead') const RunDartTestRequest$json = const { '1': 'RunDartTestRequest', diff --git a/packages/patrol/lib/src/native/patrol_app_service.dart b/packages/patrol/lib/src/native/patrol_app_service.dart index 2e0e7855e..db3f470c2 100644 --- a/packages/patrol/lib/src/native/patrol_app_service.dart +++ b/packages/patrol/lib/src/native/patrol_app_service.dart @@ -1,10 +1,12 @@ // ignore_for_file: avoid_print + // TODO: Use a logger instead of print import 'dart:async'; import 'dart:io' as io; import 'package:grpc/grpc.dart'; +import 'package:patrol/src/common.dart'; import 'package:patrol/src/native/contracts/contracts.pbgrpc.dart'; const _port = 8082; @@ -37,7 +39,7 @@ class PatrolAppService extends PatrolAppServiceBase { /// The ambient test group that wraps all the other groups and tests in the /// bundled Dart test file. - final DartTestGroup topLevelDartTestGroup; + final DartGroupEntry topLevelDartTestGroup; /// A completer that completes with the name of the Dart test file that was /// requested to execute by the native side. @@ -84,30 +86,32 @@ class PatrolAppService extends PatrolAppServiceBase { ); } - /// Returns when the native side requests execution of a Dart test file. + /// Returns when the native side requests execution of a Dart test. If the + /// native side requsted execution of [dartTest], returns true. Otherwise + /// returns false. /// - /// The native side requests execution by RPC-ing [runDartTest] and providing - /// name of a Dart test file. + /// It's used inside of [patrolTest] to halt execution of test body until + /// [runDartTest] is called. /// - /// Returns true if the native side requsted execution of [dartTestFile]. - /// Returns false otherwise. - Future waitForExecutionRequest(String dartTestFile) async { - print('PatrolAppService: registered "$dartTestFile"'); + /// The native side requests execution by RPC-ing [runDartTest] and providing + /// name of a Dart test that it wants to currently execute [dartTest]. + Future waitForExecutionRequest(String dartTest) async { + print('PatrolAppService: registered "$dartTest"'); - final requestedDartTestFile = await testExecutionRequested; - if (requestedDartTestFile != dartTestFile) { - // If the requested Dart test file is not the one we're waiting for now, - // it means that dartTestFile was already executed. Return false so that - // callers can skip the already executed test. + final requestedDartTest = await testExecutionRequested; + if (requestedDartTest != dartTest) { + // If the requested Dart test is not the one we're waiting for now, it + // means that dartTest was already executed. Return false so that callers + // can skip the already executed test. print( - 'PatrolAppService: registered test "$dartTestFile" was not matched by requested test "$requestedDartTestFile"', + 'PatrolAppService: registered test "$dartTest" was not matched by requested test "$requestedDartTest"', ); return false; } - print('PatrolAppService: requested execution of test "$dartTestFile"'); + print('PatrolAppService: requested execution of test "$dartTest"'); return true; } diff --git a/packages/patrol/test/internals_test.dart b/packages/patrol/test/internals_test.dart index 271eb2108..c4d252066 100644 --- a/packages/patrol/test/internals_test.dart +++ b/packages/patrol/test/internals_test.dart @@ -1,25 +1,28 @@ // ignore_for_file: invalid_use_of_internal_member, depend_on_referenced_packages, implementation_imports import 'package:flutter_test/flutter_test.dart'; -import 'package:patrol/src/common.dart' show createDartTestGroup; +import 'package:patrol/src/common.dart' + show createDartTestGroup, deduplicateGroupEntryName; import 'package:patrol/src/native/contracts/contracts.pbgrpc.dart'; import 'package:test_api/src/backend/group.dart'; import 'package:test_api/src/backend/invoker.dart'; import 'package:test_api/src/backend/metadata.dart'; +typedef GroupEntryType = DartGroupEntry_GroupEntryType; + void main() { group('createDartTestGroup()', () { - test('fails if a test is defined', () { + test('fails if a test is defined at top-level', () { // given final topLevelGroup = Group.root([ LocalTest('patrol_test_explorer', Metadata.empty, () {}), LocalTest('some_test', Metadata.empty, () => null), Group('example_test', [ LocalTest('example_test some example test', Metadata.empty, () {}), - ]) + ]), ]); // when - DartTestGroup callback() => createDartTestGroup(topLevelGroup); + DartGroupEntry callback() => createDartTestGroup(topLevelGroup); // then expect( @@ -27,30 +30,28 @@ void main() { throwsA(isA()), ); }); - test('takes only groups into account', () { + + test('smoke test 1', () { // given final topLevelGroup = Group.root([ LocalTest('patrol_test_explorer', Metadata.empty, () {}), Group( - 'permissions.permissions_location_test', + 'example_test', [ - LocalTest( - 'permissions.permissions_location_test accepts location permission', - Metadata.empty, - () {}, - ) + Group('example_test alpha', [ + _localTest('example_test alpha first'), + _localTest('example_test alpha second'), + ]), + Group('example_test bravo', [ + _localTest('example_test bravo first'), + _localTest('example_test bravo second'), + ]), ], ), - Group('permissions.permissions_many_test', [ - LocalTest( - 'permissions.permissions_many_test grants various permissions', - Metadata.empty, - () {}, - ), + Group('open_app_test', [ + _localTest('open_app_test open maps'), + _localTest('open_app_test open browser'), ]), - Group('example_test', [ - LocalTest('example_test some example test', Metadata.empty, () {}), - ]) ]); // when @@ -59,15 +60,131 @@ void main() { // then expect( dartTestGroup, - DartTestGroup( - name: '', - groups: [ - DartTestGroup(name: 'permissions.permissions_location_test'), - DartTestGroup(name: 'permissions.permissions_many_test'), - DartTestGroup(name: 'example_test'), + equals( + DartGroupEntry( + name: '', + type: GroupEntryType.GROUP, + entries: [ + DartGroupEntry( + name: 'example_test', + type: GroupEntryType.GROUP, + entries: [ + DartGroupEntry( + name: 'alpha', + type: GroupEntryType.GROUP, + entries: [ + DartGroupEntry(name: 'first', type: GroupEntryType.TEST), + DartGroupEntry(name: 'second', type: GroupEntryType.TEST), + ], + ), + DartGroupEntry( + name: 'bravo', + type: GroupEntryType.GROUP, + entries: [ + DartGroupEntry(name: 'first', type: GroupEntryType.TEST), + DartGroupEntry(name: 'second', type: GroupEntryType.TEST), + ], + ), + ], + ), + DartGroupEntry( + name: 'open_app_test', + type: GroupEntryType.GROUP, + entries: [ + DartGroupEntry(name: 'open maps', type: GroupEntryType.TEST), + DartGroupEntry( + name: 'open browser', + type: GroupEntryType.TEST, + ), + ], + ), + ], + ), + ), + ); + }); + + test('smoke test 2', () { + // given + final topLevelGroup = Group.root([ + LocalTest('patrol_test_explorer', Metadata.empty, () {}), + Group( + 'example_test', + [ + _localTest('example_test alpha'), + Group('example_test bravo', [ + _localTest('example_test bravo first'), + _localTest('example_test bravo second'), + ]), + _localTest('example_test charlie'), + Group('example_test delta', [ + _localTest('example_test delta first'), + _localTest('example_test delta second'), + ]), + _localTest('example_test echo'), ], ), + ]); + + // when + final dartTestGroup = createDartTestGroup(topLevelGroup); + + // then + expect( + dartTestGroup, + equals( + DartGroupEntry( + name: '', + type: GroupEntryType.GROUP, + entries: [ + DartGroupEntry( + name: 'example_test', + type: GroupEntryType.GROUP, + entries: [ + DartGroupEntry(name: 'alpha', type: GroupEntryType.TEST), + DartGroupEntry( + name: 'bravo', + type: GroupEntryType.GROUP, + entries: [ + DartGroupEntry(name: 'first', type: GroupEntryType.TEST), + DartGroupEntry(name: 'second', type: GroupEntryType.TEST), + ], + ), + DartGroupEntry(name: 'charlie', type: GroupEntryType.TEST), + DartGroupEntry( + name: 'delta', + type: GroupEntryType.GROUP, + entries: [ + DartGroupEntry(name: 'first', type: GroupEntryType.TEST), + DartGroupEntry(name: 'second', type: GroupEntryType.TEST), + ], + ), + DartGroupEntry(name: 'echo', type: GroupEntryType.TEST), + ], + ), + ], + ), + ), + ); + }); + }); + + group('deduplicateGroupEntryName()', () { + test('deduplicates group entry names', () { + // given + const parentEntryName = 'example_test example_test.dart alpha'; + const currentEntryName = 'example_test example_test.dart alpha first'; + + // when + final result = deduplicateGroupEntryName( + parentEntryName, + currentEntryName, ); + + // then + expect(result, equals('first')); }); }); } + +LocalTest _localTest(String name) => LocalTest(name, Metadata.empty, () {}); diff --git a/packages/patrol_cli/lib/src/crossplatform/flutter_tool.dart b/packages/patrol_cli/lib/src/crossplatform/flutter_tool.dart index a963bdcdc..4ca7cda00 100644 --- a/packages/patrol_cli/lib/src/crossplatform/flutter_tool.dart +++ b/packages/patrol_cli/lib/src/crossplatform/flutter_tool.dart @@ -47,7 +47,7 @@ class FlutterTool { target: target, appId: appId, dartDefines: dartDefines, - ) + ), ]); } diff --git a/packages/patrol_cli/lib/src/test_bundler.dart b/packages/patrol_cli/lib/src/test_bundler.dart index c4c45ff17..69e01200d 100644 --- a/packages/patrol_cli/lib/src/test_bundler.dart +++ b/packages/patrol_cli/lib/src/test_bundler.dart @@ -71,7 +71,7 @@ Future main() async { final nativeAutomator = NativeAutomator(config: NativeAutomatorConfig()); await nativeAutomator.initialize(); final binding = PatrolBinding.ensureInitialized(); - final testExplorationCompleter = Completer(); + final testExplorationCompleter = Completer(); // A special test to expore the hierarchy of groups and tests. This is a hack // around https://github.com/dart-lang/test/issues/1998. @@ -79,9 +79,13 @@ Future main() async { // This test must be the first to run. If not, the native side likely won't // receive any tests, and everything will fall apart. test('patrol_test_explorer', () { + // Maybe somewhat counterintuitively, this callback runs *after* the calls + // to group() below. final topLevelGroup = Invoker.current!.liveTest.groups.first; final dartTestGroup = createDartTestGroup(topLevelGroup); testExplorationCompleter.complete(dartTestGroup); + print('patrol_test_explorer: obtained Dart-side test hierarchy:'); + printGroupStructure(dartTestGroup); }); // START: GENERATED TEST GROUPS diff --git a/packages/patrol_cli/test/crossplatform/app_options_test.dart b/packages/patrol_cli/test/crossplatform/app_options_test.dart index 15045ca24..f362fb390 100644 --- a/packages/patrol_cli/test/crossplatform/app_options_test.dart +++ b/packages/patrol_cli/test/crossplatform/app_options_test.dart @@ -76,7 +76,7 @@ void main() { r'.\gradlew.bat', ':app:assembleDevReleaseAndroidTest', r'-Ptarget=C:\Users\john\app\integration_test\app_test.dart', - '-Pdart-defines=RU1BSUw9dXNlckBleGFtcGxlLmNvbQ==,UEFTU1dPUkQ9bnk0bmNhdA==,Zm9vPWJhcg==' + '-Pdart-defines=RU1BSUw9dXNlckBleGFtcGxlLmNvbQ==,UEFTU1dPUkQ9bnk0bmNhdA==,Zm9vPWJhcg==', ]), ); }); @@ -98,7 +98,7 @@ void main() { './gradlew', ':app:assembleDevDebugAndroidTest', '-Ptarget=/Users/john/app/integration_test/app_test.dart', - '-Pdart-defines=RU1BSUw9dXNlckBleGFtcGxlLmNvbQ==,UEFTU1dPUkQ9bnk0bmNhdA==,Zm9vPWJhcg==' + '-Pdart-defines=RU1BSUw9dXNlckBleGFtcGxlLmNvbQ==,UEFTU1dPUkQ9bnk0bmNhdA==,Zm9vPWJhcg==', ]), ); }); From e94fbbac584f226326f1c3c1e692946a3c628560 Mon Sep 17 00:00:00 2001 From: Bartek Pacia Date: Wed, 13 Sep 2023 12:02:13 +0200 Subject: [PATCH 059/110] Release patrol 2.3.0-dev.1, patrol_cli 2.2.0-dev.1 (#1686) * patrol: bump version to 2.3.0-dev.1 * patrol_cli: bump version to 2.2.0-dev.1 --- packages/patrol/CHANGELOG.md | 6 ++++++ packages/patrol/pubspec.yaml | 2 +- packages/patrol_cli/CHANGELOG.md | 6 ++++++ packages/patrol_cli/lib/src/base/constants.dart | 2 +- packages/patrol_cli/pubspec.yaml | 2 +- 5 files changed, 15 insertions(+), 3 deletions(-) diff --git a/packages/patrol/CHANGELOG.md b/packages/patrol/CHANGELOG.md index 5d8b5602d..01c81bfd7 100644 --- a/packages/patrol/CHANGELOG.md +++ b/packages/patrol/CHANGELOG.md @@ -1,3 +1,9 @@ +## 2.3.0-dev.1 + +- Add support for `group()` (#1634) + +This version requires version 2.2.0-dev.1 of `patrol_cli` package. + ## 2.2.4 - Remove deprecation of `nativeAutomation` and add message about migration to `patrol_finders` (#1670) diff --git a/packages/patrol/pubspec.yaml b/packages/patrol/pubspec.yaml index ba797d7b1..cb577054a 100644 --- a/packages/patrol/pubspec.yaml +++ b/packages/patrol/pubspec.yaml @@ -2,7 +2,7 @@ name: patrol description: > Powerful Flutter-native UI testing framework overcoming limitations of existing Flutter testing tools. Ready for action! -version: 2.2.4 +version: 2.3.0-dev.1 homepage: https://patrol.leancode.co repository: https://github.com/leancodepl/patrol issue_tracker: https://github.com/leancodepl/patrol/issues diff --git a/packages/patrol_cli/CHANGELOG.md b/packages/patrol_cli/CHANGELOG.md index 2b26dedee..59cbbced0 100644 --- a/packages/patrol_cli/CHANGELOG.md +++ b/packages/patrol_cli/CHANGELOG.md @@ -1,3 +1,9 @@ +## 2.2.0-dev.1 + +- Add support for `group()` (#1634) + +This version requires version 2.3.0-dev.1 of `patrol` package. + ## 2.1.3 - Add migration message due to release of `patrol_finders` diff --git a/packages/patrol_cli/lib/src/base/constants.dart b/packages/patrol_cli/lib/src/base/constants.dart index aefa3ad69..15394e2df 100644 --- a/packages/patrol_cli/lib/src/base/constants.dart +++ b/packages/patrol_cli/lib/src/base/constants.dart @@ -1,2 +1,2 @@ /// Version of Patrol CLI. Must be kept in sync with pubspec.yaml. -const version = '2.1.3'; +const version = '2.2.0-dev.1'; diff --git a/packages/patrol_cli/pubspec.yaml b/packages/patrol_cli/pubspec.yaml index 87bd44604..3baf6a92a 100644 --- a/packages/patrol_cli/pubspec.yaml +++ b/packages/patrol_cli/pubspec.yaml @@ -1,7 +1,7 @@ name: patrol_cli description: > Command-line tool for Patrol, a powerful Flutter-native UI testing framework. -version: 2.1.3 # Must be kept in sync with constants.dart +version: 2.2.0-dev.1 # Must be kept in sync with constants.dart homepage: https://patrol.leancode.co repository: https://github.com/leancodepl/patrol issue_tracker: https://github.com/leancodepl/patrol/issues From 9e1213586461d4ced57f79a7955b30ce8b7a85eb Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Wed, 13 Sep 2023 16:43:56 +0200 Subject: [PATCH 060/110] Change android dependencies --- packages/patrol/android/build.gradle | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/patrol/android/build.gradle b/packages/patrol/android/build.gradle index 770fcd25b..07558df63 100644 --- a/packages/patrol/android/build.gradle +++ b/packages/patrol/android/build.gradle @@ -65,14 +65,12 @@ android { api "androidx.test.espresso:espresso-core:3.5.0" api "androidx.test.uiautomator:uiautomator:2.2.0" - implementation "javax.annotation:javax.annotation-api:1.3.2" - implementation(platform("org.http4k:http4k-bom:5.7.4.0")) - implementation 'org.http4k:http4k-core:5.7.4.0' - implementation "org.http4k:http4k-client-apache" - implementation("org.http4k:http4k-server-netty") + implementation "org.http4k:http4k-core:5.7.4.0" + implementation "org.http4k:http4k-client-apache:5.7.4.0" + implementation "org.http4k:http4k-server-netty:5.7.4.0" implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.0" - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-guava:1.5.2") + implementation "org.jetbrains.kotlinx:kotlinx-coroutines-guava:1.5.2" testImplementation "org.jetbrains.kotlin:kotlin-test" } From 808ef976ab15573742972b2fe91551442e98e69e Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Wed, 13 Sep 2023 17:20:17 +0200 Subject: [PATCH 061/110] Fix klint and swift-format issues --- .../pl/leancode/patrol/ContractsExtensions.kt | 26 +- .../leancode/patrol/PatrolAppServiceClient.kt | 5 +- .../Classes/AutomatorServer/Automator.swift | 31 +- .../AutomatorServer/AutomatorServer.swift | 424 +++++++++--------- .../Classes/AutomatorServer/Contracts.swift | 2 + .../NativeAutomatorServer.swift | 2 + .../PatrolAppServiceClient.swift | 4 +- .../AutomatorServer/PatrolServer.swift | 8 +- .../Classes/ObjCPatrolAppServiceClient.swift | 6 +- .../ios/ios_contracts_generator.dart | 2 + .../ios/ios_flying_fox_server_generator.dart | 2 + .../ios/ios_telegraph_server_generator.dart | 2 + .../ios/ios_url_session_client_generator.dart | 4 +- 13 files changed, 266 insertions(+), 252 deletions(-) diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/ContractsExtensions.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/ContractsExtensions.kt index c0f9eae0d..76f604147 100644 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/ContractsExtensions.kt +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/ContractsExtensions.kt @@ -8,19 +8,19 @@ import pl.leancode.patrol.contracts.Contracts.DartTestGroup private fun Contracts.Selector.isEmpty(): Boolean { return ( - !hasText() && - !hasTextStartsWith() && - !hasTextContains() && - !hasClassName() && - !hasContentDescription() && - !hasContentDescriptionStartsWith() && - !hasContentDescriptionContains() && - !hasResourceId() && - !hasInstance() && - !hasEnabled() && - !hasFocused() && - !hasPkg() - ) + !hasText() && + !hasTextStartsWith() && + !hasTextContains() && + !hasClassName() && + !hasContentDescription() && + !hasContentDescriptionStartsWith() && + !hasContentDescriptionContains() && + !hasResourceId() && + !hasInstance() && + !hasEnabled() && + !hasFocused() && + !hasPkg() + ) } fun Contracts.Selector.toUiSelector(): UiSelector { diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolAppServiceClient.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolAppServiceClient.kt index e5db7780d..0de392378 100644 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolAppServiceClient.kt +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolAppServiceClient.kt @@ -1,4 +1,4 @@ -package pl.leancode.patrol; +package pl.leancode.patrol import org.apache.hc.core5.util.Timeout import pl.leancode.patrol.contracts.Contracts @@ -11,6 +11,7 @@ import pl.leancode.patrol.contracts.PatrolAppServiceClient as Client class PatrolAppServiceClient { private var client: Client + // https://github.com/leancodepl/patrol/issues/1683 private val timeout = Timeout.ofHours(2) @@ -36,4 +37,4 @@ class PatrolAppServiceClient { Logger.i("PatrolAppServiceClient.runDartTest($name)") return client.runDartTest(Contracts.RunDartTestRequest(name)) } -} \ No newline at end of file +} diff --git a/packages/patrol/ios/Classes/AutomatorServer/Automator.swift b/packages/patrol/ios/Classes/AutomatorServer/Automator.swift index 08ce13b5c..6d01e2fc0 100644 --- a/packages/patrol/ios/Classes/AutomatorServer/Automator.swift +++ b/packages/patrol/ios/Classes/AutomatorServer/Automator.swift @@ -439,9 +439,9 @@ let cells = self.springboard.buttons.matching(identifier: "NotificationCell") .allElementsBoundByIndex for (i, cell) in cells.enumerated() { - Logger.shared.i("found notification at index \(i) with label \(format: cell.label)") - let notification = Notification(title: String(), content: String(), raw: cell.label) - notifications.append(notification) + Logger.shared.i("found notification at index \(i) with label \(format: cell.label)") + let notification = Notification(title: String(), content: String(), raw: cell.label) + notifications.append(notification) } } @@ -803,19 +803,18 @@ } extension NativeView { - static func fromXCUIElement(_ xcuielement: XCUIElement, _ bundleId: String) -> NativeView - { - return NativeView( - className: String(xcuielement.elementType.rawValue), // TODO: Provide mapping for names - text: xcuielement.label, - contentDescription: xcuielement.accessibilityLabel, - focused: xcuielement.hasFocus, - enabled: xcuielement.isEnabled, - resourceName: xcuielement.identifier, - applicationPackage: bundleId, - children: xcuielement.children(matching: .any).allElementsBoundByIndex.map { child in - return NativeView.fromXCUIElement(child, bundleId) - }) + static func fromXCUIElement(_ xcuielement: XCUIElement, _ bundleId: String) -> NativeView { + return NativeView( + className: String(xcuielement.elementType.rawValue), // TODO: Provide mapping for names + text: xcuielement.label, + contentDescription: xcuielement.accessibilityLabel, + focused: xcuielement.hasFocus, + enabled: xcuielement.isEnabled, + resourceName: xcuielement.identifier, + applicationPackage: bundleId, + children: xcuielement.children(matching: .any).allElementsBoundByIndex.map { child in + return NativeView.fromXCUIElement(child, bundleId) + }) } } diff --git a/packages/patrol/ios/Classes/AutomatorServer/AutomatorServer.swift b/packages/patrol/ios/Classes/AutomatorServer/AutomatorServer.swift index 4f69766ad..5e800f85d 100644 --- a/packages/patrol/ios/Classes/AutomatorServer/AutomatorServer.swift +++ b/packages/patrol/ios/Classes/AutomatorServer/AutomatorServer.swift @@ -1,301 +1,301 @@ #if PATROL_ENABLED -import Foundation + import Foundation -final class AutomatorServer: NativeAutomatorServer { + final class AutomatorServer: NativeAutomatorServer { private let automator: Automator - + private let onAppReady: (Bool) -> Void - + init(automator: Automator, onAppReady: @escaping (Bool) -> Void) { - self.automator = automator - self.onAppReady = onAppReady + self.automator = automator + self.onAppReady = onAppReady } - + func initialize() async throws {} - + func configure(request: ConfigureRequest) async throws { - automator.configure(timeout: TimeInterval(request.findTimeoutMillis / 1000)) + automator.configure(timeout: TimeInterval(request.findTimeoutMillis / 1000)) } - + // MARK: General - + func pressHome() async throws { - return try await runCatching { - try await automator.pressHome() - } + return try await runCatching { + try await automator.pressHome() + } } - + func pressBack() async throws { - return try await runCatching { - throw PatrolError.methodNotImplemented("pressBack") - } + return try await runCatching { + throw PatrolError.methodNotImplemented("pressBack") + } } - + func pressRecentApps() async throws { - return try await runCatching { - try await automator.openAppSwitcher() - } + return try await runCatching { + try await automator.openAppSwitcher() + } } - + func doublePressRecentApps() async throws { - return try await runCatching { - throw PatrolError.methodNotImplemented("doublePressRecentApps") - } + return try await runCatching { + throw PatrolError.methodNotImplemented("doublePressRecentApps") + } } - + func openApp(request: OpenAppRequest) async throws { - return try await runCatching { - try await automator.openApp(request.appId) - } + return try await runCatching { + try await automator.openApp(request.appId) + } } - + func openQuickSettings(request: OpenQuickSettingsRequest) async throws { - return try await runCatching { - try await automator.openControlCenter() - } + return try await runCatching { + try await automator.openControlCenter() + } } - + // MARK: General UI interaction - + func getNativeViews( - request: GetNativeViewsRequest + request: GetNativeViewsRequest ) async throws -> GetNativeViewsResponse { - return try await runCatching { - let nativeViews = try await automator.getNativeViews( - byText: request.selector.text ?? String(), - inApp: request.appId - ) - - return GetNativeViewsResponse(nativeViews: nativeViews) - } + return try await runCatching { + let nativeViews = try await automator.getNativeViews( + byText: request.selector.text ?? String(), + inApp: request.appId + ) + + return GetNativeViewsResponse(nativeViews: nativeViews) + } } func tap(request: TapRequest) async throws { - return try await runCatching { - try await automator.tap( - onText: request.selector.text ?? String(), - inApp: request.appId, - atIndex: request.selector.instance ?? 0 - ) - } + return try await runCatching { + try await automator.tap( + onText: request.selector.text ?? String(), + inApp: request.appId, + atIndex: request.selector.instance ?? 0 + ) + } } - + func doubleTap(request: TapRequest) async throws { - return try await runCatching { - try await automator.doubleTap( - onText: request.selector.text ?? String(), - inApp: request.appId - ) - } + return try await runCatching { + try await automator.doubleTap( + onText: request.selector.text ?? String(), + inApp: request.appId + ) + } } - + func enterText(request: EnterTextRequest) async throws { - return try await runCatching { - if let index = request.index { - try await automator.enterText( - request.data, - byIndex: Int(index), - inApp: request.appId, - dismissKeyboard: request.keyboardBehavior == .showAndDismiss - ) - } else if let selector = request.selector { - try await automator.enterText( - request.data, - byText: selector.text ?? String(), - atIndex: selector.instance ?? 0, - inApp: request.appId, - dismissKeyboard: request.keyboardBehavior == .showAndDismiss - ) - } else { - throw PatrolError.internal("enterText(): neither index nor selector are set") - } - } + return try await runCatching { + if let index = request.index { + try await automator.enterText( + request.data, + byIndex: Int(index), + inApp: request.appId, + dismissKeyboard: request.keyboardBehavior == .showAndDismiss + ) + } else if let selector = request.selector { + try await automator.enterText( + request.data, + byText: selector.text ?? String(), + atIndex: selector.instance ?? 0, + inApp: request.appId, + dismissKeyboard: request.keyboardBehavior == .showAndDismiss + ) + } else { + throw PatrolError.internal("enterText(): neither index nor selector are set") + } + } } - + func swipe(request: SwipeRequest) async throws { - return try await runCatching { - throw PatrolError.methodNotImplemented("swipe") - } + return try await runCatching { + throw PatrolError.methodNotImplemented("swipe") + } } - + func waitUntilVisible(request: WaitUntilVisibleRequest) async throws { - return try await runCatching { - try await automator.waitUntilVisible( - onText: request.selector.text ?? String(), - inApp: request.appId - ) - } + return try await runCatching { + try await automator.waitUntilVisible( + onText: request.selector.text ?? String(), + inApp: request.appId + ) + } } - + // MARK: Services - + func enableAirplaneMode() async throws { - return try await runCatching { - try await automator.enableAirplaneMode() - } + return try await runCatching { + try await automator.enableAirplaneMode() + } } - + func disableAirplaneMode() async throws { - return try await runCatching { - try await automator.disableAirplaneMode() - } + return try await runCatching { + try await automator.disableAirplaneMode() + } } - + func enableWiFi() async throws { - return try await runCatching { - try await automator.enableWiFi() - } + return try await runCatching { + try await automator.enableWiFi() + } } - + func disableWiFi() async throws { - return try await runCatching { - try await automator.disableWiFi() - } + return try await runCatching { + try await automator.disableWiFi() + } } - + func enableCellular() async throws { - return try await runCatching { - try await automator.enableCellular() - } + return try await runCatching { + try await automator.enableCellular() + } } - + func disableCellular() async throws { - return try await runCatching { - try await automator.disableCellular() - } + return try await runCatching { + try await automator.disableCellular() + } } - + func enableBluetooth() async throws { - return try await runCatching { - try await automator.enableBluetooth() - } + return try await runCatching { + try await automator.enableBluetooth() + } } - + func disableBluetooth() async throws { - return try await runCatching { - try await automator.disableBluetooth() - } + return try await runCatching { + try await automator.disableBluetooth() + } } - + func enableDarkMode(request: DarkModeRequest) async throws { - return try await runCatching { - try await automator.enableDarkMode(request.appId) - } + return try await runCatching { + try await automator.enableDarkMode(request.appId) + } } - + func disableDarkMode(request: DarkModeRequest) async throws { - return try await runCatching { - try await automator.disableDarkMode(request.appId) - } + return try await runCatching { + try await automator.disableDarkMode(request.appId) + } } - + // MARK: Notifications - + func openNotifications() async throws { - return try await runCatching { - try await automator.openNotifications() - } + return try await runCatching { + try await automator.openNotifications() + } } - + func closeNotifications() async throws { - return try await runCatching { - try await automator.closeNotifications() - } + return try await runCatching { + try await automator.closeNotifications() + } } - + func closeHeadsUpNotification() async throws { - return try await runCatching { - try await automator.closeHeadsUpNotification() - } + return try await runCatching { + try await automator.closeHeadsUpNotification() + } } - + func getNotifications( - request: GetNotificationsRequest + request: GetNotificationsRequest ) async throws -> GetNotificationsResponse { - return try await runCatching { - let notifications = try await automator.getNotifications() - return GetNotificationsResponse(notifications: notifications) - } + return try await runCatching { + let notifications = try await automator.getNotifications() + return GetNotificationsResponse(notifications: notifications) + } } - + func tapOnNotification(request: TapOnNotificationRequest) async throws { - return try await runCatching { - if let index = request.index { - try await automator.tapOnNotification( - byIndex: index - ) - } else if let selector = request.selector { - try await automator.tapOnNotification( - bySubstring: selector.textContains ?? String() - ) - } else { - throw PatrolError.internal("tapOnNotification(): neither index nor selector are set") - } - } + return try await runCatching { + if let index = request.index { + try await automator.tapOnNotification( + byIndex: index + ) + } else if let selector = request.selector { + try await automator.tapOnNotification( + bySubstring: selector.textContains ?? String() + ) + } else { + throw PatrolError.internal("tapOnNotification(): neither index nor selector are set") + } + } } - + // MARK: Permissions - + func isPermissionDialogVisible( - request: PermissionDialogVisibleRequest + request: PermissionDialogVisibleRequest ) async throws -> PermissionDialogVisibleResponse { - return try await runCatching { - let visible = await automator.isPermissionDialogVisible( - timeout: TimeInterval(request.timeoutMillis / 1000) - ) - - return PermissionDialogVisibleResponse(visible: visible) - - } + return try await runCatching { + let visible = await automator.isPermissionDialogVisible( + timeout: TimeInterval(request.timeoutMillis / 1000) + ) + + return PermissionDialogVisibleResponse(visible: visible) + + } } - + func handlePermissionDialog(request: HandlePermissionRequest) async throws { - return try await runCatching { - switch request.code { - case .whileUsing: - try await automator.allowPermissionWhileUsingApp() - case .onlyThisTime: - try await automator.allowPermissionOnce() - case .denied: - try await automator.denyPermission() - } + return try await runCatching { + switch request.code { + case .whileUsing: + try await automator.allowPermissionWhileUsingApp() + case .onlyThisTime: + try await automator.allowPermissionOnce() + case .denied: + try await automator.denyPermission() } + } } - + func setLocationAccuracy(request: SetLocationAccuracyRequest) async throws { - return try await runCatching { - switch request.locationAccuracy { - case .coarse: - try await automator.selectCoarseLocation() - case .fine: - try await automator.selectFineLocation() - } + return try await runCatching { + switch request.locationAccuracy { + case .coarse: + try await automator.selectCoarseLocation() + case .fine: + try await automator.selectFineLocation() } + } } - + func debug() async throws { - return try await runCatching { - try await automator.debug() - } + return try await runCatching { + try await automator.debug() + } } - + private func runCatching(_ block: () async throws -> T) async throws -> T { - // TODO: Use an interceptor (like on Android) - // See: https://github.com/grpc/grpc-swift/issues/1148 - do { - return try await block() - } catch let err as PatrolError { - Logger.shared.e(err.description) - throw err - } catch let err { - throw PatrolError.unknown(err) - } + // TODO: Use an interceptor (like on Android) + // See: https://github.com/grpc/grpc-swift/issues/1148 + do { + return try await block() + } catch let err as PatrolError { + Logger.shared.e(err.description) + throw err + } catch let err { + throw PatrolError.unknown(err) + } } - + func markPatrolAppServiceReady() async throws { - onAppReady(true) + onAppReady(true) } -} + } #endif diff --git a/packages/patrol/ios/Classes/AutomatorServer/Contracts.swift b/packages/patrol/ios/Classes/AutomatorServer/Contracts.swift index 7a3bf355a..22e0cbad4 100644 --- a/packages/patrol/ios/Classes/AutomatorServer/Contracts.swift +++ b/packages/patrol/ios/Classes/AutomatorServer/Contracts.swift @@ -1,4 +1,6 @@ /// +// swift-format-ignore-file +// // Generated code. Do not modify. // source: schema.dart // diff --git a/packages/patrol/ios/Classes/AutomatorServer/NativeAutomatorServer.swift b/packages/patrol/ios/Classes/AutomatorServer/NativeAutomatorServer.swift index 933c9d93e..c230064b9 100644 --- a/packages/patrol/ios/Classes/AutomatorServer/NativeAutomatorServer.swift +++ b/packages/patrol/ios/Classes/AutomatorServer/NativeAutomatorServer.swift @@ -1,4 +1,6 @@ /// +// swift-format-ignore-file +// // Generated code. Do not modify. // source: schema.dart // diff --git a/packages/patrol/ios/Classes/AutomatorServer/PatrolAppServiceClient.swift b/packages/patrol/ios/Classes/AutomatorServer/PatrolAppServiceClient.swift index a7bc419ad..b3ed8d553 100644 --- a/packages/patrol/ios/Classes/AutomatorServer/PatrolAppServiceClient.swift +++ b/packages/patrol/ios/Classes/AutomatorServer/PatrolAppServiceClient.swift @@ -1,4 +1,6 @@ /// +// swift-format-ignore-file +// // Generated code. Do not modify. // source: schema.dart // @@ -39,7 +41,7 @@ class PatrolAppServiceClient { guard (response as? HTTPURLResponse)?.statusCode == 200 else { throw PatrolError.internal("Invalid response: \(response) \(data)") } - + return try JSONDecoder().decode(TResult.self, from: data) } } diff --git a/packages/patrol/ios/Classes/AutomatorServer/PatrolServer.swift b/packages/patrol/ios/Classes/AutomatorServer/PatrolServer.swift index 03f60fd01..36dec8545 100644 --- a/packages/patrol/ios/Classes/AutomatorServer/PatrolServer.swift +++ b/packages/patrol/ios/Classes/AutomatorServer/PatrolServer.swift @@ -1,5 +1,5 @@ -import Foundation import FlyingFox +import Foundation @objc public class PatrolServer: NSObject { private static let envPortKey = "PATROL_PORT" @@ -47,14 +47,14 @@ import FlyingFox @objc public func start() async throws { #if PATROL_ENABLED Logger.shared.i("Starting server...") - + let provider = AutomatorServer(automator: automator) { appReady in Logger.shared.i("App reported that it is ready") self.appReady = appReady } - + await provider.setupRoutes(server: server) - + Task { try await server.start() } try await server.waitUntilListening() let address = await server.listeningAddress diff --git a/packages/patrol/ios/Classes/ObjCPatrolAppServiceClient.swift b/packages/patrol/ios/Classes/ObjCPatrolAppServiceClient.swift index 1b5fa086a..803058025 100644 --- a/packages/patrol/ios/Classes/ObjCPatrolAppServiceClient.swift +++ b/packages/patrol/ios/Classes/ObjCPatrolAppServiceClient.swift @@ -22,10 +22,10 @@ @objc public override init() { let port = 8082 // TODO: Document this value better // https://github.com/leancodepl/patrol/issues/1683 - let timeout = TimeInterval(2*60*60) - + let timeout = TimeInterval(2 * 60 * 60) + NSLog("PatrolAppServiceClient: created, port: \(port)") - + client = PatrolAppServiceClient(port: port, address: "localhost", timeout: timeout) } diff --git a/packages/patrol_gen/lib/src/generators/ios/ios_contracts_generator.dart b/packages/patrol_gen/lib/src/generators/ios/ios_contracts_generator.dart index 233e66af5..4ba9dc91f 100644 --- a/packages/patrol_gen/lib/src/generators/ios/ios_contracts_generator.dart +++ b/packages/patrol_gen/lib/src/generators/ios/ios_contracts_generator.dart @@ -18,6 +18,8 @@ class IOSContractsGenerator { String _contentPrefix(IOSConfig config) { return ''' /// +// swift-format-ignore-file +// // Generated code. Do not modify. // source: schema.dart // diff --git a/packages/patrol_gen/lib/src/generators/ios/ios_flying_fox_server_generator.dart b/packages/patrol_gen/lib/src/generators/ios/ios_flying_fox_server_generator.dart index 8081fda30..7d6e7a67c 100644 --- a/packages/patrol_gen/lib/src/generators/ios/ios_flying_fox_server_generator.dart +++ b/packages/patrol_gen/lib/src/generators/ios/ios_flying_fox_server_generator.dart @@ -23,6 +23,8 @@ class IOSFlyingFoxServerGenerator { String _contentPrefix(IOSConfig config) { return ''' /// +// swift-format-ignore-file +// // Generated code. Do not modify. // source: schema.dart // diff --git a/packages/patrol_gen/lib/src/generators/ios/ios_telegraph_server_generator.dart b/packages/patrol_gen/lib/src/generators/ios/ios_telegraph_server_generator.dart index 89cbc90be..2bbba4def 100644 --- a/packages/patrol_gen/lib/src/generators/ios/ios_telegraph_server_generator.dart +++ b/packages/patrol_gen/lib/src/generators/ios/ios_telegraph_server_generator.dart @@ -23,6 +23,8 @@ class IOSTelegraphServerGenerator { String _contentPrefix(IOSConfig config) { return ''' /// +// swift-format-ignore-file +// // Generated code. Do not modify. // source: schema.dart // diff --git a/packages/patrol_gen/lib/src/generators/ios/ios_url_session_client_generator.dart b/packages/patrol_gen/lib/src/generators/ios/ios_url_session_client_generator.dart index 35cd091ee..6327e36e0 100644 --- a/packages/patrol_gen/lib/src/generators/ios/ios_url_session_client_generator.dart +++ b/packages/patrol_gen/lib/src/generators/ios/ios_url_session_client_generator.dart @@ -17,6 +17,8 @@ class IOSURLSessionClientGenerator { String _contentPrefix(IOSConfig config) { return ''' /// +// swift-format-ignore-file +// // Generated code. Do not modify. // source: schema.dart // @@ -62,7 +64,7 @@ $endpoints guard (response as? HTTPURLResponse)?.statusCode == 200 else { $throwException } - + return try JSONDecoder().decode(TResult.self, from: data) } } From b587fb2767cc997b13837c66c4c6f9e347dc1f92 Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Wed, 13 Sep 2023 17:25:17 +0200 Subject: [PATCH 062/110] Fix macro --- packages/patrol/ios/Classes/PatrolIntegrationTestRunner.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/patrol/ios/Classes/PatrolIntegrationTestRunner.h b/packages/patrol/ios/Classes/PatrolIntegrationTestRunner.h index 07993aabb..af0ef7528 100644 --- a/packages/patrol/ios/Classes/PatrolIntegrationTestRunner.h +++ b/packages/patrol/ios/Classes/PatrolIntegrationTestRunner.h @@ -85,9 +85,9 @@ IMP implementation = imp_implementationWithBlock(^(id _self) { \ [[[XCUIApplication alloc] init] launch]; \ \ - __block RunDartTestResponse2 *response = NULL; \ + __block RunDartTestResponse2 *response = NULL; \ [appServiceClient runDartTestWithName:dartTestFile \ - completionHandler:^(RunDartTestResponse2 *_Nullable r, NSError *_Nullable err) { \ + completionHandler:^(RunDartTestResponse2 *_Nullable r, NSError *_Nullable err) { \ if (err != NULL) { \ NSLog(@"runDartTestWithName(%@): failed, err: %@", dartTestFile, err); \ } \ From 46066ee8c9da2016ad5225366d8276007b6a4ea7 Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Wed, 13 Sep 2023 17:51:12 +0200 Subject: [PATCH 063/110] Fix klint issues --- .../pl/leancode/patrol/ContractsExtensions.kt | 101 +++++++++--------- .../kotlin/pl/leancode/patrol/PatrolServer.kt | 15 +-- .../pl/leancode/patrol/PatrolServerFilters.kt | 55 +++++----- 3 files changed, 85 insertions(+), 86 deletions(-) diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/ContractsExtensions.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/ContractsExtensions.kt index 76f604147..ede79ba2d 100644 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/ContractsExtensions.kt +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/ContractsExtensions.kt @@ -9,18 +9,18 @@ import pl.leancode.patrol.contracts.Contracts.DartTestGroup private fun Contracts.Selector.isEmpty(): Boolean { return ( !hasText() && - !hasTextStartsWith() && - !hasTextContains() && - !hasClassName() && - !hasContentDescription() && - !hasContentDescriptionStartsWith() && - !hasContentDescriptionContains() && - !hasResourceId() && - !hasInstance() && - !hasEnabled() && - !hasFocused() && - !hasPkg() - ) + !hasTextStartsWith() && + !hasTextContains() && + !hasClassName() && + !hasContentDescription() && + !hasContentDescriptionStartsWith() && + !hasContentDescriptionContains() && + !hasResourceId() && + !hasInstance() && + !hasEnabled() && + !hasFocused() && + !hasPkg() + ) } fun Contracts.Selector.toUiSelector(): UiSelector { @@ -94,44 +94,45 @@ fun Contracts.Selector.toBySelector(): BySelector { var matchedFocused = false var matchedPkg = false - var bySelector = if (hasText()) { - matchedText = true - By.text(text) - } else if (hasTextStartsWith()) { - matchedTextStartsWith = true - By.textStartsWith(textStartsWith) - } else if (hasTextContains()) { - matchedTextContains = true - By.textContains(textContains) - } else if (hasClassName()) { - matchedClassName = true - By.clazz(className) - } else if (hasContentDescription()) { - matchedContentDescription = true - By.desc(contentDescription) - } else if (hasContentDescriptionStartsWith()) { - matchedContentDescriptionStartsWith = true - By.descStartsWith(contentDescriptionStartsWith) - } else if (hasContentDescriptionContains()) { - matchedContentDescriptionContains = true - By.descContains(contentDescriptionContains) - } else if (hasResourceId()) { - matchedResourceId = true - By.res(resourceId) - } else if (hasInstance()) { - throw IllegalArgumentException("instance() argument is not supported for BySelector") - } else if (hasEnabled()) { - matchedEnabled = true - By.enabled(enabled!!) - } else if (hasFocused()) { - matchedFocused = true - By.focused(focused!!) - } else if (hasPkg()) { - matchedPkg = true - By.pkg(pkg) - } else { - throw IllegalArgumentException("SelectorQuery is empty") - } + var bySelector = + if (hasText()) { + matchedText = true + By.text(text) + } else if (hasTextStartsWith()) { + matchedTextStartsWith = true + By.textStartsWith(textStartsWith) + } else if (hasTextContains()) { + matchedTextContains = true + By.textContains(textContains) + } else if (hasClassName()) { + matchedClassName = true + By.clazz(className) + } else if (hasContentDescription()) { + matchedContentDescription = true + By.desc(contentDescription) + } else if (hasContentDescriptionStartsWith()) { + matchedContentDescriptionStartsWith = true + By.descStartsWith(contentDescriptionStartsWith) + } else if (hasContentDescriptionContains()) { + matchedContentDescriptionContains = true + By.descContains(contentDescriptionContains) + } else if (hasResourceId()) { + matchedResourceId = true + By.res(resourceId) + } else if (hasInstance()) { + throw IllegalArgumentException("instance() argument is not supported for BySelector") + } else if (hasEnabled()) { + matchedEnabled = true + By.enabled(enabled!!) + } else if (hasFocused()) { + matchedFocused = true + By.focused(focused!!) + } else if (hasPkg()) { + matchedPkg = true + By.pkg(pkg) + } else { + throw IllegalArgumentException("SelectorQuery is empty") + } if (!matchedText && hasText()) { bySelector = By.copy(bySelector).text(text) diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolServer.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolServer.kt index dbc84e44f..625c491ca 100644 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolServer.kt +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolServer.kt @@ -1,13 +1,13 @@ package pl.leancode.patrol import androidx.test.platform.app.InstrumentationRegistry +import com.google.common.util.concurrent.SettableFuture import org.http4k.core.ContentType import org.http4k.filter.ServerFilters import org.http4k.server.Http4kServer import org.http4k.server.Netty import org.http4k.server.asServer import java.util.concurrent.Future -import com.google.common.util.concurrent.SettableFuture; class PatrolServer { private val envPortKey = "PATROL_PORT" @@ -25,11 +25,12 @@ class PatrolServer { Logger.i("Starting server...") automatorServer = AutomatorServer(Automator.instance) - server = automatorServer!!.router - .withFilter(catcher) - .withFilter(printer) - .withFilter(ServerFilters.SetContentType(ContentType.TEXT_PLAIN)) - .asServer(Netty(port)) + server = + automatorServer!!.router + .withFilter(catcher) + .withFilter(printer) + .withFilter(ServerFilters.SetContentType(ContentType.TEXT_PLAIN)) + .asServer(Netty(port)) server?.start() Logger.i("Created and started PatrolServer, port: $port") @@ -39,7 +40,7 @@ class PatrolServer { Logger.i("Stopping server...") server?.close() Logger.i("Server stopped") - } + }, ) } diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolServerFilters.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolServerFilters.kt index d29e62f7b..55d71f44e 100644 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolServerFilters.kt +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolServerFilters.kt @@ -1,45 +1,42 @@ package pl.leancode.patrol import androidx.test.uiautomator.UiObjectNotFoundException -import kotlinx.serialization.SerializationException -import kotlinx.serialization.encodeToString import kotlinx.serialization.json.Json import org.http4k.core.Filter -import org.http4k.core.MemoryBody import org.http4k.core.Response -import org.http4k.core.Status -import org.http4k.core.Status.Companion.BAD_REQUEST import org.http4k.core.Status.Companion.INTERNAL_SERVER_ERROR import org.http4k.core.Status.Companion.NOT_FOUND import org.http4k.core.Status.Companion.NOT_IMPLEMENTED private val json = Json { ignoreUnknownKeys = true } -val printer = Filter { next -> - { request -> - val requestName = "${request.method} ${request.uri}" - Logger.i("$requestName started") - val startTime = System.currentTimeMillis() - val response = next(request) - val latency = System.currentTimeMillis() - startTime - Logger.i("$requestName took $latency ms") - response +val printer = + Filter { next -> + { request -> + val requestName = "${request.method} ${request.uri}" + Logger.i("$requestName started") + val startTime = System.currentTimeMillis() + val response = next(request) + val latency = System.currentTimeMillis() - startTime + Logger.i("$requestName took $latency ms") + response + } } -} -val catcher = Filter { next -> - { request -> - try { - next(request) - } catch (err: UiObjectNotFoundException) { - Logger.e("caught UiObjectNotFoundException", err) - val msg = "selector ${err.message} found nothing" - Response(NOT_FOUND).body(msg) - } catch (err: NotImplementedError) { - Response(NOT_IMPLEMENTED).body("method ${err.message}() is not implemented on Android") - } catch (err: Exception) { - Logger.e("caught Exception", err) - Response(INTERNAL_SERVER_ERROR).body(err.stackTraceToString()) +val catcher = + Filter { next -> + { request -> + try { + next(request) + } catch (err: UiObjectNotFoundException) { + Logger.e("caught UiObjectNotFoundException", err) + val msg = "selector ${err.message} found nothing" + Response(NOT_FOUND).body(msg) + } catch (err: NotImplementedError) { + Response(NOT_IMPLEMENTED).body("method ${err.message}() is not implemented on Android") + } catch (err: Exception) { + Logger.e("caught Exception", err) + Response(INTERNAL_SERVER_ERROR).body(err.stackTraceToString()) + } } } -} From 3d1cb376333a1c3ff6855ed7fde3d3a95c9c9e79 Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Wed, 13 Sep 2023 18:11:36 +0200 Subject: [PATCH 064/110] Downgrade packages --- .../src/main/kotlin/pl/leancode/patrol/ContractsExtensions.kt | 2 +- .../src/main/kotlin/pl/leancode/patrol/PatrolServer.kt | 2 +- packages/patrol/pubspec.yaml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/ContractsExtensions.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/ContractsExtensions.kt index ede79ba2d..097f91b61 100644 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/ContractsExtensions.kt +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/ContractsExtensions.kt @@ -20,7 +20,7 @@ private fun Contracts.Selector.isEmpty(): Boolean { !hasEnabled() && !hasFocused() && !hasPkg() - ) + ) } fun Contracts.Selector.toUiSelector(): UiSelector { diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolServer.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolServer.kt index 625c491ca..6ba10e800 100644 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolServer.kt +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolServer.kt @@ -40,7 +40,7 @@ class PatrolServer { Logger.i("Stopping server...") server?.close() Logger.i("Server stopped") - }, + } ) } diff --git a/packages/patrol/pubspec.yaml b/packages/patrol/pubspec.yaml index ea1aac318..0766b10e7 100644 --- a/packages/patrol/pubspec.yaml +++ b/packages/patrol/pubspec.yaml @@ -20,7 +20,7 @@ dependencies: http: ^0.13.6 integration_test: sdk: flutter - json_annotation: ^4.8.1 + json_annotation: ^4.6.0 meta: ^1.7.0 path: ^1.8.2 patrol_finders: ^1.0.0 @@ -29,7 +29,7 @@ dependencies: dev_dependencies: build_runner: ^2.3.3 - json_serializable: ^6.7.1 + json_serializable: ^6.3.2 leancode_lint: ^3.0.0 flutter: From 2f973d403c09831e5a97ffb707cb43898c8cc46a Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Wed, 13 Sep 2023 18:16:00 +0200 Subject: [PATCH 065/110] Downgrade http package --- packages/patrol/pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/patrol/pubspec.yaml b/packages/patrol/pubspec.yaml index 0766b10e7..76b577800 100644 --- a/packages/patrol/pubspec.yaml +++ b/packages/patrol/pubspec.yaml @@ -17,7 +17,7 @@ dependencies: sdk: flutter flutter_test: sdk: flutter - http: ^0.13.6 + http: ^0.13.5 integration_test: sdk: flutter json_annotation: ^4.6.0 From 8cc4ff95f69b05c0d5eaa32cdd00f7932e3ddadd Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Thu, 14 Sep 2023 11:23:07 +0200 Subject: [PATCH 066/110] Update contracts --- .../pl/leancode/patrol/contracts/Contracts.kt | 19 +++++---- .../Classes/AutomatorServer/Contracts.swift | 17 ++++---- .../lib/src/native/contracts/contracts.dart | 41 ++++++++----------- .../lib/src/native/contracts/contracts.g.dart | 34 +++++++-------- 4 files changed, 50 insertions(+), 61 deletions(-) diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/Contracts.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/Contracts.kt index 674a47101..75133f586 100644 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/Contracts.kt +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/Contracts.kt @@ -8,6 +8,12 @@ package pl.leancode.patrol.contracts; import kotlinx.serialization.Serializable class Contracts { + @Serializable + enum class GroupEntryType { + group, + test, + } + @Serializable enum class RunDartTestResponseResult { success, @@ -35,20 +41,15 @@ class Contracts { } @Serializable - data class DartTestCase ( - val name: String - ) - - @Serializable - data class DartTestGroup ( + data class DartGroupEntry ( val name: String, - val tests: List, - val groups: List + val type: GroupEntryType, + val entries: List ) @Serializable data class ListDartTestsResponse ( - val group: DartTestGroup + val group: DartGroupEntry ) @Serializable diff --git a/packages/patrol/ios/Classes/AutomatorServer/Contracts.swift b/packages/patrol/ios/Classes/AutomatorServer/Contracts.swift index 22e0cbad4..5ccad38f2 100644 --- a/packages/patrol/ios/Classes/AutomatorServer/Contracts.swift +++ b/packages/patrol/ios/Classes/AutomatorServer/Contracts.swift @@ -5,6 +5,11 @@ // source: schema.dart // +enum GroupEntryType: String, Codable { + case group + case test +} + enum RunDartTestResponseResult: String, Codable { case success case skipped @@ -27,18 +32,14 @@ enum SetLocationAccuracyRequestLocationAccuracy: String, Codable { case fine } -struct DartTestCase: Codable { - var name: String -} - -struct DartTestGroup: Codable { +struct DartGroupEntry: Codable { var name: String - var tests: [DartTestCase] - var groups: [DartTestGroup] + var type: GroupEntryType + var entries: [DartGroupEntry] } struct ListDartTestsResponse: Codable { - var group: DartTestGroup + var group: DartGroupEntry } struct RunDartTestRequest: Codable { diff --git a/packages/patrol/lib/src/native/contracts/contracts.dart b/packages/patrol/lib/src/native/contracts/contracts.dart index 2255f43ff..274b92266 100644 --- a/packages/patrol/lib/src/native/contracts/contracts.dart +++ b/packages/patrol/lib/src/native/contracts/contracts.dart @@ -8,6 +8,13 @@ import 'package:json_annotation/json_annotation.dart'; part 'contracts.g.dart'; +enum GroupEntryType { + @JsonValue('group') + group, + @JsonValue('test') + test +} + enum RunDartTestResponseResult { @JsonValue('success') success, @@ -41,35 +48,21 @@ enum SetLocationAccuracyRequestLocationAccuracy { } @JsonSerializable() -class DartTestCase { - DartTestCase({ - required this.name, - }); - - factory DartTestCase.fromJson(Map json) => - _$DartTestCaseFromJson(json); - - final String name; - - Map toJson() => _$DartTestCaseToJson(this); -} - -@JsonSerializable() -class DartTestGroup { - DartTestGroup({ +class DartGroupEntry { + DartGroupEntry({ required this.name, - required this.tests, - required this.groups, + required this.type, + required this.entries, }); - factory DartTestGroup.fromJson(Map json) => - _$DartTestGroupFromJson(json); + factory DartGroupEntry.fromJson(Map json) => + _$DartGroupEntryFromJson(json); final String name; - final List tests; - final List groups; + final GroupEntryType type; + final List entries; - Map toJson() => _$DartTestGroupToJson(this); + Map toJson() => _$DartGroupEntryToJson(this); } @JsonSerializable() @@ -81,7 +74,7 @@ class ListDartTestsResponse { factory ListDartTestsResponse.fromJson(Map json) => _$ListDartTestsResponseFromJson(json); - final DartTestGroup group; + final DartGroupEntry group; Map toJson() => _$ListDartTestsResponseToJson(this); } diff --git a/packages/patrol/lib/src/native/contracts/contracts.g.dart b/packages/patrol/lib/src/native/contracts/contracts.g.dart index 08eaa6a31..4583a240f 100644 --- a/packages/patrol/lib/src/native/contracts/contracts.g.dart +++ b/packages/patrol/lib/src/native/contracts/contracts.g.dart @@ -6,37 +6,31 @@ part of 'contracts.dart'; // JsonSerializableGenerator // ************************************************************************** -DartTestCase _$DartTestCaseFromJson(Map json) => DartTestCase( +DartGroupEntry _$DartGroupEntryFromJson(Map json) => + DartGroupEntry( name: json['name'] as String, - ); - -Map _$DartTestCaseToJson(DartTestCase instance) => - { - 'name': instance.name, - }; - -DartTestGroup _$DartTestGroupFromJson(Map json) => - DartTestGroup( - name: json['name'] as String, - tests: (json['tests'] as List) - .map((e) => DartTestCase.fromJson(e as Map)) - .toList(), - groups: (json['groups'] as List) - .map((e) => DartTestGroup.fromJson(e as Map)) + type: $enumDecode(_$GroupEntryTypeEnumMap, json['type']), + entries: (json['entries'] as List) + .map((e) => DartGroupEntry.fromJson(e as Map)) .toList(), ); -Map _$DartTestGroupToJson(DartTestGroup instance) => +Map _$DartGroupEntryToJson(DartGroupEntry instance) => { 'name': instance.name, - 'tests': instance.tests, - 'groups': instance.groups, + 'type': _$GroupEntryTypeEnumMap[instance.type]!, + 'entries': instance.entries, }; +const _$GroupEntryTypeEnumMap = { + GroupEntryType.group: 'group', + GroupEntryType.test: 'test', +}; + ListDartTestsResponse _$ListDartTestsResponseFromJson( Map json) => ListDartTestsResponse( - group: DartTestGroup.fromJson(json['group'] as Map), + group: DartGroupEntry.fromJson(json['group'] as Map), ); Map _$ListDartTestsResponseToJson( From 578963070095a0e663ef3ff07c93cd5502793228 Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Thu, 14 Sep 2023 11:38:18 +0200 Subject: [PATCH 067/110] Fix dart tests (Add equatable) --- packages/patrol/lib/src/common.dart | 7 +- .../lib/src/native/contracts/contracts.dart | 202 +++++++++++++++--- packages/patrol/pubspec.yaml | 1 + packages/patrol/test/internals_test.dart | 53 +++-- .../dart/dart_contracts_generator.dart | 18 +- 5 files changed, 226 insertions(+), 55 deletions(-) diff --git a/packages/patrol/lib/src/common.dart b/packages/patrol/lib/src/common.dart index fe43203c6..1d417b789 100644 --- a/packages/patrol/lib/src/common.dart +++ b/packages/patrol/lib/src/common.dart @@ -174,7 +174,8 @@ DartGroupEntry createDartTestGroup( }) { final groupDTO = DartGroupEntry( name: name, - type: DartGroupEntry_GroupEntryType.GROUP, + type: GroupEntryType.group, + entries: [], ); for (final entry in parentGroup.entries) { @@ -205,7 +206,7 @@ DartGroupEntry createDartTestGroup( } groupDTO.entries.add( - DartGroupEntry(name: name, type: DartGroupEntry_GroupEntryType.TEST), + DartGroupEntry(name: name, type: GroupEntryType.test, entries: []), ); } else { // This should really never happen, because Group and Test are the only @@ -233,7 +234,7 @@ void printGroupStructure(DartGroupEntry group, {int indentation = 0}) { debugPrint("$indent-- group: '${group.name}'"); for (final entry in group.entries) { - if (entry.type == DartGroupEntry_GroupEntryType.TEST) { + if (entry.type == GroupEntryType.test) { debugPrint("$indent -- test: '${entry.name}'"); } else { for (final subgroup in entry.entries) { diff --git a/packages/patrol/lib/src/native/contracts/contracts.dart b/packages/patrol/lib/src/native/contracts/contracts.dart index 274b92266..4fb52156a 100644 --- a/packages/patrol/lib/src/native/contracts/contracts.dart +++ b/packages/patrol/lib/src/native/contracts/contracts.dart @@ -4,6 +4,7 @@ // // ignore_for_file: public_member_api_docs +import 'package:equatable/equatable.dart'; import 'package:json_annotation/json_annotation.dart'; part 'contracts.g.dart'; @@ -48,7 +49,7 @@ enum SetLocationAccuracyRequestLocationAccuracy { } @JsonSerializable() -class DartGroupEntry { +class DartGroupEntry with EquatableMixin { DartGroupEntry({ required this.name, required this.type, @@ -63,10 +64,17 @@ class DartGroupEntry { final List entries; Map toJson() => _$DartGroupEntryToJson(this); + + @override + List get props => [ + name, + type, + entries, + ]; } @JsonSerializable() -class ListDartTestsResponse { +class ListDartTestsResponse with EquatableMixin { ListDartTestsResponse({ required this.group, }); @@ -77,10 +85,15 @@ class ListDartTestsResponse { final DartGroupEntry group; Map toJson() => _$ListDartTestsResponseToJson(this); + + @override + List get props => [ + group, + ]; } @JsonSerializable() -class RunDartTestRequest { +class RunDartTestRequest with EquatableMixin { RunDartTestRequest({ required this.name, }); @@ -91,10 +104,15 @@ class RunDartTestRequest { final String name; Map toJson() => _$RunDartTestRequestToJson(this); + + @override + List get props => [ + name, + ]; } @JsonSerializable() -class RunDartTestResponse { +class RunDartTestResponse with EquatableMixin { RunDartTestResponse({ required this.result, this.details, @@ -107,10 +125,16 @@ class RunDartTestResponse { final String? details; Map toJson() => _$RunDartTestResponseToJson(this); + + @override + List get props => [ + result, + details, + ]; } @JsonSerializable() -class ConfigureRequest { +class ConfigureRequest with EquatableMixin { ConfigureRequest({ required this.findTimeoutMillis, }); @@ -121,10 +145,15 @@ class ConfigureRequest { final int findTimeoutMillis; Map toJson() => _$ConfigureRequestToJson(this); + + @override + List get props => [ + findTimeoutMillis, + ]; } @JsonSerializable() -class OpenAppRequest { +class OpenAppRequest with EquatableMixin { OpenAppRequest({ required this.appId, }); @@ -135,20 +164,28 @@ class OpenAppRequest { final String appId; Map toJson() => _$OpenAppRequestToJson(this); + + @override + List get props => [ + appId, + ]; } @JsonSerializable() -class OpenQuickSettingsRequest { +class OpenQuickSettingsRequest with EquatableMixin { OpenQuickSettingsRequest(); factory OpenQuickSettingsRequest.fromJson(Map json) => _$OpenQuickSettingsRequestFromJson(json); Map toJson() => _$OpenQuickSettingsRequestToJson(this); + + @override + List get props => const []; } @JsonSerializable() -class Selector { +class Selector with EquatableMixin { Selector({ this.text, this.textStartsWith, @@ -181,10 +218,26 @@ class Selector { final String? pkg; Map toJson() => _$SelectorToJson(this); + + @override + List get props => [ + text, + textStartsWith, + textContains, + className, + contentDescription, + contentDescriptionStartsWith, + contentDescriptionContains, + resourceId, + instance, + enabled, + focused, + pkg, + ]; } @JsonSerializable() -class GetNativeViewsRequest { +class GetNativeViewsRequest with EquatableMixin { GetNativeViewsRequest({ required this.selector, required this.appId, @@ -197,10 +250,16 @@ class GetNativeViewsRequest { final String appId; Map toJson() => _$GetNativeViewsRequestToJson(this); + + @override + List get props => [ + selector, + appId, + ]; } @JsonSerializable() -class NativeView { +class NativeView with EquatableMixin { NativeView({ this.className, this.text, @@ -227,10 +286,23 @@ class NativeView { final List children; Map toJson() => _$NativeViewToJson(this); + + @override + List get props => [ + className, + text, + contentDescription, + focused, + enabled, + childCount, + resourceName, + applicationPackage, + children, + ]; } @JsonSerializable() -class GetNativeViewsResponse { +class GetNativeViewsResponse with EquatableMixin { GetNativeViewsResponse({ required this.nativeViews, }); @@ -241,10 +313,15 @@ class GetNativeViewsResponse { final List nativeViews; Map toJson() => _$GetNativeViewsResponseToJson(this); + + @override + List get props => [ + nativeViews, + ]; } @JsonSerializable() -class TapRequest { +class TapRequest with EquatableMixin { TapRequest({ required this.selector, required this.appId, @@ -257,10 +334,16 @@ class TapRequest { final String appId; Map toJson() => _$TapRequestToJson(this); + + @override + List get props => [ + selector, + appId, + ]; } @JsonSerializable() -class EnterTextRequest { +class EnterTextRequest with EquatableMixin { EnterTextRequest({ required this.data, required this.appId, @@ -279,10 +362,19 @@ class EnterTextRequest { final KeyboardBehavior keyboardBehavior; Map toJson() => _$EnterTextRequestToJson(this); + + @override + List get props => [ + data, + appId, + index, + selector, + keyboardBehavior, + ]; } @JsonSerializable() -class SwipeRequest { +class SwipeRequest with EquatableMixin { SwipeRequest({ required this.startX, required this.startY, @@ -301,10 +393,19 @@ class SwipeRequest { final int steps; Map toJson() => _$SwipeRequestToJson(this); + + @override + List get props => [ + startX, + startY, + endX, + endY, + steps, + ]; } @JsonSerializable() -class WaitUntilVisibleRequest { +class WaitUntilVisibleRequest with EquatableMixin { WaitUntilVisibleRequest({ required this.selector, required this.appId, @@ -317,10 +418,16 @@ class WaitUntilVisibleRequest { final String appId; Map toJson() => _$WaitUntilVisibleRequestToJson(this); + + @override + List get props => [ + selector, + appId, + ]; } @JsonSerializable() -class DarkModeRequest { +class DarkModeRequest with EquatableMixin { DarkModeRequest({ required this.appId, }); @@ -331,10 +438,15 @@ class DarkModeRequest { final String appId; Map toJson() => _$DarkModeRequestToJson(this); + + @override + List get props => [ + appId, + ]; } @JsonSerializable() -class Notification { +class Notification with EquatableMixin { Notification({ this.appName, required this.title, @@ -351,10 +463,18 @@ class Notification { final String raw; Map toJson() => _$NotificationToJson(this); + + @override + List get props => [ + appName, + title, + content, + raw, + ]; } @JsonSerializable() -class GetNotificationsResponse { +class GetNotificationsResponse with EquatableMixin { GetNotificationsResponse({ required this.notifications, }); @@ -365,20 +485,28 @@ class GetNotificationsResponse { final List notifications; Map toJson() => _$GetNotificationsResponseToJson(this); + + @override + List get props => [ + notifications, + ]; } @JsonSerializable() -class GetNotificationsRequest { +class GetNotificationsRequest with EquatableMixin { GetNotificationsRequest(); factory GetNotificationsRequest.fromJson(Map json) => _$GetNotificationsRequestFromJson(json); Map toJson() => _$GetNotificationsRequestToJson(this); + + @override + List get props => const []; } @JsonSerializable() -class TapOnNotificationRequest { +class TapOnNotificationRequest with EquatableMixin { TapOnNotificationRequest({ this.index, this.selector, @@ -391,10 +519,16 @@ class TapOnNotificationRequest { final Selector? selector; Map toJson() => _$TapOnNotificationRequestToJson(this); + + @override + List get props => [ + index, + selector, + ]; } @JsonSerializable() -class PermissionDialogVisibleResponse { +class PermissionDialogVisibleResponse with EquatableMixin { PermissionDialogVisibleResponse({ required this.visible, }); @@ -406,10 +540,15 @@ class PermissionDialogVisibleResponse { Map toJson() => _$PermissionDialogVisibleResponseToJson(this); + + @override + List get props => [ + visible, + ]; } @JsonSerializable() -class PermissionDialogVisibleRequest { +class PermissionDialogVisibleRequest with EquatableMixin { PermissionDialogVisibleRequest({ required this.timeoutMillis, }); @@ -420,10 +559,15 @@ class PermissionDialogVisibleRequest { final int timeoutMillis; Map toJson() => _$PermissionDialogVisibleRequestToJson(this); + + @override + List get props => [ + timeoutMillis, + ]; } @JsonSerializable() -class HandlePermissionRequest { +class HandlePermissionRequest with EquatableMixin { HandlePermissionRequest({ required this.code, }); @@ -434,10 +578,15 @@ class HandlePermissionRequest { final HandlePermissionRequestCode code; Map toJson() => _$HandlePermissionRequestToJson(this); + + @override + List get props => [ + code, + ]; } @JsonSerializable() -class SetLocationAccuracyRequest { +class SetLocationAccuracyRequest with EquatableMixin { SetLocationAccuracyRequest({ required this.locationAccuracy, }); @@ -448,4 +597,9 @@ class SetLocationAccuracyRequest { final SetLocationAccuracyRequestLocationAccuracy locationAccuracy; Map toJson() => _$SetLocationAccuracyRequestToJson(this); + + @override + List get props => [ + locationAccuracy, + ]; } diff --git a/packages/patrol/pubspec.yaml b/packages/patrol/pubspec.yaml index a7c39c866..fe63a7b97 100644 --- a/packages/patrol/pubspec.yaml +++ b/packages/patrol/pubspec.yaml @@ -12,6 +12,7 @@ environment: flutter: '>=3.3.0' dependencies: + equatable: ^2.0.3 fixnum: ^1.0.1 flutter: sdk: flutter diff --git a/packages/patrol/test/internals_test.dart b/packages/patrol/test/internals_test.dart index bf62b8920..da2175cd4 100644 --- a/packages/patrol/test/internals_test.dart +++ b/packages/patrol/test/internals_test.dart @@ -7,8 +7,6 @@ import 'package:test_api/src/backend/group.dart'; import 'package:test_api/src/backend/invoker.dart'; import 'package:test_api/src/backend/metadata.dart'; -typedef GroupEntryType = DartGroupEntry_GroupEntryType; - void main() { group('createDartTestGroup()', () { test('fails if a test is defined at top-level', () { @@ -63,39 +61,36 @@ void main() { equals( DartGroupEntry( name: '', - type: GroupEntryType.GROUP, + type: GroupEntryType.group, entries: [ DartGroupEntry( name: 'example_test', - type: GroupEntryType.GROUP, + type: GroupEntryType.group, entries: [ DartGroupEntry( name: 'alpha', - type: GroupEntryType.GROUP, + type: GroupEntryType.group, entries: [ - DartGroupEntry(name: 'first', type: GroupEntryType.TEST), - DartGroupEntry(name: 'second', type: GroupEntryType.TEST), + _testEntry('first'), + _testEntry('second'), ], ), DartGroupEntry( name: 'bravo', - type: GroupEntryType.GROUP, + type: GroupEntryType.group, entries: [ - DartGroupEntry(name: 'first', type: GroupEntryType.TEST), - DartGroupEntry(name: 'second', type: GroupEntryType.TEST), + _testEntry('first'), + _testEntry('second'), ], ), ], ), DartGroupEntry( name: 'open_app_test', - type: GroupEntryType.GROUP, + type: GroupEntryType.group, entries: [ - DartGroupEntry(name: 'open maps', type: GroupEntryType.TEST), - DartGroupEntry( - name: 'open browser', - type: GroupEntryType.TEST, - ), + _testEntry('open maps'), + _testEntry('open browser'), ], ), ], @@ -135,31 +130,31 @@ void main() { equals( DartGroupEntry( name: '', - type: GroupEntryType.GROUP, + type: GroupEntryType.group, entries: [ DartGroupEntry( name: 'example_test', - type: GroupEntryType.GROUP, + type: GroupEntryType.group, entries: [ - DartGroupEntry(name: 'alpha', type: GroupEntryType.TEST), + _testEntry('alpha'), DartGroupEntry( name: 'bravo', - type: GroupEntryType.GROUP, + type: GroupEntryType.group, entries: [ - DartGroupEntry(name: 'first', type: GroupEntryType.TEST), - DartGroupEntry(name: 'second', type: GroupEntryType.TEST), + _testEntry('first'), + _testEntry('second'), ], ), - DartGroupEntry(name: 'charlie', type: GroupEntryType.TEST), + _testEntry('charlie'), DartGroupEntry( name: 'delta', - type: GroupEntryType.GROUP, + type: GroupEntryType.group, entries: [ - DartGroupEntry(name: 'first', type: GroupEntryType.TEST), - DartGroupEntry(name: 'second', type: GroupEntryType.TEST), + _testEntry('first'), + _testEntry('second'), ], ), - DartGroupEntry(name: 'echo', type: GroupEntryType.TEST), + _testEntry('echo'), ], ), ], @@ -188,3 +183,7 @@ void main() { } LocalTest _localTest(String name) => LocalTest(name, Metadata.empty, () {}); + +DartGroupEntry _testEntry(String name) { + return DartGroupEntry(name: name, type: GroupEntryType.test, entries: []); +} diff --git a/packages/patrol_gen/lib/src/generators/dart/dart_contracts_generator.dart b/packages/patrol_gen/lib/src/generators/dart/dart_contracts_generator.dart index 18da0bb12..a7f2e6119 100644 --- a/packages/patrol_gen/lib/src/generators/dart/dart_contracts_generator.dart +++ b/packages/patrol_gen/lib/src/generators/dart/dart_contracts_generator.dart @@ -24,6 +24,7 @@ class DartContractsGenerator { // // ignore_for_file: public_member_api_docs +import 'package:equatable/equatable.dart'; import 'package:json_annotation/json_annotation.dart'; part '${path.basenameWithoutExtension(config.contractsFilename)}.g.dart'; @@ -52,6 +53,8 @@ enum ${enumDefinition.name} { : 'final ${f.type}${f.isOptional ? '?' : ''} ${f.name};') .join('\n'); + final propsGetter = _createPropsGetter(message); + var constructorParameters = message.fields .map((e) => '${e.isOptional ? '' : 'required'} this.${e.name},') .join(); @@ -61,7 +64,7 @@ enum ${enumDefinition.name} { return ''' @JsonSerializable() -class ${message.name} { +class ${message.name} with EquatableMixin { ${message.name}(${constructorParameters}); factory ${message.name}.fromJson(Map json) => _\$${message.name}FromJson(json); @@ -69,7 +72,20 @@ class ${message.name} { $fieldsContent Map toJson() => _\$${message.name}ToJson(this); + + $propsGetter } +'''; + } + + String _createPropsGetter(Message message) { + final properties = message.fields.map((e) => e.name).join(','); + final propertiesContent = + properties.isEmpty ? 'const []' : '[$properties,]'; + + return ''' + @override + List get props => $propertiesContent; '''; } } From 6212a5a16c2c7a54c2e0a26ee5b114312a83a499 Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Thu, 14 Sep 2023 12:15:26 +0200 Subject: [PATCH 068/110] Fix ios --- .../Classes/AutomatorServer/PatrolServer.swift | 2 +- .../ios/Classes/ObjCPatrolAppServiceClient.swift | 16 ++++++++-------- .../ios/Classes/PatrolIntegrationTestRunner.h | 6 +++--- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/patrol/ios/Classes/AutomatorServer/PatrolServer.swift b/packages/patrol/ios/Classes/AutomatorServer/PatrolServer.swift index 36dec8545..408aa9128 100644 --- a/packages/patrol/ios/Classes/AutomatorServer/PatrolServer.swift +++ b/packages/patrol/ios/Classes/AutomatorServer/PatrolServer.swift @@ -59,7 +59,7 @@ import Foundation try await server.waitUntilListening() let address = await server.listeningAddress - Logger.shared.i("Server started on :\(address)") + Logger.shared.i("Server started on :\(String(describing: address))") #endif } } diff --git a/packages/patrol/ios/Classes/ObjCPatrolAppServiceClient.swift b/packages/patrol/ios/Classes/ObjCPatrolAppServiceClient.swift index f14a4fe52..707bb59a7 100644 --- a/packages/patrol/ios/Classes/ObjCPatrolAppServiceClient.swift +++ b/packages/patrol/ios/Classes/ObjCPatrolAppServiceClient.swift @@ -1,5 +1,5 @@ /// The sole reason for existence of this class is that Swift Protobufs can't be used in Objective-C. -@objc public class RunDartTestResponse2: NSObject { +@objc public class ObjCRunDartTestResponse: NSObject { @objc public dynamic let passed: Bool @objc public dynamic let details: String? @@ -39,7 +39,7 @@ } } - @objc public func runDartTest(name: String) async throws -> RunDartTestResponse2 { + @objc public func runDartTest(name: String) async throws -> ObjCRunDartTestResponse { try await Task.sleep(nanoseconds: UInt64(2 * Double(NSEC_PER_SEC))) NSLog("PatrolAppServiceClient.runDartTest(\(name))") @@ -47,22 +47,22 @@ let request = RunDartTestRequest(name: name) let result = try await client.runDartTest(request: request) - return RunDartTestResponse2( + return ObjCRunDartTestResponse( passed: result.result == .success, details: result.details ) } } -extension Patrol_DartGroupEntry { +extension DartGroupEntry { - func listTestsFlat(parentGroupName: String) -> [Patrol_DartGroupEntry] { - var tests = [Patrol_DartGroupEntry]() + func listTestsFlat(parentGroupName: String) -> [DartGroupEntry] { + var tests = [DartGroupEntry]() for test in self.entries { var test = test - if test.type == Patrol_DartGroupEntry.GroupEntryType.test { + if test.type == GroupEntryType.test { if parentGroupName.isEmpty { // This case is invalid, because every test will have at least // 1 named group - its filename. @@ -72,7 +72,7 @@ extension Patrol_DartGroupEntry { test.name = "\(parentGroupName) \(test.name)" tests.append(test) - } else if test.type == Patrol_DartGroupEntry.GroupEntryType.group { + } else if test.type == GroupEntryType.group { if parentGroupName.isEmpty { tests.append(contentsOf: test.listTestsFlat(parentGroupName: test.name)) } else { diff --git a/packages/patrol/ios/Classes/PatrolIntegrationTestRunner.h b/packages/patrol/ios/Classes/PatrolIntegrationTestRunner.h index b227c08da..3d7fe82c8 100644 --- a/packages/patrol/ios/Classes/PatrolIntegrationTestRunner.h +++ b/packages/patrol/ios/Classes/PatrolIntegrationTestRunner.h @@ -23,7 +23,7 @@ }]; \ \ /* Create a client for PatrolAppService, which lets us list and run Dart tests */ \ - __block ObjCPatrolAppServiceClient *appServiceClient = [[PatrolAppServiceClient alloc] init]; \ + __block ObjCPatrolAppServiceClient *appServiceClient = [[ObjCPatrolAppServiceClient alloc] init]; \ \ /* Allow the Local Network permission required by Dart Observatory */ \ XCUIApplication *springboard = [[XCUIApplication alloc] initWithBundleIdentifier:@"com.apple.springboard"]; \ @@ -73,9 +73,9 @@ IMP implementation = imp_implementationWithBlock(^(id _self) { \ [[[XCUIApplication alloc] init] launch]; \ \ - __block RunDartTestResponse *response = NULL; \ + __block ObjCRunDartTestResponse *response = NULL; \ [appServiceClient runDartTestWithName:dartTest \ - completionHandler:^(RunDartTestResponse *_Nullable r, NSError *_Nullable err) { \ + completionHandler:^(ObjCRunDartTestResponse *_Nullable r, NSError *_Nullable err) { \ if (err != NULL) { \ NSLog(@"runDartTestWithName(%@): failed, err: %@", dartTest, err); \ } \ From 386c199bddf2679f97e58e84e3c14c3bcee892fd Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Thu, 14 Sep 2023 12:45:38 +0200 Subject: [PATCH 069/110] Fix android build errors --- .../pl/leancode/patrol/ContractsExtensions.kt | 14 +- .../pl/leancode/patrol/PatrolJUnitRunner.java | 3 +- .../patrol/contracts/DartGroupEntryKt.kt | 145 ------------------ 3 files changed, 10 insertions(+), 152 deletions(-) delete mode 100644 packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/DartGroupEntryKt.kt diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/ContractsExtensions.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/ContractsExtensions.kt index ca0ba5354..6688b0495 100644 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/ContractsExtensions.kt +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/ContractsExtensions.kt @@ -4,8 +4,8 @@ import androidx.test.uiautomator.By import androidx.test.uiautomator.BySelector import androidx.test.uiautomator.UiSelector import pl.leancode.patrol.contracts.Contracts.DartGroupEntry +import pl.leancode.patrol.contracts.Contracts.GroupEntryType import pl.leancode.patrol.contracts.Contracts.Selector -import pl.leancode.patrol.contracts.copy private fun Selector.isEmpty(): Boolean { return ( @@ -192,15 +192,19 @@ fun Selector.toBySelector(): BySelector { fun DartGroupEntry.listTestsFlat(parentGroupName: String = ""): List { val tests = mutableListOf() - for (test in entriesList) { - if (test.type == DartGroupEntry.GroupEntryType.TEST) { + for (test in entries) { + if (test.type == GroupEntryType.test) { if (parentGroupName.isEmpty()) { // This case is invalid, because every test will have at least 1 named group - its filename. throw IllegalStateException("Invariant violated: test $test has no named parent group") } - tests.add(test.copy { name = "$parentGroupName ${test.name}" }) - } else if (test.type == DartGroupEntry.GroupEntryType.GROUP) { + tests.add(DartGroupEntry( + name = "$parentGroupName ${test.name}", + type = GroupEntryType.test, + entries = listOf() + )) + } else if (test.type == GroupEntryType.group) { if (parentGroupName.isEmpty()) { tests.addAll(test.listTestsFlat(parentGroupName = test.name)) } else { diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolJUnitRunner.java b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolJUnitRunner.java index e6bcedc8c..1109f60bf 100644 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolJUnitRunner.java +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolJUnitRunner.java @@ -12,7 +12,6 @@ import androidx.test.runner.AndroidJUnitRunner; import pl.leancode.patrol.contracts.Contracts; -import pl.leancode.patrol.contracts.Contracts.DartTestGroup; import pl.leancode.patrol.contracts.PatrolAppServiceClientException; import java.util.ArrayList; @@ -121,7 +120,7 @@ public Object[] listDartTests() { Object[] dartTestCaseNames = dartTestCaseNamesList.toArray(); Logger.INSTANCE.i(TAG + "Got Dart tests: " + Arrays.toString(dartTestCaseNames)); return dartTestCaseNames; - } catch (StatusRuntimeException e) { + } catch (PatrolAppServiceClientException e) { Logger.INSTANCE.e(TAG + "Failed to list Dart tests: ", e); throw new RuntimeException(e); } diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/DartGroupEntryKt.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/DartGroupEntryKt.kt deleted file mode 100644 index e3f6f7fab..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/DartGroupEntryKt.kt +++ /dev/null @@ -1,145 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: contracts.proto - -// Generated files should ignore deprecation warnings -@file:Suppress("DEPRECATION") -package pl.leancode.patrol.contracts; - -@kotlin.jvm.JvmName("-initializedartGroupEntry") -public inline fun dartGroupEntry(block: pl.leancode.patrol.contracts.DartGroupEntryKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.DartGroupEntry = - pl.leancode.patrol.contracts.DartGroupEntryKt.Dsl._create(pl.leancode.patrol.contracts.Contracts.DartGroupEntry.newBuilder()).apply { block() }._build() -/** - * Protobuf type `patrol.DartGroupEntry` - */ -public object DartGroupEntryKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - public class Dsl private constructor( - private val _builder: pl.leancode.patrol.contracts.Contracts.DartGroupEntry.Builder - ) { - public companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: pl.leancode.patrol.contracts.Contracts.DartGroupEntry.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): pl.leancode.patrol.contracts.Contracts.DartGroupEntry = _builder.build() - - /** - * `string name = 1;` - */ - public var name: kotlin.String - @JvmName("getName") - get() = _builder.getName() - @JvmName("setName") - set(value) { - _builder.setName(value) - } - /** - * `string name = 1;` - */ - public fun clearName() { - _builder.clearName() - } - - /** - * `.patrol.DartGroupEntry.GroupEntryType type = 3;` - */ - public var type: pl.leancode.patrol.contracts.Contracts.DartGroupEntry.GroupEntryType - @JvmName("getType") - get() = _builder.getType() - @JvmName("setType") - set(value) { - _builder.setType(value) - } - public var typeValue: kotlin.Int - @JvmName("getTypeValue") - get() = _builder.getTypeValue() - @JvmName("setTypeValue") - set(value) { - _builder.setTypeValue(value) - } - /** - * `.patrol.DartGroupEntry.GroupEntryType type = 3;` - */ - public fun clearType() { - _builder.clearType() - } - - /** - * An uninstantiable, behaviorless type to represent the field in - * generics. - */ - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - public class EntriesProxy private constructor() : com.google.protobuf.kotlin.DslProxy() - /** - * `repeated .patrol.DartGroupEntry entries = 4;` - */ - public val entries: com.google.protobuf.kotlin.DslList - @kotlin.jvm.JvmSynthetic - get() = com.google.protobuf.kotlin.DslList( - _builder.getEntriesList() - ) - /** - * `repeated .patrol.DartGroupEntry entries = 4;` - * @param value The entries to add. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("addEntries") - public fun com.google.protobuf.kotlin.DslList.add(value: pl.leancode.patrol.contracts.Contracts.DartGroupEntry) { - _builder.addEntries(value) - } - /** - * `repeated .patrol.DartGroupEntry entries = 4;` - * @param value The entries to add. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("plusAssignEntries") - @Suppress("NOTHING_TO_INLINE") - public inline operator fun com.google.protobuf.kotlin.DslList.plusAssign(value: pl.leancode.patrol.contracts.Contracts.DartGroupEntry) { - add(value) - } - /** - * `repeated .patrol.DartGroupEntry entries = 4;` - * @param values The entries to add. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("addAllEntries") - public fun com.google.protobuf.kotlin.DslList.addAll(values: kotlin.collections.Iterable) { - _builder.addAllEntries(values) - } - /** - * `repeated .patrol.DartGroupEntry entries = 4;` - * @param values The entries to add. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("plusAssignAllEntries") - @Suppress("NOTHING_TO_INLINE") - public inline operator fun com.google.protobuf.kotlin.DslList.plusAssign(values: kotlin.collections.Iterable) { - addAll(values) - } - /** - * `repeated .patrol.DartGroupEntry entries = 4;` - * @param index The index to set the value at. - * @param value The entries to set. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("setEntries") - public operator fun com.google.protobuf.kotlin.DslList.set(index: kotlin.Int, value: pl.leancode.patrol.contracts.Contracts.DartGroupEntry) { - _builder.setEntries(index, value) - } - /** - * `repeated .patrol.DartGroupEntry entries = 4;` - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("clearEntries") - public fun com.google.protobuf.kotlin.DslList.clear() { - _builder.clearEntries() - } - } -} -public inline fun pl.leancode.patrol.contracts.Contracts.DartGroupEntry.copy(block: pl.leancode.patrol.contracts.DartGroupEntryKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.DartGroupEntry = - pl.leancode.patrol.contracts.DartGroupEntryKt.Dsl._create(this.toBuilder()).apply { block() }._build() - From 94694dcdc57b57e8688c161299dcc0e3b7f5fcf8 Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Thu, 14 Sep 2023 13:14:28 +0200 Subject: [PATCH 070/110] Fix tests --- .../pl/leancode/patrol/ContractsExtensions.kt | 14 +- .../patrol/ContractsExtensionsTest.kt | 140 +++++++++--------- 2 files changed, 78 insertions(+), 76 deletions(-) diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/ContractsExtensions.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/ContractsExtensions.kt index 6688b0495..2ac254fa7 100644 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/ContractsExtensions.kt +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/ContractsExtensions.kt @@ -21,7 +21,7 @@ private fun Selector.isEmpty(): Boolean { !hasEnabled() && !hasFocused() && !hasPkg() - ) + ) } fun Selector.toUiSelector(): UiSelector { @@ -199,11 +199,13 @@ fun DartGroupEntry.listTestsFlat(parentGroupName: String = ""): List Unit): DartGroupEntry { - return dartGroupEntry(block).copy { type = DartGroupEntry.GroupEntryType.GROUP } +fun dartTestGroup( + name: String, + entries: List, +): DartGroupEntry { + return DartGroupEntry(name, GroupEntryType.group, entries) } -fun dartTestCase(block: DartGroupEntryKt.Dsl.() -> Unit): DartGroupEntry { - return dartGroupEntry(block).copy { type = DartGroupEntry.GroupEntryType.TEST } +fun dartTestCase(name: String): DartGroupEntry { + return DartGroupEntry(name, GroupEntryType.test, listOf()) } class DartTestGroupExtensionsTest { - @Test fun `listTestsFlat() handles simple hierarchy`() { // given - val dartTestGroup = dartTestGroup { - name = "" - entries += listOf( - dartTestGroup { - name = "example_test" - entries += listOf(dartTestCase { name = "increments counter, exits the app, and comes back" }) - }, - dartTestGroup { - name = "open_app_test" - entries += listOf(dartTestCase { name = "open maps" }) - }, - dartTestGroup { - name = "webview_test" - entries += listOf(dartTestCase { name = "interacts with the LeanCode website in a webview" }) - } + val dartTestGroup = + dartTestGroup( + "", + listOf( + dartTestGroup( + "example_test", + listOf(dartTestCase("increments counter, exits the app, and comes back")), + ), + dartTestGroup( + "open_app_test", + listOf(dartTestCase("open maps")), + ), + dartTestGroup( + "webview_test", + listOf(dartTestCase("interacts with the LeanCode website in a webview")), + ), + ), ) - } // when val dartTests = dartTestGroup.listTestsFlat() @@ -44,9 +45,9 @@ class DartTestGroupExtensionsTest { // then assertContentEquals( listOf( - dartTestCase { name = "example_test increments counter, exits the app, and comes back" }, - dartTestCase { name = "open_app_test open maps" }, - dartTestCase { name = "webview_test interacts with the LeanCode website in a webview" }, + dartTestCase("example_test increments counter, exits the app, and comes back"), + dartTestCase("open_app_test open maps"), + dartTestCase("webview_test interacts with the LeanCode website in a webview"), ), dartTests, ) @@ -55,45 +56,44 @@ class DartTestGroupExtensionsTest { @Test fun `listTestsFlat() handles nested hierarchy`() { // given - val exampleTest = dartTestGroup { - name = "example_test" - entries += listOf( - dartTestCase { name = "the first test" }, - dartTestGroup { - name = "top level group in file" - entries += listOf( - dartTestGroup { - name = "alpha" - entries += listOf( - dartTestCase { name = "first" }, - dartTestCase { name = "second" }, - ) - }, - dartTestCase { name = "test between groups" }, - dartTestGroup { - name = "bravo" - entries += listOf( - dartTestCase { name = "first" }, - dartTestCase { name = "second" }, - ) - }, - ) - } + val exampleTest = + dartTestGroup( + "example_test", + listOf( + dartTestCase("the first test"), + dartTestGroup( + "top level group in file", + listOf( + dartTestGroup( + "alpha", + listOf( + dartTestCase("first"), + dartTestCase("second"), + ), + ), + dartTestCase("test between groups"), + dartTestGroup( + "bravo", + listOf( + dartTestCase("first"), + dartTestCase("second"), + ), + ), + ), + ), + ), ) - } - val openAppTest = dartTestGroup { - name = "open_app_test" - entries += listOf( - dartTestCase { name = "open maps" }, - dartTestCase { name = "open browser" }, + val openAppTest = + dartTestGroup( + "open_app_test", + listOf( + dartTestCase("open maps"), + dartTestCase("open browser"), + ), ) - } - val rootDartTestGroup = dartTestGroup { - name = "" - entries += listOf(exampleTest, openAppTest) - } + val rootDartTestGroup = dartTestGroup("", listOf(exampleTest, openAppTest)) // when val dartTests = rootDartTestGroup.listTestsFlat() @@ -102,15 +102,15 @@ class DartTestGroupExtensionsTest { assertContentEquals( listOf( // example_test - dartTestCase { name = "example_test the first test" }, - dartTestCase { name = "example_test top level group in file alpha first" }, - dartTestCase { name = "example_test top level group in file alpha second" }, - dartTestCase { name = "example_test top level group in file test between groups" }, - dartTestCase { name = "example_test top level group in file bravo first" }, - dartTestCase { name = "example_test top level group in file bravo second" }, + dartTestCase("example_test the first test"), + dartTestCase("example_test top level group in file alpha first"), + dartTestCase("example_test top level group in file alpha second"), + dartTestCase("example_test top level group in file test between groups"), + dartTestCase("example_test top level group in file bravo first"), + dartTestCase("example_test top level group in file bravo second"), // open_app_test - dartTestCase { name = "open_app_test open maps" }, - dartTestCase { name = "open_app_test open browser" }, + dartTestCase("open_app_test open maps"), + dartTestCase("open_app_test open browser"), ), dartTests, ) From ae1f78d81dd5d49352c0d2a487139ba37d1f2f7b Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Thu, 14 Sep 2023 13:26:52 +0200 Subject: [PATCH 071/110] Fix ktlint issues in ContractsExtensions --- .../main/kotlin/pl/leancode/patrol/ContractsExtensions.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/ContractsExtensions.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/ContractsExtensions.kt index 2ac254fa7..b457d0bab 100644 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/ContractsExtensions.kt +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/ContractsExtensions.kt @@ -21,7 +21,7 @@ private fun Selector.isEmpty(): Boolean { !hasEnabled() && !hasFocused() && !hasPkg() - ) + ) } fun Selector.toUiSelector(): UiSelector { @@ -203,8 +203,8 @@ fun DartGroupEntry.listTestsFlat(parentGroupName: String = ""): List Date: Thu, 14 Sep 2023 13:31:37 +0200 Subject: [PATCH 072/110] Fix dart lint issues --- .../lib/src/native/contracts/native_automator_client.dart | 2 +- packages/patrol/lib/src/native/patrol_app_service.dart | 1 + .../lib/src/generators/dart/dart_http_client_generator.dart | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/patrol/lib/src/native/contracts/native_automator_client.dart b/packages/patrol/lib/src/native/contracts/native_automator_client.dart index 0956fe8d8..ae1c10d6a 100644 --- a/packages/patrol/lib/src/native/contracts/native_automator_client.dart +++ b/packages/patrol/lib/src/native/contracts/native_automator_client.dart @@ -31,7 +31,7 @@ class NativeAutomatorClient { }) : _timeout = timeout, _headers = { 'Connection': 'keep-alive', - 'Keep-Alive': 'timeout=${timeout.inSeconds}' + 'Keep-Alive': 'timeout=${timeout.inSeconds}', }; final Duration _timeout; diff --git a/packages/patrol/lib/src/native/patrol_app_service.dart b/packages/patrol/lib/src/native/patrol_app_service.dart index edfef75ab..a4aa6699e 100644 --- a/packages/patrol/lib/src/native/patrol_app_service.dart +++ b/packages/patrol/lib/src/native/patrol_app_service.dart @@ -5,6 +5,7 @@ import 'dart:async'; import 'dart:io'; +import 'package:patrol/src/common.dart'; import 'package:patrol/src/native/contracts/contracts.dart'; import 'package:patrol/src/native/contracts/patrol_app_service_server.dart'; diff --git a/packages/patrol_gen/lib/src/generators/dart/dart_http_client_generator.dart b/packages/patrol_gen/lib/src/generators/dart/dart_http_client_generator.dart index 8606ed668..092cd07d9 100644 --- a/packages/patrol_gen/lib/src/generators/dart/dart_http_client_generator.dart +++ b/packages/patrol_gen/lib/src/generators/dart/dart_http_client_generator.dart @@ -39,7 +39,7 @@ import '${path.basename(config.contractsFilename)}'; final headers = r'''_headers = { 'Connection': 'keep-alive', - 'Keep-Alive': 'timeout=${timeout.inSeconds}' + 'Keep-Alive': 'timeout=${timeout.inSeconds}', }'''; return ''' From 0d0a6eb3ef5ed9451dbd4c793e5b4c47ab147f0a Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Thu, 14 Sep 2023 13:50:05 +0200 Subject: [PATCH 073/110] Remove task.sleep from runDartTest --- packages/patrol/ios/Classes/ObjCPatrolAppServiceClient.swift | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/patrol/ios/Classes/ObjCPatrolAppServiceClient.swift b/packages/patrol/ios/Classes/ObjCPatrolAppServiceClient.swift index 707bb59a7..5735f4b8f 100644 --- a/packages/patrol/ios/Classes/ObjCPatrolAppServiceClient.swift +++ b/packages/patrol/ios/Classes/ObjCPatrolAppServiceClient.swift @@ -40,8 +40,6 @@ } @objc public func runDartTest(name: String) async throws -> ObjCRunDartTestResponse { - try await Task.sleep(nanoseconds: UInt64(2 * Double(NSEC_PER_SEC))) - NSLog("PatrolAppServiceClient.runDartTest(\(name))") let request = RunDartTestRequest(name: name) From 98f1122a32a22c4a7ded1a07370d7c0a71fac2ee Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Thu, 14 Sep 2023 14:12:14 +0200 Subject: [PATCH 074/110] Revert change --- packages/patrol/ios/Classes/ObjCPatrolAppServiceClient.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/patrol/ios/Classes/ObjCPatrolAppServiceClient.swift b/packages/patrol/ios/Classes/ObjCPatrolAppServiceClient.swift index 5735f4b8f..20ff47b97 100644 --- a/packages/patrol/ios/Classes/ObjCPatrolAppServiceClient.swift +++ b/packages/patrol/ios/Classes/ObjCPatrolAppServiceClient.swift @@ -40,6 +40,10 @@ } @objc public func runDartTest(name: String) async throws -> ObjCRunDartTestResponse { + // TODO: simple workaround - patrolAppService starts running too slowly. + // We should wait for appReady or something... + try await Task.sleep(nanoseconds: UInt64(1 * Double(NSEC_PER_SEC))) + NSLog("PatrolAppServiceClient.runDartTest(\(name))") let request = RunDartTestRequest(name: name) From 42a52f5ceefa93fa16209f2add658587b4a862e0 Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Thu, 14 Sep 2023 18:39:19 +0200 Subject: [PATCH 075/110] Fix pr issues --- gen_from_schema | 2 +- packages/patrol/android/build.gradle | 2 +- .../kotlin/pl/leancode/patrol/Automator.kt | 34 ++--- .../pl/leancode/patrol/AutomatorServer.kt | 84 +++++++------ .../patrol/BrowserstackPatrolJUnitRunner.java | 6 +- .../pl/leancode/patrol/ContractsExtensions.kt | 11 +- .../kotlin/pl/leancode/patrol/PatrolServer.kt | 15 ++- .../pl/leancode/patrol/contracts/Contracts.kt | 5 +- .../patrol/ContractsExtensionsTest.kt | 79 ++++++------ .../Classes/AutomatorServer/Contracts.swift | 118 +++++++++--------- .../Classes/ObjCPatrolAppServiceClient.swift | 5 +- .../lib/src/native/contracts/contracts.dart | 4 +- .../lib/src/native/contracts/contracts.g.dart | 2 +- packages/patrol/pubspec.yaml | 2 +- .../ios/ios_contracts_generator.dart | 4 +- schema.dart | 2 +- 16 files changed, 189 insertions(+), 186 deletions(-) diff --git a/gen_from_schema b/gen_from_schema index 0b908ccf6..4185e992b 100755 --- a/gen_from_schema +++ b/gen_from_schema @@ -16,7 +16,7 @@ dart_out="$patrol_package/$patrol_dart_out_dir" android_out="$patrol_package/android/src/main/kotlin/pl/leancode/patrol/contracts" android_package="pl.leancode.patrol.contracts" -dart run packages/patrol_gen/bin/main.dart $schema $dart_out $ios_out $android_out $android_package +dart run packages/patrol_gen/bin/main.dart "$schema" "$dart_out" "$ios_out" "$android_out" "$android_package" cd "${patrol_package}" dart run build_runner build --delete-conflicting-outputs --build-filter="$patrol_dart_out_dir/*.dart" diff --git a/packages/patrol/android/build.gradle b/packages/patrol/android/build.gradle index 07558df63..9aa4b1894 100644 --- a/packages/patrol/android/build.gradle +++ b/packages/patrol/android/build.gradle @@ -65,7 +65,7 @@ android { api "androidx.test.espresso:espresso-core:3.5.0" api "androidx.test.uiautomator:uiautomator:2.2.0" - implementation(platform("org.http4k:http4k-bom:5.7.4.0")) + implementation platform("org.http4k:http4k-bom:5.7.4.0") implementation "org.http4k:http4k-core:5.7.4.0" implementation "org.http4k:http4k-client-apache:5.7.4.0" implementation "org.http4k:http4k-server-netty:5.7.4.0" diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/Automator.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/Automator.kt index 11c2306cc..fc7438a5a 100644 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/Automator.kt +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/Automator.kt @@ -15,11 +15,14 @@ import androidx.test.uiautomator.UiObject import androidx.test.uiautomator.UiObject2 import androidx.test.uiautomator.UiObjectNotFoundException import androidx.test.uiautomator.UiSelector -import pl.leancode.patrol.contracts.Contracts +import pl.leancode.patrol.contracts.Contracts.KeyboardBehavior +import pl.leancode.patrol.contracts.Contracts.NativeView +import pl.leancode.patrol.contracts.Contracts.Notification +import pl.leancode.patrol.contracts.Contracts.Selector import kotlin.math.roundToInt -private fun fromUiObject2(obj: UiObject2): Contracts.NativeView { - return Contracts.NativeView( +private fun fromUiObject2(obj: UiObject2): NativeView { + return NativeView( className = obj.className, text = obj.text, contentDescription = obj.contentDescription, @@ -136,7 +139,7 @@ class Automator private constructor() { fun disableBluetooth(): Unit = throw NotImplementedError("disableBluetooth") - fun getNativeViews(selector: BySelector): List { + fun getNativeViews(selector: BySelector): List { Logger.d("getNativeViews()") val uiObjects2 = uiDevice.findObjects(selector) @@ -174,7 +177,7 @@ class Automator private constructor() { delay() } - fun enterText(text: String, index: Int, keyboardBehavior: Contracts.KeyboardBehavior) { + fun enterText(text: String, index: Int, keyboardBehavior: KeyboardBehavior) { Logger.d("enterText(text: $text, index: $index)") val selector = By.clazz(EditText::class.java) @@ -187,13 +190,13 @@ class Automator private constructor() { val uiSelector = UiSelector().className(EditText::class.java).instance(index) val uiObject = uiDevice.findObject(uiSelector) - if (keyboardBehavior == Contracts.KeyboardBehavior.showAndDismiss) { + if (keyboardBehavior == KeyboardBehavior.showAndDismiss) { uiObject.click() } uiObject.text = text - if (keyboardBehavior == Contracts.KeyboardBehavior.showAndDismiss) { + if (keyboardBehavior == KeyboardBehavior.showAndDismiss) { pressBack() // Hide keyboard. } } @@ -203,7 +206,7 @@ class Automator private constructor() { uiSelector: UiSelector, bySelector: BySelector, index: Int, - keyboardBehavior: Contracts.KeyboardBehavior + keyboardBehavior: KeyboardBehavior ) { Logger.d("enterText($text): $uiSelector, $bySelector") @@ -213,13 +216,13 @@ class Automator private constructor() { val uiObject = uiDevice.findObject(uiSelector).getFromParent(UiSelector().className(EditText::class.java)) - if (keyboardBehavior == Contracts.KeyboardBehavior.showAndDismiss) { + if (keyboardBehavior == KeyboardBehavior.showAndDismiss) { uiObject.click() } uiObject.text = text - if (keyboardBehavior == Contracts.KeyboardBehavior.showAndDismiss) { + if (keyboardBehavior == KeyboardBehavior.showAndDismiss) { pressBack() // Hide keyboard. } } @@ -291,7 +294,7 @@ class Automator private constructor() { delay() } - fun getNotifications(): List { + fun getNotifications(): List { Logger.d("getNotifications()") val notificationContainers = mutableListOf() @@ -313,7 +316,7 @@ class Automator private constructor() { Logger.d("Found ${notificationContainers.size} notifications") - val notifications = mutableListOf() + val notifications = mutableListOf() for (notificationContainer in notificationContainers) { val appName = notificationContainer.findObject(By.res("android:id/app_name_text"))?.text @@ -330,11 +333,10 @@ class Automator private constructor() { Logger.e("Could not find title text") } - val notification = Contracts.Notification( + val notification = Notification( appName = appName, content = content ?: "", - title = title ?: "", - raw = "" // Should it be optional ? + title = title ?: "" ) notifications.add(notification) @@ -347,7 +349,7 @@ class Automator private constructor() { Logger.d("tapOnNotification($index)") try { - val query = Contracts.Selector( + val query = Selector( resourceId = "android:id/status_bar_latest_event_content", instance = index.toLong() ) diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/AutomatorServer.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/AutomatorServer.kt index aaeaa51cc..158c1c5a0 100644 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/AutomatorServer.kt +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/AutomatorServer.kt @@ -1,6 +1,24 @@ package pl.leancode.patrol -import pl.leancode.patrol.contracts.Contracts +import pl.leancode.patrol.contracts.Contracts.ConfigureRequest +import pl.leancode.patrol.contracts.Contracts.DarkModeRequest +import pl.leancode.patrol.contracts.Contracts.EnterTextRequest +import pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest +import pl.leancode.patrol.contracts.Contracts.GetNativeViewsResponse +import pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest +import pl.leancode.patrol.contracts.Contracts.GetNotificationsResponse +import pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest +import pl.leancode.patrol.contracts.Contracts.HandlePermissionRequestCode +import pl.leancode.patrol.contracts.Contracts.OpenAppRequest +import pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest +import pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest +import pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleResponse +import pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest +import pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequestLocationAccuracy +import pl.leancode.patrol.contracts.Contracts.SwipeRequest +import pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest +import pl.leancode.patrol.contracts.Contracts.TapRequest +import pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest import pl.leancode.patrol.contracts.NativeAutomatorServer class AutomatorServer(private val automation: Automator) : NativeAutomatorServer() { @@ -9,7 +27,7 @@ class AutomatorServer(private val automation: Automator) : NativeAutomatorServer automation.initialize() } - override fun configure(request: Contracts.ConfigureRequest) { + override fun configure(request: ConfigureRequest) { automation.configure(waitForSelectorTimeout = request.findTimeoutMillis) } @@ -29,7 +47,7 @@ class AutomatorServer(private val automation: Automator) : NativeAutomatorServer automation.pressDoubleRecentApps() } - override fun openApp(request: Contracts.OpenAppRequest) { + override fun openApp(request: OpenAppRequest) { automation.openApp(request.appId) } @@ -45,15 +63,15 @@ class AutomatorServer(private val automation: Automator) : NativeAutomatorServer // iOS only } - override fun openQuickSettings(request: Contracts.OpenQuickSettingsRequest) { + override fun openQuickSettings(request: OpenQuickSettingsRequest) { automation.openQuickSettings() } - override fun enableDarkMode(request: Contracts.DarkModeRequest) { + override fun enableDarkMode(request: DarkModeRequest) { automation.enableDarkMode() } - override fun disableDarkMode(request: Contracts.DarkModeRequest) { + override fun disableDarkMode(request: DarkModeRequest) { automation.disableDarkMode() } @@ -89,19 +107,19 @@ class AutomatorServer(private val automation: Automator) : NativeAutomatorServer automation.disableBluetooth() } - override fun getNativeViews(request: Contracts.GetNativeViewsRequest): Contracts.GetNativeViewsResponse { + override fun getNativeViews(request: GetNativeViewsRequest): GetNativeViewsResponse { val views = automation.getNativeViews(request.selector.toBySelector()) - return Contracts.GetNativeViewsResponse( + return GetNativeViewsResponse( nativeViews = views ) } - override fun getNotifications(request: Contracts.GetNotificationsRequest): Contracts.GetNotificationsResponse { + override fun getNotifications(request: GetNotificationsRequest): GetNotificationsResponse { val notifs = automation.getNotifications() - return Contracts.GetNotificationsResponse(notifs) + return GetNotificationsResponse(notifs) } - override fun tap(request: Contracts.TapRequest) { + override fun tap(request: TapRequest) { automation.tap( uiSelector = request.selector.toUiSelector(), bySelector = request.selector.toBySelector(), @@ -109,7 +127,7 @@ class AutomatorServer(private val automation: Automator) : NativeAutomatorServer ) } - override fun doubleTap(request: Contracts.TapRequest) { + override fun doubleTap(request: TapRequest) { automation.doubleTap( uiSelector = request.selector.toUiSelector(), bySelector = request.selector.toBySelector(), @@ -117,7 +135,7 @@ class AutomatorServer(private val automation: Automator) : NativeAutomatorServer ) } - override fun enterText(request: Contracts.EnterTextRequest) { + override fun enterText(request: EnterTextRequest) { if (request.index != null) { automation.enterText( text = request.data, @@ -137,7 +155,7 @@ class AutomatorServer(private val automation: Automator) : NativeAutomatorServer } } - override fun swipe(request: Contracts.SwipeRequest) { + override fun swipe(request: SwipeRequest) { automation.swipe( startX = request.startX.toFloat(), startY = request.startY.toFloat(), @@ -147,7 +165,7 @@ class AutomatorServer(private val automation: Automator) : NativeAutomatorServer ) } - override fun waitUntilVisible(request: Contracts.WaitUntilVisibleRequest) { + override fun waitUntilVisible(request: WaitUntilVisibleRequest) { automation.waitUntilVisible( uiSelector = request.selector.toUiSelector(), bySelector = request.selector.toBySelector(), @@ -155,31 +173,23 @@ class AutomatorServer(private val automation: Automator) : NativeAutomatorServer ) } - override fun isPermissionDialogVisible(request: Contracts.PermissionDialogVisibleRequest): Contracts.PermissionDialogVisibleResponse { + override fun isPermissionDialogVisible(request: PermissionDialogVisibleRequest): PermissionDialogVisibleResponse { val visible = automation.isPermissionDialogVisible(timeout = request.timeoutMillis) - return Contracts.PermissionDialogVisibleResponse(visible) + return PermissionDialogVisibleResponse(visible) } - override fun handlePermissionDialog(request: Contracts.HandlePermissionRequest) { + override fun handlePermissionDialog(request: HandlePermissionRequest) { when (request.code) { - Contracts.HandlePermissionRequestCode.whileUsing - -> automation.allowPermissionWhileUsingApp() - - Contracts.HandlePermissionRequestCode.onlyThisTime - -> automation.allowPermissionOnce() - - Contracts.HandlePermissionRequestCode.denied - -> automation.denyPermission() + HandlePermissionRequestCode.whileUsing -> automation.allowPermissionWhileUsingApp() + HandlePermissionRequestCode.onlyThisTime -> automation.allowPermissionOnce() + HandlePermissionRequestCode.denied -> automation.denyPermission() } } - override fun setLocationAccuracy(request: Contracts.SetLocationAccuracyRequest) { + override fun setLocationAccuracy(request: SetLocationAccuracyRequest) { when (request.locationAccuracy) { - Contracts.SetLocationAccuracyRequestLocationAccuracy.coarse - -> automation.selectCoarseLocation() - - Contracts.SetLocationAccuracyRequestLocationAccuracy.fine - -> automation.selectFineLocation() + SetLocationAccuracyRequestLocationAccuracy.coarse -> automation.selectCoarseLocation() + SetLocationAccuracyRequestLocationAccuracy.fine -> automation.selectFineLocation() } } @@ -187,15 +197,11 @@ class AutomatorServer(private val automation: Automator) : NativeAutomatorServer // iOS only } - override fun tapOnNotification(request: Contracts.TapOnNotificationRequest) { + override fun tapOnNotification(request: TapOnNotificationRequest) { if (request.index != null) { - automation.tapOnNotification( - request.index.toInt() - ) + automation.tapOnNotification(request.index.toInt()) } else if (request.selector != null) { - automation.tapOnNotification( - request.selector.toUiSelector() - ) + automation.tapOnNotification(request.selector.toUiSelector()) } else { throw PatrolException("tapOnNotification(): neither index nor selector are set") } diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/BrowserstackPatrolJUnitRunner.java b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/BrowserstackPatrolJUnitRunner.java index ace3d41e0..e799bfcf7 100644 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/BrowserstackPatrolJUnitRunner.java +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/BrowserstackPatrolJUnitRunner.java @@ -18,10 +18,12 @@ public PatrolAppServiceClient createAppServiceClient() { try { client.listDartTests(); - } catch (PatrolAppServiceClientException ex) {//TODO + + //TODO verify in a project where we use Browserstack + } catch (PatrolAppServiceClientException ex) { ex.printStackTrace(); // If the client on localhost:8082 fails, let's apply the wokraround - Logger.INSTANCE.i("StatusRuntimeException in createAppServiceClient " + ex.getMessage()); + Logger.INSTANCE.i("PatrolAppServiceClientException in createAppServiceClient " + ex.getMessage()); Logger.INSTANCE.i("LOOPBACK: " + getLoopback()); client = new PatrolAppServiceClient(getLoopback()); } diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/ContractsExtensions.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/ContractsExtensions.kt index b457d0bab..1f134b800 100644 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/ContractsExtensions.kt +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/ContractsExtensions.kt @@ -95,8 +95,7 @@ fun Selector.toBySelector(): BySelector { var matchedFocused = false var matchedPkg = false - var bySelector = - if (hasText()) { + var bySelector = if (hasText()) { matchedText = true By.text(text) } else if (hasTextStartsWith()) { @@ -199,13 +198,7 @@ fun DartGroupEntry.listTestsFlat(parentGroupName: String = ""): List ObjCRunDartTestResponse { // TODO: simple workaround - patrolAppService starts running too slowly. - // We should wait for appReady or something... + // We should wait for appReady in the dynamically created test case method, + // before calling runDartTest() (in PATROL_INTEGRATION_TEST_IOS_MACRO) try await Task.sleep(nanoseconds: UInt64(1 * Double(NSEC_PER_SEC))) NSLog("PatrolAppServiceClient.runDartTest(\(name))") diff --git a/packages/patrol/lib/src/native/contracts/contracts.dart b/packages/patrol/lib/src/native/contracts/contracts.dart index 4fb52156a..27fb69c01 100644 --- a/packages/patrol/lib/src/native/contracts/contracts.dart +++ b/packages/patrol/lib/src/native/contracts/contracts.dart @@ -451,7 +451,7 @@ class Notification with EquatableMixin { this.appName, required this.title, required this.content, - required this.raw, + this.raw, }); factory Notification.fromJson(Map json) => @@ -460,7 +460,7 @@ class Notification with EquatableMixin { final String? appName; final String title; final String content; - final String raw; + final String? raw; Map toJson() => _$NotificationToJson(this); diff --git a/packages/patrol/lib/src/native/contracts/contracts.g.dart b/packages/patrol/lib/src/native/contracts/contracts.g.dart index 4583a240f..02a6c767f 100644 --- a/packages/patrol/lib/src/native/contracts/contracts.g.dart +++ b/packages/patrol/lib/src/native/contracts/contracts.g.dart @@ -264,7 +264,7 @@ Notification _$NotificationFromJson(Map json) => Notification( appName: json['appName'] as String?, title: json['title'] as String, content: json['content'] as String, - raw: json['raw'] as String, + raw: json['raw'] as String?, ); Map _$NotificationToJson(Notification instance) => diff --git a/packages/patrol/pubspec.yaml b/packages/patrol/pubspec.yaml index fe63a7b97..be844f607 100644 --- a/packages/patrol/pubspec.yaml +++ b/packages/patrol/pubspec.yaml @@ -18,7 +18,7 @@ dependencies: sdk: flutter flutter_test: sdk: flutter - http: ^0.13.5 + http: '>=0.13.5 <2.0.0' integration_test: sdk: flutter json_annotation: ^4.6.0 diff --git a/packages/patrol_gen/lib/src/generators/ios/ios_contracts_generator.dart b/packages/patrol_gen/lib/src/generators/ios/ios_contracts_generator.dart index 4ba9dc91f..aba8537c9 100644 --- a/packages/patrol_gen/lib/src/generators/ios/ios_contracts_generator.dart +++ b/packages/patrol_gen/lib/src/generators/ios/ios_contracts_generator.dart @@ -31,8 +31,8 @@ class IOSContractsGenerator { final fields = message.fields.map((e) { final optional = e.isOptional ? '?' : ''; return e.isList - ? ' var ${e.name}: [${_transformType(e.type)}]$optional' - : ' var ${e.name}: ${_transformType(e.type)}$optional'; + ? ' var ${e.name}: [${_transformType(e.type)}]$optional' + : ' var ${e.name}: ${_transformType(e.type)}$optional'; }).join('\n'); return ''' diff --git a/schema.dart b/schema.dart index 8d01ea07a..efcb1c4aa 100644 --- a/schema.dart +++ b/schema.dart @@ -115,7 +115,7 @@ class Notification { String? appName; late String title; late String content; - late String raw; + String? raw; } class GetNotificationsResponse { From e49cc2248882b7ec1bc29c04a512f5a7696b9002 Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Fri, 15 Sep 2023 11:26:51 +0200 Subject: [PATCH 076/110] Add simple documentation to schema --- packages/patrol_gen/pubspec.yaml | 7 ++++--- schema.dart | 9 +++++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/packages/patrol_gen/pubspec.yaml b/packages/patrol_gen/pubspec.yaml index 860e66d4b..2db8c3db8 100644 --- a/packages/patrol_gen/pubspec.yaml +++ b/packages/patrol_gen/pubspec.yaml @@ -1,7 +1,8 @@ name: patrol_gen description: > Generate contracts for all languages -version: 1.0.0 +version: 0.0.1 +publish_to: none homepage: https://patrol.leancode.co repository: https://github.com/leancodepl/patrol issue_tracker: https://github.com/leancodepl/patrol/issues @@ -10,10 +11,10 @@ environment: sdk: '>=2.18.0 <4.0.0' dependencies: - meta: ^1.7.0 - path: ^1.8.2 analyzer: ^6.1.0 dart_style: ^2.3.2 + meta: ^1.7.0 + path: ^1.8.2 dev_dependencies: leancode_lint: ^3.0.0 diff --git a/schema.dart b/schema.dart index efcb1c4aa..d117a8707 100644 --- a/schema.dart +++ b/schema.dart @@ -1,3 +1,12 @@ +/// Schema supports: +// - enum definition +// - late type name - required field definition +// - type? name - optional field definition +// - abstract class - service definition where we define: +// - ResponseModel endpointName(RequestModel) - endpoint definition (void = no response) +// - Generic types (IOSServer, IOSClient, AndroidServer, AndroidClient, DartServer, DartClient) +// control where we need clients and servers + class DartGroupEntry { late String name; late GroupEntryType type; From 13fc1f5d6a303e51962e4064e5d2dffc774ec026 Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Fri, 15 Sep 2023 11:27:25 +0200 Subject: [PATCH 077/110] Add analysis_options to patrol_gen --- packages/patrol_gen/LICENSE | 201 ++++++++++++++++++ packages/patrol_gen/analysis_options.yaml | 9 + .../android/android_contracts_generator.dart | 21 +- .../generators/android/android_generator.dart | 2 +- .../android_http4k_client_generator.dart | 11 +- .../android_http4k_server_generator.dart | 8 +- .../lib/src/generators/dart/dart_config.dart | 2 +- .../dart/dart_contracts_generator.dart | 24 ++- .../src/generators/dart/dart_generator.dart | 2 +- .../dart/dart_http_client_generator.dart | 18 +- .../dart/dart_shelf_server_generator.dart | 7 +- .../ios/ios_contracts_generator.dart | 10 +- .../lib/src/generators/ios/ios_generator.dart | 2 +- .../ios/ios_url_session_client_generator.dart | 12 +- packages/patrol_gen/lib/src/patrol_gen.dart | 8 +- .../patrol_gen/lib/src/resolve_schema.dart | 85 +++++--- packages/patrol_gen/lib/src/schema.dart | 12 +- packages/patrol_gen/lib/src/utils.dart | 2 +- 18 files changed, 345 insertions(+), 91 deletions(-) create mode 100644 packages/patrol_gen/LICENSE create mode 100644 packages/patrol_gen/analysis_options.yaml diff --git a/packages/patrol_gen/LICENSE b/packages/patrol_gen/LICENSE new file mode 100644 index 000000000..7a6914410 --- /dev/null +++ b/packages/patrol_gen/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2021 LeanCode Sp. z o.o. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/packages/patrol_gen/analysis_options.yaml b/packages/patrol_gen/analysis_options.yaml new file mode 100644 index 000000000..2bdc49a2f --- /dev/null +++ b/packages/patrol_gen/analysis_options.yaml @@ -0,0 +1,9 @@ +include: package:leancode_lint/analysis_options_package.yaml + +linter: + rules: + public_member_api_docs: false + +analyzer: + exclude: + - lib/**/*.g.dart diff --git a/packages/patrol_gen/lib/src/generators/android/android_contracts_generator.dart b/packages/patrol_gen/lib/src/generators/android/android_contracts_generator.dart index eee3f5ba3..d18a113a0 100644 --- a/packages/patrol_gen/lib/src/generators/android/android_contracts_generator.dart +++ b/packages/patrol_gen/lib/src/generators/android/android_contracts_generator.dart @@ -5,12 +5,18 @@ import 'package:patrol_gen/src/utils.dart'; class AndroidContractsGenerator { OutputFile generate(Schema schema, AndroidConfig config) { - final buffer = StringBuffer()..write(_contentPrefix(config)); + final buffer = StringBuffer() + ..write(_contentPrefix(config)) + ..writeln('class Contracts {'); - buffer.writeln("class Contracts {"); - schema.enums.forEach((e) => buffer.writeln(_createEnum(e))); - schema.messages.forEach((e) => buffer.writeln(_createMessage(e))); - buffer.writeln("}"); + for (final enumDefinition in schema.enums) { + buffer.writeln(_createEnum(enumDefinition)); + } + for (final messageDefintion in schema.messages) { + buffer.writeln(_createMessage(messageDefintion)); + } + + buffer.writeln('}'); return OutputFile( filename: config.contractsFilename, @@ -46,7 +52,8 @@ import kotlinx.serialization.Serializable var optionalFieldUtils = optionalFields.map(_optionalFieldUtil).join('\n'); if (optionalFields.isNotEmpty) { - optionalFieldUtils = '''{ + optionalFieldUtils = ''' +{ $optionalFieldUtils }'''; } @@ -67,7 +74,7 @@ $fields } String _createEnum(Enum enumDefinition) { - final cases = enumDefinition.fields.map((e) => ' ${e},').join('\n'); + final cases = enumDefinition.fields.map((e) => ' $e,').join('\n'); return ''' @Serializable diff --git a/packages/patrol_gen/lib/src/generators/android/android_generator.dart b/packages/patrol_gen/lib/src/generators/android/android_generator.dart index 0928fec57..9a9a25f74 100644 --- a/packages/patrol_gen/lib/src/generators/android/android_generator.dart +++ b/packages/patrol_gen/lib/src/generators/android/android_generator.dart @@ -14,7 +14,7 @@ class AndroidGenerator { final serverGenerator = AndroidHttp4kServerGenerator(); final clientGenerator = AndroidHttp4kClientGenerator(); - for (var service in schema.services) { + for (final service in schema.services) { if (service.android.needsServer) { result.add(serverGenerator.generate(service, config)); } diff --git a/packages/patrol_gen/lib/src/generators/android/android_http4k_client_generator.dart b/packages/patrol_gen/lib/src/generators/android/android_http4k_client_generator.dart index 0bf666f0f..0773c0daa 100644 --- a/packages/patrol_gen/lib/src/generators/android/android_http4k_client_generator.dart +++ b/packages/patrol_gen/lib/src/generators/android/android_http4k_client_generator.dart @@ -4,9 +4,8 @@ import 'package:patrol_gen/src/schema.dart'; class AndroidHttp4kClientGenerator { OutputFile generate(Service service, AndroidConfig config) { - final buffer = StringBuffer()..write(_contentPrefix(config)); - - buffer + final buffer = StringBuffer() + ..write(_contentPrefix(config)) ..writeln(_generateClientClass(service)) ..writeln() ..writeln(_generateExceptionClass(service)); @@ -40,12 +39,12 @@ import org.http4k.core.Status } String _generateClientClass(Service service) { - final url = r'"http://$address:$port/"'; + const url = r'"http://$address:$port/"'; final endpoints = service.endpoints.map(_createEndpoint).join('\n\n'); - final throwException = + const throwException = r'throw PatrolAppServiceClientException("Invalid response ${response.status}, ${response.bodyString()}")'; - final urlWithPath = r'"$serverUrl$path"'; + const urlWithPath = r'"$serverUrl$path"'; return ''' class ${service.name}Client(private val address: String, private val port: Int, private val timeout: Timeout) { diff --git a/packages/patrol_gen/lib/src/generators/android/android_http4k_server_generator.dart b/packages/patrol_gen/lib/src/generators/android/android_http4k_server_generator.dart index f320ac8fc..20277c235 100644 --- a/packages/patrol_gen/lib/src/generators/android/android_http4k_server_generator.dart +++ b/packages/patrol_gen/lib/src/generators/android/android_http4k_server_generator.dart @@ -4,9 +4,9 @@ import 'package:patrol_gen/src/schema.dart'; class AndroidHttp4kServerGenerator { OutputFile generate(Service service, AndroidConfig config) { - final buffer = StringBuffer()..write(_contentPrefix(config)); - - buffer.writeln(_createServerClass(service)); + final buffer = StringBuffer() + ..write(_contentPrefix(config)) + ..writeln(_createServerClass(service)); return OutputFile( filename: config.serverFileName(service.name), @@ -68,7 +68,7 @@ $routes return ''' "${e.name}" bind POST to {$requestDeserialization $responseVariable${e.name}($requestArg) - Response(OK)${responseSerialization} + Response(OK)$responseSerialization }'''; }).join(',\n'); } diff --git a/packages/patrol_gen/lib/src/generators/dart/dart_config.dart b/packages/patrol_gen/lib/src/generators/dart/dart_config.dart index ee9c3d0ed..5720e2143 100644 --- a/packages/patrol_gen/lib/src/generators/dart/dart_config.dart +++ b/packages/patrol_gen/lib/src/generators/dart/dart_config.dart @@ -15,7 +15,7 @@ class DartConfig { path.join(outputDirectory, '${_fileName(serviceName)}_client.dart'); String _fileName(String pascalCaseName) { - final beforeCapitalLetter = RegExp(r"(?=[A-Z])"); + final beforeCapitalLetter = RegExp('(?=[A-Z])'); final parts = pascalCaseName.split(beforeCapitalLetter); return parts.map((e) => e.toLowerCase()).join('_'); diff --git a/packages/patrol_gen/lib/src/generators/dart/dart_contracts_generator.dart b/packages/patrol_gen/lib/src/generators/dart/dart_contracts_generator.dart index a7f2e6119..7a467ea6b 100644 --- a/packages/patrol_gen/lib/src/generators/dart/dart_contracts_generator.dart +++ b/packages/patrol_gen/lib/src/generators/dart/dart_contracts_generator.dart @@ -1,6 +1,6 @@ import 'package:dart_style/dart_style.dart'; -import 'package:patrol_gen/src/generators/dart/dart_config.dart'; import 'package:path/path.dart' as path; +import 'package:patrol_gen/src/generators/dart/dart_config.dart'; import 'package:patrol_gen/src/generators/output_file.dart'; import 'package:patrol_gen/src/schema.dart'; @@ -8,8 +8,12 @@ class DartContractsGenerator { OutputFile generate(Schema schema, DartConfig config) { final buffer = StringBuffer()..write(_contentPrefix(config)); - schema.enums.forEach((e) => buffer.writeln(_createEnum(e))); - schema.messages.forEach((e) => buffer.writeln(_createMessage(e))); + for (final enumDefinition in schema.enums) { + buffer.writeln(_createEnum(enumDefinition)); + } + for (final messageDefintion in schema.messages) { + buffer.writeln(_createMessage(messageDefintion)); + } final content = DartFormatter().format(buffer.toString()); @@ -35,8 +39,8 @@ part '${path.basenameWithoutExtension(config.contractsFilename)}.g.dart'; String _createEnum(Enum enumDefinition) { final fieldsContent = enumDefinition.fields.map((e) { return ''' -@JsonValue('${e}') -${e}'''; +@JsonValue('$e') +$e'''; }).join(',\n'); return ''' @@ -48,9 +52,11 @@ enum ${enumDefinition.name} { String? _createMessage(Message message) { final fieldsContent = message.fields - .map((f) => f.isList - ? 'final List<${f.type}>${f.isOptional ? '?' : ''} ${f.name};' - : 'final ${f.type}${f.isOptional ? '?' : ''} ${f.name};') + .map( + (f) => f.isList + ? 'final List<${f.type}>${f.isOptional ? '?' : ''} ${f.name};' + : 'final ${f.type}${f.isOptional ? '?' : ''} ${f.name};', + ) .join('\n'); final propsGetter = _createPropsGetter(message); @@ -65,7 +71,7 @@ enum ${enumDefinition.name} { return ''' @JsonSerializable() class ${message.name} with EquatableMixin { - ${message.name}(${constructorParameters}); + ${message.name}($constructorParameters); factory ${message.name}.fromJson(Map json) => _\$${message.name}FromJson(json); diff --git a/packages/patrol_gen/lib/src/generators/dart/dart_generator.dart b/packages/patrol_gen/lib/src/generators/dart/dart_generator.dart index f9ad3e6af..ce48c3926 100644 --- a/packages/patrol_gen/lib/src/generators/dart/dart_generator.dart +++ b/packages/patrol_gen/lib/src/generators/dart/dart_generator.dart @@ -14,7 +14,7 @@ class DartGenerator { final serverGenerator = DartShelfServerGenerator(); final clientGenerator = DartHttpClientGenerator(); - for (var service in schema.services) { + for (final service in schema.services) { if (service.dart.needsServer) { result.add(serverGenerator.generate(service, config)); } diff --git a/packages/patrol_gen/lib/src/generators/dart/dart_http_client_generator.dart b/packages/patrol_gen/lib/src/generators/dart/dart_http_client_generator.dart index 092cd07d9..5e7f9fdf2 100644 --- a/packages/patrol_gen/lib/src/generators/dart/dart_http_client_generator.dart +++ b/packages/patrol_gen/lib/src/generators/dart/dart_http_client_generator.dart @@ -1,8 +1,8 @@ import 'package:dart_style/dart_style.dart'; +import 'package:path/path.dart' as path; import 'package:patrol_gen/src/generators/dart/dart_config.dart'; import 'package:patrol_gen/src/generators/output_file.dart'; import 'package:patrol_gen/src/schema.dart'; -import 'package:path/path.dart' as path; class DartHttpClientGenerator { OutputFile generate(Service service, DartConfig config) { @@ -37,10 +37,11 @@ import '${path.basename(config.contractsFilename)}'; String _generateClientClass(Service service) { final endpoints = service.endpoints.map(_createEndpoint).join('\n\n'); - final headers = r'''_headers = { - 'Connection': 'keep-alive', - 'Keep-Alive': 'timeout=${timeout.inSeconds}', - }'''; + const headers = r''' +_headers = { + 'Connection': 'keep-alive', + 'Keep-Alive': 'timeout=${timeout.inSeconds}', +}'''; return ''' class ${service.name}Client { @@ -86,11 +87,11 @@ $endpoints final sendRequest = endpoint.response != null ? ''' -final json = await _sendRequest('${endpoint.name}', ${jsonRequest}); +final json = await _sendRequest('${endpoint.name}', $jsonRequest); return ${endpoint.response!.name}.fromJson(json); ''' : ''' -return _sendRequest('${endpoint.name}', ${jsonRequest});'''; +return _sendRequest('${endpoint.name}', $jsonRequest);'''; return ''' Future<$returnType> ${endpoint.name}($parameter) $asyncKeyword { @@ -100,7 +101,8 @@ Future<$returnType> ${endpoint.name}($parameter) $asyncKeyword { } String _generateExceptionClass(Service service) { - final toStringMethod = r'''@override + const toStringMethod = r''' +@override String toString() { return 'Invalid response: $statusCode $responseBody'; }'''; diff --git a/packages/patrol_gen/lib/src/generators/dart/dart_shelf_server_generator.dart b/packages/patrol_gen/lib/src/generators/dart/dart_shelf_server_generator.dart index 721e4179f..a4a06da53 100644 --- a/packages/patrol_gen/lib/src/generators/dart/dart_shelf_server_generator.dart +++ b/packages/patrol_gen/lib/src/generators/dart/dart_shelf_server_generator.dart @@ -1,8 +1,8 @@ import 'package:dart_style/dart_style.dart'; +import 'package:path/path.dart' as path; import 'package:patrol_gen/src/generators/dart/dart_config.dart'; import 'package:patrol_gen/src/generators/output_file.dart'; import 'package:patrol_gen/src/schema.dart'; -import 'package:path/path.dart' as path; class DartShelfServerGenerator { OutputFile generate(Service service, DartConfig config) { @@ -84,7 +84,10 @@ $responseSerialization } String _createServerClass( - Service service, String handlerCalls, String handlers) { + Service service, + String handlerCalls, + String handlers, + ) { var notFoundRespone = r"return Response.notFound('Request ${request.url} not found');"; if (service.endpoints.isNotEmpty) { diff --git a/packages/patrol_gen/lib/src/generators/ios/ios_contracts_generator.dart b/packages/patrol_gen/lib/src/generators/ios/ios_contracts_generator.dart index aba8537c9..d6288532d 100644 --- a/packages/patrol_gen/lib/src/generators/ios/ios_contracts_generator.dart +++ b/packages/patrol_gen/lib/src/generators/ios/ios_contracts_generator.dart @@ -6,8 +6,12 @@ class IOSContractsGenerator { OutputFile generate(Schema schema, IOSConfig config) { final buffer = StringBuffer()..write(_contentPrefix(config)); - schema.enums.forEach((e) => buffer.writeln(_createEnum(e))); - schema.messages.forEach((e) => buffer.writeln(_createMessage(e))); + for (final enumDefinition in schema.enums) { + buffer.writeln(_createEnum(enumDefinition)); + } + for (final messageDefintion in schema.messages) { + buffer.writeln(_createMessage(messageDefintion)); + } return OutputFile( filename: config.contractsFilename, @@ -43,7 +47,7 @@ $fields } String _createEnum(Enum enumDefinition) { - final cases = enumDefinition.fields.map((e) => ' case ${e}').join('\n'); + final cases = enumDefinition.fields.map((e) => ' case $e').join('\n'); return ''' enum ${enumDefinition.name}: String, Codable { diff --git a/packages/patrol_gen/lib/src/generators/ios/ios_generator.dart b/packages/patrol_gen/lib/src/generators/ios/ios_generator.dart index ccf43e67b..3722540d5 100644 --- a/packages/patrol_gen/lib/src/generators/ios/ios_generator.dart +++ b/packages/patrol_gen/lib/src/generators/ios/ios_generator.dart @@ -14,7 +14,7 @@ class IOSGenerator { final serverGenerator = IOSFlyingFoxServerGenerator(); final clientGenerator = IOSURLSessionClientGenerator(); - for (var service in schema.services) { + for (final service in schema.services) { if (service.ios.needsServer) { result.add(serverGenerator.generate(service, config)); } diff --git a/packages/patrol_gen/lib/src/generators/ios/ios_url_session_client_generator.dart b/packages/patrol_gen/lib/src/generators/ios/ios_url_session_client_generator.dart index 6327e36e0..7d0c8cabb 100644 --- a/packages/patrol_gen/lib/src/generators/ios/ios_url_session_client_generator.dart +++ b/packages/patrol_gen/lib/src/generators/ios/ios_url_session_client_generator.dart @@ -4,9 +4,9 @@ import 'package:patrol_gen/src/schema.dart'; class IOSURLSessionClientGenerator { OutputFile generate(Service service, IOSConfig config) { - final buffer = StringBuffer()..write(_contentPrefix(config)); - - buffer.write(_createClass(service)); + final buffer = StringBuffer() + ..write(_contentPrefix(config)) + ..write(_createClass(service)); return OutputFile( filename: config.clientFileName(service.name), @@ -29,9 +29,9 @@ class IOSURLSessionClientGenerator { String _createClass(Service service) { final endpoints = service.endpoints.map(_createEndpoint).join('\n\n'); - final url = r'http://\(address):\(port)/\(requestName)'; + const url = r'http://\(address):\(port)/\(requestName)'; - final throwException = + const throwException = r'throw PatrolError.internal("Invalid response: \(response) \(data)")'; return ''' @@ -85,7 +85,7 @@ $endpoints return ''' func ${endpoint.name}($parameterDef) async throws $returnDef {$bodyCode - return try await performRequest(requestName: "${endpoint.name}"${bodyArgument}) + return try await performRequest(requestName: "${endpoint.name}"$bodyArgument) }'''; } } diff --git a/packages/patrol_gen/lib/src/patrol_gen.dart b/packages/patrol_gen/lib/src/patrol_gen.dart index 744832003..27b1b9295 100644 --- a/packages/patrol_gen/lib/src/patrol_gen.dart +++ b/packages/patrol_gen/lib/src/patrol_gen.dart @@ -1,3 +1,5 @@ +import 'dart:io'; + import 'package:patrol_gen/src/generators/android/android_config.dart'; import 'package:patrol_gen/src/generators/android/android_generator.dart'; import 'package:patrol_gen/src/generators/dart/dart_config.dart'; @@ -5,7 +7,6 @@ import 'package:patrol_gen/src/generators/dart/dart_generator.dart'; import 'package:patrol_gen/src/generators/ios/ios_config.dart'; import 'package:patrol_gen/src/generators/ios/ios_generator.dart'; import 'package:patrol_gen/src/resolve_schema.dart'; -import 'dart:io'; class PatrolGenConfig { const PatrolGenConfig({ @@ -25,12 +26,11 @@ class PatrolGen { Future run(PatrolGenConfig config) async { final schema = await resolveSchema(config.schemaFilename); - final files = DartGenerator().generate(schema, config.dartConfig); - files + final files = DartGenerator().generate(schema, config.dartConfig) ..addAll(IOSGenerator().generate(schema, config.iosConfig)) ..addAll(AndroidGenerator().generate(schema, config.androidConfig)); - for (var outputFile in files) { + for (final outputFile in files) { await File(outputFile.filename) .writeAsString(outputFile.content, flush: true); } diff --git a/packages/patrol_gen/lib/src/resolve_schema.dart b/packages/patrol_gen/lib/src/resolve_schema.dart index 0fa1302bf..ad1b515c0 100644 --- a/packages/patrol_gen/lib/src/resolve_schema.dart +++ b/packages/patrol_gen/lib/src/resolve_schema.dart @@ -13,10 +13,14 @@ Future resolveSchema(String schemaPath) async { final classServices = []; if (result is ResolvedUnitResult) { - for (var declaration in result.unit.declarations) { + for (final declaration in result.unit.declarations) { if (declaration is EnumDeclaration) { - enums.add(Enum(declaration.name.lexeme, - declaration.constants.map((e) => e.name.lexeme).toList())); + enums.add( + Enum( + declaration.name.lexeme, + declaration.constants.map((e) => e.name.lexeme).toList(), + ), + ); } else if (declaration is ClassDeclaration) { if (declaration.abstractKeyword != null) { classServices.add(declaration); @@ -27,8 +31,11 @@ Future resolveSchema(String schemaPath) async { } } - return Schema(enums, messages, - classServices.map((e) => _createService(e, messages)).toList()); + return Schema( + enums, + messages, + classServices.map((e) => _createService(e, messages)).toList(), + ); } Service _createService(ClassDeclaration declaration, List messages) { @@ -38,18 +45,18 @@ Service _createService(ClassDeclaration declaration, List messages) { {}; final iosGenConfig = ServiceGenConfig( - genericTypes.contains('IOSClient'), - genericTypes.contains('IOSServer'), + needsClient: genericTypes.contains('IOSClient'), + needsServer: genericTypes.contains('IOSServer'), ); final dartGenConfig = ServiceGenConfig( - genericTypes.contains('DartClient'), - genericTypes.contains('DartServer'), + needsClient: genericTypes.contains('DartClient'), + needsServer: genericTypes.contains('DartServer'), ); final androidGenConfig = ServiceGenConfig( - genericTypes.contains('AndroidClient'), - genericTypes.contains('AndroidServer'), + needsClient: genericTypes.contains('AndroidClient'), + needsServer: genericTypes.contains('AndroidServer'), ); return Service( @@ -69,18 +76,18 @@ Service _createService(ClassDeclaration declaration, List messages) { final parameter = method.parameters!.parameters.first; if (parameter is SimpleFormalParameter) { final parameterTypeName = - (parameter.type as NamedType).name2.lexeme; + (parameter.type! as NamedType).name2.lexeme; requestMessage = messages.firstWhere((msg) => msg.name == parameterTypeName); } else { - throw 'unsupported parameter $parameter'; + throw UnsupportedError('unsupported parameter $parameter'); } } return Endpoint(responseMessage, requestMessage, method.name.lexeme); } else { - throw 'unsupported return type $returnType'; + throw UnsupportedError('unsupported return type $returnType'); } }).toList(), ); @@ -88,28 +95,36 @@ Service _createService(ClassDeclaration declaration, List messages) { Message _createMessage(ClassDeclaration declaration) { return Message( - declaration.name.lexeme, - declaration.members - .whereType() - .map((e) => e.fields) - .whereType() - .map((e) { - final type = e.type; - if (type is NamedType) { - final isOptional = type.question != null; - final fieldName = e.variables.first.name.lexeme; + declaration.name.lexeme, + declaration.members + .whereType() + .map((e) => e.fields) + .whereType() + .map((e) { + final type = e.type; + if (type is NamedType) { + final isOptional = type.question != null; + final fieldName = e.variables.first.name.lexeme; - if (type.type?.isDartCoreList ?? false) { - final genericType = - type.typeArguments!.arguments.first as NamedType; - return MessageField( - isOptional, fieldName, genericType.name2.lexeme, true); - } else { - return MessageField( - isOptional, fieldName, type.name2.lexeme, false); - } + if (type.type?.isDartCoreList ?? false) { + final genericType = type.typeArguments!.arguments.first as NamedType; + return MessageField( + isOptional: isOptional, + name: fieldName, + type: genericType.name2.lexeme, + isList: true, + ); } else { - throw 'unsupported type $type'; + return MessageField( + isOptional: isOptional, + name: fieldName, + type: type.name2.lexeme, + isList: false, + ); } - }).toList()); + } else { + throw UnsupportedError('unsupported type $type'); + } + }).toList(), + ); } diff --git a/packages/patrol_gen/lib/src/schema.dart b/packages/patrol_gen/lib/src/schema.dart index 71dd0d793..7d40d3179 100644 --- a/packages/patrol_gen/lib/src/schema.dart +++ b/packages/patrol_gen/lib/src/schema.dart @@ -6,7 +6,12 @@ class Enum { } class MessageField { - const MessageField(this.isOptional, this.name, this.type, this.isList); + const MessageField({ + required this.name, + required this.type, + required this.isOptional, + required this.isList, + }); final bool isOptional; final bool isList; @@ -30,7 +35,10 @@ class Endpoint { } class ServiceGenConfig { - const ServiceGenConfig(this.needsClient, this.needsServer); + const ServiceGenConfig({ + required this.needsClient, + required this.needsServer, + }); final bool needsClient; final bool needsServer; diff --git a/packages/patrol_gen/lib/src/utils.dart b/packages/patrol_gen/lib/src/utils.dart index f010b1a17..606ce3065 100644 --- a/packages/patrol_gen/lib/src/utils.dart +++ b/packages/patrol_gen/lib/src/utils.dart @@ -4,6 +4,6 @@ String normalizePath(String path) => p.normalize(p.absolute(path)); extension StringExtension on String { String capitalize() { - return "${this[0].toUpperCase()}${this.substring(1)}"; + return '${this[0].toUpperCase()}${substring(1)}'; } } From 4bc2ac9b4c306faf7567f3bde6d4d6574bc2d450 Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Fri, 15 Sep 2023 11:44:01 +0200 Subject: [PATCH 078/110] Add patrol_gen-prepare --- .github/workflows/patrol_gen-prepare.yaml | 42 +++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/patrol_gen-prepare.yaml diff --git a/.github/workflows/patrol_gen-prepare.yaml b/.github/workflows/patrol_gen-prepare.yaml new file mode 100644 index 000000000..bed5f2058 --- /dev/null +++ b/.github/workflows/patrol_gen-prepare.yaml @@ -0,0 +1,42 @@ +name: patrol_gen prepare + +on: + workflow_dispatch: + pull_request: + branches: [master] + paths: + - 'packages/patrol_gen/**' + +jobs: + prepare: + name: Flutter ${{ matrix.flutter-version }} + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + sdk: ['2.18.0', stable] + + defaults: + run: + working-directory: packages/patrol_gen + + steps: + - name: Clone repository + uses: actions/checkout@v3 + + - name: Set up Dart + uses: dart-lang/setup-dart@v1 + with: + sdk: ${{ matrix.sdk }} + + - name: dart pub get + run: dart pub get + + - name: dart analyze + if: success() || failure() + run: dart analyze + + - name: dart format + if: success() || failure() + run: dart format --set-exit-if-changed . From e3934e44cd1bb24f9dc633af28bb22e0136de299 Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Fri, 15 Sep 2023 11:52:27 +0200 Subject: [PATCH 079/110] Fix prepare --- .github/workflows/patrol_gen-prepare.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/patrol_gen-prepare.yaml b/.github/workflows/patrol_gen-prepare.yaml index bed5f2058..e088edfb6 100644 --- a/.github/workflows/patrol_gen-prepare.yaml +++ b/.github/workflows/patrol_gen-prepare.yaml @@ -3,7 +3,6 @@ name: patrol_gen prepare on: workflow_dispatch: pull_request: - branches: [master] paths: - 'packages/patrol_gen/**' From 937da39214e8bb3317aaf33ce59d18bf3a213c30 Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Fri, 15 Sep 2023 12:01:48 +0200 Subject: [PATCH 080/110] Fix swift-format --- packages/patrol/ios/Classes/ObjCPatrolAppServiceClient.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/patrol/ios/Classes/ObjCPatrolAppServiceClient.swift b/packages/patrol/ios/Classes/ObjCPatrolAppServiceClient.swift index 6b3c9e44c..d7626cadb 100644 --- a/packages/patrol/ios/Classes/ObjCPatrolAppServiceClient.swift +++ b/packages/patrol/ios/Classes/ObjCPatrolAppServiceClient.swift @@ -40,8 +40,8 @@ } @objc public func runDartTest(name: String) async throws -> ObjCRunDartTestResponse { - // TODO: simple workaround - patrolAppService starts running too slowly. - // We should wait for appReady in the dynamically created test case method, + // TODO: simple workaround - patrolAppService starts running too slowly. + // We should wait for appReady in the dynamically created test case method, // before calling runDartTest() (in PATROL_INTEGRATION_TEST_IOS_MACRO) try await Task.sleep(nanoseconds: UInt64(1 * Double(NSEC_PER_SEC))) From 2d82c88699b7270553c98cb1edf292d93beb212a Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Fri, 15 Sep 2023 12:06:02 +0200 Subject: [PATCH 081/110] Apply ktlint format to ContractsExtensions.kt --- .../main/kotlin/pl/leancode/patrol/ContractsExtensions.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/ContractsExtensions.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/ContractsExtensions.kt index 1f134b800..a5e3ac371 100644 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/ContractsExtensions.kt +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/ContractsExtensions.kt @@ -21,7 +21,7 @@ private fun Selector.isEmpty(): Boolean { !hasEnabled() && !hasFocused() && !hasPkg() - ) + ) } fun Selector.toUiSelector(): UiSelector { @@ -95,7 +95,8 @@ fun Selector.toBySelector(): BySelector { var matchedFocused = false var matchedPkg = false - var bySelector = if (hasText()) { + var bySelector = + if (hasText()) { matchedText = true By.text(text) } else if (hasTextStartsWith()) { From 75ca30526800c24b13e922a2facfde4e528218c3 Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Fri, 15 Sep 2023 12:10:22 +0200 Subject: [PATCH 082/110] Downgrade dart style --- packages/patrol_gen/pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/patrol_gen/pubspec.yaml b/packages/patrol_gen/pubspec.yaml index 2db8c3db8..663851cb2 100644 --- a/packages/patrol_gen/pubspec.yaml +++ b/packages/patrol_gen/pubspec.yaml @@ -12,7 +12,7 @@ environment: dependencies: analyzer: ^6.1.0 - dart_style: ^2.3.2 + dart_style: ^2.2.5 meta: ^1.7.0 path: ^1.8.2 From 9e6d5d1c3049e5e80047aa8c7da116f47986826c Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Fri, 15 Sep 2023 12:13:31 +0200 Subject: [PATCH 083/110] Downgrade analyzer --- packages/patrol_gen/pubspec.lock | 8 ++++---- packages/patrol_gen/pubspec.yaml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/patrol_gen/pubspec.lock b/packages/patrol_gen/pubspec.lock index 0014aca80..b3b87edce 100644 --- a/packages/patrol_gen/pubspec.lock +++ b/packages/patrol_gen/pubspec.lock @@ -5,18 +5,18 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - sha256: "58826e40314219b223f4723dd4205845040161cdc2df3e6a1cdceed5d8165084" + sha256: ae92f5d747aee634b87f89d9946000c2de774be1d6ac3e58268224348cd0101a url: "https://pub.dev" source: hosted - version: "63.0.0" + version: "61.0.0" analyzer: dependency: "direct main" description: name: analyzer - sha256: f85566ec7b3d25cbea60f7dd4f157c5025f2f19233ca4feeed33b616c78a26a3 + sha256: ea3d8652bda62982addfd92fdc2d0214e5f82e43325104990d4f4c4a2a313562 url: "https://pub.dev" source: hosted - version: "6.1.0" + version: "5.13.0" args: dependency: transitive description: diff --git a/packages/patrol_gen/pubspec.yaml b/packages/patrol_gen/pubspec.yaml index 663851cb2..d8ce36729 100644 --- a/packages/patrol_gen/pubspec.yaml +++ b/packages/patrol_gen/pubspec.yaml @@ -11,7 +11,7 @@ environment: sdk: '>=2.18.0 <4.0.0' dependencies: - analyzer: ^6.1.0 + analyzer: ^5.6.0 dart_style: ^2.2.5 meta: ^1.7.0 path: ^1.8.2 From 2e2bba295663125a8974c4c9a78ae961ac09be7a Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Fri, 15 Sep 2023 12:20:06 +0200 Subject: [PATCH 084/110] Revert package versions, change dartsdk --- .github/workflows/patrol_gen-prepare.yaml | 2 +- packages/patrol_gen/pubspec.lock | 8 ++++---- packages/patrol_gen/pubspec.yaml | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/patrol_gen-prepare.yaml b/.github/workflows/patrol_gen-prepare.yaml index e088edfb6..f8a7ab0d3 100644 --- a/.github/workflows/patrol_gen-prepare.yaml +++ b/.github/workflows/patrol_gen-prepare.yaml @@ -14,7 +14,7 @@ jobs: strategy: fail-fast: false matrix: - sdk: ['2.18.0', stable] + sdk: ['3.0.0', stable] defaults: run: diff --git a/packages/patrol_gen/pubspec.lock b/packages/patrol_gen/pubspec.lock index b3b87edce..a7f24b26e 100644 --- a/packages/patrol_gen/pubspec.lock +++ b/packages/patrol_gen/pubspec.lock @@ -5,18 +5,18 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - sha256: ae92f5d747aee634b87f89d9946000c2de774be1d6ac3e58268224348cd0101a + sha256: eb376e9acf6938204f90eb3b1f00b578640d3188b4c8a8ec054f9f479af8d051 url: "https://pub.dev" source: hosted - version: "61.0.0" + version: "64.0.0" analyzer: dependency: "direct main" description: name: analyzer - sha256: ea3d8652bda62982addfd92fdc2d0214e5f82e43325104990d4f4c4a2a313562 + sha256: "69f54f967773f6c26c7dcb13e93d7ccee8b17a641689da39e878d5cf13b06893" url: "https://pub.dev" source: hosted - version: "5.13.0" + version: "6.2.0" args: dependency: transitive description: diff --git a/packages/patrol_gen/pubspec.yaml b/packages/patrol_gen/pubspec.yaml index d8ce36729..363972ed6 100644 --- a/packages/patrol_gen/pubspec.yaml +++ b/packages/patrol_gen/pubspec.yaml @@ -8,11 +8,11 @@ repository: https://github.com/leancodepl/patrol issue_tracker: https://github.com/leancodepl/patrol/issues environment: - sdk: '>=2.18.0 <4.0.0' + sdk: '>=3.0.0 <4.0.0' dependencies: - analyzer: ^5.6.0 - dart_style: ^2.2.5 + analyzer: ^6.1.0 + dart_style: ^2.3.2 meta: ^1.7.0 path: ^1.8.2 From 39253245bd7a65285401fa8d3f82293338750f9b Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Fri, 15 Sep 2023 12:27:43 +0200 Subject: [PATCH 085/110] Fix ktlint manually --- .../src/main/kotlin/pl/leancode/patrol/ContractsExtensions.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/ContractsExtensions.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/ContractsExtensions.kt index a5e3ac371..99d810776 100644 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/ContractsExtensions.kt +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/ContractsExtensions.kt @@ -21,7 +21,7 @@ private fun Selector.isEmpty(): Boolean { !hasEnabled() && !hasFocused() && !hasPkg() - ) + ) } fun Selector.toUiSelector(): UiSelector { From a42a17eb770e12a063572a0fe1a4c711666217c0 Mon Sep 17 00:00:00 2001 From: Bartek Pacia Date: Fri, 15 Sep 2023 14:07:12 +0200 Subject: [PATCH 086/110] sync `develop` with `master` --- packages/patrol/CHANGELOG.md | 7 +++- .../kotlin/pl/leancode/patrol/Automator.kt | 21 +++++++----- .../permissions_location_test.dart | 2 +- .../lib/src/native/native_automator.dart | 4 +++ packages/patrol_cli/CHANGELOG.md | 4 +++ .../patrol_cli/lib/src/commands/develop.dart | 22 ++++++++---- .../patrol_cli/lib/src/commands/test.dart | 20 +++++++---- .../lib/src/ios/ios_test_backend.dart | 34 +++++++++++++++++-- .../test/ios/ios_test_backend_test.dart | 32 +++++++++++++++++ 9 files changed, 120 insertions(+), 26 deletions(-) diff --git a/packages/patrol/CHANGELOG.md b/packages/patrol/CHANGELOG.md index 01c81bfd7..dc5ffe177 100644 --- a/packages/patrol/CHANGELOG.md +++ b/packages/patrol/CHANGELOG.md @@ -4,9 +4,14 @@ This version requires version 2.2.0-dev.1 of `patrol_cli` package. +## 2.2.5 + +- Fix `grantPermissionOnlyThisTime()` crashing on Android <11 (#1698) + ## 2.2.4 -- Remove deprecation of `nativeAutomation` and add message about migration to `patrol_finders` (#1670) +- Remove deprecation of `nativeAutomation` and add message about migration to + `patrol_finders` (#1670) ## 2.2.3 diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/Automator.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/Automator.kt index fc7438a5a..a1098bf6d 100644 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/Automator.kt +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/Automator.kt @@ -392,9 +392,9 @@ class Automator private constructor() { fun allowPermissionWhileUsingApp() { val identifiers = arrayOf( - "com.android.packageinstaller:id/permission_allow_button", - "com.android.permissioncontroller:id/permission_allow_button", - "com.android.permissioncontroller:id/permission_allow_foreground_only_button" + "com.android.packageinstaller:id/permission_allow_button", // API <= 28 + "com.android.permissioncontroller:id/permission_allow_button", // API 29 + "com.android.permissioncontroller:id/permission_allow_foreground_only_button" // API >= 30 + API 29 (only for location permission) ) val uiObject = waitForUiObjectByResourceId(*identifiers, timeout = timeoutMillis) @@ -404,10 +404,15 @@ class Automator private constructor() { } fun allowPermissionOnce() { + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R) { + // One-time permissions are available only on API 30 (R) and above. + // See: https://developer.android.com/training/permissions/requesting#one-time + allowPermissionWhileUsingApp() + return + } + val identifiers = arrayOf( - "com.android.packageinstaller:id/permission_allow_button", - "com.android.permissioncontroller:id/permission_allow_button", - "com.android.permissioncontroller:id/permission_allow_one_time_button" + "com.android.permissioncontroller:id/permission_allow_one_time_button" // API >= 30 ) val uiObject = waitForUiObjectByResourceId(*identifiers, timeout = timeoutMillis) @@ -418,8 +423,8 @@ class Automator private constructor() { fun denyPermission() { val identifiers = arrayOf( - "com.android.packageinstaller:id/permission_deny_button", - "com.android.permissioncontroller:id/permission_deny_button" + "com.android.packageinstaller:id/permission_deny_button", // API <= 28 + "com.android.permissioncontroller:id/permission_deny_button" // API >= 29 ) val uiObject = waitForUiObjectByResourceId(*identifiers, timeout = timeoutMillis) diff --git a/packages/patrol/example/integration_test/permissions/permissions_location_test.dart b/packages/patrol/example/integration_test/permissions/permissions_location_test.dart index cc312b023..d47f1b917 100644 --- a/packages/patrol/example/integration_test/permissions/permissions_location_test.dart +++ b/packages/patrol/example/integration_test/permissions/permissions_location_test.dart @@ -40,7 +40,7 @@ void main() { await $.native.selectFineLocation(); await $.native.selectCoarseLocation(); await $.native.selectFineLocation(); - await $.native.grantPermissionWhenInUse(); + await $.native.grantPermissionOnlyThisTime(); } await $.pump(); diff --git a/packages/patrol/lib/src/native/native_automator.dart b/packages/patrol/lib/src/native/native_automator.dart index e4d014564..cde6bfaf5 100644 --- a/packages/patrol/lib/src/native/native_automator.dart +++ b/packages/patrol/lib/src/native/native_automator.dart @@ -694,6 +694,10 @@ class NativeAutomator { /// On iOS, this is the same as [grantPermissionWhenInUse] except for the /// location permission. /// + /// On Android versions older than 11 (R, API level 30), the concept of + /// "one-time permissions" doesn't exist. In this case, this method is the + /// same as [grantPermissionWhenInUse]. + /// /// See also: /// /// * [grantPermissionWhenInUse] and [denyPermission] diff --git a/packages/patrol_cli/CHANGELOG.md b/packages/patrol_cli/CHANGELOG.md index 59cbbced0..14a1309d0 100644 --- a/packages/patrol_cli/CHANGELOG.md +++ b/packages/patrol_cli/CHANGELOG.md @@ -4,6 +4,10 @@ This version requires version 2.3.0-dev.1 of `patrol` package. +## 2.1.4 + +- Uninstall RunnerUITests app on iOS when flavor is present (#1694) + ## 2.1.3 - Add migration message due to release of `patrol_finders` diff --git a/packages/patrol_cli/lib/src/commands/develop.dart b/packages/patrol_cli/lib/src/commands/develop.dart index d9a376002..03ff86857 100644 --- a/packages/patrol_cli/lib/src/commands/develop.dart +++ b/packages/patrol_cli/lib/src/commands/develop.dart @@ -223,7 +223,11 @@ class DevelopCommand extends PatrolCommand { case TargetPlatform.iOS: final bundleId = iosOpts.bundleId; if (bundleId != null) { - action = () => _iosTestBackend.uninstall(bundleId, device); + action = () => _iosTestBackend.uninstall( + appId: bundleId, + flavor: iosOpts.flutter.flavor, + device: device, + ); } break; } @@ -238,7 +242,7 @@ class DevelopCommand extends PatrolCommand { Future _execute( FlutterAppOptions flutterOpts, AndroidAppOptions android, - IOSAppOptions ios, { + IOSAppOptions iosOpts, { required bool uninstall, required Device device, }) async { @@ -257,12 +261,16 @@ class DevelopCommand extends PatrolCommand { } break; case TargetPlatform.iOS: - appId = ios.bundleId; + appId = iosOpts.bundleId; action = () async => - _iosTestBackend.execute(ios, device, interruptible: true); - final bundle = ios.bundleId; - if (bundle != null && uninstall) { - finalizer = () => _iosTestBackend.uninstall(bundle, device); + _iosTestBackend.execute(iosOpts, device, interruptible: true); + final bundleId = iosOpts.bundleId; + if (bundleId != null && uninstall) { + finalizer = () => _iosTestBackend.uninstall( + appId: bundleId, + flavor: iosOpts.flutter.flavor, + device: device, + ); } } diff --git a/packages/patrol_cli/lib/src/commands/test.dart b/packages/patrol_cli/lib/src/commands/test.dart index 3fef35591..bfe02ccfe 100644 --- a/packages/patrol_cli/lib/src/commands/test.dart +++ b/packages/patrol_cli/lib/src/commands/test.dart @@ -200,7 +200,11 @@ See https://github.com/leancodepl/patrol/issues/1316 to learn more. case TargetPlatform.iOS: final bundleId = iosOpts.bundleId; if (bundleId != null) { - action = () => _iosTestBackend.uninstall(bundleId, device); + action = () => _iosTestBackend.uninstall( + appId: bundleId, + flavor: iosOpts.flutter.flavor, + device: device, + ); } break; } @@ -240,7 +244,7 @@ See https://github.com/leancodepl/patrol/issues/1316 to learn more. Future _execute( FlutterAppOptions flutterOpts, AndroidAppOptions android, - IOSAppOptions ios, { + IOSAppOptions iosOpts, { required bool uninstall, required Device device, }) async { @@ -256,10 +260,14 @@ See https://github.com/leancodepl/patrol/issues/1316 to learn more. } break; case TargetPlatform.iOS: - action = () async => _iosTestBackend.execute(ios, device); - final bundle = ios.bundleId; - if (bundle != null && uninstall) { - finalizer = () => _iosTestBackend.uninstall(bundle, device); + action = () async => _iosTestBackend.execute(iosOpts, device); + final bundleId = iosOpts.bundleId; + if (bundleId != null && uninstall) { + finalizer = () => _iosTestBackend.uninstall( + appId: bundleId, + flavor: iosOpts.flutter.flavor, + device: device, + ); } break; } diff --git a/packages/patrol_cli/lib/src/ios/ios_test_backend.dart b/packages/patrol_cli/lib/src/ios/ios_test_backend.dart index 19fb2ea18..9e1edec3c 100644 --- a/packages/patrol_cli/lib/src/ios/ios_test_backend.dart +++ b/packages/patrol_cli/lib/src/ios/ios_test_backend.dart @@ -4,6 +4,7 @@ import 'dart:io' show Process; import 'package:dispose_scope/dispose_scope.dart'; import 'package:file/file.dart'; import 'package:glob/glob.dart'; +import 'package:meta/meta.dart'; import 'package:path/path.dart' show join; import 'package:patrol_cli/src/base/exceptions.dart'; import 'package:patrol_cli/src/base/logger.dart'; @@ -189,7 +190,14 @@ class IOSTestBackend { }); } - Future uninstall(String appId, Device device) async { + /// Uninstalls the app under test and the test runner from [device]. + /// + /// [flavor] is required to infer the test runner bundle ID. + Future uninstall({ + required String appId, + required String? flavor, + required Device device, + }) async { if (device.real) { // uninstall from iOS device await _processManager.run( @@ -208,8 +216,10 @@ class IOSTestBackend { ); } - // TODO: Not being removed https://github.com/leancodepl/patrol/issues/1094 - final testApp = '$appId.RunnerUITests.xctrunner'; + // See rationale: https://github.com/leancodepl/patrol/issues/1094 + final appIdWithoutFlavor = stripFlavorFromAppId(appId, flavor); + final testApp = '$appIdWithoutFlavor.RunnerUITests.xctrunner'; + if (device.real) { // uninstall from iOS device await _processManager.run( @@ -229,6 +239,24 @@ class IOSTestBackend { } } + /// Removes [flavor] from the end of [appId]. + /// + /// Assumes that [appId] and [flavor] are separated by a dot. + @visibleForTesting + String stripFlavorFromAppId(String appId, String? flavor) { + if (flavor == null) { + return appId; + } + + final idx = appId.indexOf('.$flavor'); + + if (idx == -1) { + return appId; + } + + return appId.substring(0, idx); + } + Future xcTestRunPath({ required bool real, required String scheme, diff --git a/packages/patrol_cli/test/ios/ios_test_backend_test.dart b/packages/patrol_cli/test/ios/ios_test_backend_test.dart index c1bced1cc..1bbbda658 100644 --- a/packages/patrol_cli/test/ios/ios_test_backend_test.dart +++ b/packages/patrol_cli/test/ios/ios_test_backend_test.dart @@ -178,6 +178,38 @@ void main() { testPlan: 'SomeTestPlan', ); }); + + group('stripFlavorFromAppId', () { + test('simply returns appId when flavor is null', () { + const appId = 'com.company.app'; + const String? flavor = null; + + expect( + iosTestBackend.stripFlavorFromAppId(appId, flavor), + 'com.company.app', + ); + }); + + test('works when appId contains flavor', () { + const appId = 'com.company.app.dev'; + const flavor = 'dev'; + + expect( + iosTestBackend.stripFlavorFromAppId(appId, flavor), + 'com.company.app', + ); + }); + + test('ignores when appId contains flavor not preceded by a dot', () { + const appId = 'com.company.app_dev'; + const flavor = 'dev'; + + expect( + iosTestBackend.stripFlavorFromAppId(appId, flavor), + 'com.company.app_dev', + ); + }); + }); }); } From e5f117c4f2fa5626a45b576df1984705cfaeb431 Mon Sep 17 00:00:00 2001 From: Bartek Pacia Date: Fri, 15 Sep 2023 14:18:41 +0200 Subject: [PATCH 087/110] patrol: bump version to 2.3.0-dev.2 --- packages/patrol/CHANGELOG.md | 7 +++++++ packages/patrol/pubspec.yaml | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/patrol/CHANGELOG.md b/packages/patrol/CHANGELOG.md index dc5ffe177..a7bcd7288 100644 --- a/packages/patrol/CHANGELOG.md +++ b/packages/patrol/CHANGELOG.md @@ -1,3 +1,10 @@ +## 2.3.0-dev.2 + +- Replace Protocol Buffers and gRPC with a custom code generation solution that + is more lightweight (#1681) + +This version requires version 2.2.0-dev.2 of `patrol_cli` package. + ## 2.3.0-dev.1 - Add support for `group()` (#1634) diff --git a/packages/patrol/pubspec.yaml b/packages/patrol/pubspec.yaml index 96d3a3eb4..b21bd45b9 100644 --- a/packages/patrol/pubspec.yaml +++ b/packages/patrol/pubspec.yaml @@ -2,7 +2,7 @@ name: patrol description: > Powerful Flutter-native UI testing framework overcoming limitations of existing Flutter testing tools. Ready for action! -version: 2.3.0-dev.1 +version: 2.3.0-dev.2 homepage: https://patrol.leancode.co repository: https://github.com/leancodepl/patrol issue_tracker: https://github.com/leancodepl/patrol/issues From 6dd4f1b46ca312c5c78b3282830592145d06e063 Mon Sep 17 00:00:00 2001 From: Bartek Pacia Date: Fri, 15 Sep 2023 14:19:26 +0200 Subject: [PATCH 088/110] patrol_cli: bump version to 2.2.0-dev.2 --- packages/patrol_cli/CHANGELOG.md | 6 ++++++ packages/patrol_cli/lib/src/base/constants.dart | 2 +- packages/patrol_cli/pubspec.yaml | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/patrol_cli/CHANGELOG.md b/packages/patrol_cli/CHANGELOG.md index 14a1309d0..0a9154ab1 100644 --- a/packages/patrol_cli/CHANGELOG.md +++ b/packages/patrol_cli/CHANGELOG.md @@ -1,3 +1,9 @@ +## 2.2.0-dev.2 + +- Adjust generated `test_bundle.dart` to not depend on gRPC contracts (#1681) + +This version requires version 2.3.0-dev.2 of `patrol` package. + ## 2.2.0-dev.1 - Add support for `group()` (#1634) diff --git a/packages/patrol_cli/lib/src/base/constants.dart b/packages/patrol_cli/lib/src/base/constants.dart index 15394e2df..b5b7326df 100644 --- a/packages/patrol_cli/lib/src/base/constants.dart +++ b/packages/patrol_cli/lib/src/base/constants.dart @@ -1,2 +1,2 @@ /// Version of Patrol CLI. Must be kept in sync with pubspec.yaml. -const version = '2.2.0-dev.1'; +const version = '2.2.0-dev.2'; diff --git a/packages/patrol_cli/pubspec.yaml b/packages/patrol_cli/pubspec.yaml index 3baf6a92a..b93926aba 100644 --- a/packages/patrol_cli/pubspec.yaml +++ b/packages/patrol_cli/pubspec.yaml @@ -1,7 +1,7 @@ name: patrol_cli description: > Command-line tool for Patrol, a powerful Flutter-native UI testing framework. -version: 2.2.0-dev.1 # Must be kept in sync with constants.dart +version: 2.2.0-dev.2 # Must be kept in sync with constants.dart homepage: https://patrol.leancode.co repository: https://github.com/leancodepl/patrol issue_tracker: https://github.com/leancodepl/patrol/issues From 3d176e8e0769c40aea4df8dfd516bc1f09471818 Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Fri, 15 Sep 2023 16:46:55 +0200 Subject: [PATCH 089/110] Switch ios server to telegraph --- packages/patrol/example/ios/Podfile.lock | 22 +- .../NativeAutomatorServer.swift | 274 +++++++++--------- .../AutomatorServer/PatrolServer.swift | 18 +- packages/patrol/ios/patrol.podspec | 2 +- .../lib/src/generators/ios/ios_generator.dart | 4 +- 5 files changed, 169 insertions(+), 151 deletions(-) diff --git a/packages/patrol/example/ios/Podfile.lock b/packages/patrol/example/ios/Podfile.lock index 7a3b7c88f..79b1ff61b 100644 --- a/packages/patrol/example/ios/Podfile.lock +++ b/packages/patrol/example/ios/Podfile.lock @@ -1,21 +1,23 @@ PODS: + - CocoaAsyncSocket (7.6.5) - Flutter (1.0.0) - flutter_local_notifications (0.0.1): - Flutter - flutter_timezone (0.0.1): - Flutter - - FlyingFox (0.12.2): - - FlyingSocks (~> 0.12.2) - - FlyingSocks (0.12.2) - geolocator_apple (1.2.0): - Flutter + - HTTPParserC (2.9.4) - integration_test (0.0.1): - Flutter - patrol (0.0.1): - Flutter - - FlyingFox (~> 0.12.0) + - Telegraph (~> 0.30.0) - permission_handler_apple (9.1.1): - Flutter + - Telegraph (0.30.0): + - CocoaAsyncSocket (~> 7.6) + - HTTPParserC (~> 2.9) - webview_flutter_wkwebview (0.0.1): - Flutter @@ -31,8 +33,9 @@ DEPENDENCIES: SPEC REPOS: trunk: - - FlyingFox - - FlyingSocks + - CocoaAsyncSocket + - HTTPParserC + - Telegraph EXTERNAL SOURCES: Flutter: @@ -53,15 +56,16 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/webview_flutter_wkwebview/ios" SPEC CHECKSUMS: + CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99 Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 flutter_local_notifications: 0c0b1ae97e741e1521e4c1629a459d04b9aec743 flutter_timezone: ffb07bdad3c6276af8dada0f11978d8a1f8a20bb - FlyingFox: 64c3302f81bd8690514a8988dafc9ff951781e7d - FlyingSocks: 7b2a722af4be5cf74499c0a5a94d3f31f028a4f7 geolocator_apple: cc556e6844d508c95df1e87e3ea6fa4e58c50401 + HTTPParserC: aea14c3d2d4ac5beb3988781daa36dfa62e0d9ef integration_test: 13825b8a9334a850581300559b8839134b124670 - patrol: 8726a57cd3859ed03bc0b5217784b58bbdbf57c5 + patrol: 0966206ac7e717e0ee4d9b6b4e86c8aab62acbfc permission_handler_apple: e76247795d700c14ea09e3a2d8855d41ee80a2e6 + Telegraph: 12576b119324138e4929792af9e5a1085c2ecbc1 webview_flutter_wkwebview: 2e2d318f21a5e036e2c3f26171342e95908bd60a PODFILE CHECKSUM: 0976da911d4a3d1a369deaf59f82a1c7d01a40d5 diff --git a/packages/patrol/ios/Classes/AutomatorServer/NativeAutomatorServer.swift b/packages/patrol/ios/Classes/AutomatorServer/NativeAutomatorServer.swift index c230064b9..cd5d630f9 100644 --- a/packages/patrol/ios/Classes/AutomatorServer/NativeAutomatorServer.swift +++ b/packages/patrol/ios/Classes/AutomatorServer/NativeAutomatorServer.swift @@ -5,7 +5,7 @@ // source: schema.dart // -import FlyingFox +import Telegraph protocol NativeAutomatorServer { func initialize() async throws @@ -47,381 +47,397 @@ protocol NativeAutomatorServer { extension NativeAutomatorServer { private func initializeHandler(request: HTTPRequest) async throws -> HTTPResponse { try await initialize() - return HTTPResponse(statusCode: .ok) + return HTTPResponse(.ok) } private func configureHandler(request: HTTPRequest) async throws -> HTTPResponse { - let requestArg = try await JSONDecoder().decode(ConfigureRequest.self, from: request.bodyData) + let requestArg = try JSONDecoder().decode(ConfigureRequest.self, from: request.body) try await configure(request: requestArg) - return HTTPResponse(statusCode: .ok) + return HTTPResponse(.ok) } private func pressHomeHandler(request: HTTPRequest) async throws -> HTTPResponse { try await pressHome() - return HTTPResponse(statusCode: .ok) + return HTTPResponse(.ok) } private func pressBackHandler(request: HTTPRequest) async throws -> HTTPResponse { try await pressBack() - return HTTPResponse(statusCode: .ok) + return HTTPResponse(.ok) } private func pressRecentAppsHandler(request: HTTPRequest) async throws -> HTTPResponse { try await pressRecentApps() - return HTTPResponse(statusCode: .ok) + return HTTPResponse(.ok) } private func doublePressRecentAppsHandler(request: HTTPRequest) async throws -> HTTPResponse { try await doublePressRecentApps() - return HTTPResponse(statusCode: .ok) + return HTTPResponse(.ok) } private func openAppHandler(request: HTTPRequest) async throws -> HTTPResponse { - let requestArg = try await JSONDecoder().decode(OpenAppRequest.self, from: request.bodyData) + let requestArg = try JSONDecoder().decode(OpenAppRequest.self, from: request.body) try await openApp(request: requestArg) - return HTTPResponse(statusCode: .ok) + return HTTPResponse(.ok) } private func openQuickSettingsHandler(request: HTTPRequest) async throws -> HTTPResponse { - let requestArg = try await JSONDecoder().decode(OpenQuickSettingsRequest.self, from: request.bodyData) + let requestArg = try JSONDecoder().decode(OpenQuickSettingsRequest.self, from: request.body) try await openQuickSettings(request: requestArg) - return HTTPResponse(statusCode: .ok) + return HTTPResponse(.ok) } private func getNativeViewsHandler(request: HTTPRequest) async throws -> HTTPResponse { - let requestArg = try await JSONDecoder().decode(GetNativeViewsRequest.self, from: request.bodyData) + let requestArg = try JSONDecoder().decode(GetNativeViewsRequest.self, from: request.body) let response = try await getNativeViews(request: requestArg) let body = try JSONEncoder().encode(response) - return HTTPResponse(statusCode: .ok, body: body) + return HTTPResponse(.ok, body: body) } private func tapHandler(request: HTTPRequest) async throws -> HTTPResponse { - let requestArg = try await JSONDecoder().decode(TapRequest.self, from: request.bodyData) + let requestArg = try JSONDecoder().decode(TapRequest.self, from: request.body) try await tap(request: requestArg) - return HTTPResponse(statusCode: .ok) + return HTTPResponse(.ok) } private func doubleTapHandler(request: HTTPRequest) async throws -> HTTPResponse { - let requestArg = try await JSONDecoder().decode(TapRequest.self, from: request.bodyData) + let requestArg = try JSONDecoder().decode(TapRequest.self, from: request.body) try await doubleTap(request: requestArg) - return HTTPResponse(statusCode: .ok) + return HTTPResponse(.ok) } private func enterTextHandler(request: HTTPRequest) async throws -> HTTPResponse { - let requestArg = try await JSONDecoder().decode(EnterTextRequest.self, from: request.bodyData) + let requestArg = try JSONDecoder().decode(EnterTextRequest.self, from: request.body) try await enterText(request: requestArg) - return HTTPResponse(statusCode: .ok) + return HTTPResponse(.ok) } private func swipeHandler(request: HTTPRequest) async throws -> HTTPResponse { - let requestArg = try await JSONDecoder().decode(SwipeRequest.self, from: request.bodyData) + let requestArg = try JSONDecoder().decode(SwipeRequest.self, from: request.body) try await swipe(request: requestArg) - return HTTPResponse(statusCode: .ok) + return HTTPResponse(.ok) } private func waitUntilVisibleHandler(request: HTTPRequest) async throws -> HTTPResponse { - let requestArg = try await JSONDecoder().decode(WaitUntilVisibleRequest.self, from: request.bodyData) + let requestArg = try JSONDecoder().decode(WaitUntilVisibleRequest.self, from: request.body) try await waitUntilVisible(request: requestArg) - return HTTPResponse(statusCode: .ok) + return HTTPResponse(.ok) } private func enableAirplaneModeHandler(request: HTTPRequest) async throws -> HTTPResponse { try await enableAirplaneMode() - return HTTPResponse(statusCode: .ok) + return HTTPResponse(.ok) } private func disableAirplaneModeHandler(request: HTTPRequest) async throws -> HTTPResponse { try await disableAirplaneMode() - return HTTPResponse(statusCode: .ok) + return HTTPResponse(.ok) } private func enableWiFiHandler(request: HTTPRequest) async throws -> HTTPResponse { try await enableWiFi() - return HTTPResponse(statusCode: .ok) + return HTTPResponse(.ok) } private func disableWiFiHandler(request: HTTPRequest) async throws -> HTTPResponse { try await disableWiFi() - return HTTPResponse(statusCode: .ok) + return HTTPResponse(.ok) } private func enableCellularHandler(request: HTTPRequest) async throws -> HTTPResponse { try await enableCellular() - return HTTPResponse(statusCode: .ok) + return HTTPResponse(.ok) } private func disableCellularHandler(request: HTTPRequest) async throws -> HTTPResponse { try await disableCellular() - return HTTPResponse(statusCode: .ok) + return HTTPResponse(.ok) } private func enableBluetoothHandler(request: HTTPRequest) async throws -> HTTPResponse { try await enableBluetooth() - return HTTPResponse(statusCode: .ok) + return HTTPResponse(.ok) } private func disableBluetoothHandler(request: HTTPRequest) async throws -> HTTPResponse { try await disableBluetooth() - return HTTPResponse(statusCode: .ok) + return HTTPResponse(.ok) } private func enableDarkModeHandler(request: HTTPRequest) async throws -> HTTPResponse { - let requestArg = try await JSONDecoder().decode(DarkModeRequest.self, from: request.bodyData) + let requestArg = try JSONDecoder().decode(DarkModeRequest.self, from: request.body) try await enableDarkMode(request: requestArg) - return HTTPResponse(statusCode: .ok) + return HTTPResponse(.ok) } private func disableDarkModeHandler(request: HTTPRequest) async throws -> HTTPResponse { - let requestArg = try await JSONDecoder().decode(DarkModeRequest.self, from: request.bodyData) + let requestArg = try JSONDecoder().decode(DarkModeRequest.self, from: request.body) try await disableDarkMode(request: requestArg) - return HTTPResponse(statusCode: .ok) + return HTTPResponse(.ok) } private func openNotificationsHandler(request: HTTPRequest) async throws -> HTTPResponse { try await openNotifications() - return HTTPResponse(statusCode: .ok) + return HTTPResponse(.ok) } private func closeNotificationsHandler(request: HTTPRequest) async throws -> HTTPResponse { try await closeNotifications() - return HTTPResponse(statusCode: .ok) + return HTTPResponse(.ok) } private func closeHeadsUpNotificationHandler(request: HTTPRequest) async throws -> HTTPResponse { try await closeHeadsUpNotification() - return HTTPResponse(statusCode: .ok) + return HTTPResponse(.ok) } private func getNotificationsHandler(request: HTTPRequest) async throws -> HTTPResponse { - let requestArg = try await JSONDecoder().decode(GetNotificationsRequest.self, from: request.bodyData) + let requestArg = try JSONDecoder().decode(GetNotificationsRequest.self, from: request.body) let response = try await getNotifications(request: requestArg) let body = try JSONEncoder().encode(response) - return HTTPResponse(statusCode: .ok, body: body) + return HTTPResponse(.ok, body: body) } private func tapOnNotificationHandler(request: HTTPRequest) async throws -> HTTPResponse { - let requestArg = try await JSONDecoder().decode(TapOnNotificationRequest.self, from: request.bodyData) + let requestArg = try JSONDecoder().decode(TapOnNotificationRequest.self, from: request.body) try await tapOnNotification(request: requestArg) - return HTTPResponse(statusCode: .ok) + return HTTPResponse(.ok) } private func isPermissionDialogVisibleHandler(request: HTTPRequest) async throws -> HTTPResponse { - let requestArg = try await JSONDecoder().decode(PermissionDialogVisibleRequest.self, from: request.bodyData) + let requestArg = try JSONDecoder().decode(PermissionDialogVisibleRequest.self, from: request.body) let response = try await isPermissionDialogVisible(request: requestArg) let body = try JSONEncoder().encode(response) - return HTTPResponse(statusCode: .ok, body: body) + return HTTPResponse(.ok, body: body) } private func handlePermissionDialogHandler(request: HTTPRequest) async throws -> HTTPResponse { - let requestArg = try await JSONDecoder().decode(HandlePermissionRequest.self, from: request.bodyData) + let requestArg = try JSONDecoder().decode(HandlePermissionRequest.self, from: request.body) try await handlePermissionDialog(request: requestArg) - return HTTPResponse(statusCode: .ok) + return HTTPResponse(.ok) } private func setLocationAccuracyHandler(request: HTTPRequest) async throws -> HTTPResponse { - let requestArg = try await JSONDecoder().decode(SetLocationAccuracyRequest.self, from: request.bodyData) + let requestArg = try JSONDecoder().decode(SetLocationAccuracyRequest.self, from: request.body) try await setLocationAccuracy(request: requestArg) - return HTTPResponse(statusCode: .ok) + return HTTPResponse(.ok) } private func debugHandler(request: HTTPRequest) async throws -> HTTPResponse { try await debug() - return HTTPResponse(statusCode: .ok) + return HTTPResponse(.ok) } private func markPatrolAppServiceReadyHandler(request: HTTPRequest) async throws -> HTTPResponse { try await markPatrolAppServiceReady() - return HTTPResponse(statusCode: .ok) + return HTTPResponse(.ok) } } extension NativeAutomatorServer { - func setupRoutes(server: HTTPServer) async { - await server.appendRoute("/initialize") { request in - return await handleRequest( + func setupRoutes(server: Server) { + server.route(.POST, "initialize") { + request in handleRequest( request: request, handler: initializeHandler) } - await server.appendRoute("/configure") { request in - return await handleRequest( + server.route(.POST, "configure") { + request in handleRequest( request: request, handler: configureHandler) } - await server.appendRoute("/pressHome") { request in - return await handleRequest( + server.route(.POST, "pressHome") { + request in handleRequest( request: request, handler: pressHomeHandler) } - await server.appendRoute("/pressBack") { request in - return await handleRequest( + server.route(.POST, "pressBack") { + request in handleRequest( request: request, handler: pressBackHandler) } - await server.appendRoute("/pressRecentApps") { request in - return await handleRequest( + server.route(.POST, "pressRecentApps") { + request in handleRequest( request: request, handler: pressRecentAppsHandler) } - await server.appendRoute("/doublePressRecentApps") { request in - return await handleRequest( + server.route(.POST, "doublePressRecentApps") { + request in handleRequest( request: request, handler: doublePressRecentAppsHandler) } - await server.appendRoute("/openApp") { request in - return await handleRequest( + server.route(.POST, "openApp") { + request in handleRequest( request: request, handler: openAppHandler) } - await server.appendRoute("/openQuickSettings") { request in - return await handleRequest( + server.route(.POST, "openQuickSettings") { + request in handleRequest( request: request, handler: openQuickSettingsHandler) } - await server.appendRoute("/getNativeViews") { request in - return await handleRequest( + server.route(.POST, "getNativeViews") { + request in handleRequest( request: request, handler: getNativeViewsHandler) } - await server.appendRoute("/tap") { request in - return await handleRequest( + server.route(.POST, "tap") { + request in handleRequest( request: request, handler: tapHandler) } - await server.appendRoute("/doubleTap") { request in - return await handleRequest( + server.route(.POST, "doubleTap") { + request in handleRequest( request: request, handler: doubleTapHandler) } - await server.appendRoute("/enterText") { request in - return await handleRequest( + server.route(.POST, "enterText") { + request in handleRequest( request: request, handler: enterTextHandler) } - await server.appendRoute("/swipe") { request in - return await handleRequest( + server.route(.POST, "swipe") { + request in handleRequest( request: request, handler: swipeHandler) } - await server.appendRoute("/waitUntilVisible") { request in - return await handleRequest( + server.route(.POST, "waitUntilVisible") { + request in handleRequest( request: request, handler: waitUntilVisibleHandler) } - await server.appendRoute("/enableAirplaneMode") { request in - return await handleRequest( + server.route(.POST, "enableAirplaneMode") { + request in handleRequest( request: request, handler: enableAirplaneModeHandler) } - await server.appendRoute("/disableAirplaneMode") { request in - return await handleRequest( + server.route(.POST, "disableAirplaneMode") { + request in handleRequest( request: request, handler: disableAirplaneModeHandler) } - await server.appendRoute("/enableWiFi") { request in - return await handleRequest( + server.route(.POST, "enableWiFi") { + request in handleRequest( request: request, handler: enableWiFiHandler) } - await server.appendRoute("/disableWiFi") { request in - return await handleRequest( + server.route(.POST, "disableWiFi") { + request in handleRequest( request: request, handler: disableWiFiHandler) } - await server.appendRoute("/enableCellular") { request in - return await handleRequest( + server.route(.POST, "enableCellular") { + request in handleRequest( request: request, handler: enableCellularHandler) } - await server.appendRoute("/disableCellular") { request in - return await handleRequest( + server.route(.POST, "disableCellular") { + request in handleRequest( request: request, handler: disableCellularHandler) } - await server.appendRoute("/enableBluetooth") { request in - return await handleRequest( + server.route(.POST, "enableBluetooth") { + request in handleRequest( request: request, handler: enableBluetoothHandler) } - await server.appendRoute("/disableBluetooth") { request in - return await handleRequest( + server.route(.POST, "disableBluetooth") { + request in handleRequest( request: request, handler: disableBluetoothHandler) } - await server.appendRoute("/enableDarkMode") { request in - return await handleRequest( + server.route(.POST, "enableDarkMode") { + request in handleRequest( request: request, handler: enableDarkModeHandler) } - await server.appendRoute("/disableDarkMode") { request in - return await handleRequest( + server.route(.POST, "disableDarkMode") { + request in handleRequest( request: request, handler: disableDarkModeHandler) } - await server.appendRoute("/openNotifications") { request in - return await handleRequest( + server.route(.POST, "openNotifications") { + request in handleRequest( request: request, handler: openNotificationsHandler) } - await server.appendRoute("/closeNotifications") { request in - return await handleRequest( + server.route(.POST, "closeNotifications") { + request in handleRequest( request: request, handler: closeNotificationsHandler) } - await server.appendRoute("/closeHeadsUpNotification") { request in - return await handleRequest( + server.route(.POST, "closeHeadsUpNotification") { + request in handleRequest( request: request, handler: closeHeadsUpNotificationHandler) } - await server.appendRoute("/getNotifications") { request in - return await handleRequest( + server.route(.POST, "getNotifications") { + request in handleRequest( request: request, handler: getNotificationsHandler) } - await server.appendRoute("/tapOnNotification") { request in - return await handleRequest( + server.route(.POST, "tapOnNotification") { + request in handleRequest( request: request, handler: tapOnNotificationHandler) } - await server.appendRoute("/isPermissionDialogVisible") { request in - return await handleRequest( + server.route(.POST, "isPermissionDialogVisible") { + request in handleRequest( request: request, handler: isPermissionDialogVisibleHandler) } - await server.appendRoute("/handlePermissionDialog") { request in - return await handleRequest( + server.route(.POST, "handlePermissionDialog") { + request in handleRequest( request: request, handler: handlePermissionDialogHandler) } - await server.appendRoute("/setLocationAccuracy") { request in - return await handleRequest( + server.route(.POST, "setLocationAccuracy") { + request in handleRequest( request: request, handler: setLocationAccuracyHandler) } - await server.appendRoute("/debug") { request in - return await handleRequest( + server.route(.POST, "debug") { + request in handleRequest( request: request, handler: debugHandler) } - await server.appendRoute("/markPatrolAppServiceReady") { request in - return await handleRequest( + server.route(.POST, "markPatrolAppServiceReady") { + request in handleRequest( request: request, handler: markPatrolAppServiceReadyHandler) } } } +fileprivate class Box { + var result: Result? = nil +} + extension NativeAutomatorServer { - private func handleRequest(request: HTTPRequest, handler: @escaping (HTTPRequest) async throws -> HTTPResponse) async -> HTTPResponse { + private func handleRequest(request: HTTPRequest, handler: @escaping (HTTPRequest) async throws -> HTTPResponse) -> HTTPResponse { do { - return try await handler(request) + return try unsafeWait { + return try await handler(request) + } } catch let err { - return HTTPResponse(statusCode: .badRequest, headers: [:], body: err.localizedDescription.utf8Data) + return HTTPResponse(.badRequest, headers: [:], error: err) } } -} - -extension String { - var utf8Data: Data { - return data(using: .utf8)! - } + + private func unsafeWait(_ f: @escaping () async throws -> ResultType) throws -> ResultType { + let box = Box() + let sema = DispatchSemaphore(value: 0) + Task { + do { + let val = try await f() + box.result = .success(val) + } catch { + box.result = .failure(error) + } + sema.signal() + } + sema.wait() + return try box.result!.get() + } } diff --git a/packages/patrol/ios/Classes/AutomatorServer/PatrolServer.swift b/packages/patrol/ios/Classes/AutomatorServer/PatrolServer.swift index 408aa9128..0afc35d6e 100644 --- a/packages/patrol/ios/Classes/AutomatorServer/PatrolServer.swift +++ b/packages/patrol/ios/Classes/AutomatorServer/PatrolServer.swift @@ -1,4 +1,4 @@ -import FlyingFox +import Telegraph import Foundation @objc public class PatrolServer: NSObject { @@ -9,7 +9,7 @@ import Foundation #if PATROL_ENABLED private let port: Int private let automator: Automator - private let server: HTTPServer + private let server: Server #endif @objc @@ -38,7 +38,7 @@ import Foundation Logger.shared.i("PATROL_ENABLED flag is defined") self.port = passedPort self.automator = Automator() - self.server = HTTPServer(address: .loopback(port: UInt16(self.port))) + self.server = Server() #else Logger.shared.i("Fatal error: PATROL_ENABLED flag is not defined") #endif @@ -52,14 +52,12 @@ import Foundation Logger.shared.i("App reported that it is ready") self.appReady = appReady } + + provider.setupRoutes(server: server) - await provider.setupRoutes(server: server) - - Task { try await server.start() } - try await server.waitUntilListening() - let address = await server.listeningAddress - - Logger.shared.i("Server started on :\(String(describing: address))") + try server.start(onPort: UInt16(port)) + + Logger.shared.i("Server started on http://0.0.0.0:\(port)") #endif } } diff --git a/packages/patrol/ios/patrol.podspec b/packages/patrol/ios/patrol.podspec index d82722cf0..15af13f7c 100644 --- a/packages/patrol/ios/patrol.podspec +++ b/packages/patrol/ios/patrol.podspec @@ -24,5 +24,5 @@ Runs tests that use flutter_test and patrol APIs as native iOS integration tests s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' } s.swift_version = '5.0' - s.dependency 'FlyingFox', '~> 0.12.0' + s.dependency 'Telegraph', '~> 0.30.0' end diff --git a/packages/patrol_gen/lib/src/generators/ios/ios_generator.dart b/packages/patrol_gen/lib/src/generators/ios/ios_generator.dart index 3722540d5..00443d4dd 100644 --- a/packages/patrol_gen/lib/src/generators/ios/ios_generator.dart +++ b/packages/patrol_gen/lib/src/generators/ios/ios_generator.dart @@ -1,6 +1,6 @@ import 'package:patrol_gen/src/generators/ios/ios_config.dart'; import 'package:patrol_gen/src/generators/ios/ios_contracts_generator.dart'; -import 'package:patrol_gen/src/generators/ios/ios_flying_fox_server_generator.dart'; +import 'package:patrol_gen/src/generators/ios/ios_telegraph_server_generator.dart'; import 'package:patrol_gen/src/generators/ios/ios_url_session_client_generator.dart'; import 'package:patrol_gen/src/generators/output_file.dart'; import 'package:patrol_gen/src/schema.dart'; @@ -11,7 +11,7 @@ class IOSGenerator { IOSContractsGenerator().generate(schema, config), ]; - final serverGenerator = IOSFlyingFoxServerGenerator(); + final serverGenerator = IOSTelegraphServerGenerator(); final clientGenerator = IOSURLSessionClientGenerator(); for (final service in schema.services) { From d482fe50f39bd7d100f4c36111b3a661d2f8cfdb Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Fri, 15 Sep 2023 17:03:36 +0200 Subject: [PATCH 090/110] Fix deprecated warning --- packages/patrol/ios/Classes/AutomatorServer/PatrolServer.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/patrol/ios/Classes/AutomatorServer/PatrolServer.swift b/packages/patrol/ios/Classes/AutomatorServer/PatrolServer.swift index 0afc35d6e..57e2b3b60 100644 --- a/packages/patrol/ios/Classes/AutomatorServer/PatrolServer.swift +++ b/packages/patrol/ios/Classes/AutomatorServer/PatrolServer.swift @@ -55,7 +55,7 @@ import Foundation provider.setupRoutes(server: server) - try server.start(onPort: UInt16(port)) + try server.start(port: port) Logger.shared.i("Server started on http://0.0.0.0:\(port)") #endif From 002b613f1a916c959d5c21ae21e4267fb4f09887 Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Fri, 15 Sep 2023 17:16:18 +0200 Subject: [PATCH 091/110] Fix swift-format issues --- .../ios/Classes/AutomatorServer/NativeAutomatorServer.swift | 2 +- .../patrol/ios/Classes/AutomatorServer/PatrolServer.swift | 6 +++--- .../src/generators/ios/ios_telegraph_server_generator.dart | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/patrol/ios/Classes/AutomatorServer/NativeAutomatorServer.swift b/packages/patrol/ios/Classes/AutomatorServer/NativeAutomatorServer.swift index cd5d630f9..0342b5275 100644 --- a/packages/patrol/ios/Classes/AutomatorServer/NativeAutomatorServer.swift +++ b/packages/patrol/ios/Classes/AutomatorServer/NativeAutomatorServer.swift @@ -424,7 +424,7 @@ extension NativeAutomatorServer { return HTTPResponse(.badRequest, headers: [:], error: err) } } - + private func unsafeWait(_ f: @escaping () async throws -> ResultType) throws -> ResultType { let box = Box() let sema = DispatchSemaphore(value: 0) diff --git a/packages/patrol/ios/Classes/AutomatorServer/PatrolServer.swift b/packages/patrol/ios/Classes/AutomatorServer/PatrolServer.swift index 57e2b3b60..ef2575e5a 100644 --- a/packages/patrol/ios/Classes/AutomatorServer/PatrolServer.swift +++ b/packages/patrol/ios/Classes/AutomatorServer/PatrolServer.swift @@ -1,5 +1,5 @@ -import Telegraph import Foundation +import Telegraph @objc public class PatrolServer: NSObject { private static let envPortKey = "PATROL_PORT" @@ -52,11 +52,11 @@ import Foundation Logger.shared.i("App reported that it is ready") self.appReady = appReady } - + provider.setupRoutes(server: server) try server.start(port: port) - + Logger.shared.i("Server started on http://0.0.0.0:\(port)") #endif } diff --git a/packages/patrol_gen/lib/src/generators/ios/ios_telegraph_server_generator.dart b/packages/patrol_gen/lib/src/generators/ios/ios_telegraph_server_generator.dart index 2bbba4def..a51ef770b 100644 --- a/packages/patrol_gen/lib/src/generators/ios/ios_telegraph_server_generator.dart +++ b/packages/patrol_gen/lib/src/generators/ios/ios_telegraph_server_generator.dart @@ -120,7 +120,7 @@ extension NativeAutomatorServer { return HTTPResponse(.badRequest, headers: [:], error: err) } } - + private func unsafeWait(_ f: @escaping () async throws -> ResultType) throws -> ResultType { let box = Box() let sema = DispatchSemaphore(value: 0) From e1f11157f6bac03c6a83484ae593ac549126a16b Mon Sep 17 00:00:00 2001 From: Bartek Pacia Date: Mon, 18 Sep 2023 13:46:53 +0200 Subject: [PATCH 092/110] Replace HTTP server (#1709) Replace HTTP server (http4k-server-netty -> org.http4k:http4k-server-ktorcnio) --- packages/patrol/android/build.gradle | 6 +++--- .../src/main/kotlin/pl/leancode/patrol/PatrolServer.kt | 4 ++-- packages/patrol/example/android/app/build.gradle | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/patrol/android/build.gradle b/packages/patrol/android/build.gradle index 9aa4b1894..d7feddf65 100644 --- a/packages/patrol/android/build.gradle +++ b/packages/patrol/android/build.gradle @@ -66,9 +66,9 @@ android { api "androidx.test.uiautomator:uiautomator:2.2.0" implementation platform("org.http4k:http4k-bom:5.7.4.0") - implementation "org.http4k:http4k-core:5.7.4.0" - implementation "org.http4k:http4k-client-apache:5.7.4.0" - implementation "org.http4k:http4k-server-netty:5.7.4.0" + implementation "org.http4k:http4k-core" + implementation "org.http4k:http4k-client-apache" + implementation "org.http4k:http4k-server-ktorcio" implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.0" implementation "org.jetbrains.kotlinx:kotlinx-coroutines-guava:1.5.2" diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolServer.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolServer.kt index bfeb11c39..3e8d395a8 100644 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolServer.kt +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolServer.kt @@ -5,7 +5,7 @@ import com.google.common.util.concurrent.SettableFuture import org.http4k.core.ContentType import org.http4k.filter.ServerFilters import org.http4k.server.Http4kServer -import org.http4k.server.Netty +import org.http4k.server.KtorCIO import org.http4k.server.asServer import java.util.concurrent.Future @@ -29,7 +29,7 @@ class PatrolServer { .withFilter(catcher) .withFilter(printer) .withFilter(ServerFilters.SetContentType(ContentType.TEXT_PLAIN)) - .asServer(Netty(port)) + .asServer(KtorCIO(port)) .start() Logger.i("Created and started PatrolServer, port: $port") diff --git a/packages/patrol/example/android/app/build.gradle b/packages/patrol/example/android/app/build.gradle index 55bba1cac..067721752 100644 --- a/packages/patrol/example/android/app/build.gradle +++ b/packages/patrol/example/android/app/build.gradle @@ -33,7 +33,7 @@ android { jvmTarget = "1.8" } - //TODO verify + // TODO: Find workaround packagingOptions { pickFirst "META-INF/INDEX.LIST" pickFirst "META-INF/io.netty.versions.properties" From 3e23ba561affbae29dc01d002766249472e930e6 Mon Sep 17 00:00:00 2001 From: Bartek Pacia Date: Mon, 18 Sep 2023 14:01:40 +0200 Subject: [PATCH 093/110] remove unneded lines in `packagingOptions {}` (#1710) --- packages/patrol/example/android/app/build.gradle | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/patrol/example/android/app/build.gradle b/packages/patrol/example/android/app/build.gradle index 067721752..af8d1fd21 100644 --- a/packages/patrol/example/android/app/build.gradle +++ b/packages/patrol/example/android/app/build.gradle @@ -35,8 +35,6 @@ android { // TODO: Find workaround packagingOptions { - pickFirst "META-INF/INDEX.LIST" - pickFirst "META-INF/io.netty.versions.properties" pickFirst "META-INF/DEPENDENCIES" } From 31fad79864b65b4f5a243c67ceebf803f633719e Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Mon, 18 Sep 2023 17:45:01 +0200 Subject: [PATCH 094/110] Remove coroutines-guava dependency, use ConditionVariable instead of SettableFuture --- packages/patrol/android/build.gradle | 1 - .../main/kotlin/pl/leancode/patrol/AutomatorServer.kt | 2 +- .../kotlin/pl/leancode/patrol/PatrolJUnitRunner.java | 9 ++------- .../src/main/kotlin/pl/leancode/patrol/PatrolServer.kt | 6 ++---- 4 files changed, 5 insertions(+), 13 deletions(-) diff --git a/packages/patrol/android/build.gradle b/packages/patrol/android/build.gradle index d7feddf65..d34afe114 100644 --- a/packages/patrol/android/build.gradle +++ b/packages/patrol/android/build.gradle @@ -70,7 +70,6 @@ android { implementation "org.http4k:http4k-client-apache" implementation "org.http4k:http4k-server-ktorcio" implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.0" - implementation "org.jetbrains.kotlinx:kotlinx-coroutines-guava:1.5.2" testImplementation "org.jetbrains.kotlin:kotlin-test" } diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/AutomatorServer.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/AutomatorServer.kt index 158c1c5a0..6ea616c19 100644 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/AutomatorServer.kt +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/AutomatorServer.kt @@ -208,6 +208,6 @@ class AutomatorServer(private val automation: Automator) : NativeAutomatorServer } override fun markPatrolAppServiceReady() { - PatrolServer.appReady.set(true) + PatrolServer.appReady.open() } } diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolJUnitRunner.java b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolJUnitRunner.java index 1109f60bf..03c969a7e 100644 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolJUnitRunner.java +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolJUnitRunner.java @@ -96,13 +96,8 @@ public PatrolAppServiceClient createAppServiceClient() { public void waitForPatrolAppService() { final String TAG = "PatrolJUnitRunner.setUp(): "; - try { - Logger.INSTANCE.i(TAG + "Waiting for PatrolAppService to report its readiness..."); - PatrolServer.Companion.getAppReadyFuture().get(); - } catch (InterruptedException | ExecutionException e) { - Logger.INSTANCE.e(TAG + "Exception was thrown when waiting for appReady: ", e); - throw new RuntimeException(e); - } + Logger.INSTANCE.i(TAG + "Waiting for PatrolAppService to report its readiness..."); + PatrolServer.Companion.getAppReady().block(); Logger.INSTANCE.i(TAG + "PatrolAppService is ready to report Dart tests"); } diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolServer.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolServer.kt index 3e8d395a8..8d588b2fa 100644 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolServer.kt +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolServer.kt @@ -1,7 +1,7 @@ package pl.leancode.patrol +import android.os.ConditionVariable import androidx.test.platform.app.InstrumentationRegistry -import com.google.common.util.concurrent.SettableFuture import org.http4k.core.ContentType import org.http4k.filter.ServerFilters import org.http4k.server.Http4kServer @@ -44,9 +44,7 @@ class PatrolServer { } companion object { - val appReady: SettableFuture = SettableFuture.create() - val appReadyFuture: Future - get() = appReady + val appReady: ConditionVariable = ConditionVariable() } } From e31e1c20a9e5b22ee705756b661e4d392304fd97 Mon Sep 17 00:00:00 2001 From: Damian Cudzik Date: Mon, 18 Sep 2023 17:50:35 +0200 Subject: [PATCH 095/110] Remove unused import --- .../android/src/main/kotlin/pl/leancode/patrol/PatrolServer.kt | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolServer.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolServer.kt index 8d588b2fa..fc82c0870 100644 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolServer.kt +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolServer.kt @@ -7,7 +7,6 @@ import org.http4k.filter.ServerFilters import org.http4k.server.Http4kServer import org.http4k.server.KtorCIO import org.http4k.server.asServer -import java.util.concurrent.Future class PatrolServer { private val envPortKey = "PATROL_PORT" From b0b579fdce17792184a8f7a3f52fe78ee3483102 Mon Sep 17 00:00:00 2001 From: Bartek Pacia Date: Tue, 19 Sep 2023 12:51:49 +0200 Subject: [PATCH 096/110] Use OkHttp client in instrumentation app (#1711) * migrate to OkHttp client * remove `packagingOptions {}` block * set connectionSpecs, still failing * downgrade to OkHttp 2.7.5 * patrol_gen: update code generator for PatrolAppServiceClient --- packages/patrol/android/build.gradle | 2 +- .../leancode/patrol/PatrolAppServiceClient.kt | 9 +-- .../contracts/PatrolAppServiceClient.kt | 56 ++++++++++--------- .../patrol/example/android/app/build.gradle | 5 -- .../android_http4k_client_generator.dart | 54 +++++++++--------- 5 files changed, 63 insertions(+), 63 deletions(-) diff --git a/packages/patrol/android/build.gradle b/packages/patrol/android/build.gradle index d34afe114..681dd2537 100644 --- a/packages/patrol/android/build.gradle +++ b/packages/patrol/android/build.gradle @@ -67,7 +67,7 @@ android { implementation platform("org.http4k:http4k-bom:5.7.4.0") implementation "org.http4k:http4k-core" - implementation "org.http4k:http4k-client-apache" + implementation "com.squareup.okhttp:okhttp:2.7.5" // See https://github.com/square/okhttp/issues/8031 implementation "org.http4k:http4k-server-ktorcio" implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.0" diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolAppServiceClient.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolAppServiceClient.kt index eb163fbdf..7bdfa7bad 100644 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolAppServiceClient.kt +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolAppServiceClient.kt @@ -1,8 +1,8 @@ package pl.leancode.patrol -import org.apache.hc.core5.util.Timeout import pl.leancode.patrol.contracts.Contracts import pl.leancode.patrol.contracts.PatrolAppServiceClientException +import java.util.concurrent.TimeUnit import pl.leancode.patrol.contracts.PatrolAppServiceClient as Client /** @@ -13,15 +13,16 @@ class PatrolAppServiceClient { private var client: Client // https://github.com/leancodepl/patrol/issues/1683 - private val timeout = Timeout.ofHours(2) + private val timeout = 2L + private val timeUnit = TimeUnit.HOURS constructor() { - client = Client(address = "localhost", port = 8082, timeout = timeout) + client = Client(address = "localhost", port = 8082, timeout = timeout, timeUnit = timeUnit) Logger.i("Created PatrolAppServiceClient: ${client.serverUrl}") } constructor(address: String) { - client = Client(address = address, port = 8082, timeout = timeout) + client = Client(address = address, port = 8082, timeout = timeout, timeUnit = timeUnit) Logger.i("Created PatrolAppServiceClient: ${client.serverUrl}") } diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/PatrolAppServiceClient.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/PatrolAppServiceClient.kt index f1a9b8c7a..5f39bd12e 100644 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/PatrolAppServiceClient.kt +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/PatrolAppServiceClient.kt @@ -5,55 +5,57 @@ package pl.leancode.patrol.contracts; +import com.squareup.okhttp.MediaType +import com.squareup.okhttp.OkHttpClient +import com.squareup.okhttp.Request +import com.squareup.okhttp.RequestBody import kotlinx.serialization.encodeToString import kotlinx.serialization.json.Json -import org.apache.hc.client5.http.config.RequestConfig -import org.apache.hc.client5.http.impl.classic.HttpClients -import org.apache.hc.core5.util.Timeout -import org.http4k.client.ApacheClient -import org.http4k.core.Method -import org.http4k.core.Request -import org.http4k.core.Status +import java.util.concurrent.TimeUnit -class PatrolAppServiceClient(private val address: String, private val port: Int, private val timeout: Timeout) { +class PatrolAppServiceClient(address: String, port: Int, private val timeout: Long, private val timeUnit: TimeUnit) { - fun listDartTests() : Contracts.ListDartTestsResponse { + fun listDartTests(): Contracts.ListDartTestsResponse { val response = performRequest("listDartTests") return json.decodeFromString(response) } - fun runDartTest(request: Contracts.RunDartTestRequest) : Contracts.RunDartTestResponse { + fun runDartTest(request: Contracts.RunDartTestRequest): Contracts.RunDartTestResponse { val response = performRequest("runDartTest", json.encodeToString(request)) return json.decodeFromString(response) } private fun performRequest(path: String, requestBody: String? = null): String { - var request = Request(Method.POST, "$serverUrl$path") - if (requestBody != null) { - request = request.body(requestBody) + val endpoint = "$serverUrl$path" + + val client = OkHttpClient().apply { + setConnectTimeout(timeout, timeUnit) + setReadTimeout(timeout, timeUnit) + setWriteTimeout(timeout, timeUnit) } - val client = ApacheClient( - HttpClients.custom().setDefaultRequestConfig( - RequestConfig - .copy(RequestConfig.DEFAULT) - .setResponseTimeout(timeout) - .setConnectionRequestTimeout(timeout) - .build() - ).build()) - - val response = client(request) - - if (response.status != Status.OK) { - throw PatrolAppServiceClientException("Invalid response ${response.status}, ${response.bodyString()}") + val request = Request.Builder() + .url(endpoint) + .also { + if (requestBody != null) { + it.post(RequestBody.create(jsonMediaType, requestBody)) + } + } + .build() + + val response = client.newCall(request).execute() + if (response.code() != 200) { + throw PatrolAppServiceClientException("Invalid response ${response.code()}, ${response?.body()?.string()}") } - return response.bodyString() + return response.body().string() } val serverUrl = "http://$address:$port/" private val json = Json { ignoreUnknownKeys = true } + + private val jsonMediaType = MediaType.parse("application/json; charset=utf-8") } class PatrolAppServiceClientException(message: String) : Exception(message) diff --git a/packages/patrol/example/android/app/build.gradle b/packages/patrol/example/android/app/build.gradle index af8d1fd21..cb9dd3f5c 100644 --- a/packages/patrol/example/android/app/build.gradle +++ b/packages/patrol/example/android/app/build.gradle @@ -32,11 +32,6 @@ android { kotlinOptions { jvmTarget = "1.8" } - - // TODO: Find workaround - packagingOptions { - pickFirst "META-INF/DEPENDENCIES" - } sourceSets { main.java.srcDirs += "src/main/kotlin" diff --git a/packages/patrol_gen/lib/src/generators/android/android_http4k_client_generator.dart b/packages/patrol_gen/lib/src/generators/android/android_http4k_client_generator.dart index 0773c0daa..2ecf09a90 100644 --- a/packages/patrol_gen/lib/src/generators/android/android_http4k_client_generator.dart +++ b/packages/patrol_gen/lib/src/generators/android/android_http4k_client_generator.dart @@ -25,15 +25,13 @@ class AndroidHttp4kClientGenerator { package ${config.package}; +import com.squareup.okhttp.MediaType +import com.squareup.okhttp.OkHttpClient +import com.squareup.okhttp.Request +import com.squareup.okhttp.RequestBody import kotlinx.serialization.encodeToString import kotlinx.serialization.json.Json -import org.apache.hc.client5.http.config.RequestConfig -import org.apache.hc.client5.http.impl.classic.HttpClients -import org.apache.hc.core5.util.Timeout -import org.http4k.client.ApacheClient -import org.http4k.core.Method -import org.http4k.core.Request -import org.http4k.core.Status +import java.util.concurrent.TimeUnit '''; } @@ -42,42 +40,46 @@ import org.http4k.core.Status const url = r'"http://$address:$port/"'; final endpoints = service.endpoints.map(_createEndpoint).join('\n\n'); const throwException = - r'throw PatrolAppServiceClientException("Invalid response ${response.status}, ${response.bodyString()}")'; + r'throw PatrolAppServiceClientException("Invalid response ${response.code()}, ${response?.body()?.string()}")'; const urlWithPath = r'"$serverUrl$path"'; return ''' -class ${service.name}Client(private val address: String, private val port: Int, private val timeout: Timeout) { +class ${service.name}Client(address: String, port: Int, private val timeout: Long, private val timeUnit: TimeUnit) { $endpoints private fun performRequest(path: String, requestBody: String? = null): String { - var request = Request(Method.POST, $urlWithPath) - if (requestBody != null) { - request = request.body(requestBody) + val endpoint = $urlWithPath + + val client = OkHttpClient().apply { + setConnectTimeout(timeout, timeUnit) + setReadTimeout(timeout, timeUnit) + setWriteTimeout(timeout, timeUnit) } - val client = ApacheClient( - HttpClients.custom().setDefaultRequestConfig( - RequestConfig - .copy(RequestConfig.DEFAULT) - .setResponseTimeout(timeout) - .setConnectionRequestTimeout(timeout) - .build() - ).build()) - - val response = client(request) - - if (response.status != Status.OK) { + val request = Request.Builder() + .url(endpoint) + .also { + if (requestBody != null) { + it.post(RequestBody.create(jsonMediaType, requestBody)) + } + } + .build() + + val response = client.newCall(request).execute() + if (response.code() != 200) { $throwException } - return response.bodyString() + return response.body().string() } val serverUrl = $url private val json = Json { ignoreUnknownKeys = true } + + private val jsonMediaType = MediaType.parse("application/json; charset=utf-8") }'''; } @@ -100,7 +102,7 @@ $endpoints return performRequest("${endpoint.name}"$serializeParameter)'''; return ''' - fun ${endpoint.name}($parameterDef) $returnDef { + fun ${endpoint.name}($parameterDef)$returnDef { $body }'''; } From 652cd516ac95cc3920a4bb20a1cc5585a652ca9c Mon Sep 17 00:00:00 2001 From: Bartek Pacia Date: Tue, 19 Sep 2023 14:11:41 +0200 Subject: [PATCH 097/110] patrol: bump version to 2.3.0-dev.3 (#1720) --- packages/patrol/CHANGELOG.md | 5 +++++ packages/patrol/pubspec.yaml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/patrol/CHANGELOG.md b/packages/patrol/CHANGELOG.md index a7bcd7288..e094636a7 100644 --- a/packages/patrol/CHANGELOG.md +++ b/packages/patrol/CHANGELOG.md @@ -1,3 +1,8 @@ +## 2.3.0-dev.3 + +- Fix problem with Gradle build failing unless correct `packagingOptions {}` are + specified (#1709) (#1711) + ## 2.3.0-dev.2 - Replace Protocol Buffers and gRPC with a custom code generation solution that diff --git a/packages/patrol/pubspec.yaml b/packages/patrol/pubspec.yaml index b21bd45b9..d23236c01 100644 --- a/packages/patrol/pubspec.yaml +++ b/packages/patrol/pubspec.yaml @@ -2,7 +2,7 @@ name: patrol description: > Powerful Flutter-native UI testing framework overcoming limitations of existing Flutter testing tools. Ready for action! -version: 2.3.0-dev.2 +version: 2.3.0-dev.3 homepage: https://patrol.leancode.co repository: https://github.com/leancodepl/patrol issue_tracker: https://github.com/leancodepl/patrol/issues From 7a232ab94ff6c802f922a8d2c55e1186240ab7f7 Mon Sep 17 00:00:00 2001 From: Bartek Pacia Date: Wed, 20 Sep 2023 14:19:19 +0200 Subject: [PATCH 098/110] Fix test name label blocking hit testing (#1731) * reproduce bug with test name label blocking hittesting * fix the bug - use IgnorePointer * remove bug repro --- packages/patrol/lib/src/binding.dart | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/patrol/lib/src/binding.dart b/packages/patrol/lib/src/binding.dart index 02a61d8b7..1c1988b86 100644 --- a/packages/patrol/lib/src/binding.dart +++ b/packages/patrol/lib/src/binding.dart @@ -193,10 +193,12 @@ class PatrolBinding extends IntegrationTestWidgetsFlutterBinding { top: MediaQueryData.fromWindow(window).padding.top + 4, left: 4, ), - child: Text( - _currentDartTest!, - textDirection: TextDirection.ltr, - style: const TextStyle(color: Colors.red), + child: IgnorePointer( + child: Text( + _currentDartTest!, + textDirection: TextDirection.ltr, + style: const TextStyle(color: Colors.red), + ), ), ), ), From cdd2df83d17a58e9bdbb1a9372d2fa3e374a674c Mon Sep 17 00:00:00 2001 From: Bartek Pacia Date: Wed, 20 Sep 2023 14:58:39 +0200 Subject: [PATCH 099/110] patrol: bump version to 2.3.0-dev.4 (#1734) --- packages/patrol/CHANGELOG.md | 4 ++++ packages/patrol/pubspec.yaml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/patrol/CHANGELOG.md b/packages/patrol/CHANGELOG.md index e094636a7..368254a12 100644 --- a/packages/patrol/CHANGELOG.md +++ b/packages/patrol/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.3.0-dev.4 + +- Fix test name label blocking hit testing (#1731) + ## 2.3.0-dev.3 - Fix problem with Gradle build failing unless correct `packagingOptions {}` are diff --git a/packages/patrol/pubspec.yaml b/packages/patrol/pubspec.yaml index d23236c01..0d1a0a489 100644 --- a/packages/patrol/pubspec.yaml +++ b/packages/patrol/pubspec.yaml @@ -2,7 +2,7 @@ name: patrol description: > Powerful Flutter-native UI testing framework overcoming limitations of existing Flutter testing tools. Ready for action! -version: 2.3.0-dev.3 +version: 2.3.0-dev.4 homepage: https://patrol.leancode.co repository: https://github.com/leancodepl/patrol issue_tracker: https://github.com/leancodepl/patrol/issues From 4211399e946fa2268527db8b02baeb7959457f25 Mon Sep 17 00:00:00 2001 From: Bartek Pacia Date: Thu, 21 Sep 2023 09:13:52 +0200 Subject: [PATCH 100/110] Merge master into develop (#1740) * Use iPhone 15 Pro Max on CirrusCI (#1718) * Move emulator/simulator webview tests to own workflows (#1716) * Add missing label (#1719) * Add missing label * Use flutter 3.13 and xcode 15 * Bump to 2.8.0 (#1722) * Trim trailing comma (#1735) * Fix (#1736) * remove notice about Patrol 2.0 (#1738) * patrol: bump version to 2.2.5 (#1739) --------- Co-authored-by: EthnosDev <123928164+ethnosdev@users.noreply.github.com> Co-authored-by: Filip Tuzimek <63547653+fylyppo@users.noreply.github.com> --- .cirrus.yml | 8 +- .github/labeler.yml | 2 + .github/workflows/test-android-device.yaml | 3 +- .../test-android-emulator-webview.yaml | 109 +++++++++++++ .github/workflows/test-android-emulator.yaml | 8 +- .github/workflows/test-ios-device.yaml | 1 + .../workflows/test-ios-simulator-webview.yaml | 146 ++++++++++++++++++ .github/workflows/test-ios-simulator.yaml | 4 +- docs/getting-started.mdx | 2 +- packages/patrol/example/emulatorwtf.yaml | 9 ++ packages/patrol_cli/CHANGELOG.md | 4 + .../lib/src/runner/patrol_command_runner.dart | 8 - 12 files changed, 288 insertions(+), 16 deletions(-) create mode 100644 .github/workflows/test-android-emulator-webview.yaml create mode 100644 .github/workflows/test-ios-simulator-webview.yaml diff --git a/.cirrus.yml b/.cirrus.yml index 5940e9ce6..d71032c87 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -3,6 +3,7 @@ test_linux_task: required_pr_labels: - 'package: patrol_cli' - 'package: patrol' + - 'cirrusci' container: image: ghcr.io/cirruslabs/flutter:stable cpu: 6 @@ -10,7 +11,7 @@ test_linux_task: kvm: 'true' env: PATH: $HOME/.pub-cache/bin:$HOME/fvm/default/bin:$CIRRUS_WORKING_DIR/fvm:${PATH} - FLUTTER_VERSION: '3.10' + FLUTTER_VERSION: '3.13' EMULATOR_API_LEVEL: '34' EMULATOR_ABI: google_apis_playstore;x86_64 EMULATOR_IMAGE: system-images;android-${EMULATOR_API_LEVEL};${EMULATOR_ABI} @@ -71,11 +72,12 @@ test_macos_task: required_pr_labels: - 'package: patrol_cli' - 'package: patrol' + - 'cirrusci' macos_instance: image: ghcr.io/cirruslabs/macos-ventura-xcode:latest env: PATH: $HOME/.pub-cache/bin:$HOME/fvm/default/bin:${PATH} - FLUTTER_VERSION: '3.10' + FLUTTER_VERSION: '3.13' timeout_in: 30m set_up_fvm_script: | @@ -94,7 +96,7 @@ test_macos_task: setup_patrol_cli_script: - dart pub global activate --source path packages/patrol_cli && patrol setup_simulator_script: | - xcrun simctl boot "iPhone 14 Pro Max" + xcrun simctl boot "iPhone 15 Pro Max" patrol_test_script: | cd dev/cli_tests dart pub get diff --git a/.github/labeler.yml b/.github/labeler.yml index 7a12d8d8a..0a32aea1c 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -2,6 +2,8 @@ - packages/adb/**/* 'package: patrol_cli': - packages/patrol_cli/**/* +'cirrusci': + - .cirrus.yml 'package: patrol': - packages/patrol/**/* 'docs': diff --git a/.github/workflows/test-android-device.yaml b/.github/workflows/test-android-device.yaml index 7b1ce354f..eb44186c6 100644 --- a/.github/workflows/test-android-device.yaml +++ b/.github/workflows/test-android-device.yaml @@ -47,7 +47,7 @@ jobs: uses: google-github-actions/setup-gcloud@v1 - name: Gradle cache - uses: gradle/gradle-build-action@v2 + uses: gradle/gradle-build-action@v2.8.0 with: generate-job-summary: false @@ -76,6 +76,7 @@ jobs: for target in $(echo $TESTS_TO_EXCLUDE | tr ',' '\n'); do target_paths+="integration_test/${target}.dart," done + target_paths="${target_paths%,}" echo "EXCLUDED_TESTS=$TESTS_TO_EXCLUDE" >> "$GITHUB_OUTPUT" echo "EXCLUDED_TESTS=$target_paths" >> "$GITHUB_ENV" diff --git a/.github/workflows/test-android-emulator-webview.yaml b/.github/workflows/test-android-emulator-webview.yaml new file mode 100644 index 000000000..5a3734586 --- /dev/null +++ b/.github/workflows/test-android-emulator-webview.yaml @@ -0,0 +1,109 @@ +name: test android emulator webview + +on: + workflow_dispatch: + schedule: + - cron: '0 */24 * * *' + +jobs: + run_tests: + name: Flutter ${{ matrix.flutter_version }} webview on emulator.wtf + runs-on: ubuntu-latest + timeout-minutes: 30 + outputs: + SLACK_MESSAGE_TITLE: Flutter ${{ matrix.flutter_version }} webview on emulator.wtf + TESTS_EXIT_CODE: ${{ steps.tests_step.outputs.TESTS_EXIT_CODE }} + URL_TO_DETAILS: ${{ steps.tests_step.outputs.URL_TO_DETAILS }} + + strategy: + fail-fast: false + matrix: + flutter_version: ['3.13.x'] + + defaults: + run: + working-directory: packages/patrol/example + + steps: + - name: Clone repository + uses: actions/checkout@v3 + + - name: Set up Java + uses: actions/setup-java@v3 + with: + distribution: temurin + java-version: 17 + + - name: Gradle cache + uses: gradle/gradle-build-action@v2.8.0 + with: + generate-job-summary: false + + - name: Set up Flutter + uses: subosito/flutter-action@v2 + with: + flutter-version: ${{ matrix.flutter_version }} + + - name: Preload Flutter artifacts + run: flutter precache + + - name: Set up Patrol CLI + working-directory: packages/patrol_cli + run: dart pub global activate --source path . && patrol + + - name: Generate Gradle wrapper + run: flutter build apk --debug --flavor=does-not-exist || true + + - name: Install ew-cli + run: | + mkdir -p "$HOME/bin" + curl "https://maven.emulator.wtf/releases/ew-cli" -o "$HOME/bin/ew-cli" + chmod a+x "$HOME/bin/ew-cli" + echo "$HOME/bin" >> $GITHUB_PATH + echo "EW_API_TOKEN=${{ secrets.EW_API_TOKEN }}" >> $GITHUB_ENV + + - name: Set tests to include + run: | + TESTS_TO_INCLUDE="webview_hackernews_test,\ + webview_leancode_test,\ + webview_stackoverflow_test" + + target_paths="" + for target in $(echo $TESTS_TO_INCLUDE | tr ',' '\n'); do + target_paths+="integration_test/${target}.dart," + done + target_paths="${target_paths%,}" + + echo "INCLUDED_TESTS=$target_paths" >> "$GITHUB_ENV" + + - name: patrol build android + run: patrol build android --target ${{ env.INCLUDED_TESTS }} --verbose + + - name: Upload APKs to emulator.wtf and wait for tests to finish + id: tests_step + run: | + set +e + output="$(ew-cli \ + emulatorwtf.yaml:ci_webview --json \ + --display-name "Patrol example app (${GITHUB_SHA::7})")" + TESTS_EXIT_CODE=$? + set -e + + # Extract the results URL and write it to Github Summmary + link="$(echo "$output" | jq -r ".resultsUrl")" + echo "[Test details on emulator.wtf]($link) (LeanCode members only)" >> "$GITHUB_STEP_SUMMARY" + + echo "URL_TO_DETAILS=$link" >> "$GITHUB_OUTPUT" + echo "TESTS_EXIT_CODE=$TESTS_EXIT_CODE" >> "$GITHUB_OUTPUT" + exit $TESTS_EXIT_CODE + + call_send_slack_message: + name: Notify on Slack + uses: ./.github/workflows/send-slack-message.yaml + needs: run_tests + if: always() + with: + TESTS_EXIT_CODE: ${{ needs.run_tests.outputs.TESTS_EXIT_CODE }} + SLACK_MESSAGE_TITLE: ${{ needs.run_tests.outputs.SLACK_MESSAGE_TITLE }} + URL_TO_DETAILS: ${{ needs.run_tests.outputs.URL_TO_DETAILS }} + secrets: inherit diff --git a/.github/workflows/test-android-emulator.yaml b/.github/workflows/test-android-emulator.yaml index ae8eff364..ae67ec21d 100644 --- a/.github/workflows/test-android-emulator.yaml +++ b/.github/workflows/test-android-emulator.yaml @@ -36,7 +36,7 @@ jobs: java-version: 17 - name: Gradle cache - uses: gradle/gradle-build-action@v2 + uses: gradle/gradle-build-action@v2.8.0 with: generate-job-summary: false @@ -68,12 +68,16 @@ jobs: run: | TESTS_TO_EXCLUDE="service_airplane_mode_test,\ service_bluetooth_test,\ - notifications_test" + notifications_test,\ + webview_hackernews_test,\ + webview_leancode_test,\ + webview_stackoverflow_test" target_paths="" for target in $(echo $TESTS_TO_EXCLUDE | tr ',' '\n'); do target_paths+="integration_test/${target}.dart," done + target_paths="${target_paths%,}" echo "EXCLUDED_TESTS=$TESTS_TO_EXCLUDE" >> "$GITHUB_OUTPUT" echo "EXCLUDED_TESTS=$target_paths" >> "$GITHUB_ENV" diff --git a/.github/workflows/test-ios-device.yaml b/.github/workflows/test-ios-device.yaml index 99bee1f4b..3b0f3fa41 100644 --- a/.github/workflows/test-ios-device.yaml +++ b/.github/workflows/test-ios-device.yaml @@ -91,6 +91,7 @@ jobs: for target in $(echo $TESTS_TO_EXCLUDE | tr ',' '\n'); do target_paths+="integration_test/${target}.dart," done + target_paths="${target_paths%,}" echo "EXCLUDED_TESTS=$TESTS_TO_EXCLUDE" >> "$GITHUB_OUTPUT" echo "EXCLUDED_TESTS=$target_paths" >> "$GITHUB_ENV" diff --git a/.github/workflows/test-ios-simulator-webview.yaml b/.github/workflows/test-ios-simulator-webview.yaml new file mode 100644 index 000000000..dbbf59bb1 --- /dev/null +++ b/.github/workflows/test-ios-simulator-webview.yaml @@ -0,0 +1,146 @@ +name: test ios simulator webview + +on: + workflow_dispatch: + schedule: + - cron: '0 */24 * * *' + +jobs: + run_tests: + name: Flutter ${{ matrix.flutter_version }} webview on ${{ matrix.device_model }} (${{ matrix.os_version }}) simulator + runs-on: macos-latest + timeout-minutes: 40 + outputs: + SLACK_MESSAGE_TITLE: Flutter ${{ matrix.flutter_version }} on ${{ matrix.os }} ${{ matrix.os_version }} simulator + TESTS_EXIT_CODE: ${{ steps.tests_step.outputs.TESTS_EXIT_CODE }} + FAILURE_STATUS: ${{ steps.status_step.outputs.FAILURE_STATUS }} + ERROR_STATUS: ${{ steps.status_step.outputs.ERROR_STATUS }} + + strategy: + fail-fast: false + matrix: + flutter_version: ['3.13.x'] + device_model: [iPhone 14] + os: [iOS] + os_version: ['16.2'] + + defaults: + run: + working-directory: packages/patrol/example + + steps: + - name: Clone repository + uses: actions/checkout@v3 + + - name: Set up Flutter + uses: subosito/flutter-action@v2 + with: + flutter-version: ${{ matrix.flutter_version }} + + - name: Preload Flutter artifacts + run: flutter precache + + - name: Set up Patrol CLI + working-directory: packages/patrol_cli + run: dart pub global activate --source path . && patrol + + - name: Start iOS simulator + uses: futureware-tech/simulator-action@v2 + with: + model: ${{ matrix.device_model }} + os: ${{ matrix.os }} + os_version: ${{ matrix.os_version }} + erase_before_boot: true + shutdown_after_job: true + + - name: Set tests to include + run: | + TESTS_TO_INCLUDE="webview_hackernews_test,\ + webview_leancode_test,\ + webview_stackoverflow_test" + + target_paths="" + for target in $(echo $TESTS_TO_INCLUDE | tr ',' '\n'); do + target_paths+="integration_test/${target}.dart," + done + target_paths="${target_paths%,}" + + echo "INCLUDED_TESTS=$target_paths" >> "$GITHUB_ENV" + + - name: Run tests + id: tests_step + run: | + xcrun simctl io booted recordVideo --codec=h264 "${{ matrix.device_model }}.mp4" & + recordingpid="$!" + + xcrun simctl spawn booted log stream --type log --color none > all_simulator_logs.txt & + logpid="$!" + + sleep 10 # See https://github.com/leancodepl/patrol/issues/1282 + + TESTS_EXIT_CODE=0 + patrol test --target ${{ env.INCLUDED_TESTS }} --verbose || TESTS_EXIT_CODE=$? + + kill -SIGINT $recordingpid + kill -SIGINT $logpid + echo "TESTS_EXIT_CODE=$TESTS_EXIT_CODE" >> "$GITHUB_OUTPUT" + exit $TESTS_EXIT_CODE + + - name: Check if something went wrong + id: status_step + if: always() + run: > + if [ -z ${{ steps.tests_step.outputs.TESTS_EXIT_CODE }} ]; then + echo "ERROR_STATUS=error" >> "$GITHUB_OUTPUT"; + elif [ ! ${{ steps.tests_step.outputs.TESTS_EXIT_CODE }} == 0 ]; then + echo "FAILURE_STATUS=failure" >> "$GITHUB_OUTPUT"; + fi; + + - name: Find xcresult path + if: ${{ (failure() || success()) && contains(fromJson('["success", "failure"]'), steps.tests_step.conclusion) }} + run: | + brew install coreutils # to provide realpath binary + echo "XCRESULT_PATH=$(realpath build/ios_results_*.xcresult)" >> $GITHUB_ENV + + - name: Publish test report to summary + if: ${{ (failure() || success()) && contains(fromJson('["success", "failure"]'), steps.tests_step.conclusion) }} + uses: kishikawakatsumi/xcresulttool@v1 + with: + title: Patrol tests on ${{ matrix.device_model }} + upload-bundles: never + path: | + ${{ env.XCRESULT_PATH }} + + - name: Upload XCRESULT test result to artifacts + if: ${{ (failure() || success()) && contains(fromJson('["success", "failure"]'), steps.tests_step.conclusion) }} + uses: actions/upload-artifact@v3 + with: + name: Test result from ${{ matrix.device_model }}.xcresult + path: ${{ env.XCRESULT_PATH }} + + - name: Upload simulator logs to artifacts + if: ${{ (failure() || success()) && contains(fromJson('["success", "failure"]'), steps.tests_step.conclusion) }} + uses: actions/upload-artifact@v3 + with: + name: Logs from ${{ matrix.device_model }} + path: | + ${{ github.workspace }}/packages/patrol/example/all_simulator_logs.txt + + - name: Upload captured video to artifacts + if: ${{ (failure() || success()) && contains(fromJson('["success", "failure"]'), steps.tests_step.conclusion) }} + uses: actions/upload-artifact@v3 + with: + name: Captured video from ${{ matrix.device_model }}.mp4 + path: ${{ github.workspace }}/packages/patrol/example/${{ matrix.device_model }}.mp4 + + call_send_slack_message: + name: Notify on Slack + uses: ./.github/workflows/send-slack-message.yaml + needs: run_tests + if: always() + with: + TESTS_EXIT_CODE: ${{ needs.run_tests.outputs.TESTS_EXIT_CODE }} + FAILURE_STATUS: ${{ needs.run_tests.outputs.FAILURE_STATUS }} + ERROR_STATUS: ${{ needs.run_tests.outputs.ERROR_STATUS }} + SLACK_MESSAGE_TITLE: ${{ needs.run_tests.outputs.SLACK_MESSAGE_TITLE }} + secrets: inherit diff --git a/.github/workflows/test-ios-simulator.yaml b/.github/workflows/test-ios-simulator.yaml index c25ed1fae..556affeb0 100644 --- a/.github/workflows/test-ios-simulator.yaml +++ b/.github/workflows/test-ios-simulator.yaml @@ -46,7 +46,6 @@ jobs: run: dart pub global activate --source path . && patrol - name: Start iOS simulator - id: start_simulator uses: futureware-tech/simulator-action@v2 with: model: ${{ matrix.device_model }} @@ -67,12 +66,15 @@ jobs: service_cellular_test,\ service_wifi_test,\ webview_stackoverflow_test,\ + webview_leancode_test,\ + webview_hackernews_test,\ swipe_test" target_paths="" for target in $(echo $TESTS_TO_EXCLUDE | tr ',' '\n'); do target_paths+="integration_test/${target}.dart," done + target_paths="${target_paths%,}" echo "EXCLUDED_TESTS=$TESTS_TO_EXCLUDE" >> "$GITHUB_OUTPUT" echo "EXCLUDED_TESTS=$target_paths" >> "$GITHUB_ENV" diff --git a/docs/getting-started.mdx b/docs/getting-started.mdx index f4103333c..b3a93a73d 100644 --- a/docs/getting-started.mdx +++ b/docs/getting-started.mdx @@ -177,7 +177,7 @@ Psst... Android is a bit easier to set up, so we recommend starting with it! end ``` - 6. Create an empty file `integration_test/example_test.dart`. From the command line, run: + 6. Create an empty file `integration_test/example_test.dart` in the root of your Flutter project. From the command line, run: ``` $ flutter build ios --config-only integration_test/example_test.dart diff --git a/packages/patrol/example/emulatorwtf.yaml b/packages/patrol/example/emulatorwtf.yaml index 3fed010d1..bae9a022c 100644 --- a/packages/patrol/example/emulatorwtf.yaml +++ b/packages/patrol/example/emulatorwtf.yaml @@ -42,6 +42,12 @@ ci_devices: # version: 27 # gpu: auto +ci_webview_devices: + device: + - model: Pixel7 + version: 31 + gpu: auto + config: use-orchestrator: true clear-package-data: true @@ -63,5 +69,8 @@ config_ci: ci: include: [apps, ci_devices, config, config_ci] +ci_webview: + include: [apps, ci_webview_devices, config, config_ci] + debug: include: [apps, all_devices, config] diff --git a/packages/patrol_cli/CHANGELOG.md b/packages/patrol_cli/CHANGELOG.md index 0a9154ab1..ad38ead48 100644 --- a/packages/patrol_cli/CHANGELOG.md +++ b/packages/patrol_cli/CHANGELOG.md @@ -10,6 +10,10 @@ This version requires version 2.3.0-dev.2 of `patrol` package. This version requires version 2.3.0-dev.1 of `patrol` package. +## 2.1.5 + +- Remove notice about migrating to Patrol 2.0 (#1738) + ## 2.1.4 - Uninstall RunnerUITests app on iOS when flavor is present (#1694) diff --git a/packages/patrol_cli/lib/src/runner/patrol_command_runner.dart b/packages/patrol_cli/lib/src/runner/patrol_command_runner.dart index 3b493d689..74780d63b 100644 --- a/packages/patrol_cli/lib/src/runner/patrol_command_runner.dart +++ b/packages/patrol_cli/lib/src/runner/patrol_command_runner.dart @@ -64,14 +64,6 @@ Disable this warning by setting the PATROL_FINDERS environment variable. '''); } - if (!platform.environment.containsKey('PATROL_MIGRATED')) { - logger.warn(''' -You're using Patrol CLI 2.0, which has breaking changes. -Read the migration guide at https://patrol.leancode.co/v2. -Disable this warning by setting the PATROL_MIGRATED environment variable. -'''); - } - ProcessSignal.sigint.watch().listen((signal) async { logger.detail('Caught SIGINT, exiting...'); await runner.dispose().onError((err, st) { From 9d37377bb295b7a8026bc1fcb8822fada0917ba1 Mon Sep 17 00:00:00 2001 From: Bartek Pacia Date: Fri, 29 Sep 2023 11:44:05 +0200 Subject: [PATCH 101/110] add a demo test that is failing --- .../integration_test/long_name_test.dart | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 packages/patrol/example/integration_test/long_name_test.dart diff --git a/packages/patrol/example/integration_test/long_name_test.dart b/packages/patrol/example/integration_test/long_name_test.dart new file mode 100644 index 000000000..6988819f9 --- /dev/null +++ b/packages/patrol/example/integration_test/long_name_test.dart @@ -0,0 +1,32 @@ +import 'package:flutter/material.dart'; + +import 'common.dart'; + +String _generateString(int length) { + return 'a' * length; +} + +void main() { + patrol( + // way too long for ATO because of https://github.com/android/android-test/issues/1935 + _generateString(200), + ($) async { + await createApp($); + + await $(FloatingActionButton).tap(); + expect($(#counterText).text, '1'); + + await $(#textField).enterText('Hello, Flutter!'); + expect($('Hello, Flutter!'), findsOneWidget); + + await $.native.pressHome(); + await $.native.openApp(); + + expect($(#counterText).text, '1'); + await $(FloatingActionButton).tap(); + + expect($(#counterText).text, '2'); + expect($('Hello, Flutter!'), findsOneWidget); + }, + ); +} From 0965b9eac68ad55d19e86ad272d2a4e62066c601 Mon Sep 17 00:00:00 2001 From: Bartek Pacia Date: Fri, 29 Sep 2023 11:48:58 +0200 Subject: [PATCH 102/110] refactor in preparation for the workaround Minimize the number of places that try to access the current test name using the Invoker API. --- .../integration_test/internal/group_test.dart | 6 ++--- packages/patrol/lib/src/binding.dart | 18 +++---------- packages/patrol/lib/src/common.dart | 11 +++----- packages/patrol/lib/src/extensions.dart | 16 ------------ packages/patrol/lib/src/global_state.dart | 26 +++++++++++++++++++ packages/patrol/test/internals_test.dart | 2 +- 6 files changed, 37 insertions(+), 42 deletions(-) delete mode 100644 packages/patrol/lib/src/extensions.dart create mode 100644 packages/patrol/lib/src/global_state.dart diff --git a/packages/patrol/example/integration_test/internal/group_test.dart b/packages/patrol/example/integration_test/internal/group_test.dart index 4acbc78ca..b938c20ba 100644 --- a/packages/patrol/example/integration_test/internal/group_test.dart +++ b/packages/patrol/example/integration_test/internal/group_test.dart @@ -1,6 +1,4 @@ -import 'package:patrol/src/extensions.dart'; -// ignore: depend_on_referenced_packages -import 'package:test_api/src/backend/invoker.dart'; +import 'package:patrol/src/global_state.dart' as global_state; import '../common.dart'; @@ -37,7 +35,7 @@ void main() { Future _testBody(PatrolTester $) async { await createApp($); - final testName = Invoker.current!.fullCurrentTestName(); + final testName = global_state.currentTestFullName; await $(#textField).enterText(testName); await $.native.pressHome(); diff --git a/packages/patrol/lib/src/binding.dart b/packages/patrol/lib/src/binding.dart index 1c1988b86..7d03225f7 100644 --- a/packages/patrol/lib/src/binding.dart +++ b/packages/patrol/lib/src/binding.dart @@ -1,18 +1,10 @@ -// We allow for using properties of IntegrationTestWidgetsFlutterBinding, which -// are marked as @visibleForTesting but we need them (we could write our own, -// but we're lazy and prefer to use theirs). - import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:integration_test/common.dart'; import 'package:integration_test/integration_test.dart'; import 'package:patrol/patrol.dart'; -import 'package:patrol/src/extensions.dart'; -// ignore: implementation_imports, depend_on_referenced_packages -import 'package:test_api/src/backend/invoker.dart'; - -// ignore: implementation_imports, depend_on_referenced_packages +import 'package:patrol/src/global_state.dart' as global_state; import 'constants.dart' as constants; @@ -60,7 +52,7 @@ class PatrolBinding extends IntegrationTestWidgetsFlutterBinding { return; } - _currentDartTest = Invoker.current!.fullCurrentTestName(); + _currentDartTest = global_state.currentTestFullName; }); tearDown(() async { @@ -69,7 +61,7 @@ class PatrolBinding extends IntegrationTestWidgetsFlutterBinding { return; } - final testName = Invoker.current!.liveTest.individualName; + final testName = global_state.currentTestIndividualName; final isTestExplorer = testName == 'patrol_test_explorer'; if (isTestExplorer) { return; @@ -79,8 +71,6 @@ class PatrolBinding extends IntegrationTestWidgetsFlutterBinding { ); } - final invoker = Invoker.current!; - final nameOfRequestedTest = await patrolAppService.testExecutionRequested; if (nameOfRequestedTest == _currentDartTest) { @@ -88,7 +78,7 @@ class PatrolBinding extends IntegrationTestWidgetsFlutterBinding { 'finished test $_currentDartTest. Will report its status back to the native side', ); - final passed = invoker.liveTest.state.result.isPassing; + final passed = global_state.isCurrentTestPassing(); logger( 'tearDown(): test "$testName" in group "$_currentDartTest", passed: $passed', ); diff --git a/packages/patrol/lib/src/common.dart b/packages/patrol/lib/src/common.dart index 1d417b789..d2702007a 100644 --- a/packages/patrol/lib/src/common.dart +++ b/packages/patrol/lib/src/common.dart @@ -1,5 +1,3 @@ -// ignore_for_file: invalid_use_of_internal_member, implementation_imports - import 'dart:io' as io; import 'package:flutter/foundation.dart'; @@ -7,12 +5,13 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:integration_test/integration_test.dart'; import 'package:meta/meta.dart'; import 'package:patrol/src/binding.dart'; -import 'package:patrol/src/extensions.dart'; +import 'package:patrol/src/global_state.dart' as global_state; import 'package:patrol/src/native/contracts/contracts.dart'; import 'package:patrol/src/native/native.dart'; import 'package:patrol_finders/patrol_finders.dart' as finders; +// ignore: implementation_imports import 'package:test_api/src/backend/group.dart'; -import 'package:test_api/src/backend/invoker.dart'; +// ignore: implementation_imports import 'package:test_api/src/backend/test.dart'; import 'constants.dart' as constants; @@ -116,10 +115,8 @@ void patrolTest( // "integration_test/examples" directory, we assume that the name of the // immediate parent group is "examples.example_test". - final testName = Invoker.current!.fullCurrentTestName(); - final requestedToExecute = await patrolBinding.patrolAppService - .waitForExecutionRequest(testName); + .waitForExecutionRequest(global_state.currentTestFullName); if (!requestedToExecute) { return; diff --git a/packages/patrol/lib/src/extensions.dart b/packages/patrol/lib/src/extensions.dart deleted file mode 100644 index 0f241bec9..000000000 --- a/packages/patrol/lib/src/extensions.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:meta/meta.dart'; -// ignore: implementation_imports -import 'package:test_api/src/backend/invoker.dart'; - -/// Provides convenience methods for [Invoker]. -@internal -extension InvokerX on Invoker { - /// Returns the full name of the current test (names of all ancestor groups + - /// name of the current test). - String fullCurrentTestName() { - final parentGroupName = liveTest.groups.last.name; - final testName = liveTest.individualName; - - return '$parentGroupName $testName'; - } -} diff --git a/packages/patrol/lib/src/global_state.dart b/packages/patrol/lib/src/global_state.dart new file mode 100644 index 000000000..f9c692fba --- /dev/null +++ b/packages/patrol/lib/src/global_state.dart @@ -0,0 +1,26 @@ +// ignore: implementation_imports +import 'package:test_api/src/backend/invoker.dart'; + +/// This file wraps the [Invoker] API, which is internal to package:test. We +/// want to minimize the usage of internal APIs to a minimum. + +/// Returns the full name of the current test (names of all ancestor groups + +/// name of the current test). +String get currentTestFullName { + final invoker = Invoker.current!; + + final parentGroupName = invoker.liveTest.groups.last.name; + final testName = invoker.liveTest.individualName; + + return '$parentGroupName $testName'; +} + +/// Returns the individual name of the current test. Omits all ancestor groups. +String get currentTestIndividualName { + return Invoker.current!.liveTest.individualName; +} + +/// Returns whether the current test is passing. +bool isCurrentTestPassing() { + return Invoker.current!.liveTest.state.result.isPassing; +} diff --git a/packages/patrol/test/internals_test.dart b/packages/patrol/test/internals_test.dart index da2175cd4..ecda2a49d 100644 --- a/packages/patrol/test/internals_test.dart +++ b/packages/patrol/test/internals_test.dart @@ -4,7 +4,7 @@ import 'package:patrol/src/common.dart' show createDartTestGroup, deduplicateGroupEntryName; import 'package:patrol/src/native/contracts/contracts.dart'; import 'package:test_api/src/backend/group.dart'; -import 'package:test_api/src/backend/invoker.dart'; +import 'package:test_api/src/backend/invoker.dart' show LocalTest; import 'package:test_api/src/backend/metadata.dart'; void main() { From b412a88854d9aa7b4020d439459fbe42d204cd5e Mon Sep 17 00:00:00 2001 From: Bartek Pacia Date: Fri, 29 Sep 2023 12:09:23 +0200 Subject: [PATCH 103/110] modify example_test to demo failing --- packages/patrol/example/integration_test/example_test.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/patrol/example/integration_test/example_test.dart b/packages/patrol/example/integration_test/example_test.dart index 62aeac09a..5efcbdbe9 100644 --- a/packages/patrol/example/integration_test/example_test.dart +++ b/packages/patrol/example/integration_test/example_test.dart @@ -4,7 +4,8 @@ import 'common.dart'; void main() { patrol( - 'counter state is the same after going to Home and switching apps', + // '${"alpha" * 30}ABCDE', / 12 + 1 + 150 = 163 + 'alpha' * 40, ($) async { await createApp($); From 44d6818baac3d75339654aac342d16c3ca0d5b05 Mon Sep 17 00:00:00 2001 From: Bartek Pacia Date: Fri, 29 Sep 2023 12:16:15 +0200 Subject: [PATCH 104/110] make `isCurrentTestPassing` into a getter --- packages/patrol/lib/src/binding.dart | 2 +- packages/patrol/lib/src/global_state.dart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/patrol/lib/src/binding.dart b/packages/patrol/lib/src/binding.dart index 7d03225f7..85328c4e7 100644 --- a/packages/patrol/lib/src/binding.dart +++ b/packages/patrol/lib/src/binding.dart @@ -78,7 +78,7 @@ class PatrolBinding extends IntegrationTestWidgetsFlutterBinding { 'finished test $_currentDartTest. Will report its status back to the native side', ); - final passed = global_state.isCurrentTestPassing(); + final passed = global_state.isCurrentTestPassing; logger( 'tearDown(): test "$testName" in group "$_currentDartTest", passed: $passed', ); diff --git a/packages/patrol/lib/src/global_state.dart b/packages/patrol/lib/src/global_state.dart index f9c692fba..72dce0ce5 100644 --- a/packages/patrol/lib/src/global_state.dart +++ b/packages/patrol/lib/src/global_state.dart @@ -21,6 +21,6 @@ String get currentTestIndividualName { } /// Returns whether the current test is passing. -bool isCurrentTestPassing() { +bool get isCurrentTestPassing { return Invoker.current!.liveTest.state.result.isPassing; } From 848b12c3f362e5ad1c51d358b9b8cdc5394778ed Mon Sep 17 00:00:00 2001 From: Bartek Pacia Date: Fri, 29 Sep 2023 13:00:41 +0200 Subject: [PATCH 105/110] create good reproducer --- .../integration_test/example_test.dart | 35 ++++++++++++------ packages/patrol/test/internals_test.dart | 36 +++++++++++++++++++ 2 files changed, 60 insertions(+), 11 deletions(-) diff --git a/packages/patrol/example/integration_test/example_test.dart b/packages/patrol/example/integration_test/example_test.dart index 5efcbdbe9..cd6a33587 100644 --- a/packages/patrol/example/integration_test/example_test.dart +++ b/packages/patrol/example/integration_test/example_test.dart @@ -3,26 +3,39 @@ import 'package:flutter/material.dart'; import 'common.dart'; void main() { + // WORKS + // 12 + 1 + 180 + 1 = 194 + // + // example_test: 12 + // space: 1 + // alpha * 36: 180 + // A: 1 patrol( - // '${"alpha" * 30}ABCDE', / 12 + 1 + 150 = 163 - 'alpha' * 40, + '${"alpha" * 36}A', // 194 ($) async { await createApp($); + await Future.delayed(Duration(seconds: 5)); + await $(FloatingActionButton).tap(); expect($(#counterText).text, '1'); + }, + ); - await $(#textField).enterText('Hello, Flutter!'); - expect($('Hello, Flutter!'), findsOneWidget); - - await $.native.pressHome(); - await $.native.openApp(); + // WORKS + // 12 + 1 + 180 + 2 = 195 + // + // example_test: 12 + // space: 1 + // alpha * 36: 180 + // A: 2 + patrol( + '${"alpha" * 36}AA', // 195 + ($) async { + await createApp($); - expect($(#counterText).text, '1'); await $(FloatingActionButton).tap(); - - expect($(#counterText).text, '2'); - expect($('Hello, Flutter!'), findsOneWidget); + expect($(#counterText).text, '1'); }, ); } diff --git a/packages/patrol/test/internals_test.dart b/packages/patrol/test/internals_test.dart index ecda2a49d..fed1525e2 100644 --- a/packages/patrol/test/internals_test.dart +++ b/packages/patrol/test/internals_test.dart @@ -162,6 +162,42 @@ void main() { ), ); }); + + test('smoke test 3 (long test names)', () { + // given + final topLevelGroup = Group.root([ + LocalTest('patrol_test_explorer', Metadata.empty, () {}), + Group( + 'example_test', + [ + _localTest('example_test ${"alpha" * 40}'), // 12 + 1 + 200 = 213 + ], + ), + ]); + + // when + final dartTestGroup = createDartTestGroup(topLevelGroup); + + // then + expect( + dartTestGroup, + equals( + DartGroupEntry( + name: '', + type: GroupEntryType.group, + entries: [ + DartGroupEntry( + name: 'example_test', + type: GroupEntryType.group, + entries: [ + _testEntry('alpha'), + ], + ), + ], + ), + ), + ); + }); }); group('deduplicateGroupEntryName()', () { From 9e07f2673f4a582b43a9dff1f4551f09630004a9 Mon Sep 17 00:00:00 2001 From: Bartek Pacia Date: Fri, 29 Sep 2023 13:32:17 +0200 Subject: [PATCH 106/110] start trying to make the fix (FAILS) --- packages/patrol/lib/src/common.dart | 1 + packages/patrol/lib/src/global_state.dart | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/patrol/lib/src/common.dart b/packages/patrol/lib/src/common.dart index d2702007a..fb125b007 100644 --- a/packages/patrol/lib/src/common.dart +++ b/packages/patrol/lib/src/common.dart @@ -181,6 +181,7 @@ DartGroupEntry createDartTestGroup( var name = entry.name; if (parentGroup.name.isNotEmpty) { name = deduplicateGroupEntryName(parentGroup.name, entry.name); + name = name.substring(0, 190); } if (entry is Group) { diff --git a/packages/patrol/lib/src/global_state.dart b/packages/patrol/lib/src/global_state.dart index 72dce0ce5..b8eda480c 100644 --- a/packages/patrol/lib/src/global_state.dart +++ b/packages/patrol/lib/src/global_state.dart @@ -1,6 +1,8 @@ // ignore: implementation_imports import 'package:test_api/src/backend/invoker.dart'; +const maxTestLength = 190; + /// This file wraps the [Invoker] API, which is internal to package:test. We /// want to minimize the usage of internal APIs to a minimum. @@ -12,7 +14,7 @@ String get currentTestFullName { final parentGroupName = invoker.liveTest.groups.last.name; final testName = invoker.liveTest.individualName; - return '$parentGroupName $testName'; + return '$parentGroupName $testName'.substring(0, 190); } /// Returns the individual name of the current test. Omits all ancestor groups. From 0fab546e79e1dd425d310ec80674a4cfc676a01e Mon Sep 17 00:00:00 2001 From: Bartek Pacia Date: Fri, 29 Sep 2023 14:19:02 +0200 Subject: [PATCH 107/110] apply the workaround - it seems to work in simple cases --- .../example/integration_test/example_test.dart | 8 +++----- packages/patrol/lib/src/common.dart | 17 +++++++++++++++-- packages/patrol/lib/src/global_state.dart | 6 +++++- packages/patrol/test/internals_test.dart | 9 +++++++-- 4 files changed, 30 insertions(+), 10 deletions(-) diff --git a/packages/patrol/example/integration_test/example_test.dart b/packages/patrol/example/integration_test/example_test.dart index cd6a33587..17a721357 100644 --- a/packages/patrol/example/integration_test/example_test.dart +++ b/packages/patrol/example/integration_test/example_test.dart @@ -15,22 +15,20 @@ void main() { ($) async { await createApp($); - await Future.delayed(Duration(seconds: 5)); - await $(FloatingActionButton).tap(); expect($(#counterText).text, '1'); }, ); - // WORKS + // FAILS // 12 + 1 + 180 + 2 = 195 // // example_test: 12 // space: 1 - // alpha * 36: 180 + // kocyk * 36: 180 // A: 2 patrol( - '${"alpha" * 36}AA', // 195 + '${"kocyk" * 36}AA', // 195 ($) async { await createApp($); diff --git a/packages/patrol/lib/src/common.dart b/packages/patrol/lib/src/common.dart index fb125b007..625699d05 100644 --- a/packages/patrol/lib/src/common.dart +++ b/packages/patrol/lib/src/common.dart @@ -168,6 +168,7 @@ DartGroupEntry createDartTestGroup( Group parentGroup, { String name = '', int level = 0, + int maxTestCaseLength = 190, }) { final groupDTO = DartGroupEntry( name: name, @@ -180,8 +181,14 @@ DartGroupEntry createDartTestGroup( var name = entry.name; if (parentGroup.name.isNotEmpty) { - name = deduplicateGroupEntryName(parentGroup.name, entry.name); - name = name.substring(0, 190); + // Assume that parentGroupName fits maxTestCaseLength + // Assume that after cropping, test names are different. + + if (name.length > maxTestCaseLength) { + name = name.substring(0, maxTestCaseLength); + } + + name = deduplicateGroupEntryName(parentGroup.name, name); } if (entry is Group) { @@ -190,6 +197,7 @@ DartGroupEntry createDartTestGroup( entry, name: name, level: level + 1, + maxTestCaseLength: maxTestCaseLength, ), ); } else if (entry is Test) { @@ -217,6 +225,11 @@ DartGroupEntry createDartTestGroup( } /// Allows for retrieving the name of a GroupEntry by stripping the names of all ancestor groups. +/// +/// Example: +/// parentName = 'example_test myGroup' +/// currentName = 'example_test myGroup myTest' +/// should return 'myTest' @internal String deduplicateGroupEntryName(String parentName, String currentName) { return currentName.substring( diff --git a/packages/patrol/lib/src/global_state.dart b/packages/patrol/lib/src/global_state.dart index b8eda480c..077a7a36c 100644 --- a/packages/patrol/lib/src/global_state.dart +++ b/packages/patrol/lib/src/global_state.dart @@ -14,7 +14,11 @@ String get currentTestFullName { final parentGroupName = invoker.liveTest.groups.last.name; final testName = invoker.liveTest.individualName; - return '$parentGroupName $testName'.substring(0, 190); + var nameCandidate = '$parentGroupName $testName'; + if (nameCandidate.length > 190) { + nameCandidate = nameCandidate.substring(0, 190); + } + return nameCandidate; } /// Returns the individual name of the current test. Omits all ancestor groups. diff --git a/packages/patrol/test/internals_test.dart b/packages/patrol/test/internals_test.dart index fed1525e2..a7cc8bf1f 100644 --- a/packages/patrol/test/internals_test.dart +++ b/packages/patrol/test/internals_test.dart @@ -170,13 +170,17 @@ void main() { Group( 'example_test', [ - _localTest('example_test ${"alpha" * 40}'), // 12 + 1 + 200 = 213 + _localTest('example_test alpha'), // 18 chars + _localTest('example_test zielony kocyk'), // 26 chars, 6 too many ], ), ]); // when - final dartTestGroup = createDartTestGroup(topLevelGroup); + final dartTestGroup = createDartTestGroup( + topLevelGroup, + maxTestCaseLength: 20, + ); // then expect( @@ -191,6 +195,7 @@ void main() { type: GroupEntryType.group, entries: [ _testEntry('alpha'), + _testEntry('zielony'), ], ), ], From 9307e4e5e80b0a1b4db4f6add76eed34b432d907 Mon Sep 17 00:00:00 2001 From: Bartek Pacia Date: Sat, 30 Sep 2023 00:26:21 +0200 Subject: [PATCH 108/110] fix CI --- packages/patrol/lib/src/common.dart | 2 +- packages/patrol/lib/src/global_state.dart | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/patrol/lib/src/common.dart b/packages/patrol/lib/src/common.dart index 625699d05..f6df39cb1 100644 --- a/packages/patrol/lib/src/common.dart +++ b/packages/patrol/lib/src/common.dart @@ -168,7 +168,7 @@ DartGroupEntry createDartTestGroup( Group parentGroup, { String name = '', int level = 0, - int maxTestCaseLength = 190, + int maxTestCaseLength = global_state.maxTestLength, }) { final groupDTO = DartGroupEntry( name: name, diff --git a/packages/patrol/lib/src/global_state.dart b/packages/patrol/lib/src/global_state.dart index 077a7a36c..318574d3e 100644 --- a/packages/patrol/lib/src/global_state.dart +++ b/packages/patrol/lib/src/global_state.dart @@ -1,6 +1,9 @@ // ignore: implementation_imports import 'package:test_api/src/backend/invoker.dart'; +/// Maximum test case length for ATO, after transformations. +/// +/// See https://github.com/leancodepl/patrol/issues/1725 const maxTestLength = 190; /// This file wraps the [Invoker] API, which is internal to package:test. We From 9648795bceef4648c15c9e03c6362aec29003495 Mon Sep 17 00:00:00 2001 From: Bartek Pacia Date: Sat, 30 Sep 2023 23:10:56 +0200 Subject: [PATCH 109/110] fix dart formatting --- packages/patrol_cli/lib/src/base/constants.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/patrol_cli/lib/src/base/constants.dart b/packages/patrol_cli/lib/src/base/constants.dart index 129e0deb7..b5b7326df 100644 --- a/packages/patrol_cli/lib/src/base/constants.dart +++ b/packages/patrol_cli/lib/src/base/constants.dart @@ -1,2 +1,2 @@ /// Version of Patrol CLI. Must be kept in sync with pubspec.yaml. -const version = '2.2.0-dev.2'; \ No newline at end of file +const version = '2.2.0-dev.2'; From ff8dab3faa77e8adec2345cc60b46b4fd5cee459 Mon Sep 17 00:00:00 2001 From: Bartek Pacia Date: Sun, 1 Oct 2023 00:23:03 +0200 Subject: [PATCH 110/110] Fix and update CI workflows (#1756) * fix Firebase Test Lab trying to run on phased-out iOS version * run_ios_local: remove (it's unused) * `run_ios_testlab`: move logic out of GitHub Action * bring back old example_test * move `long_name_test` to integration_test/internal * remove `test-android-emulator 2` workflow - it's unused * use `gradle-build-action@v2`, not too strict `2.8.0` --- .github/workflows/test-android-device.yaml | 2 +- .../workflows/test-android-emulator-2.yaml | 128 ------------------ .../test-android-emulator-webview.yaml | 2 +- .github/workflows/test-android-emulator.yaml | 2 +- .github/workflows/test-ios-device.yaml | 8 +- .../integration_test/example_test.dart | 32 ++--- .../{ => internal}/long_name_test.dart | 22 ++- packages/patrol/example/run_ios_local | 48 ------- packages/patrol/example/run_ios_testlab | 9 +- 9 files changed, 44 insertions(+), 209 deletions(-) delete mode 100644 .github/workflows/test-android-emulator-2.yaml rename packages/patrol/example/integration_test/{ => internal}/long_name_test.dart (63%) delete mode 100755 packages/patrol/example/run_ios_local diff --git a/.github/workflows/test-android-device.yaml b/.github/workflows/test-android-device.yaml index eb44186c6..e53ea4a75 100644 --- a/.github/workflows/test-android-device.yaml +++ b/.github/workflows/test-android-device.yaml @@ -47,7 +47,7 @@ jobs: uses: google-github-actions/setup-gcloud@v1 - name: Gradle cache - uses: gradle/gradle-build-action@v2.8.0 + uses: gradle/gradle-build-action@v2 with: generate-job-summary: false diff --git a/.github/workflows/test-android-emulator-2.yaml b/.github/workflows/test-android-emulator-2.yaml deleted file mode 100644 index 539f677da..000000000 --- a/.github/workflows/test-android-emulator-2.yaml +++ /dev/null @@ -1,128 +0,0 @@ -name: test android emulator 2 - -on: - workflow_dispatch: - -env: - ANDROID_IMAGE: system-images;android-31;default;x86_64 - -jobs: - main: - name: Test on Android Emulator - runs-on: macos-latest - timeout-minutes: 60 - - defaults: - run: - working-directory: ${{ github.workspace }}/packages/patrol/example - - steps: - - name: Clone repository - uses: actions/checkout@v3 - with: - lfs: true - - - name: Set up Java - run: export JAVA_HOME="$JAVA_HOME_11_X64" - - - name: Set up Flutter - uses: subosito/flutter-action@v2 - with: - channel: stable - - - name: Preload Flutter artifacts - run: flutter precache - - - name: Install patrol_cli - run: | - dart pub global activate \ - --source git https://github.com/leancodepl/patrol.git \ - --git-path packages/patrol_cli \ - --git-ref patrol_cli-v - - - name: Download TestButler - run: curl -f -o ~/test-butler-2.2.1.apk https://repo1.maven.org/maven2/com/linkedin/testbutler/test-butler-app/2.2.1/test-butler-app-2.2.1.apk - - - name: Install ffmpeg - uses: FedericoCarboni/setup-ffmpeg@v2 - id: setup-ffmpeg - - - name: Install sponge - run: brew install sponge 1>/dev/null 2>&1 - - - name: Generate gradlew - run: | - flutter build apk --target lib/main_dev.dart --debug --flavor=does-not-exist & - buildpid="$!" - while [ ! -e "android/gradlew" ]; do - echo "waiting for gradlew to generate..." - sleep 2 - done - kill $buildpid - - - name: Install cmdline-tools - run: | - cd - curl -LO https://dl.google.com/android/repository/commandlinetools-mac-9477386_latest.zip - brew install unzip 1>/dev/null 2>&1 - unzip commandlinetools-mac-9477386_latest.zip - - mkdir ~/android-sdk - mkdir ~/android-sdk/cmdline-tools - mkdir ~/android-sdk/platforms # we just need empty folder - mkdir ~/android-sdk/cmdline-tools/latest - mv -v ~/cmdline-tools/* ~/android-sdk/cmdline-tools/latest - - echo "$HOME/android-sdk/cmdline-tools/latest/bin" >> $GITHUB_PATH - - - name: Install SDKs with sdkmanager - run: | - yes | sdkmanager --licenses > /dev/null - sdkmanager "emulator" > /dev/null - sdkmanager "platform-tools" > /dev/null - sdkmanager "$ANDROID_IMAGE" > /dev/null - sdkmanager "build-tools;30.0.3" > /dev/null - - echo "$HOME/android-sdk/emulator" >> $GITHUB_PATH - echo "$HOME/android-sdk/platform-tools" >> $GITHUB_PATH - - echo "ANDROID_SDK_ROOT=$HOME/android-sdk" >> $GITHUB_ENV - echo "ANDROID_HOME=$HOME/android-sdk" >> $GITHUB_ENV - flutter config --android-sdk "$HOME/android-sdk" - - - name: Create and configure emulator - run: | - avdmanager -s create avd -n MyAVD -k "$ANDROID_IMAGE" - echo "hw.gpu.enabled=yes" >> ~/.android/avd/MyAVD.avd/config.ini - echo "hw.gpu.mode=swiftshader_indirect" >> ~/.android/avd/MyAVD.avd/config.ini - echo "hw.ramSize=4096" >> ~/.android/avd/MyAVD.avd/config.ini - echo "disk.dataPartition.size=6G" >> ~/.android/avd/MyAVD.avd/config.ini - echo "hw.camera.back=virtualscene" >> ~/.android/avd/MyAVD.avd/config.ini - echo "vm.heapSize=576" >> ~/.android/avd/MyAVD.avd/config.ini - echo "hw.lcd.density=440" >> ~/.android/avd/MyAVD.avd/config.ini - echo "hw.lcd.height=2220" >> ~/.android/avd/MyAVD.avd/config.ini - echo "hw.lcd.width=1080" >> ~/.android/avd/MyAVD.avd/config.ini - - - name: Run emulator and tests - run: ${{ github.workspace }}/.github/scripts/run-emulator-and-tests.sh - - - name: Upload flutter logs to artifacts - if: always() - uses: actions/upload-artifact@v3 - with: - name: flutter-logs - path: flutter-logs - - - name: Upload tests summary to artifacts - if: always() - uses: actions/upload-artifact@v3 - with: - name: tests-summary - path: tests-summary - - - name: Upload screenrecordings to artifacts - if: always() - uses: actions/upload-artifact@v3 - with: - name: screenrecord.mp4 - path: screenrecords/screenrecord.mp4 diff --git a/.github/workflows/test-android-emulator-webview.yaml b/.github/workflows/test-android-emulator-webview.yaml index 5a3734586..f3e06d921 100644 --- a/.github/workflows/test-android-emulator-webview.yaml +++ b/.github/workflows/test-android-emulator-webview.yaml @@ -35,7 +35,7 @@ jobs: java-version: 17 - name: Gradle cache - uses: gradle/gradle-build-action@v2.8.0 + uses: gradle/gradle-build-action@v2 with: generate-job-summary: false diff --git a/.github/workflows/test-android-emulator.yaml b/.github/workflows/test-android-emulator.yaml index ae67ec21d..38cd19ecc 100644 --- a/.github/workflows/test-android-emulator.yaml +++ b/.github/workflows/test-android-emulator.yaml @@ -36,7 +36,7 @@ jobs: java-version: 17 - name: Gradle cache - uses: gradle/gradle-build-action@v2.8.0 + uses: gradle/gradle-build-action@v2 with: generate-job-summary: false diff --git a/.github/workflows/test-ios-device.yaml b/.github/workflows/test-ios-device.yaml index 3b0f3fa41..56ac3047e 100644 --- a/.github/workflows/test-ios-device.yaml +++ b/.github/workflows/test-ios-device.yaml @@ -21,7 +21,7 @@ jobs: matrix: flutter_version: ['3.13.x'] device_model: ['iphone14pro'] - os_version: ['16.5'] + os_version: ['16.6'] os: [iOS] defaults: @@ -61,7 +61,7 @@ jobs: - name: Authenticate to Google Cloud uses: google-github-actions/auth@v1 with: - credentials_json: '${{ secrets.GOOGLE_SERVICE_ACCOUNT_KEY_JSON }}' + credentials_json: ${{ secrets.GOOGLE_SERVICE_ACCOUNT_KEY_JSON }} - name: Set up Cloud SDK uses: google-github-actions/setup-gcloud@v1 @@ -99,10 +99,6 @@ jobs: - name: Build tests run: patrol build ios --release --exclude ${{ env.EXCLUDED_TESTS }} --verbose - - name: Compress test files to zip - working-directory: packages/patrol/example/build/ios_integ/Build/Products - run: zip -r ios_tests.zip Release-iphoneos/*.app *.xctestrun - - name: Upload APKs to Firebase Test Lab and wait for tests to finish id: tests_step env: diff --git a/packages/patrol/example/integration_test/example_test.dart b/packages/patrol/example/integration_test/example_test.dart index 17a721357..62aeac09a 100644 --- a/packages/patrol/example/integration_test/example_test.dart +++ b/packages/patrol/example/integration_test/example_test.dart @@ -3,37 +3,25 @@ import 'package:flutter/material.dart'; import 'common.dart'; void main() { - // WORKS - // 12 + 1 + 180 + 1 = 194 - // - // example_test: 12 - // space: 1 - // alpha * 36: 180 - // A: 1 patrol( - '${"alpha" * 36}A', // 194 + 'counter state is the same after going to Home and switching apps', ($) async { await createApp($); await $(FloatingActionButton).tap(); expect($(#counterText).text, '1'); - }, - ); - // FAILS - // 12 + 1 + 180 + 2 = 195 - // - // example_test: 12 - // space: 1 - // kocyk * 36: 180 - // A: 2 - patrol( - '${"kocyk" * 36}AA', // 195 - ($) async { - await createApp($); + await $(#textField).enterText('Hello, Flutter!'); + expect($('Hello, Flutter!'), findsOneWidget); + + await $.native.pressHome(); + await $.native.openApp(); - await $(FloatingActionButton).tap(); expect($(#counterText).text, '1'); + await $(FloatingActionButton).tap(); + + expect($(#counterText).text, '2'); + expect($('Hello, Flutter!'), findsOneWidget); }, ); } diff --git a/packages/patrol/example/integration_test/long_name_test.dart b/packages/patrol/example/integration_test/internal/long_name_test.dart similarity index 63% rename from packages/patrol/example/integration_test/long_name_test.dart rename to packages/patrol/example/integration_test/internal/long_name_test.dart index 6988819f9..913b21d56 100644 --- a/packages/patrol/example/integration_test/long_name_test.dart +++ b/packages/patrol/example/integration_test/internal/long_name_test.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; -import 'common.dart'; +import '../common.dart'; String _generateString(int length) { return 'a' * length; @@ -29,4 +29,24 @@ void main() { expect($('Hello, Flutter!'), findsOneWidget); }, ); + + patrol( + '${"alpha" * 36}A', // 194 - max allowed value + ($) async { + await createApp($); + + await $(FloatingActionButton).tap(); + expect($(#counterText).text, '1'); + }, + ); + + patrol( + '${"kocyk" * 36}AA', // 195 - 1 too many + ($) async { + await createApp($); + + await $(FloatingActionButton).tap(); + expect($(#counterText).text, '1'); + }, + ); } diff --git a/packages/patrol/example/run_ios_local b/packages/patrol/example/run_ios_local deleted file mode 100755 index fb08e6d29..000000000 --- a/packages/patrol/example/run_ios_local +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cd "$(dirname "$0")" - -_usage() { - printf "usage: ./run_ios_local \n" - printf "\tfor example:\n" - printf "\t\$ ./run_ios_local integration_test/app_test.dart --simulator\n" -} - -target="${1:-}" -simulator="${2:-}" - -if [ -z "$target" ]; then - _usage - exit 1 -fi - -target_path="$(realpath "$target")" -dev_target="16.2" - -run_mode="Release" -flag="--debug" -sdk="iphoneos" -if [ -n "$simulator" ]; then - echo "Running tests in debug mode on iOS Simulator" - run_mode="Debug" - sdk="iphonesimulator" - flag="--simulator" -else - echo "Running tests in release mode on iOS device" -fi - -flutter build ios "$target_path" "$flag" - -pushd ios -xcodebuild build-for-testing \ - -workspace Runner.xcworkspace \ - -scheme Runner \ - -xcconfig Flutter/"$run_mode.xcconfig" \ - -configuration "$run_mode" \ - -derivedDataPath ../build/ios_integ \ - -sdk "$sdk" -popd - -exec xcodebuild test-without-building \ - -xctestrun "build/ios_integ/Build/Products/Runner_iphoneos$dev_target-arm64.xctestrun" \ - -destination id="$(idevice_id -l)" diff --git a/packages/patrol/example/run_ios_testlab b/packages/patrol/example/run_ios_testlab index 62d7e1b26..2ff350da1 100755 --- a/packages/patrol/example/run_ios_testlab +++ b/packages/patrol/example/run_ios_testlab @@ -5,7 +5,14 @@ set -euo pipefail # * DEVICE_MODEL (for example: "iphone11pro") # * DEVICE_VERSION (for example: "16.3") -# And ios_tests.zip containing the iOS app and XCTest files +# patrol build ios must be called before this script + +cd build/ios_integ/Build/Products + +rm -f ios_tests.zip +zip -r ios_tests.zip Release-iphoneos/*.app *.xctestrun + +cd - gcloud firebase test ios run \ --type xctest \