aboutsummaryrefslogtreecommitdiff
path: root/dexmaker-mockito-inline-tests
diff options
context:
space:
mode:
authorPhilip P. Moltmann <moltmann@google.com>2018-01-17 07:15:43 -0800
committerPhilip P. Moltmann <moltmann@google.com>2018-01-19 08:25:38 -0800
commit9484bbe2ce359b072dd89853b72b490b0cd4ea74 (patch)
tree837ff8a42257dbad91e62e454811d115469b189c /dexmaker-mockito-inline-tests
parentbe3cc8777686d4ca74017c118ba34e4a5ed3ddaa (diff)
downloaddexmaker-9484bbe2ce359b072dd89853b72b490b0cd4ea74.tar.gz
Register transformation hook only when needed
This prevents us from attempting to transform classes when not needed. Every transformation is expensive, hence we want to avoid them if we can. If another agent triggers transformations of mocked classes the objects of the classes will become unmocked without knowledge of mockito breaking many assuptions. Having another agent registered is very rare, i.e. currently the only other usage is profiling using Android Studio. Still, we want to support this, hence we might want to revert this change later. Wifi-tests runtime 590s -> 417s Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh atest CtsInlineMockingTestCases CtsMockingTestCase Bug: 72052158 Change-Id: I2556e749806bed4f80697d5cba38a8d8a2f7ce6a
Diffstat (limited to 'dexmaker-mockito-inline-tests')
-rw-r--r--dexmaker-mockito-inline-tests/src/androidTest/java/com/android/dx/mockito/inline/tests/MultipleJvmtiAgentsInterference.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/dexmaker-mockito-inline-tests/src/androidTest/java/com/android/dx/mockito/inline/tests/MultipleJvmtiAgentsInterference.java b/dexmaker-mockito-inline-tests/src/androidTest/java/com/android/dx/mockito/inline/tests/MultipleJvmtiAgentsInterference.java
index d66b128..9231202 100644
--- a/dexmaker-mockito-inline-tests/src/androidTest/java/com/android/dx/mockito/inline/tests/MultipleJvmtiAgentsInterference.java
+++ b/dexmaker-mockito-inline-tests/src/androidTest/java/com/android/dx/mockito/inline/tests/MultipleJvmtiAgentsInterference.java
@@ -19,6 +19,7 @@ package com.android.dx.mockito.inline.tests;
import android.os.Build;
import org.junit.BeforeClass;
+import org.junit.Ignore;
import org.junit.Test;
import java.io.File;
@@ -33,6 +34,8 @@ import static org.junit.Assert.assertNull;
import static org.junit.Assume.assumeTrue;
import static org.mockito.Mockito.mock;
+@Ignore("Leaving the transformation hook enabled causes a lot of unnecessary transformations. " +
+ "This is too expensive. Hence for now, we cannot support multiple agents")
public class MultipleJvmtiAgentsInterference {
private static final String AGENT_LIB_NAME = "multiplejvmtiagentsinterferenceagent";