Skip to content

Commit

Permalink
Move auxiliary test storage classes to internal APIs from experimental.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 627866071
  • Loading branch information
brettchabot authored and copybara-androidxtest committed Apr 26, 2024
1 parent 3377b35 commit 5ceba4f
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 115 deletions.
13 changes: 7 additions & 6 deletions services/storage/java/androidx/test/services/storage/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ java_library(
name = "test_storage_constants",
srcs = ["TestStorageConstants.java"],
deps = [
"//annotation",
"//opensource/androidx:annotation",
],
)

Expand Down Expand Up @@ -78,11 +78,12 @@ maven_artifact(
target = ":test_storage_aar",
)

dackka_test(
name = "test_storage_doc",
runtime_dep = ":storage",
src_jar = ":test_storage_aar-src.jar",
)
# no public documentation
# dackka_test(
# name = "test_storage_doc",
# runtime_dep = ":storage",
# src_jar = ":test_storage_aar-src.jar",
# )

api_checks(
name = "storage_api",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@
* <p>Users should ideally not reference this class directly, but rather retrieve the
* PlatformTestStorage implementation appropriate for their execution environment from {@link
* androidx.test.platform.io.PlatformTestStorageRegistry}.
*
* @hide
*/
@RestrictTo(Scope.LIBRARY_GROUP)
public final class TestStorage implements PlatformTestStorage {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,15 @@
*/
package androidx.test.services.storage;

import androidx.test.annotation.ExperimentalTestApi;
import androidx.annotation.RestrictTo;
import androidx.annotation.RestrictTo.Scope;

/** Holds constants that are shared between on-device and host-side testing infrastructure. */
@ExperimentalTestApi
/**
* Holds constants that are shared between on-device and host-side testing infrastructure.
*
* @hide
*/
@RestrictTo(Scope.LIBRARY)
public final class TestStorageConstants {

/** The parent folder name for all the test related files. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,15 @@
*/
package androidx.test.services.storage;

import androidx.test.annotation.ExperimentalTestApi;
import androidx.annotation.RestrictTo;
import androidx.annotation.RestrictTo.Scope;

/** A RuntimeException thrown out of the test storage service. */
@ExperimentalTestApi
/**
* A RuntimeException thrown out of the test storage service.
*
* @hide
*/
@RestrictTo(Scope.LIBRARY_GROUP)
public class TestStorageException extends RuntimeException {

public TestStorageException(String message) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,98 +1 @@
// Signature format: 3.0
package androidx.test.services.storage {

public final class TestStorage implements androidx.test.platform.io.PlatformTestStorage {
ctor public TestStorage();
ctor public TestStorage(android.content.ContentResolver);
method public void addOutputProperties(java.util.Map<java.lang.String!,java.io.Serializable!>!);
method public String! getInputArg(String);
method public java.util.Map<java.lang.String!,java.lang.String!>! getInputArgs();
method public android.net.Uri! getInputFileUri(String);
method public android.net.Uri! getOutputFileUri(String);
method public java.util.Map<java.lang.String!,java.io.Serializable!>! getOutputProperties();
method public boolean isTestStorageFilePath(String);
method public java.io.InputStream! openInputFile(String) throws java.io.FileNotFoundException;
method public java.io.OutputStream! openOutputFile(String) throws java.io.FileNotFoundException;
method public java.io.OutputStream! openOutputFile(String, boolean) throws java.io.FileNotFoundException;
}

@androidx.test.annotation.ExperimentalTestApi public final class TestStorageConstants {
field public static final String INTERNAL_USE_PROVIDER_AUTHORITY = "androidx.test.services.storage._internal_use_files";
field public static final String ON_DEVICE_FIXTURE_SCRIPTS = "googletest/fixture_scripts/";
field public static final String ON_DEVICE_PATH_INTERNAL_USE = "googletest/internal_use/";
field public static final String ON_DEVICE_PATH_ROOT = "googletest/";
field public static final String ON_DEVICE_PATH_TEST_OUTPUT = "googletest/test_outputfiles/";
field public static final String ON_DEVICE_PATH_TEST_PROPERTIES = "googletest/test_exportproperties/";
field public static final String ON_DEVICE_TEST_RUNFILES = "googletest/test_runfiles/";
field public static final String OUTPUT_PROPERTIES_PROVIDER_AUTHORITY = "androidx.test.services.storage.properties";
field public static final String TEST_ARGS_FILE_NAME = "test_args.dat";
field public static final String TEST_ARGS_PROVIDER_AUTHORITY = "androidx.test.services.storage.testargs";
field public static final String TEST_OUTPUT_PROVIDER_AUTHORITY = "androidx.test.services.storage.outputfiles";
field public static final String TEST_RUNFILES_PROVIDER_AUTHORITY = "androidx.test.services.storage.runfiles";
}

@androidx.test.annotation.ExperimentalTestApi public class TestStorageException extends java.lang.RuntimeException {
ctor public TestStorageException(String!);
ctor public TestStorageException(String!, Throwable!);
}

}

package androidx.test.services.storage.file {

@androidx.test.annotation.ExperimentalTestApi public final class HostedFile {
method public static android.net.Uri! buildUri(androidx.test.services.storage.file.HostedFile.FileHost!, String!);
method public static java.io.File! getInputRootDirectory(android.content.Context!);
method public static java.io.File! getOutputRootDirectory(android.content.Context!);
}

public enum HostedFile.FileHost {
method public String! getAuthority();
method public boolean isWritable();
enum_constant public static final androidx.test.services.storage.file.HostedFile.FileHost EXPORT_PROPERTIES;
enum_constant public static final androidx.test.services.storage.file.HostedFile.FileHost INTERNAL_USE_ONLY;
enum_constant public static final androidx.test.services.storage.file.HostedFile.FileHost OUTPUT;
enum_constant public static final androidx.test.services.storage.file.HostedFile.FileHost TEST_FILE;
}

public enum HostedFile.FileType {
method public static androidx.test.services.storage.file.HostedFile.FileType! fromTypeCode(String!);
method public String! getTypeCode();
enum_constant public static final androidx.test.services.storage.file.HostedFile.FileType DIRECTORY;
enum_constant public static final androidx.test.services.storage.file.HostedFile.FileType FILE;
}

public enum HostedFile.HostedFileColumn {
method public int getAndroidType();
method public String! getColumnName();
method public static String![]! getColumnNames();
method public Class<?>! getColumnType();
method public int getPosition();
enum_constant public static final androidx.test.services.storage.file.HostedFile.HostedFileColumn DATA;
enum_constant public static final androidx.test.services.storage.file.HostedFile.HostedFileColumn DISPLAY_NAME;
enum_constant public static final androidx.test.services.storage.file.HostedFile.HostedFileColumn NAME;
enum_constant public static final androidx.test.services.storage.file.HostedFile.HostedFileColumn SIZE;
enum_constant public static final androidx.test.services.storage.file.HostedFile.HostedFileColumn SIZE_2;
enum_constant public static final androidx.test.services.storage.file.HostedFile.HostedFileColumn TYPE;
}

@androidx.test.annotation.ExperimentalTestApi public final class PropertyFile {
method public static android.net.Uri! buildUri(androidx.test.services.storage.file.PropertyFile.Authority!);
method public static android.net.Uri! buildUri(androidx.test.services.storage.file.PropertyFile.Authority!, String!);
}

public enum PropertyFile.Authority {
method public String! getAuthority();
enum_constant public static final androidx.test.services.storage.file.PropertyFile.Authority TEST_ARGS;
}

public enum PropertyFile.Column {
method public String! getName();
method public static String![]! getNames();
method public int getPosition();
enum_constant public static final androidx.test.services.storage.file.PropertyFile.Column NAME;
enum_constant public static final androidx.test.services.storage.file.PropertyFile.Column VALUE;
}

}

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ android_library(
name = "file",
srcs = glob(["*.java"]),
deps = [
"//annotation",
"//opensource/androidx:annotation",
"//runner/monitor",
"//services/storage/java/androidx/test/services/storage:test_storage_constants",
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,18 @@
import android.os.UserManager;
import android.provider.OpenableColumns;
import android.util.Log;
import androidx.test.annotation.ExperimentalTestApi;
import androidx.test.services.storage.TestStorageConstants;
import java.io.File;

/** Constants to access hosted file data and convenience methods for building Uris. */
@ExperimentalTestApi
import androidx.annotation.RestrictTo;
import androidx.annotation.RestrictTo.Scope;

/**
* Constants to access hosted file data and convenience methods for building Uris.
*
* @hide
*/
@RestrictTo(Scope.LIBRARY)
public final class HostedFile {

private static final String TAG = "HostedFile";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,18 @@
import static androidx.test.internal.util.Checks.checkNotNull;

import android.net.Uri;
import androidx.test.annotation.ExperimentalTestApi;
import androidx.test.services.storage.TestStorageConstants;

import androidx.annotation.RestrictTo;
import androidx.annotation.RestrictTo.Scope;

/**
* Constants to access property file data (holding name/value pairs) and convenience methods for
* build URIs.
*
* @hide
*/
@ExperimentalTestApi
@RestrictTo(Scope.LIBRARY)
public final class PropertyFile {

/** Represents columns returned by the property file service. */
Expand Down

0 comments on commit 5ceba4f

Please sign in to comment.