summaryrefslogtreecommitdiff
path: root/test-mock/src/android/test/mock/MockApplication.java
diff options
context:
space:
mode:
authorPaul Duffin <paulduffin@google.com>2017-11-15 11:39:14 +0000
committerColin Cross <ccross@android.com>2017-12-12 23:23:31 +0000
commit69516f4df7129b39dfa05654b9e5163442438c72 (patch)
tree3e21c3ef15385e32487c3750cdc43af95c2b21f6 /test-mock/src/android/test/mock/MockApplication.java
parenteb652a47a180092b397ec40c718dfc13935f7fb6 (diff)
Separate android.test.mock from test-runner source
Extracts the source for the android.test.mock library from the frameworks/base/test-runner directory into its own frameworks/base/test-mock directory. They are already treated separately at runtime and compile time so this just makes the separation complete. Bug: 30188076 Test: make checkbuild Change-Id: I20e5b06ba79677e76117c82e9f9e2ecd15e5fed6 Merged-In: I20e5b06ba79677e76117c82e9f9e2ecd15e5fed6 (cherry picked from commit e254526f0fe5d22681555bd4a00b7ee96fee1dc1)
Diffstat (limited to 'test-mock/src/android/test/mock/MockApplication.java')
-rw-r--r--test-mock/src/android/test/mock/MockApplication.java51
1 files changed, 51 insertions, 0 deletions
diff --git a/test-mock/src/android/test/mock/MockApplication.java b/test-mock/src/android/test/mock/MockApplication.java
new file mode 100644
index 000000000000..3257ecf11066
--- /dev/null
+++ b/test-mock/src/android/test/mock/MockApplication.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.test.mock;
+
+import android.app.Application;
+import android.content.res.Configuration;
+
+/**
+ * A mock {@link android.app.Application} class. All methods are non-functional and throw
+ * {@link java.lang.UnsupportedOperationException}. Override it as necessary to provide the
+ * operations that you need.
+ *
+ * @deprecated Use a mocking framework like <a href="https://github.com/mockito/mockito">Mockito</a>.
+ * New tests should be written using the
+ * <a href="{@docRoot}tools/testing-support-library/index.html">Android Testing Support Library</a>.
+ */
+@Deprecated
+public class MockApplication extends Application {
+
+ public MockApplication() {
+ }
+
+ @Override
+ public void onCreate() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void onTerminate() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void onConfigurationChanged(Configuration newConfig) {
+ throw new UnsupportedOperationException();
+ }
+}