Skip to content

Commit f2098ad

Browse files
committedMay 3, 2024
[Jetcaster]: Create data-testing module.
1 parent 57b962f commit f2098ad

File tree

14 files changed

+78
-12
lines changed

14 files changed

+78
-12
lines changed
 
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
plugins {
2+
alias(libs.plugins.android.library)
3+
alias(libs.plugins.kotlin.android)
4+
}
5+
6+
android {
7+
namespace = "com.example.jetcaster.core.data.testing"
8+
compileSdk = libs.versions.compileSdk.get().toInt()
9+
10+
defaultConfig {
11+
minSdk = libs.versions.minSdk.get().toInt()
12+
13+
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
14+
consumerProguardFiles("consumer-rules.pro")
15+
}
16+
17+
buildTypes {
18+
release {
19+
isMinifyEnabled = false
20+
proguardFiles(
21+
getDefaultProguardFile("proguard-android-optimize.txt"),
22+
"proguard-rules.pro"
23+
)
24+
}
25+
}
26+
compileOptions {
27+
isCoreLibraryDesugaringEnabled = true
28+
sourceCompatibility = JavaVersion.VERSION_17
29+
targetCompatibility = JavaVersion.VERSION_17
30+
}
31+
}
32+
33+
dependencies {
34+
implementation(libs.androidx.core.ktx)
35+
implementation(projects.core.data)
36+
coreLibraryDesugaring(libs.core.jdk.desugaring)
37+
testImplementation(libs.junit)
38+
testImplementation(libs.kotlinx.coroutines.test)
39+
}

‎Jetcaster/core/data-testing/consumer-rules.pro

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
3+
4+
</manifest>

‎Jetcaster/core/domain/src/test/kotlin/com/example/jetcaster/core/repository/TestCategoryStore.kt renamed to ‎Jetcaster/core/data-testing/src/main/java/com/example/jetcaster/core/data/testing/repository/TestCategoryStore.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package com.example.jetcaster.core.repository
17+
package com.example.jetcaster.core.data.testing.repository
1818

1919
import com.example.jetcaster.core.data.database.model.Category
2020
import com.example.jetcaster.core.data.database.model.EpisodeToPodcast

‎Jetcaster/core/domain/src/test/kotlin/com/example/jetcaster/core/repository/TestEpisodeStore.kt renamed to ‎Jetcaster/core/data-testing/src/main/java/com/example/jetcaster/core/data/testing/repository/TestEpisodeStore.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package com.example.jetcaster.core.repository
17+
package com.example.jetcaster.core.data.testing.repository
1818

1919
import com.example.jetcaster.core.data.database.model.Episode
2020
import com.example.jetcaster.core.data.database.model.EpisodeToPodcast

‎Jetcaster/core/domain/src/test/kotlin/com/example/jetcaster/core/repository/TestPodcastStore.kt renamed to ‎Jetcaster/core/data-testing/src/main/java/com/example/jetcaster/core/data/testing/repository/TestPodcastStore.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package com.example.jetcaster.core.repository
17+
package com.example.jetcaster.core.data.testing.repository
1818

1919
import com.example.jetcaster.core.data.database.model.Category
2020
import com.example.jetcaster.core.data.database.model.Podcast

‎Jetcaster/core/domain-testing/build.gradle.kts

+2-3
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,11 @@ android {
3131
}
3232

3333
dependencies {
34-
implementation(projects.core.data)
35-
implementation(project(":core:domain"))
34+
implementation(projects.core.domain)
3635

3736
coreLibraryDesugaring(libs.core.jdk.desugaring)
3837

3938
testImplementation(libs.junit)
4039
androidTestImplementation(libs.androidx.test.ext.junit)
4140
androidTestImplementation(libs.androidx.test.espresso.core)
42-
}
41+
}

‎Jetcaster/core/domain/build.gradle.kts

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ android {
3535
dependencies {
3636
coreLibraryDesugaring(libs.core.jdk.desugaring)
3737
implementation(projects.core.data)
38+
implementation(projects.core.dataTesting)
3839

3940
// Dependency injection
4041
implementation(libs.androidx.hilt.navigation.compose)

‎Jetcaster/core/domain/src/test/kotlin/com/example/jetcaster/core/domain/FilterableCategoriesUseCaseTest.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
package com.example.jetcaster.core.domain
1818

1919
import com.example.jetcaster.core.data.database.model.Category
20+
import com.example.jetcaster.core.data.testing.repository.TestCategoryStore
2021
import com.example.jetcaster.core.model.asExternalModel
21-
import com.example.jetcaster.core.repository.TestCategoryStore
2222
import kotlinx.coroutines.flow.first
2323
import kotlinx.coroutines.test.runTest
2424
import org.junit.Assert.assertEquals

‎Jetcaster/core/domain/src/test/kotlin/com/example/jetcaster/core/domain/GetLatestFollowedEpisodesUseCaseTest.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717
package com.example.jetcaster.core.domain
1818

1919
import com.example.jetcaster.core.data.database.model.Episode
20-
import com.example.jetcaster.core.repository.TestEpisodeStore
21-
import com.example.jetcaster.core.repository.TestPodcastStore
22-
import java.time.OffsetDateTime
20+
import com.example.jetcaster.core.data.testing.repository.TestEpisodeStore
21+
import com.example.jetcaster.core.data.testing.repository.TestPodcastStore
2322
import kotlinx.coroutines.flow.first
2423
import kotlinx.coroutines.test.runTest
2524
import org.junit.Assert.assertTrue
2625
import org.junit.Test
26+
import java.time.OffsetDateTime
2727

2828
class GetLatestFollowedEpisodesUseCaseTest {
2929

‎Jetcaster/core/domain/src/test/kotlin/com/example/jetcaster/core/domain/PodcastCategoryFilterUseCaseTest.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ import com.example.jetcaster.core.data.database.model.Episode
2121
import com.example.jetcaster.core.data.database.model.EpisodeToPodcast
2222
import com.example.jetcaster.core.data.database.model.Podcast
2323
import com.example.jetcaster.core.data.database.model.PodcastWithExtraInfo
24+
import com.example.jetcaster.core.data.testing.repository.TestCategoryStore
2425
import com.example.jetcaster.core.model.asExternalModel
2526
import com.example.jetcaster.core.model.asPodcastToEpisodeInfo
26-
import com.example.jetcaster.core.repository.TestCategoryStore
27-
import java.time.OffsetDateTime
2827
import kotlinx.coroutines.flow.first
2928
import kotlinx.coroutines.test.runTest
3029
import org.junit.Assert.assertEquals
3130
import org.junit.Assert.assertTrue
3231
import org.junit.Test
32+
import java.time.OffsetDateTime
3333

3434
class PodcastCategoryFilterUseCaseTest {
3535

‎Jetcaster/settings.gradle.kts

+1
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,4 @@ include(
4545
":wear"
4646
)
4747
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
48+
include(":core:data-testing")

0 commit comments

Comments
 (0)
Please sign in to comment.