Move test helper classes to a consistent package (com.nextcloud.test)

Avoids having them mixed up with the tests

Signed-off-by: Álvaro Brey <alvaro.brey@nextcloud.com>
This commit is contained in:
Álvaro Brey 2023-01-12 09:36:27 +01:00
parent 7368809f37
commit 443e6984f6
No known key found for this signature in database
GPG key ID: 2585783189A62105
35 changed files with 42 additions and 39 deletions

View file

@ -96,7 +96,7 @@ android {
}
// arguments to be passed to functional tests
testInstrumentationRunner "com.nextcloud.client.ScreenshotTestRunner"
testInstrumentationRunner "com.nextcloud.test.ScreenshotTestRunner"
testInstrumentationRunnerArgument "TEST_SERVER_URL", "${NC_TEST_SERVER_BASEURL}"
testInstrumentationRunnerArgument "TEST_SERVER_USERNAME", "${NC_TEST_SERVER_USERNAME}"
testInstrumentationRunnerArgument "TEST_SERVER_PASSWORD", "${NC_TEST_SERVER_PASSWORD}"

View file

@ -20,9 +20,9 @@
package com.nextcloud.client;
import android.Manifest;
import android.widget.TextView;
import com.nextcloud.test.GrantStoragePermissionRule;
import com.owncloud.android.AbstractIT;
import com.owncloud.android.R;
import com.owncloud.android.authentication.AuthenticatorActivity;
@ -34,8 +34,6 @@ import org.junit.rules.TestRule;
import androidx.test.espresso.intent.rule.IntentsTestRule;
import static androidx.test.espresso.Espresso.onView;
import static androidx.test.espresso.action.ViewActions.typeText;
import static androidx.test.espresso.matcher.ViewMatchers.withId;

View file

@ -24,6 +24,7 @@ package com.nextcloud.client;
import android.app.Activity;
import com.nextcloud.test.GrantStoragePermissionRule;
import com.owncloud.android.AbstractIT;
import com.owncloud.android.ui.activity.CommunityActivity;
import com.owncloud.android.utils.ScreenshotTest;

View file

@ -25,6 +25,7 @@ package com.nextcloud.client;
import android.accounts.AccountManager;
import com.nextcloud.test.RandomStringGenerator;
import com.nextcloud.test.RetryTestRule;
import com.owncloud.android.AbstractOnServerIT;
import com.owncloud.android.datamodel.ArbitraryDataProvider;
import com.owncloud.android.datamodel.ArbitraryDataProviderImpl;

View file

@ -29,6 +29,7 @@ import androidx.test.espresso.contrib.NavigationViewActions
import androidx.test.espresso.intent.rule.IntentsTestRule
import androidx.test.espresso.matcher.ViewMatchers
import androidx.test.platform.app.InstrumentationRegistry
import com.nextcloud.test.RetryTestRule
import com.owncloud.android.AbstractOnServerIT
import com.owncloud.android.R
import com.owncloud.android.lib.resources.files.CreateFolderRemoteOperation

View file

@ -25,6 +25,7 @@ import android.app.Activity
import android.content.Intent
import android.os.Looper
import androidx.test.espresso.intent.rule.IntentsTestRule
import com.nextcloud.test.GrantStoragePermissionRule
import com.owncloud.android.AbstractIT
import com.owncloud.android.datamodel.ArbitraryDataProviderImpl
import com.owncloud.android.ui.activity.RequestCredentialsActivity

View file

@ -19,7 +19,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.nextcloud.client
package com.nextcloud.test
import android.Manifest
import android.os.Build

View file

@ -20,7 +20,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.nextcloud.client
package com.nextcloud.test
import com.owncloud.android.BuildConfig
import com.owncloud.android.lib.common.utils.Log_OC

View file

@ -20,7 +20,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.nextcloud.client;
package com.nextcloud.test;
import android.app.Application;
import android.content.Context;

View file

@ -26,7 +26,7 @@ import android.graphics.BitmapFactory
import android.widget.ImageView
import android.widget.LinearLayout
import androidx.test.espresso.intent.rule.IntentsTestRule
import com.nextcloud.client.TestActivity
import com.nextcloud.test.TestActivity
import com.owncloud.android.AbstractIT
import com.owncloud.android.R
import com.owncloud.android.utils.BitmapUtils

View file

@ -14,7 +14,7 @@ import android.view.View;
import com.facebook.testing.screenshot.Screenshot;
import com.facebook.testing.screenshot.internal.TestNameDetector;
import com.nextcloud.client.GrantStoragePermissionRule;
import com.nextcloud.test.GrantStoragePermissionRule;
import com.nextcloud.client.account.User;
import com.nextcloud.client.account.UserAccountManager;
import com.nextcloud.client.account.UserAccountManagerImpl;

View file

@ -23,9 +23,9 @@
package com.owncloud.android.authentication
import androidx.test.core.app.launchActivity
import com.nextcloud.client.TestActivity
import com.nextcloud.client.core.Clock
import com.nextcloud.client.preferences.AppPreferences
import com.nextcloud.test.TestActivity
import com.owncloud.android.ui.activity.SettingsActivity
import io.mockk.MockKAnnotations
import io.mockk.every

View file

@ -22,8 +22,8 @@ package com.owncloud.android.files
import androidx.test.core.app.launchActivity
import androidx.test.ext.junit.runners.AndroidJUnit4
import com.nextcloud.client.TestActivity
import com.nextcloud.client.account.User
import com.nextcloud.test.TestActivity
import com.nextcloud.utils.EditorUtils
import com.owncloud.android.AbstractIT
import com.owncloud.android.R

View file

@ -22,7 +22,7 @@
package com.owncloud.android.providers
import androidx.test.espresso.intent.rule.IntentsTestRule
import com.nextcloud.client.TestActivity
import com.nextcloud.test.TestActivity
import com.owncloud.android.AbstractOnServerIT
import org.junit.Rule
import org.junit.Test

View file

@ -29,10 +29,10 @@ import androidx.test.espresso.web.webdriver.DriverAtoms
import androidx.test.espresso.web.webdriver.Locator
import androidx.test.filters.LargeTest
import androidx.test.platform.app.InstrumentationRegistry
import com.nextcloud.client.GrantStoragePermissionRule
import com.nextcloud.client.RetryTestRule
import com.nextcloud.client.account.UserAccountManager
import com.nextcloud.client.account.UserAccountManagerImpl
import com.nextcloud.test.GrantStoragePermissionRule
import com.nextcloud.test.RetryTestRule
import com.owncloud.android.AbstractIT
import com.owncloud.android.R
import com.owncloud.android.authentication.AuthenticatorActivity

View file

@ -27,7 +27,7 @@ import android.accounts.AccountManager;
import android.net.Uri;
import android.os.Bundle;
import com.nextcloud.client.RetryTestRule;
import com.nextcloud.test.RetryTestRule;
import com.nextcloud.client.account.User;
import com.nextcloud.client.account.UserAccountManager;
import com.nextcloud.client.account.UserAccountManagerImpl;

View file

@ -2,12 +2,10 @@ package com.owncloud.android.ui.activity;
import android.app.Activity;
import com.nextcloud.client.GrantStoragePermissionRule;
import com.nextcloud.client.onboarding.WhatsNewActivity;
import com.owncloud.android.AbstractIT;
import org.junit.Test;
import org.junit.rules.TestRule;
import androidx.test.core.app.ActivityScenario;
import androidx.test.platform.app.InstrumentationRegistry;

View file

@ -23,7 +23,7 @@ package com.owncloud.android.ui.activity
import android.content.Intent
import androidx.test.espresso.intent.rule.IntentsTestRule
import com.nextcloud.client.GrantStoragePermissionRule
import com.nextcloud.test.GrantStoragePermissionRule
import com.owncloud.android.AbstractIT
import com.owncloud.android.utils.FileStorageUtils
import com.owncloud.android.utils.ScreenshotTest

View file

@ -25,7 +25,7 @@ import androidx.fragment.app.FragmentManager
import androidx.recyclerview.widget.RecyclerView
import androidx.test.espresso.intent.rule.IntentsTestRule
import androidx.test.platform.app.InstrumentationRegistry
import com.nextcloud.client.TestActivity
import com.nextcloud.test.TestActivity
import com.owncloud.android.AbstractIT
import com.owncloud.android.R
import com.owncloud.android.datamodel.OCFile

View file

@ -24,7 +24,7 @@ package com.owncloud.android.ui.dialog
import androidx.fragment.app.FragmentManager
import androidx.test.espresso.intent.rule.IntentsTestRule
import androidx.test.platform.app.InstrumentationRegistry
import com.nextcloud.client.TestActivity
import com.nextcloud.test.TestActivity
import com.owncloud.android.AbstractIT
import com.owncloud.android.datamodel.OCFile
import com.owncloud.android.lib.resources.status.OCCapability

View file

@ -23,7 +23,7 @@ package com.owncloud.android.ui.dialog
import androidx.test.espresso.intent.rule.IntentsTestRule
import androidx.test.internal.runner.junit4.statement.UiThreadStatement.runOnUiThread
import com.nextcloud.client.TestActivity
import com.nextcloud.test.TestActivity
import com.owncloud.android.AbstractIT
import com.owncloud.android.utils.ScreenshotTest
import org.junit.Rule

View file

@ -24,7 +24,7 @@ package com.owncloud.android.ui.fragment
import android.graphics.BitmapFactory
import androidx.test.espresso.intent.rule.IntentsTestRule
import androidx.test.internal.runner.junit4.statement.UiThreadStatement.runOnUiThread
import com.nextcloud.client.TestActivity
import com.nextcloud.test.TestActivity
import com.owncloud.android.AbstractIT
import com.owncloud.android.R
import com.owncloud.android.lib.resources.users.StatusType

View file

@ -23,7 +23,7 @@
package com.owncloud.android.ui.fragment
import androidx.test.espresso.intent.rule.IntentsTestRule
import com.nextcloud.client.TestActivity
import com.nextcloud.test.TestActivity
import com.owncloud.android.AbstractIT
import com.owncloud.android.R
import com.owncloud.android.datamodel.OCFile

View file

@ -37,8 +37,8 @@ import androidx.test.espresso.matcher.ViewMatchers.withText
import com.google.android.apps.common.testing.accessibility.framework.AccessibilityCheckResultBaseUtils.matchesCheckNames
import com.google.android.apps.common.testing.accessibility.framework.AccessibilityCheckResultUtils.matchesViews
import com.google.android.material.floatingactionbutton.FloatingActionButton
import com.nextcloud.client.RetryTestRule
import com.nextcloud.client.TestActivity
import com.nextcloud.test.RetryTestRule
import com.nextcloud.test.TestActivity
import com.owncloud.android.AbstractIT
import com.owncloud.android.R
import com.owncloud.android.datamodel.OCFile

View file

@ -27,7 +27,7 @@ import android.graphics.Canvas
import android.graphics.Color
import android.graphics.Paint
import androidx.test.espresso.intent.rule.IntentsTestRule
import com.nextcloud.client.TestActivity
import com.nextcloud.test.TestActivity
import com.owncloud.android.AbstractIT
import com.owncloud.android.datamodel.ImageDimension
import com.owncloud.android.datamodel.OCFile

View file

@ -23,8 +23,8 @@
package com.owncloud.android.ui.fragment
import androidx.test.espresso.intent.rule.IntentsTestRule
import com.nextcloud.client.GrantStoragePermissionRule
import com.nextcloud.client.TestActivity
import com.nextcloud.test.GrantStoragePermissionRule
import com.nextcloud.test.TestActivity
import com.owncloud.android.AbstractIT
import com.owncloud.android.datamodel.OCFile
import com.owncloud.android.lib.resources.shares.ShareType

View file

@ -22,7 +22,7 @@ package com.owncloud.android.ui.fragment
import androidx.test.espresso.intent.rule.IntentsTestRule
import androidx.test.internal.runner.junit4.statement.UiThreadStatement
import com.nextcloud.client.TestActivity
import com.nextcloud.test.TestActivity
import com.owncloud.android.AbstractIT
import com.owncloud.android.datamodel.OCFile
import com.owncloud.android.lib.common.SearchResultEntry

View file

@ -2,7 +2,7 @@ package com.owncloud.android.ui.helpers
import android.net.Uri
import androidx.test.core.app.launchActivity
import com.nextcloud.client.TestActivity
import com.nextcloud.test.TestActivity
import com.owncloud.android.AbstractIT
import com.owncloud.android.files.services.FileUploader
import org.junit.Assert

View file

@ -22,7 +22,7 @@
package com.owncloud.android.ui.preview
import androidx.test.espresso.intent.rule.IntentsTestRule
import com.nextcloud.client.TestActivity
import com.nextcloud.test.TestActivity
import com.owncloud.android.AbstractIT
import org.junit.Rule

View file

@ -23,7 +23,7 @@ package com.owncloud.android.ui.preview.pdf
import androidx.lifecycle.Lifecycle
import androidx.test.espresso.intent.rule.IntentsTestRule
import com.nextcloud.client.TestActivity
import com.nextcloud.test.TestActivity
import com.owncloud.android.AbstractIT
import com.owncloud.android.datamodel.OCFile
import com.owncloud.android.utils.ScreenshotTest

View file

@ -26,7 +26,7 @@ import android.text.TextUtils;
import com.google.gson.JsonElement;
import com.google.gson.JsonParser;
import com.google.gson.reflect.TypeToken;
import com.nextcloud.client.RetryTestRule;
import com.nextcloud.test.RetryTestRule;
import com.nextcloud.test.RandomStringGenerator;
import com.owncloud.android.datamodel.DecryptedFolderMetadata;
import com.owncloud.android.datamodel.EncryptedFolderMetadata;

View file

@ -12,6 +12,6 @@
android:testOnly="false"
tools:ignore="GoogleAppIndexingWarning">
<activity android:name="com.nextcloud.client.TestActivity" />
<activity android:name="com.nextcloud.test.TestActivity" />
</application>
</manifest>

View file

@ -22,7 +22,7 @@
package com.nextcloud.client.di;
import com.nextcloud.client.TestActivity;
import com.nextcloud.test.TestActivity;
import dagger.Module;
import dagger.android.ContributesAndroidInjector;

View file

@ -19,7 +19,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.nextcloud.client
package com.nextcloud.test
import android.os.Bundle
import android.view.View

View file

@ -255,11 +255,14 @@ public class MainApp extends MultiDexApplication implements HasAndroidInjector {
}
private void initDagger() {
appComponent = DaggerAppComponent.builder()
appComponent = buildAppComponent();
appComponent.inject(this);
}
protected AppComponent buildAppComponent() {
return DaggerAppComponent.builder()
.application(this)
.build();
appComponent.inject(this);
}
/**