Skip to content

Commit 7121a24

Browse files
committed
Fix androidTests in Library project after moves to Ktx
1 parent 75b8319 commit 7121a24

File tree

10 files changed

+23
-57
lines changed

10 files changed

+23
-57
lines changed

Ext/Ktx/README.md

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,9 @@ Why Use Testify KTX?
1414

1515
# Set up testify-ktx
1616

17-
**Root build.gradle**
18-
19-
```groovy
20-
plugins {
21-
id("dev.testify") version "5.0.0" apply false
22-
}
23-
```
24-
2517
**settings.gradle**
2618

27-
Ensure that `mavenCentral()` is available to both `pluginManagement` and `dependencyResolutionManagement`.
19+
Ensure that `mavenCentral()` is available in `dependencyResolutionManagement`.
2820

2921
**Application build.gradle**
3022
```groovy
@@ -33,9 +25,6 @@ dependencies {
3325
}
3426
```
3527

36-
# Included API
37-
38-
3928
---
4029

4130
# License

Ext/Ktx/src/androidTest/java/dev/testify/ScreenshotUtilityTest.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import android.view.View
3232
import androidx.test.ext.junit.runners.AndroidJUnit4
3333
import androidx.test.platform.app.InstrumentationRegistry
3434
import androidx.test.rule.ActivityTestRule
35+
import dev.testify.ktx.TestActivity
3536
import dev.testify.output.getDestination
3637
import org.junit.Assert.assertFalse
3738
import org.junit.Assert.assertNotNull

Ext/Ktx/src/debug/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<uses-sdk tools:overrideLibrary="io.mockk, io.mockk.proxy.android" />
99

1010
<application android:theme="@style/Theme.MaterialComponents.Light.DarkActionBar">
11-
<activity android:name="dev.testify.TestActivity" />
11+
<activity android:name="dev.testify.ktx.TestActivity" />
1212
</application>
1313

1414
</manifest>

Ext/Ktx/src/debug/java/dev/testify/TestActivity.kt

Lines changed: 0 additions & 38 deletions
This file was deleted.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package dev.testify.ktx
2+
3+
import android.app.Activity
4+
import android.os.Bundle
5+
6+
/**
7+
* This is a test Activity that is used to test the Testify library.
8+
*/
9+
class TestActivity : Activity() {
10+
11+
override fun onCreate(savedInstanceState: Bundle?) {
12+
super.onCreate(savedInstanceState)
13+
}
14+
}

Ext/Ktx/src/main/java/dev/testify/internal/extensions/LocaleExtensions.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ fun Context.updateLocale(locale: Locale?): Context {
6262
*/
6363
@VisibleForTesting
6464
@RequiresApi(Build.VERSION_CODES.N)
65-
internal fun Context.updateResources(locale: Locale): Context {
65+
fun Context.updateResources(locale: Locale): Context {
6666
val configuration = Configuration(this.resources.configuration)
6767
val localeList = LocaleList(locale)
6868
LocaleList.setDefault(localeList)
@@ -80,7 +80,7 @@ internal fun Context.updateResources(locale: Locale): Context {
8080
*/
8181
@VisibleForTesting
8282
@Suppress("DEPRECATION")
83-
internal fun Context.updateResourcesLegacy(locale: Locale): Context {
83+
fun Context.updateResourcesLegacy(locale: Locale): Context {
8484
Locale.setDefault(locale)
8585
val configuration = Configuration(this.resources.configuration)
8686
configuration.locale = locale

Ext/Ktx/src/main/java/dev/testify/output/DataDirectoryDestination.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,5 +136,5 @@ open class DataDirectoryDestination(
136136
/**
137137
* Exception to throw when the destination is not found or could not be created.
138138
*/
139-
internal class DataDirectoryDestinationNotFoundException(path: String) :
139+
class DataDirectoryDestinationNotFoundException(path: String) :
140140
TestifyException("NO_DIRECTORY", "\n\n* Could not find or create path {$path}")

Ext/Ktx/src/main/java/dev/testify/output/SdCardDestination.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ open class SdCardDestination(
147147
/**
148148
* Exception to throw when the destination is not found
149149
*/
150-
internal class SdCardDestinationNotFoundException(path: String) :
150+
class SdCardDestinationNotFoundException(path: String) :
151151
TestifyException(
152152
"NO_SD_CARD",
153153
"""

Ext/Ktx/src/main/java/dev/testify/output/TestStorageDestination.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ class TestStorageDestination(
155155
/**
156156
* Exception to throw when the [TestStorage] service is not found.
157157
*/
158-
internal class TestStorageNotFoundException :
158+
class TestStorageNotFoundException :
159159
TestifyException(
160160
"NO_TEST_STORAGE",
161161
"""

Library/src/androidTest/java/dev/testify/core/processor/ImageBufferTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class ImageBufferTest {
7070
@Test(expected = LowMemoryException::class)
7171
fun allocate_fails_on_oom() {
7272
val activityManager = getInstrumentation().targetContext.getSystemService(ACTIVITY_SERVICE) as ActivityManager
73-
val requestedSize: Int = activityManager.memoryClass * 1_048_576 / 2
73+
val requestedSize: Int = activityManager.memoryClass * 1_048_576 * 2
7474
ImageBuffers.allocate(width = 1, height = requestedSize, allocateDiffBuffer = false)
7575
}
7676

0 commit comments

Comments
 (0)