Skip to content

Commit

Permalink
update some settings.
Browse files Browse the repository at this point in the history
  • Loading branch information
jigar-f committed Nov 29, 2024
1 parent 49bbb16 commit 6802bef
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 9 deletions.
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ android {
}

testOptions {
unitTests.returnDefaultValues = true
// unitTests.returnDefaultValues = true
execution "ANDROIDX_TEST_ORCHESTRATOR"
}
namespace 'org.getlantern.lantern'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
package org.getlantern.lantern.test;

import androidx.test.platform.app.InstrumentationRegistry;

import org.getlantern.lantern.MainActivity;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;

import pl.leancode.patrol.PatrolJUnitRunner;

@RunWith(Parameterized.class)
public class MainActivityTest {
@Parameters(name = "{0}")
public static Object[] testCases() {
PatrolJUnitRunner instrumentation = (PatrolJUnitRunner) InstrumentationRegistry.getInstrumentation();
// replace "MainActivity.class" with "io.flutter.embedding.android.FlutterActivity.class"
// if in AndroidManifest.xml in manifest/application/activity you have
// android:name="io.flutter.embedding.android.FlutterActivity"
instrumentation.setUp(MainActivity.class);
instrumentation.waitForPatrolAppService();
return instrumentation.listDartTests();
Expand All @@ -32,3 +32,37 @@ public void runDartTest() {
instrumentation.runDartTest(dartTestName);
}
}


//import androidx.test.platform.app.InstrumentationRegistry;
//
//import org.getlantern.lantern.MainActivity;
//import org.junit.Test;
//import org.junit.runner.RunWith;
//import org.junit.runners.Parameterized;
//import org.junit.runners.Parameterized.Parameters;
//
//import pl.leancode.patrol.PatrolJUnitRunner;
//
//@RunWith(Parameterized.class)
//public class MainActivityTest {
// @Parameters(name = "{0}")
// public static Object[] testCases() {
// PatrolJUnitRunner instrumentation = (PatrolJUnitRunner) InstrumentationRegistry.getInstrumentation();
// instrumentation.setUp(MainActivity.class);
// instrumentation.waitForPatrolAppService();
// return instrumentation.listDartTests();
// }
//
// public MainActivityTest(String dartTestName) {
// this.dartTestName = dartTestName;
// }
//
// private final String dartTestName;
//
// @Test
// public void runDartTest() {
// PatrolJUnitRunner instrumentation = (PatrolJUnitRunner) InstrumentationRegistry.getInstrumentation();
// instrumentation.runDartTest(dartTestName);
// }
//}
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
buildscript {
ext.kotlin_version = '2.0.20'
ext.kotlin_version = '1.9.0'
ext.signal_version = '2.8.1'
ext.protoc_version = '4.26.1'
ext.desugarJdk = '2.0.4'
Expand Down
2 changes: 1 addition & 1 deletion android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pluginManagement {
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version '8.6.0' apply false
id "org.jetbrains.kotlin.android" version "2.0.20" apply false
id "org.jetbrains.kotlin.android" version "1.9.0" apply false
}

include ":app"
4 changes: 2 additions & 2 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1333,10 +1333,10 @@ packages:
dependency: "direct dev"
description:
name: patrol
sha256: "7f030b709f42fa53cec593e8ad906f23b6730cdbe205ee59ad53eb2af2ee9d94"
sha256: "829065b7daa1307283339a2b3a2d57f29631e5178d2f9d5276b376f34efda2e8"
url: "https://pub.dev"
source: hosted
version: "3.12.0"
version: "3.13.0"
patrol_finders:
dependency: transitive
description:
Expand Down
6 changes: 5 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,11 @@ dev_dependencies:
analyzer: ^6.7.0
golden_toolkit: ^0.15.0
# Testing
patrol: 3.12.0
patrol: ^3.13.0
# patrol:
# git:
# url: https://github.com/leancodepl/patrol.git
# path: packages/patrol



Expand Down

0 comments on commit 6802bef

Please sign in to comment.