Skip to content

Commit

Permalink
Move HandleManagerTestBase and tests under integration/ package (both…
Browse files Browse the repository at this point in the history
… core/ and android/)

PiperOrigin-RevId: 347919703
  • Loading branch information
Maria Mandlis authored and arcs-c3po committed Dec 17, 2020
1 parent bd88941 commit eeed4d9
Show file tree
Hide file tree
Showing 16 changed files with 144 additions and 78 deletions.
5 changes: 0 additions & 5 deletions javatests/arcs/android/entity/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,4 @@
package="arcs.sdk.android.handle">

<uses-sdk android:minSdkVersion="28" android:targetSdkVersion="28"/>

<application>
<service android:name="arcs.sdk.android.service.StorageService" android:exported="false"/>
</application>

</manifest>
2 changes: 0 additions & 2 deletions javatests/arcs/android/entity/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ arcs_kt_android_test_suite(
"//java/arcs/core/storage",
"//java/arcs/core/storage/api",
"//java/arcs/core/storage/database",
"//java/arcs/core/storage/driver:driver_providers",
"//java/arcs/core/storage/keys",
"//java/arcs/core/storage/referencemode",
"//java/arcs/core/testutil",
Expand All @@ -33,7 +32,6 @@ arcs_kt_android_test_suite(
"//java/arcs/sdk/android/storage",
"//java/arcs/sdk/android/storage/service",
"//java/arcs/sdk/android/storage/service/testutil",
"//javatests/arcs/core/entity:lib",
"//third_party/android/androidx_test/core",
"//third_party/android/androidx_test/ext/junit",
"//third_party/java/androidx/work:testing",
Expand Down
21 changes: 21 additions & 0 deletions javatests/arcs/android/entity/integration/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!--
~ Copyright 2020 Google LLC.
~
~ This code may only be used under the BSD style license found at
~ http://polymer.github.io/LICENSE.txt
~
~ Code distributed by Google as part of this project is also subject to an additional IP rights
~ grant found at
~ http://polymer.github.io/PATENTS.txt
-->

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="arcs.android.entity.integration">

<uses-sdk android:minSdkVersion="28" android:targetSdkVersion="28"/>

<application>
<service android:name="arcs.sdk.android.storage.service.StorageService" android:exported="false"/>
</application>

</manifest>
31 changes: 31 additions & 0 deletions javatests/arcs/android/entity/integration/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
load(
"//third_party/java/arcs/build_defs:build_defs.bzl",
"arcs_kt_android_test_suite",
)

licenses(["notice"])

arcs_kt_android_test_suite(
name = "integration",
size = "medium",
srcs = glob(["*.kt"]),
manifest = "AndroidManifest.xml",
package = "arcs.android.entity.integration",
deps = [
"//java/arcs/android/storage/database",
"//java/arcs/core/host",
"//java/arcs/core/storage",
"//java/arcs/core/storage/driver:driver_providers",
"//java/arcs/core/testutil",
"//java/arcs/sdk/android/storage",
"//java/arcs/sdk/android/storage/service",
"//java/arcs/sdk/android/storage/service/testutil",
"//javatests/arcs/core/entity/integration:lib",
"//third_party/android/androidx_test/core",
"//third_party/android/androidx_test/ext/junit",
"//third_party/java/androidx/work:testing",
"//third_party/java/junit:junit-android",
"//third_party/java/truth:truth-android",
"//third_party/kotlin/kotlinx_coroutines",
],
)
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package arcs.android.entity
package arcs.android.entity.integration

import android.app.Application
import androidx.test.core.app.ApplicationProvider
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.work.testing.WorkManagerTestInitHelper
import arcs.android.storage.database.AndroidSqliteDatabaseManager
import arcs.core.entity.HandleManagerTestBase
import arcs.core.entity.integration.HandleManagerTestBase
import arcs.core.host.HandleManagerImpl
import arcs.core.storage.StorageEndpointManager
import arcs.core.storage.driver.DatabaseDriverProvider
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package arcs.android.entity
package arcs.android.entity.integration

import android.app.Application
import androidx.test.core.app.ApplicationProvider
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.work.testing.WorkManagerTestInitHelper
import arcs.android.storage.database.AndroidSqliteDatabaseManager
import arcs.core.entity.HandleManagerTestBase
import arcs.core.entity.integration.HandleManagerTestBase
import arcs.core.host.HandleManagerImpl
import arcs.core.storage.StorageEndpointManager
import arcs.core.storage.driver.DatabaseDriverProvider
Expand Down
11 changes: 0 additions & 11 deletions javatests/arcs/android/storage/database/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ arcs_kt_android_test_suite(
"//java/arcs/core/util:utils-platform-dependencies",
"//java/arcs/core/util/testutil",
"//java/arcs/jvm/util/testutil",
"//javatests/arcs/core/entity:lib",
"//third_party/android/androidx_test/core",
"//third_party/android/androidx_test/ext/junit",
"//third_party/java/androidx/work",
Expand Down Expand Up @@ -69,25 +68,15 @@ arcs_kt_android_test_suite(
"//java/arcs/core/data",
"//java/arcs/core/data:schema_fields",
"//java/arcs/core/data/util:data-util",
"//java/arcs/core/entity",
"//java/arcs/core/host",
"//java/arcs/core/storage",
"//java/arcs/core/storage:reference",
"//java/arcs/core/storage:storage_key",
"//java/arcs/core/storage/api",
"//java/arcs/core/storage/database",
"//java/arcs/core/storage/keys",
"//java/arcs/core/storage/referencemode",
"//java/arcs/core/storage/testutil",
"//java/arcs/core/testutil",
"//java/arcs/core/testutil/handles",
"//java/arcs/core/util",
"//java/arcs/core/util:utils-platform-dependencies",
"//java/arcs/core/util/testutil",
"//java/arcs/jvm/host",
"//java/arcs/jvm/util",
"//java/arcs/jvm/util/testutil",
"//javatests/arcs/core/entity:lib",
"//third_party/android/androidx_test/core",
"//third_party/android/androidx_test/ext/junit",
"//third_party/java/androidx/work",
Expand Down
1 change: 0 additions & 1 deletion javatests/arcs/android/storage/service/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ arcs_kt_android_test_suite(
"//java/arcs/jvm/util",
"//java/arcs/jvm/util/testutil",
"//java/arcs/sdk/android/storage",
"//javatests/arcs/core/entity:lib",
"//third_party/android/androidx_test/ext/junit",
"//third_party/java/junit:junit-android",
"//third_party/java/robolectric",
Expand Down
1 change: 0 additions & 1 deletion javatests/arcs/android/storage/ttl/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ arcs_kt_android_test_suite(
"//java/arcs/core/testutil/handles",
"//java/arcs/jvm/util",
"//java/arcs/jvm/util/testutil",
"//javatests/arcs/core/entity:lib",
"//third_party/android/androidx_test/core",
"//third_party/android/androidx_test/ext/junit",
"//third_party/java/androidx/work",
Expand Down
46 changes: 1 addition & 45 deletions javatests/arcs/core/entity/BUILD
Original file line number Diff line number Diff line change
@@ -1,26 +1,15 @@
load(
"//third_party/java/arcs/build_defs:build_defs.bzl",
"arcs_kt_jvm_library",
"arcs_kt_jvm_test_suite",
"arcs_kt_schema",
)

licenses(["notice"])

TEST_SRCS = glob(["*Test.kt"])

arcs_kt_schema(
name = "test_arcs_gen",
srcs = ["test.arcs"],
)

arcs_kt_jvm_test_suite(
name = "entity",
size = "medium",
srcs = TEST_SRCS,
srcs = glob(["*.kt"]),
package = "arcs.core.entity",
deps = [
":lib",
"//java/arcs/core/common",
"//java/arcs/core/crdt",
"//java/arcs/core/data",
Expand Down Expand Up @@ -56,36 +45,3 @@ arcs_kt_jvm_test_suite(
"//third_party/kotlin/mockito_kotlin",
],
)

arcs_kt_jvm_library(
name = "lib",
testonly = 1,
srcs = glob(
["*.kt"],
exclude = TEST_SRCS,
),
visibility = ["//javatests/arcs:__subpackages__"],
deps = [
":test_arcs_gen",
"//java/arcs/core/common",
"//java/arcs/core/data",
"//java/arcs/core/entity",
"//java/arcs/core/host",
"//java/arcs/core/storage",
"//java/arcs/core/storage/api",
"//java/arcs/core/storage/driver:ramdisk",
"//java/arcs/core/storage/driver/testutil",
"//java/arcs/core/storage/keys",
"//java/arcs/core/storage/referencemode",
"//java/arcs/core/testutil",
"//java/arcs/core/testutil/handles",
"//java/arcs/core/util:utils-platform-dependencies",
"//java/arcs/core/util/testutil",
"//java/arcs/flags/testing",
"//java/arcs/jvm/util/testutil",
"//third_party/java/junit:junit-android",
"//third_party/java/truth:truth-android",
"//third_party/kotlin/kotlin:kotlin_test",
"//third_party/kotlin/kotlinx_coroutines",
],
)
63 changes: 63 additions & 0 deletions javatests/arcs/core/entity/integration/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
load(
"//third_party/java/arcs/build_defs:build_defs.bzl",
"arcs_kt_jvm_library",
"arcs_kt_jvm_test_suite",
"arcs_kt_schema",
)

licenses(["notice"])

TEST_SRCS = glob(["*Test.kt"])

arcs_kt_schema(
name = "test_arcs_gen",
srcs = ["test.arcs"],
)

arcs_kt_jvm_test_suite(
name = "integration",
size = "medium",
srcs = TEST_SRCS,
package = "arcs.core.entity.integration",
deps = [
":lib",
"//java/arcs/core/host",
"//java/arcs/core/storage/testutil",
"//third_party/java/junit:junit-android",
"//third_party/java/mockito",
"//third_party/kotlin/kotlin:kotlin_test",
"//third_party/kotlin/mockito_kotlin",
],
)

arcs_kt_jvm_library(
name = "lib",
testonly = 1,
srcs = glob(
["*.kt"],
exclude = TEST_SRCS,
),
visibility = ["//javatests/arcs:__subpackages__"],
deps = [
":test_arcs_gen",
"//java/arcs/core/data",
"//java/arcs/core/entity",
"//java/arcs/core/host",
"//java/arcs/core/storage",
"//java/arcs/core/storage/api",
"//java/arcs/core/storage/driver:ramdisk",
"//java/arcs/core/storage/driver/testutil",
"//java/arcs/core/storage/keys",
"//java/arcs/core/storage/referencemode",
"//java/arcs/core/testutil",
"//java/arcs/core/testutil/handles",
"//java/arcs/core/util:utils-platform-dependencies",
"//java/arcs/core/util/testutil",
"//java/arcs/flags/testing",
"//java/arcs/jvm/util/testutil",
"//third_party/java/junit:junit-android",
"//third_party/java/truth:truth-android",
"//third_party/kotlin/kotlin:kotlin_test",
"//third_party/kotlin/kotlinx_coroutines",
],
)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package arcs.core.entity
package arcs.core.entity.integration

import arcs.core.host.HandleManagerImpl
import arcs.core.storage.testutil.testStorageEndpointManager
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package arcs.core.entity
package arcs.core.entity.integration

import arcs.core.host.HandleManagerImpl
import arcs.core.storage.testutil.testStorageEndpointManager
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package arcs.core.entity
package arcs.core.entity.integration

import arcs.core.common.ReferenceId
import arcs.core.data.Capability.Ttl
Expand All @@ -8,10 +8,25 @@ import arcs.core.data.HandleMode
import arcs.core.data.RawEntity
import arcs.core.data.ReferenceType
import arcs.core.data.SingletonType
import arcs.core.entity.AbstractTestParticle.CoolnessIndex
import arcs.core.entity.AbstractTestParticle.Friend
import arcs.core.entity.AbstractTestParticle.Hat
import arcs.core.entity.AbstractTestParticle.Person
import arcs.core.entity.Entity
import arcs.core.entity.EntitySpec
import arcs.core.entity.ForeignReferenceChecker
import arcs.core.entity.ForeignReferenceCheckerImpl
import arcs.core.entity.HandleSpec
import arcs.core.entity.ReadCollectionHandle
import arcs.core.entity.ReadSingletonHandle
import arcs.core.entity.ReadWriteCollectionHandle
import arcs.core.entity.ReadWriteQueryCollectionHandle
import arcs.core.entity.ReadWriteSingletonHandle
import arcs.core.entity.ReadableHandle
import arcs.core.entity.Reference
import arcs.core.entity.WriteCollectionHandle
import arcs.core.entity.WriteSingletonHandle
import arcs.core.entity.awaitReady
import arcs.core.entity.integration.AbstractTestParticle.CoolnessIndex
import arcs.core.entity.integration.AbstractTestParticle.Friend
import arcs.core.entity.integration.AbstractTestParticle.Hat
import arcs.core.entity.integration.AbstractTestParticle.Person
import arcs.core.host.HandleManagerImpl
import arcs.core.host.SchedulerProvider
import arcs.core.host.SimpleSchedulerProvider
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package arcs.core.entity
package arcs.core.entity.integration

import arcs.core.host.HandleManagerImpl
import arcs.core.storage.testutil.testStorageEndpointManager
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
meta
namespace: arcs.core.entity
namespace: arcs.core.entity.integration

schema Package

Expand Down

0 comments on commit eeed4d9

Please sign in to comment.