Skip to content

Commit

Permalink
Update unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mykola-mokhnach committed Oct 20, 2023
1 parent da19ccb commit 1506f40
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
25 changes: 20 additions & 5 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ apply plugin: 'com.android.application'
apply plugin: 'de.mobilej.unmock'

android {
compileSdkVersion 30
compileSdk 30
defaultConfig {
applicationId 'io.appium.uiautomator2'
minSdkVersion 21
Expand Down Expand Up @@ -50,7 +50,23 @@ android {
}
}
testOptions {
unitTests.returnDefaultValues = true
unitTests {
includeAndroidResources = true
returnDefaultValues = true
all {
it.jvmArgs([
'--add-opens', 'java.base/java.lang=ALL-UNNAMED',
'--add-opens', 'java.base/java.time=ALL-UNNAMED',
'--add-opens', 'java.base/java.time.format=ALL-UNNAMED',
'--add-opens', 'java.base/java.util=ALL-UNNAMED',
'--add-opens', 'java.base/java.util.concurrent=ALL-UNNAMED',
'--add-exports', 'java.base/sun.nio.ch=ALL-UNNAMED',
'--add-opens', 'java.base/java.lang.reflect=ALL-UNNAMED',
'--add-opens', 'java.base/java.io=ALL-UNNAMED',
'--add-exports', 'jdk.unsupported/sun.misc=ALL-UNNAMED',
])
}
}
}
packagingOptions {
resources {
Expand All @@ -76,7 +92,7 @@ dependencies {
implementation 'androidx.test.uiautomator:uiautomator:2.2.0'
implementation 'androidx.test:core:1.4.0'
implementation 'androidx.test:runner:1.4.0'
implementation 'com.google.code.gson:gson:2.8.9'
implementation 'com.google.code.gson:gson:2.10.1'
//noinspection GradleDependency
implementation 'commons-io:commons-io:2.6'
implementation 'io.netty:netty-all:4.0.41.Final'
Expand All @@ -86,7 +102,6 @@ dependencies {
implementation 'com.github.vbmacher:java-cup-runtime:11b-20160615-1'
//noinspection GradleDependency
implementation 'com.ibm.icu:icu4j:60.2'
unmock 'org.robolectric:android-all:7.1.0_r7-robolectric-0'
testImplementation 'androidx.test.ext:junit:1.1.3'
//noinspection GradleDependency
testImplementation 'junit:junit:4.12'
Expand All @@ -95,7 +110,7 @@ dependencies {
testImplementation 'org.powermock:powermock-classloading-xstream:2.0.9'
testImplementation 'org.powermock:powermock-module-junit4-rule:2.0.9'
testImplementation 'org.powermock:powermock-module-junit4:2.0.9'
testImplementation 'org.robolectric:robolectric:4.5.1'
testImplementation 'org.robolectric:robolectric:4.10.3'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'com.squareup.okhttp:okhttp:2.7.5'
androidTestImplementation 'androidx.test.espresso:espresso-web:3.4.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ public void parsesComplexXpath2() {
}

@Test
@Ignore("robolectric depends on com.ibm.icu:icu4j:72.1 while psychopath requires 60.2")
public void parsesXpath2UsingIcu() {
String query = "//android.widget.TextView[substring(@text, 1) = 'some, text']";
List<Node> nodes = findNodesUsingXpath2(XML, query, false);
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
org.gradle.parallel=true
org.gradle.jvmargs=-Xms512m -Xmx2048m -XX\:MaxMetaspaceSize\=1g
android.useAndroidX=true
android.defaults.buildfeatures.buildconfig=true
Expand Down

0 comments on commit 1506f40

Please sign in to comment.