Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[New arch] [Modularization] Tests and cleanup #2728

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
41cf7b2
Polish FileDataStorageManager
abelgardep Nov 15, 2019
2cae8de
Remove already implemented functions in usecases from FileDataStorage…
abelgardep Nov 15, 2019
26cfd47
Keep polishing FileDataStorageManager
abelgardep Nov 18, 2019
b94ac18
Data module: unit tests
davigonz Nov 18, 2019
4a9263b
Data module: instrumented tests
davigonz Nov 18, 2019
b5553b1
Domain module tests
davigonz Nov 18, 2019
49e54de
Create test utils module
abelgardep Nov 18, 2019
dee911a
Add new tests to OCCapabilityRepository
abelgardep Nov 18, 2019
d48fbdc
App module tests, restructure
davigonz Nov 18, 2019
743f84b
Include viewmodels
davigonz Nov 19, 2019
ecb6bff
Add new tests to OCCapabilityDaoTest
abelgardep Nov 19, 2019
42928da
Include some utils for viewmodel tests
davigonz Nov 19, 2019
da72dc2
Move business logic from repository to usecase and test it
abelgardep Oct 31, 2019
48794ee
Fix OCCapabilityTest
abelgardep Nov 19, 2019
df811a2
Fix and add tests to GetStoredCapabilities
abelgardep Nov 19, 2019
569c81b
Fix SearchShareesFragmentTest tests and use variables in build.gradle…
davigonz Nov 19, 2019
c3a3e63
Adapt PublicShareCreationDialogFragmentTest tests
davigonz Nov 19, 2019
01fbe7c
Keep adapting UI tests to modularization
davigonz Nov 19, 2019
7065a96
Complete fragment and provider tests
davigonz Nov 20, 2019
baa0592
Fix some error tests
davigonz Nov 20, 2019
4b1c53c
Wrap Shares UIResult inside Event
abelgardep Nov 20, 2019
102c56a
Fix double notification error after screen rotation
davigonz Nov 20, 2019
2da5d07
Moving testutils to new module
abelgardep Nov 21, 2019
ec9fe40
Update type of test Accounts and remove no longer needed test utils
davigonz Nov 21, 2019
e5aadb8
Start to fix OCCapabilityViewModelTest
davigonz Nov 21, 2019
0dfe7eb
Move datautils to owncloudTestUtil module
abelgardep Nov 21, 2019
91e1330
Fix ViewModels tests
abelgardep Nov 26, 2019
dc1ae37
First attempt to fix migration tests
abelgardep Nov 26, 2019
49e991c
Remove dataUtils
abelgardep Nov 26, 2019
668c00c
Fix sqlite dependencies broken in FileContentProvider
davigonz Nov 26, 2019
c8115ba
Fix owncloudData tests
abelgardep Nov 27, 2019
2f58165
Update schemas location
abelgardep Nov 27, 2019
ed92c45
Fix a few more tests after the recent changes
davigonz Nov 27, 2019
52bf727
Fix migration tests
abelgardep Nov 28, 2019
c278a66
Update RemoteCapability
abelgardep Nov 28, 2019
33b8582
Remove utils from owncloudData
abelgardep Nov 28, 2019
60a87d0
Fix ShareFileFragment getters
davigonz Nov 28, 2019
c60ade2
Apply changes requested in library code review
davigonz Dec 3, 2019
01e970c
Apply changes requested in code review
davigonz Dec 3, 2019
1e9168f
More changes requested in code review
davigonz Dec 4, 2019
62b6ec6
Rename migration test
abelgardep Dec 4, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 22 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,27 +1,43 @@
buildscript {
ext {
// SDK
sdkCompileVersion = 28
sdkMinVersion = 19
sdkTargetVersion = 28

// Android jetpack
archLifecycleVersion = '2.1.0'
roomVersion = '2.1.0'
archLifecycleVersion = "2.1.0"
roomVersion = "2.2.2"
appCompat = "1.1.0"
sqliteVersion = "2.0.1"
lifecycleLiveData = "2.0.0"

// Kotlin
kotlinVersion = '1.3.50'
kotlinVersion = "1.3.50"
coroutinesVersion = "1.3.2"

// Koin
koinVersion = '2.0.1'
mockkVersion = '1.9.3'
koinVersion = "2.0.1"
mockkVersion = "1.9.3"

// Testing
junitVersion = "4.12"
extJunitVersion = "1.1.1"
androidTestVersion = "1.2.0"
mockitoVersion = "2.24.0"
espressoTestVersion = "3.2.0"
fragmentTestVersion = "1.1.0"
uiAutomatorTestVersion = "2.2.0"
annotationTestVersion = "1.1.0"

// Extensions
ktxVersion = "1.1.0"

// KTX extensions
ktxCoreVersion = "1.0.2"
ktxCoreVersion = "1.1.0"
ktxViewModelVersion = "2.2.0-alpha01"
ktxFragmentVersion = "1.0.0"
ktxLiveData = "2.1.0"
}

repositories {
Expand Down
60 changes: 24 additions & 36 deletions owncloudApp/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,33 +19,35 @@ dependencies {
implementation 'com.jakewharton:disklrucache:2.0.2'
implementation 'com.google.android.exoplayer:exoplayer:r2.2.0'
implementation 'com.andrognito.patternlockview:patternlockview:1.0.0'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation "androidx.appcompat:appcompat:$appCompat"
implementation 'com.getbase:floatingactionbutton:1.10.1'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation "androidx.browser:browser:$androidX"
implementation 'commons-io:commons-io:2.6'
implementation "androidx.sqlite:sqlite:$sqliteVersion"

// Dependencies for unit tests
// Tests
testImplementation project(':owncloudTestUtil')
testImplementation "junit:junit:$junitVersion"
testImplementation "androidx.arch.core:core-testing:$archLifecycleVersion"
testImplementation "io.mockk:mockk:$mockkVersion"

// Dependencies for instrumented tests
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
// JUnit4 Rules
androidTestImplementation 'androidx.test:rules:1.2.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
// Android JUnit Runner
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-intents:3.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-web:3.2.0'
androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0'
androidTestImplementation 'androidx.annotation:annotation:1.1.0'
androidTestImplementation "androidx.room:room-testing:$roomVersion"
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutinesVersion"

// Instrumented tests
androidTestImplementation project(':owncloudTestUtil')
androidTestImplementation "androidx.test:core:$androidTestVersion"
androidTestImplementation "androidx.test:rules:$androidTestVersion"
androidTestImplementation "androidx.test:runner:$androidTestVersion"
androidTestImplementation "androidx.test:runner:$androidTestVersion"
androidTestImplementation "androidx.test.ext:junit:$extJunitVersion"
androidTestImplementation "androidx.test.espresso:espresso-core:$espressoTestVersion"
androidTestImplementation "androidx.test.espresso:espresso-contrib:$espressoTestVersion"
androidTestImplementation "androidx.test.espresso:espresso-intents:$espressoTestVersion"
androidTestImplementation "androidx.test.espresso:espresso-web:$espressoTestVersion"
androidTestImplementation "androidx.test.uiautomator:uiautomator:$uiAutomatorTestVersion"
androidTestImplementation "androidx.annotation:annotation:$annotationTestVersion"
androidTestImplementation "androidx.arch.core:core-testing:$archLifecycleVersion"
androidTestImplementation ("io.mockk:mockk-android:$mockkVersion") {
androidTestImplementation("io.mockk:mockk-android:$mockkVersion") {
exclude module: 'objenesis'
}

Expand All @@ -64,10 +66,9 @@ dependencies {

implementation "androidx.lifecycle:lifecycle-extensions:$archLifecycleVersion"
implementation "androidx.lifecycle:lifecycle-viewmodel:$archLifecycleVersion"
kapt "androidx.lifecycle:lifecycle-compiler:$archLifecycleVersion"
kapt "androidx.lifecycle:lifecycle-common-java8:$archLifecycleVersion"

implementation "androidx.room:room-runtime:$roomVersion"
kapt "androidx.room:room-compiler:$roomVersion"

// Koin dependency injector
implementation "org.koin:koin-androidx-viewmodel:$koinVersion"
Expand All @@ -76,12 +77,6 @@ dependencies {
implementation "androidx.core:core-ktx:$ktxCoreVersion"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$ktxViewModelVersion"
implementation "androidx.fragment:fragment-ktx:$ktxFragmentVersion"

// Kotlin library to mock
testImplementation "io.mockk:mockk:$mockkVersion"
androidTestImplementation ("io.mockk:mockk-android:$mockkVersion") {
exclude module: 'objenesis'
}
}

tasks.withType(Test) {
Expand All @@ -97,24 +92,18 @@ allOpen {
}

android {
compileSdkVersion 28
compileSdkVersion sdkCompileVersion

defaultConfig {
minSdkVersion 19
targetSdkVersion 28
minSdkVersion sdkMinVersion
targetSdkVersion sdkTargetVersion

versionCode = 21300100
versionName = "2.13.1"

buildConfigField "String", gitRemote, "\"" + getGitOriginRemote() + "\""
buildConfigField "String", commitSHA1, "\"" + getLatestGitHash() + "\""

javaCompileOptions {
annotationProcessorOptions {
arguments = ["room.schemaLocation": "$projectDir/schemas".toString()]
}
}

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

Expand All @@ -126,7 +115,6 @@ android {
sourceSets {
androidTest.java.srcDirs += "src/test-common/java"
test.java.srcDirs += "src/test-common/java"
androidTest.assets.srcDirs += files("$projectDir/schemas".toString())
}

lintOptions {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
*
* @author David A. Velasco
* Copyright (C) 2017 ownCloud GmbH.
* <p>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
* as published by the Free Software Foundation.
* <p>
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
Expand All @@ -21,11 +21,9 @@

import android.os.Parcel;

import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;

import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
Expand All @@ -39,7 +37,6 @@
*
* See http://developer.android.com/intl/es/training/testing/unit-testing/instrumented-unit-tests.html .
*/
@RunWith(AndroidJUnit4.class)
@SmallTest
public class OCFileUnitTest {

Expand Down
Loading