diff --git a/build.gradle b/build.gradle index 7516cddc2..8fe7fd1d3 100644 --- a/build.gradle +++ b/build.gradle @@ -8,7 +8,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:7.3.1' + classpath 'com.android.tools.build:gradle:8.1.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.0" classpath 'com.google.gms:google-services:4.4.2' } diff --git a/example_java/build.gradle b/example_java/build.gradle index 9b364844d..0c22fd12c 100644 --- a/example_java/build.gradle +++ b/example_java/build.gradle @@ -21,11 +21,11 @@ android { proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } - - lintOptions { - checkReleaseBuilds false + lint { abortOnError false + checkReleaseBuilds false } + } dependencies { diff --git a/example_java/src/androidTest/java/org/flyve/example_java/ExampleInstrumentedTest.java b/example_java/src/androidTest/java/org/flyve/example_java/ExampleInstrumentedTest.java index 2bf99eb80..d1590921a 100644 --- a/example_java/src/androidTest/java/org/flyve/example_java/ExampleInstrumentedTest.java +++ b/example_java/src/androidTest/java/org/flyve/example_java/ExampleInstrumentedTest.java @@ -28,8 +28,8 @@ import android.content.Context; -import androidx.test.InstrumentationRegistry; -import androidx.test.runner.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner; import org.junit.Test; import org.junit.runner.RunWith; @@ -41,12 +41,12 @@ * * @see Testing documentation */ -@RunWith(AndroidJUnit4.class) +@RunWith(AndroidJUnit4ClassRunner.class) public class ExampleInstrumentedTest { @Test public void useAppContext() throws Exception { // Context of the app under test. - Context appContext = InstrumentationRegistry.getTargetContext(); + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); assertEquals("org.flyve.example_java", appContext.getPackageName()); } diff --git a/example_kotlin/build.gradle b/example_kotlin/build.gradle index 0f4006df2..51fbf712a 100644 --- a/example_kotlin/build.gradle +++ b/example_kotlin/build.gradle @@ -22,10 +22,18 @@ android { proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } - - lintOptions { - checkReleaseBuilds false + lint { abortOnError false + checkReleaseBuilds false + } + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } + + kotlinOptions { + jvmTarget = JavaVersion.VERSION_17 } } diff --git a/example_kotlin/src/androidTest/java/org/flyve/example_kotlin/ExampleInstrumentedTest.kt b/example_kotlin/src/androidTest/java/org/flyve/example_kotlin/ExampleInstrumentedTest.kt index ab176963b..47a902418 100644 --- a/example_kotlin/src/androidTest/java/org/flyve/example_kotlin/ExampleInstrumentedTest.kt +++ b/example_kotlin/src/androidTest/java/org/flyve/example_kotlin/ExampleInstrumentedTest.kt @@ -25,9 +25,8 @@ */ package org.flyve.example_kotlin -import androidx.test.platform.app.InstrumentationRegistry -import androidx.test.runner.AndroidJUnit4 -import org.junit.Assert.* +import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner +import org.junit.Assert.assertEquals import org.junit.Test import org.junit.runner.RunWith @@ -36,7 +35,7 @@ import org.junit.runner.RunWith * * See [testing documentation](http://d.android.com/tools/testing). */ -@RunWith(AndroidJUnit4::class) +@RunWith(AndroidJUnit4ClassRunner::class) class ExampleInstrumentedTest { @Test fun useAppContext() { diff --git a/gradle.properties b/gradle.properties index ed508580f..4003f9bc6 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,6 @@ org.gradle.jvmargs=-Xmx4608m android.useAndroidX=true android.enableJetifier=true +android.defaults.buildfeatures.buildconfig=true +android.nonTransitiveRClass=false +android.nonFinalResIds=false diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index caab1fed9..72d878518 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Mon Dec 02 16:44:40 CET 2024 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/inventory/build.gradle b/inventory/build.gradle index 36ee4aea9..ede5b8438 100644 --- a/inventory/build.gradle +++ b/inventory/build.gradle @@ -17,13 +17,15 @@ android { } debug { minifyEnabled false - testCoverageEnabled true + enableUnitTestCoverage true + enableAndroidTestCoverage true } } buildFeatures { viewBinding true } + namespace 'org.flyve.inventory' } configurations { @@ -37,8 +39,7 @@ dependencies { androidTestImplementation('androidx.test.espresso:espresso-core:3.3.0', { exclude group: 'com.android.support', module: 'support-annotations' }) - testImplementation 'junit:junit:4.12' - testImplementation 'androidx.test:runner:1.3.0' + testImplementation 'androidx.test:runner:1.6.2' // Or latest version testImplementation 'androidx.test:core:1.3.0' implementation 'com.orhanobut:logger:2.2.0' diff --git a/inventory/src/androidTest/java/org/flyve/inventory/BatteryTest.java b/inventory/src/androidTest/java/org/flyve/inventory/BatteryTest.java index ee1eb6d15..129772f69 100644 --- a/inventory/src/androidTest/java/org/flyve/inventory/BatteryTest.java +++ b/inventory/src/androidTest/java/org/flyve/inventory/BatteryTest.java @@ -28,8 +28,8 @@ import android.content.Context; -import androidx.test.InstrumentationRegistry; -import androidx.test.runner.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner; import org.flyve.inventory.categories.Battery; import org.junit.Test; @@ -37,10 +37,10 @@ import static org.junit.Assert.assertNotEquals; -@RunWith(AndroidJUnit4.class) +@RunWith(AndroidJUnit4ClassRunner.class) public class BatteryTest { - Context appContext = InstrumentationRegistry.getTargetContext(); + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); @Test public void getTechnology() { diff --git a/inventory/src/androidTest/java/org/flyve/inventory/BiosTest.java b/inventory/src/androidTest/java/org/flyve/inventory/BiosTest.java index abb95b3ca..d22a4650d 100644 --- a/inventory/src/androidTest/java/org/flyve/inventory/BiosTest.java +++ b/inventory/src/androidTest/java/org/flyve/inventory/BiosTest.java @@ -29,8 +29,8 @@ import android.content.Context; -import androidx.test.InstrumentationRegistry; -import androidx.test.runner.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner; import org.flyve.inventory.categories.Bios; @@ -38,9 +38,9 @@ import org.junit.runner.RunWith; import static org.junit.Assert.*; -@RunWith(AndroidJUnit4.class) +@RunWith(AndroidJUnit4ClassRunner.class) public class BiosTest { - private Context appContext = InstrumentationRegistry.getTargetContext(); + private Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();; @Test public void getAssesTag() { diff --git a/inventory/src/androidTest/java/org/flyve/inventory/BluetoothTest.java b/inventory/src/androidTest/java/org/flyve/inventory/BluetoothTest.java index 1ed531691..dd02d28d2 100644 --- a/inventory/src/androidTest/java/org/flyve/inventory/BluetoothTest.java +++ b/inventory/src/androidTest/java/org/flyve/inventory/BluetoothTest.java @@ -27,8 +27,8 @@ package org.flyve.inventory; import android.content.Context; -import androidx.test.InstrumentationRegistry; -import androidx.test.runner.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner; import org.flyve.inventory.categories.Bluetooth; @@ -38,10 +38,10 @@ import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.assertTrue; -@RunWith(AndroidJUnit4.class) +@RunWith(AndroidJUnit4ClassRunner.class) public class BluetoothTest { - Context appContext = InstrumentationRegistry.getTargetContext(); + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); @Test public void getHardware_address() throws Exception { diff --git a/inventory/src/androidTest/java/org/flyve/inventory/CamerasTest.java b/inventory/src/androidTest/java/org/flyve/inventory/CamerasTest.java index 3845080ad..dbcd1e6b7 100644 --- a/inventory/src/androidTest/java/org/flyve/inventory/CamerasTest.java +++ b/inventory/src/androidTest/java/org/flyve/inventory/CamerasTest.java @@ -29,8 +29,8 @@ import android.content.Context; import android.hardware.Camera; import android.hardware.camera2.CameraCharacteristics; -import androidx.test.InstrumentationRegistry; -import androidx.test.runner.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner; import org.flyve.inventory.categories.Cameras; import org.junit.Test; @@ -40,10 +40,10 @@ import static org.junit.Assert.assertNotEquals; -@RunWith(AndroidJUnit4.class) +@RunWith(AndroidJUnit4ClassRunner.class) public class CamerasTest { - Context appContext = InstrumentationRegistry.getTargetContext(); + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); @Test public void getResolutions() { diff --git a/inventory/src/androidTest/java/org/flyve/inventory/ControllersTest.java b/inventory/src/androidTest/java/org/flyve/inventory/ControllersTest.java index d2df71f40..5e1419350 100644 --- a/inventory/src/androidTest/java/org/flyve/inventory/ControllersTest.java +++ b/inventory/src/androidTest/java/org/flyve/inventory/ControllersTest.java @@ -27,8 +27,9 @@ package org.flyve.inventory; import android.content.Context; -import androidx.test.InstrumentationRegistry; -import androidx.test.runner.AndroidJUnit4; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner; import org.flyve.inventory.categories.Controllers; import org.junit.Test; @@ -38,10 +39,10 @@ import static org.junit.Assert.assertNotEquals; -@RunWith(AndroidJUnit4.class) +@RunWith(AndroidJUnit4ClassRunner.class) public class ControllersTest { - Context appContext = InstrumentationRegistry.getTargetContext(); + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); @Test public void getDriver() { diff --git a/inventory/src/androidTest/java/org/flyve/inventory/CpusTest.java b/inventory/src/androidTest/java/org/flyve/inventory/CpusTest.java index 47c49b74a..2fb689e5e 100644 --- a/inventory/src/androidTest/java/org/flyve/inventory/CpusTest.java +++ b/inventory/src/androidTest/java/org/flyve/inventory/CpusTest.java @@ -27,8 +27,8 @@ package org.flyve.inventory; import android.content.Context; -import androidx.test.InstrumentationRegistry; -import androidx.test.runner.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner; import org.flyve.inventory.categories.Cpus; @@ -38,10 +38,10 @@ import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.assertTrue; -@RunWith(AndroidJUnit4.class) +@RunWith(AndroidJUnit4ClassRunner.class) public class CpusTest { - Context appContext = InstrumentationRegistry.getTargetContext(); + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); @Test public void getArch() throws Exception { diff --git a/inventory/src/androidTest/java/org/flyve/inventory/CreateFileTest.java b/inventory/src/androidTest/java/org/flyve/inventory/CreateFileTest.java index de8016058..69e06fb17 100644 --- a/inventory/src/androidTest/java/org/flyve/inventory/CreateFileTest.java +++ b/inventory/src/androidTest/java/org/flyve/inventory/CreateFileTest.java @@ -27,8 +27,8 @@ package org.flyve.inventory; import android.content.Context; -import androidx.test.InstrumentationRegistry; -import androidx.test.runner.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner; import org.flyve.inventory.categories.Categories; import org.flyve.inventory.categories.Category; @@ -42,10 +42,10 @@ import static org.junit.Assert.assertTrue; -@RunWith(AndroidJUnit4.class) +@RunWith(AndroidJUnit4ClassRunner.class) public class CreateFileTest { - Context appContext = InstrumentationRegistry.getTargetContext(); + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); @Test public void createXMLTest() throws Exception { diff --git a/inventory/src/androidTest/java/org/flyve/inventory/DrivesTest.java b/inventory/src/androidTest/java/org/flyve/inventory/DrivesTest.java index 03d90f2c1..4c8bc03f3 100644 --- a/inventory/src/androidTest/java/org/flyve/inventory/DrivesTest.java +++ b/inventory/src/androidTest/java/org/flyve/inventory/DrivesTest.java @@ -28,7 +28,6 @@ import android.content.Context; import android.os.Environment; -import androidx.test.InstrumentationRegistry; import org.flyve.inventory.categories.Drives; @@ -38,9 +37,11 @@ import static org.junit.Assert.assertNotEquals; - public class DrivesTest { +import androidx.test.platform.app.InstrumentationRegistry; - Context appContext = InstrumentationRegistry.getTargetContext(); +public class DrivesTest { + + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); File froot = Environment.getRootDirectory(); File fexternal = Environment.getExternalStorageDirectory(); diff --git a/inventory/src/androidTest/java/org/flyve/inventory/HardwareTest.java b/inventory/src/androidTest/java/org/flyve/inventory/HardwareTest.java index 4a3965883..1c2dd9ea4 100644 --- a/inventory/src/androidTest/java/org/flyve/inventory/HardwareTest.java +++ b/inventory/src/androidTest/java/org/flyve/inventory/HardwareTest.java @@ -27,8 +27,9 @@ package org.flyve.inventory; import android.content.Context; -import androidx.test.InstrumentationRegistry; -import androidx.test.runner.AndroidJUnit4; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner; import org.flyve.inventory.categories.Hardware; @@ -37,10 +38,10 @@ import static org.junit.Assert.assertNotEquals; -@RunWith(AndroidJUnit4.class) +@RunWith(AndroidJUnit4ClassRunner.class) public class HardwareTest { - Context appContext = InstrumentationRegistry.getTargetContext(); + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); @Test public void getDatelastloggeduser() throws Exception { diff --git a/inventory/src/androidTest/java/org/flyve/inventory/InputsTest.java b/inventory/src/androidTest/java/org/flyve/inventory/InputsTest.java index 392159fc1..e804eb7ec 100644 --- a/inventory/src/androidTest/java/org/flyve/inventory/InputsTest.java +++ b/inventory/src/androidTest/java/org/flyve/inventory/InputsTest.java @@ -27,8 +27,9 @@ package org.flyve.inventory; import android.content.Context; -import androidx.test.InstrumentationRegistry; -import androidx.test.runner.AndroidJUnit4; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner; import org.flyve.inventory.categories.Inputs; import org.junit.Test; @@ -37,10 +38,10 @@ import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.assertNotNull; -@RunWith(AndroidJUnit4.class) +@RunWith(AndroidJUnit4ClassRunner.class) public class InputsTest { - Context appContext = InstrumentationRegistry.getTargetContext(); + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); @Test public void getKeyboard() throws Exception { diff --git a/inventory/src/androidTest/java/org/flyve/inventory/InventoryTaskTest.java b/inventory/src/androidTest/java/org/flyve/inventory/InventoryTaskTest.java index 799f91f12..e57bd0741 100644 --- a/inventory/src/androidTest/java/org/flyve/inventory/InventoryTaskTest.java +++ b/inventory/src/androidTest/java/org/flyve/inventory/InventoryTaskTest.java @@ -27,8 +27,8 @@ package org.flyve.inventory; import android.content.Context; -import androidx.test.InstrumentationRegistry; -import androidx.test.runner.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner; import android.util.Log; import org.junit.Test; @@ -37,9 +37,9 @@ import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.assertTrue; -@RunWith(AndroidJUnit4.class) +@RunWith(AndroidJUnit4ClassRunner.class) public class InventoryTaskTest { - Context appContext = InstrumentationRegistry.getTargetContext(); + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); @Test public void getJSONTest() throws Exception { diff --git a/inventory/src/androidTest/java/org/flyve/inventory/MemoryTest.java b/inventory/src/androidTest/java/org/flyve/inventory/MemoryTest.java index 608bbb4fa..9a664c3ce 100644 --- a/inventory/src/androidTest/java/org/flyve/inventory/MemoryTest.java +++ b/inventory/src/androidTest/java/org/flyve/inventory/MemoryTest.java @@ -27,8 +27,8 @@ package org.flyve.inventory; import android.content.Context; -import androidx.test.InstrumentationRegistry; -import androidx.test.runner.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner; import org.flyve.inventory.categories.Memory; @@ -37,10 +37,10 @@ import static org.junit.Assert.assertNotEquals; -@RunWith(AndroidJUnit4.class) +@RunWith(AndroidJUnit4ClassRunner.class) public class MemoryTest { - Context appContext = InstrumentationRegistry.getTargetContext(); + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); @Test public void getCapacity() throws Exception { diff --git a/inventory/src/androidTest/java/org/flyve/inventory/ModemsTest.java b/inventory/src/androidTest/java/org/flyve/inventory/ModemsTest.java index 030972c40..1208be475 100644 --- a/inventory/src/androidTest/java/org/flyve/inventory/ModemsTest.java +++ b/inventory/src/androidTest/java/org/flyve/inventory/ModemsTest.java @@ -27,18 +27,18 @@ package org.flyve.inventory; import android.content.Context; -import androidx.test.InstrumentationRegistry; -import androidx.test.runner.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner; import org.flyve.inventory.categories.Modems; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.assertNotEquals; -@RunWith(AndroidJUnit4.class) +@RunWith(AndroidJUnit4ClassRunner.class) public class ModemsTest { - Context appContext = InstrumentationRegistry.getTargetContext(); + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); @Test public void getDriver() { diff --git a/inventory/src/androidTest/java/org/flyve/inventory/NetworksTest.java b/inventory/src/androidTest/java/org/flyve/inventory/NetworksTest.java index dad7ad5dd..605da4545 100644 --- a/inventory/src/androidTest/java/org/flyve/inventory/NetworksTest.java +++ b/inventory/src/androidTest/java/org/flyve/inventory/NetworksTest.java @@ -27,8 +27,8 @@ package org.flyve.inventory; import android.content.Context; -import androidx.test.InstrumentationRegistry; -import androidx.test.runner.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner; import org.flyve.inventory.categories.Networks; import org.junit.Test; @@ -36,10 +36,10 @@ import static org.junit.Assert.assertNotEquals; -@RunWith(AndroidJUnit4.class) +@RunWith(AndroidJUnit4ClassRunner.class) public class NetworksTest { - Context appContext = InstrumentationRegistry.getTargetContext(); + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); @Test public void getMacaddr() { diff --git a/inventory/src/androidTest/java/org/flyve/inventory/OperatingSystemTest.java b/inventory/src/androidTest/java/org/flyve/inventory/OperatingSystemTest.java index 7c2de8e6a..1273d60b0 100644 --- a/inventory/src/androidTest/java/org/flyve/inventory/OperatingSystemTest.java +++ b/inventory/src/androidTest/java/org/flyve/inventory/OperatingSystemTest.java @@ -27,8 +27,8 @@ package org.flyve.inventory; import android.content.Context; -import androidx.test.InstrumentationRegistry; -import androidx.test.runner.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner; import org.flyve.inventory.categories.OperatingSystem; import org.junit.Test; import org.junit.runner.RunWith; @@ -38,10 +38,10 @@ import static org.junit.Assert.assertTrue; -@RunWith(AndroidJUnit4.class) +@RunWith(AndroidJUnit4ClassRunner.class) public class OperatingSystemTest { - Context appContext = InstrumentationRegistry.getTargetContext(); + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); @Test public void getBootTime() { diff --git a/inventory/src/androidTest/java/org/flyve/inventory/SensorsTest.java b/inventory/src/androidTest/java/org/flyve/inventory/SensorsTest.java index 5a0591ed7..458ce70b3 100644 --- a/inventory/src/androidTest/java/org/flyve/inventory/SensorsTest.java +++ b/inventory/src/androidTest/java/org/flyve/inventory/SensorsTest.java @@ -29,8 +29,8 @@ import android.content.Context; import android.hardware.Sensor; import android.hardware.SensorManager; -import androidx.test.InstrumentationRegistry; -import androidx.test.runner.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner; import org.flyve.inventory.categories.Sensors; @@ -41,10 +41,10 @@ import static org.junit.Assert.assertNotEquals; -@RunWith(AndroidJUnit4.class) +@RunWith(AndroidJUnit4ClassRunner.class) public class SensorsTest { - Context appContext = InstrumentationRegistry.getTargetContext(); + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); Sensors csensors = new Sensors(appContext); @Test diff --git a/inventory/src/androidTest/java/org/flyve/inventory/SimcardsTest.java b/inventory/src/androidTest/java/org/flyve/inventory/SimcardsTest.java index c8bcf88f4..8f08e63d5 100644 --- a/inventory/src/androidTest/java/org/flyve/inventory/SimcardsTest.java +++ b/inventory/src/androidTest/java/org/flyve/inventory/SimcardsTest.java @@ -27,8 +27,8 @@ package org.flyve.inventory; import android.content.Context; -import androidx.test.InstrumentationRegistry; -import androidx.test.runner.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner; import android.telephony.SubscriptionInfo; import org.flyve.inventory.categories.Simcards; @@ -39,10 +39,10 @@ import static org.junit.Assert.assertNotEquals; -@RunWith(AndroidJUnit4.class) +@RunWith(AndroidJUnit4ClassRunner.class) public class SimcardsTest { - Context appContext = InstrumentationRegistry.getTargetContext(); + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); @Test public void getCountry() throws Exception { diff --git a/inventory/src/androidTest/java/org/flyve/inventory/SoftwareTest.java b/inventory/src/androidTest/java/org/flyve/inventory/SoftwareTest.java index 18b0416cc..b3603d560 100644 --- a/inventory/src/androidTest/java/org/flyve/inventory/SoftwareTest.java +++ b/inventory/src/androidTest/java/org/flyve/inventory/SoftwareTest.java @@ -29,8 +29,8 @@ import android.content.Context; import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; -import androidx.test.InstrumentationRegistry; -import androidx.test.runner.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner; import org.flyve.inventory.categories.Software; @@ -41,10 +41,10 @@ import static org.junit.Assert.assertNotEquals; -@RunWith(AndroidJUnit4.class) +@RunWith(AndroidJUnit4ClassRunner.class) public class SoftwareTest { - Context appContext = InstrumentationRegistry.getTargetContext(); + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); @Test public void getName() { diff --git a/inventory/src/androidTest/java/org/flyve/inventory/UsbTest.java b/inventory/src/androidTest/java/org/flyve/inventory/UsbTest.java index 726691697..9c1b70239 100644 --- a/inventory/src/androidTest/java/org/flyve/inventory/UsbTest.java +++ b/inventory/src/androidTest/java/org/flyve/inventory/UsbTest.java @@ -27,8 +27,8 @@ package org.flyve.inventory; import android.content.Context; -import androidx.test.InstrumentationRegistry; -import androidx.test.runner.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner; import org.flyve.inventory.categories.Usb; import org.junit.Test; @@ -36,10 +36,10 @@ import static org.junit.Assert.assertNotEquals; -@RunWith(AndroidJUnit4.class) +@RunWith(AndroidJUnit4ClassRunner.class) public class UsbTest { - Context appContext = InstrumentationRegistry.getTargetContext(); + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); @Test public void getClassTest() { diff --git a/inventory/src/androidTest/java/org/flyve/inventory/UserTest.java b/inventory/src/androidTest/java/org/flyve/inventory/UserTest.java index d139e3325..ab48f03e6 100644 --- a/inventory/src/androidTest/java/org/flyve/inventory/UserTest.java +++ b/inventory/src/androidTest/java/org/flyve/inventory/UserTest.java @@ -27,8 +27,8 @@ package org.flyve.inventory; import android.content.Context; -import androidx.test.InstrumentationRegistry; -import androidx.test.runner.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner; import org.flyve.inventory.categories.User; import org.junit.Test; @@ -36,10 +36,10 @@ import static org.junit.Assert.assertNotEquals; -@RunWith(AndroidJUnit4.class) +@RunWith(AndroidJUnit4ClassRunner.class) public class UserTest { - Context appContext = InstrumentationRegistry.getTargetContext(); + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); @Test public void getClassTest() { diff --git a/inventory/src/androidTest/java/org/flyve/inventory/VideosTest.java b/inventory/src/androidTest/java/org/flyve/inventory/VideosTest.java index 308e31e88..ef541159f 100644 --- a/inventory/src/androidTest/java/org/flyve/inventory/VideosTest.java +++ b/inventory/src/androidTest/java/org/flyve/inventory/VideosTest.java @@ -28,8 +28,8 @@ import android.content.Context; -import androidx.test.InstrumentationRegistry; -import androidx.test.runner.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner; import org.flyve.inventory.categories.Videos; @@ -38,10 +38,10 @@ import static org.junit.Assert.assertNotEquals; -@RunWith(AndroidJUnit4.class) +@RunWith(AndroidJUnit4ClassRunner.class) public class VideosTest { - Context appContext = InstrumentationRegistry.getTargetContext(); + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); @Test public void getResolution() throws Exception { diff --git a/inventory/src/main/AndroidManifest.xml b/inventory/src/main/AndroidManifest.xml index ae40c397d..6c99eed02 100644 --- a/inventory/src/main/AndroidManifest.xml +++ b/inventory/src/main/AndroidManifest.xml @@ -1,13 +1,11 @@ + xmlns:android="http://schemas.android.com/apk/res/android"> -