This repository was archived by the owner on Nov 5, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
test/java/br/com/ilhasoft/support/validation
test/java/br/com/ilhasoft/support/validation Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,6 +7,9 @@ android {
77 compileSdkVersion 28
88 buildToolsVersion ' 28.0.3'
99
10+ // Gradle automatically adds 'android.test.runner' as a dependency.
11+ useLibrary ' android.test.runner'
12+
1013 dataBinding {
1114 enabled true
1215 }
@@ -17,14 +20,22 @@ android {
1720 versionCode 3
1821 versionName " 1.0.0"
1922 consumerProguardFiles ' proguard-rules.pro'
23+
24+ testInstrumentationRunner " androidx.test.runner.AndroidJUnitRunner"
2025 }
2126}
2227
2328dependencies {
2429 implementation fileTree(dir : ' libs' , include : [' *.jar' ])
2530 api ' androidx.appcompat:appcompat:1.0.0'
2631 api ' com.google.android.material:material:1.0.0'
32+ // JUnit 4 framework
2733 testImplementation ' junit:junit:4.12'
34+ // Android annotations
35+ androidTestImplementation ' androidx.annotation:annotation:1.0.0'
36+ // AndroidJUnitRunner and JUnit Rules
37+ androidTestImplementation ' androidx.test:runner:1.1.0-beta02'
38+ androidTestImplementation ' androidx.test:rules:1.1.0-beta02'
2839}
2940
3041// build a jar with source files
Original file line number Diff line number Diff line change 33 package =" br.com.ilhasoft.support.validation" >
44
55 <application android : allowBackup =" true"
6- android : supportsRtl =" true" />
6+ android : supportsRtl =" true" />
77
88</manifest >
Original file line number Diff line number Diff line change 88 * To work on unit tests, switch the Test Artifact in the Build Variants view.
99 */
1010public class ExampleUnitTest {
11+
1112 @ Test
1213 public void addition_isCorrect () throws Exception {
1314 assertEquals (4 , 2 + 2 );
Original file line number Diff line number Diff line change @@ -4,6 +4,9 @@ android {
44 compileSdkVersion 28
55 buildToolsVersion " 28.0.3"
66
7+ // Gradle automatically adds 'android.test.runner' as a dependency.
8+ useLibrary ' android.test.runner'
9+
710 dataBinding {
811 enabled true
912 }
@@ -14,6 +17,8 @@ android {
1417 targetSdkVersion 28
1518 versionCode 1
1619 versionName " 1.0"
20+
21+ testInstrumentationRunner " androidx.test.runner.AndroidJUnitRunner"
1722 }
1823 buildTypes {
1924 release {
@@ -31,7 +36,13 @@ allprojects {
3136
3237dependencies {
3338 implementation fileTree(dir : ' libs' , include : [' *.jar' ])
34- testImplementation ' junit:junit:4.12'
3539 implementation project(' :library' )
40+ // JUnit 4 framework
41+ testImplementation ' junit:junit:4.12'
42+ // Android annotations
43+ androidTestImplementation ' androidx.annotation:annotation:1.0.0'
44+ // AndroidJUnitRunner and JUnit Rules
45+ androidTestImplementation ' androidx.test:runner:1.1.0-beta02'
46+ androidTestImplementation ' androidx.test:rules:1.1.0-beta02'
3647// compile 'org.bitbucket.ilhasoft:support-validation:e3ed964'
3748}
Original file line number Diff line number Diff line change 88 android : label =" @string/app_name"
99 android : supportsRtl =" true"
1010 android : theme =" @style/AppTheme" >
11+ <uses-library android : name =" android.test.runner"
12+ android : required =" false" />
1113 <activity android : name =" .MainActivity" >
1214 <intent-filter >
1315 <action android : name =" android.intent.action.MAIN" />
Original file line number Diff line number Diff line change 22
33import org .junit .Test ;
44
5- import static org .junit .Assert .* ;
5+ import static org .junit .Assert .assertEquals ;
66
77/**
88 * To work on unit tests, switch the Test Artifact in the Build Variants view.
99 */
1010public class ExampleUnitTest {
11+
1112 @ Test
1213 public void addition_isCorrect () throws Exception {
1314 assertEquals (4 , 2 + 2 );
You can’t perform that action at this time.
0 commit comments