From 56ce85bc82dc8b927c650da5bd15e848066ba8ac Mon Sep 17 00:00:00 2001 From: Eric Ampire Date: Wed, 8 Sep 2021 19:28:05 +0200 Subject: [PATCH] Removing test module --- settings.gradle.kts | 3 +- test-shared/.gitignore | 1 - test-shared/build.gradle.kts | 40 ------------- test-shared/consumer-rules.pro | 0 test-shared/proguard-rules.pro | 21 ------- test-shared/src/main/AndroidManifest.xml | 4 -- .../testshared/MainCoroutineRule.kt | 56 ------------------- 7 files changed, 1 insertion(+), 124 deletions(-) delete mode 100644 test-shared/.gitignore delete mode 100644 test-shared/build.gradle.kts delete mode 100644 test-shared/consumer-rules.pro delete mode 100644 test-shared/proguard-rules.pro delete mode 100644 test-shared/src/main/AndroidManifest.xml delete mode 100644 test-shared/src/main/java/com/ericampire/android/androidstudycase/testshared/MainCoroutineRule.kt diff --git a/settings.gradle.kts b/settings.gradle.kts index bbd510a..5f9ef90 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -11,7 +11,7 @@ dependencyResolutionManagement { repositories { google() mavenCentral() - jcenter() // Warning: this repository is going to shut down soon + jcenter() // Todo: Warning this repository is going to shut down soon } } rootProject.name = "lottiefiles" @@ -20,4 +20,3 @@ include(":util") include(":i18n") include(":data") include(":domain") -//include(":test-shared") diff --git a/test-shared/.gitignore b/test-shared/.gitignore deleted file mode 100644 index 42afabf..0000000 --- a/test-shared/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/build \ No newline at end of file diff --git a/test-shared/build.gradle.kts b/test-shared/build.gradle.kts deleted file mode 100644 index 5c4269e..0000000 --- a/test-shared/build.gradle.kts +++ /dev/null @@ -1,40 +0,0 @@ -plugins { - id("com.android.library") - id("kotlin-android") - kotlin("kapt") -} - -android { - compileSdk = Apps.compileSdk - buildToolsVersion = Apps.buildToolsVersion - - defaultConfig { - minSdk = Apps.minSdk - targetSdk = Apps.targetSdk - - testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" - consumerProguardFiles("consumer-rules.pro") - } - - buildTypes { - release { - isMinifyEnabled = false - proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") - } - } - compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - } -} - -dependencies { - implementation(platform(Libs.kotlin_coroutine_bom)) - implementation(Libs.kotlin_coroutine_core) - implementation(Libs.kotlin_coroutine_test) - - implementation(Libs.junit_jupiter_api) - implementation(Libs.junit_jupiter_engine) - - testImplementation(Libs.mockk_core) -} \ No newline at end of file diff --git a/test-shared/consumer-rules.pro b/test-shared/consumer-rules.pro deleted file mode 100644 index e69de29..0000000 diff --git a/test-shared/proguard-rules.pro b/test-shared/proguard-rules.pro deleted file mode 100644 index ff59496..0000000 --- a/test-shared/proguard-rules.pro +++ /dev/null @@ -1,21 +0,0 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle.kts. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/test-shared/src/main/AndroidManifest.xml b/test-shared/src/main/AndroidManifest.xml deleted file mode 100644 index 1cb8c98..0000000 --- a/test-shared/src/main/AndroidManifest.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/test-shared/src/main/java/com/ericampire/android/androidstudycase/testshared/MainCoroutineRule.kt b/test-shared/src/main/java/com/ericampire/android/androidstudycase/testshared/MainCoroutineRule.kt deleted file mode 100644 index 10762b0..0000000 --- a/test-shared/src/main/java/com/ericampire/android/androidstudycase/testshared/MainCoroutineRule.kt +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2019 Google LLC - * - * 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 - * - * https://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. - */ - -package com.ericampire.android.androidstudycase.testshared - -import kotlinx.coroutines.CoroutineScope -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.ExperimentalCoroutinesApi -import kotlinx.coroutines.test.TestCoroutineDispatcher -import kotlinx.coroutines.test.TestCoroutineScope -import kotlinx.coroutines.test.resetMain -import kotlinx.coroutines.test.runBlockingTest -import kotlinx.coroutines.test.setMain -import org.junit.jupiter.api.AfterAll -import org.junit.jupiter.api.BeforeAll -import org.junit.jupiter.api.extension.AfterAllCallback -import org.junit.jupiter.api.extension.BeforeAllCallback -import org.junit.jupiter.api.extension.ExtensionContext - -@ExperimentalCoroutinesApi -class MainCoroutineExtension( - val testDispatcher: TestCoroutineDispatcher = TestCoroutineDispatcher() -) : BeforeAllCallback, AfterAllCallback { - - override fun beforeAll(context: ExtensionContext?) { - Dispatchers.setMain(testDispatcher) - } - - override fun afterAll(context: ExtensionContext?) { - Dispatchers.resetMain() - testDispatcher.cleanupTestCoroutines() - } -} - -//fun MainCoroutineRule.runBlockingTest(block: suspend TestCoroutineScope.() -> Unit) = -// this.testDispatcher.runBlockingTest { -// block() -// } -// -///** -// * Creates a new [CoroutineScope] with the rule's testDispatcher -// */ -//fun MainCoroutineRule.CoroutineScope(): CoroutineScope = CoroutineScope(testDispatcher)