Removing old signature test, migrating to new one.

bug: 11436500
Change-Id: I84165979a7ddc358f28512ad298444ce4a190ea9
diff --git a/tests/SignatureTest/Android.mk b/tests/SignatureTest/Android.mk
index 0b51f25..3656afb 100644
--- a/tests/SignatureTest/Android.mk
+++ b/tests/SignatureTest/Android.mk
@@ -17,8 +17,7 @@
 
 # don't include this package in any target
 LOCAL_MODULE_TAGS := optional
-# and when built explicitly put it in the data partition
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
+
 # and because it is in data, do not strip classes.dex
 LOCAL_DEX_PREOPT := false
 
@@ -30,65 +29,7 @@
 
 LOCAL_SDK_VERSION := current
 
-# To be passed in on command line
-CTS_API_VERSION ?= current
+include $(BUILD_CTS_PACKAGE)
 
-ifeq (current,$(CTS_API_VERSION))
-android_api_description := frameworks/base/api/$(CTS_API_VERSION).txt
-else
-android_api_description := $(SRC_API_DIR)/$(CTS_API_VERSION).txt
-endif
-
-# Can't call local-intermediates-dir directly here because we have to
-# include BUILD_PACAKGE first.  Can't include BUILD_PACKAGE first
-# because we have to override LOCAL_RESOURCE_DIR first.  Hence this
-# hack.
-intermediates.COMMON := $(call intermediates-dir-for,APPS,$(LOCAL_PACKAGE_NAME),,COMMON)
-signature_res_dir := $(intermediates.COMMON)/genres
-LOCAL_RESOURCE_DIR := $(signature_res_dir) $(LOCAL_PATH)/res
-
-include $(BUILD_PACKAGE)
-
-generated_res_stamp := $(intermediates.COMMON)/genres.stamp
-api_ver_file := $(intermediates.COMMON)/api_ver_is_$(CTS_API_VERSION)
-
-# The api_ver_file keeps track of which api version was last built.
-# By only ever having one of these magic files in existance and making
-# sure the generated resources rule depend on it, we can ensure that
-# the proper version of the api resource gets generated.
-$(api_ver_file):
-	$(hide) rm -f $(dir $@)/api_ver_is_* \
-		&& mkdir -p $(dir $@) && touch $@
-
-android_api_xml_description := $(intermediates.COMMON)/api.xml
-$(android_api_xml_description): $(android_api_description) | $(APICHECK)
-	@ echo "Convert api file to xml: $@"
-	@ mkdir -p $(dir $@)
-	$(hide) $(APICHECK_COMMAND) -convert2xml $< $@
-
-# Split up config/api/1.xml by "package" and save the files as the
-# resource files of SignatureTest.
-$(generated_res_stamp): PRIVATE_PATH := $(LOCAL_PATH)
-$(generated_res_stamp): PRIVATE_MODULE := $(LOCAL_MODULE)
-$(generated_res_stamp): PRIVATE_RES_DIR := $(signature_res_dir)
-$(generated_res_stamp): PRIVATE_API_XML_DESC := $(android_api_xml_description)
-$(generated_res_stamp): $(api_ver_file)
-$(generated_res_stamp): $(android_api_xml_description)
-	@ echo "Copy generated resources: $(PRIVATE_MODULE)"
-	$(hide) python cts/tools/utils/android_api_description_splitter.py \
-		$(PRIVATE_API_XML_DESC) $(PRIVATE_RES_DIR) package
-	$(hide) touch $@
-
-$(R_file_stamp): $(generated_res_stamp)
-
-# clean up temp vars
-android_api_xml_description :=
-api_ver_file :=
-generated_res_stamp :=
-signature_res_dir :=
-android_api_description :=
-CTS_API_VERSION :=
-
-
-# Use the folloing include to make our test apk.
+# Use the following include to make our test apk.
 include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/tests/SignatureTest/AndroidManifest.xml b/tests/SignatureTest/AndroidManifest.xml
index 762dfae..b4813e6 100644
--- a/tests/SignatureTest/AndroidManifest.xml
+++ b/tests/SignatureTest/AndroidManifest.xml
@@ -16,30 +16,15 @@
  -->
 
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="android.tests.sigtest">
-    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
+          package="android.tests.sigtest">
+    <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
 
     <application>
-        <uses-library android:name="android.test.runner" />
-
-        <activity android:name=".SignatureTestActivity"
-                android:stateNotNeeded="true">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.DEFAULT" />
-            </intent-filter>
-        </activity>
-
-        <uses-library android:name="android.test.runner" />
+        <uses-library android:name="android.test.runner"/>
     </application>
 
-    <instrumentation android:name=".InstrumentationRunner"
+    <instrumentation android:name="android.test.InstrumentationTestRunner"
                      android:targetPackage="android.tests.sigtest"
                      android:label="API Signature Test"/>
 
-    <instrumentation android:name="android.test.InstrumentationTestRunner"
-        android:targetPackage="android.tests.sigtest"
-        android:label="Simple API Signature Test">
-    </instrumentation>
-
-</manifest>
+</manifest>
\ No newline at end of file
diff --git a/tests/SignatureTest/src/android/tests/sigtest/InstrumentationRunner.java b/tests/SignatureTest/src/android/tests/sigtest/InstrumentationRunner.java
deleted file mode 100644
index b196ade..0000000
--- a/tests/SignatureTest/src/android/tests/sigtest/InstrumentationRunner.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * 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.tests.sigtest;
-
-import android.app.Activity;
-import android.app.Instrumentation;
-import android.content.Intent;
-import android.os.Bundle;
-
-public class InstrumentationRunner extends Instrumentation {
-    @Override
-    public void onCreate(Bundle arguments) {
-        start();
-    }
-
-    @SuppressWarnings("deprecation")
-    @Override
-    public void onStart() {
-        Intent intent = new Intent(Intent.ACTION_MAIN);
-        intent.setClassName(getTargetContext(),
-                "android.tests.sigtest.SignatureTestActivity");
-        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
-
-        SignatureTestActivity activity = (SignatureTestActivity) startActivitySync(intent);
-        waitForIdleSync();
-
-        finish(Activity.RESULT_OK, activity.mBundle);
-    }
-
-}
diff --git a/tests/SignatureTest/src/android/tests/sigtest/JDiffClassDescription.java b/tests/SignatureTest/src/android/tests/sigtest/JDiffClassDescription.java
index 9d95bb4..c51c6c3 100644
--- a/tests/SignatureTest/src/android/tests/sigtest/JDiffClassDescription.java
+++ b/tests/SignatureTest/src/android/tests/sigtest/JDiffClassDescription.java
@@ -16,6 +16,8 @@
 
 package android.tests.sigtest;
 
+import android.tests.sigtest.SignatureTest.FAILURE_TYPE;
+
 import java.lang.reflect.Constructor;
 import java.lang.reflect.Field;
 import java.lang.reflect.GenericArrayType;
@@ -81,7 +83,7 @@
      */
     public JDiffClassDescription(String pkg, String className) {
         this(pkg, className, new ResultObserver() {
-            public void notifyFailure(SignatureTestActivity.FAILURE_TYPE type,
+            public void notifyFailure(FAILURE_TYPE type,
                     String name,
                     String errorMessage) {
                 // This is a null result observer that doesn't do anything.
@@ -498,7 +500,7 @@
 
                 Method m = findMatchingMethod(method);
                 if (m == null) {
-                    mResultObserver.notifyFailure(SignatureTestActivity.FAILURE_TYPE.MISSING_METHOD,
+                    mResultObserver.notifyFailure(FAILURE_TYPE.MISSING_METHOD,
                             method.toReadableString(mAbsoluteClassName),
                             "No method with correct signature found:" +
                             method.toSignatureString());
@@ -519,7 +521,7 @@
                     }
 
                     if (!areMethodModifiedCompatibile(method, m)) {
-                        mResultObserver.notifyFailure(SignatureTestActivity.FAILURE_TYPE.MISMATCH_METHOD,
+                        mResultObserver.notifyFailure(FAILURE_TYPE.MISMATCH_METHOD,
                                 method.toReadableString(mAbsoluteClassName),
                                 "Non-compatible method found when looking for " +
                                 method.toSignatureString());
@@ -527,7 +529,7 @@
                 }
             } catch (Exception e) {
                 SignatureTestLog.e("Got exception when checking method compliance", e);
-                mResultObserver.notifyFailure(SignatureTestActivity.FAILURE_TYPE.CAUGHT_EXCEPTION,
+                mResultObserver.notifyFailure(FAILURE_TYPE.CAUGHT_EXCEPTION,
                         method.toReadableString(mAbsoluteClassName),
                 "Exception!");
             }
@@ -635,7 +637,7 @@
             try {
                 Constructor<?> c = findMatchingConstructor(con);
                 if (c == null) {
-                    mResultObserver.notifyFailure(SignatureTestActivity.FAILURE_TYPE.MISSING_METHOD,
+                    mResultObserver.notifyFailure(FAILURE_TYPE.MISSING_METHOD,
                             con.toReadableString(mAbsoluteClassName),
                             "No method with correct signature found:" +
                             con.toSignatureString());
@@ -645,7 +647,7 @@
                     }
                     if (c.getModifiers() != con.mModifier) {
                         mResultObserver.notifyFailure(
-                                SignatureTestActivity.FAILURE_TYPE.MISMATCH_METHOD,
+                                FAILURE_TYPE.MISMATCH_METHOD,
                                 con.toReadableString(mAbsoluteClassName),
                                 "Non-compatible method found when looking for " +
                                 con.toSignatureString());
@@ -653,7 +655,7 @@
                 }
             } catch (Exception e) {
                 SignatureTestLog.e("Got exception when checking constructor compliance", e);
-                mResultObserver.notifyFailure(SignatureTestActivity.FAILURE_TYPE.CAUGHT_EXCEPTION,
+                mResultObserver.notifyFailure(FAILURE_TYPE.CAUGHT_EXCEPTION,
                         con.toReadableString(mAbsoluteClassName),
                 "Exception!");
             }
@@ -714,12 +716,12 @@
             try {
                 Field f = findMatchingField(field);
                 if (f == null) {
-                    mResultObserver.notifyFailure(SignatureTestActivity.FAILURE_TYPE.MISSING_FIELD,
+                    mResultObserver.notifyFailure(FAILURE_TYPE.MISSING_FIELD,
                             field.toReadableString(mAbsoluteClassName),
                             "No field with correct signature found:" +
                             field.toSignatureString());
                 } else if (f.getModifiers() != field.mModifier) {
-                    mResultObserver.notifyFailure(SignatureTestActivity.FAILURE_TYPE.MISMATCH_FIELD,
+                    mResultObserver.notifyFailure(FAILURE_TYPE.MISMATCH_FIELD,
                             field.toReadableString(mAbsoluteClassName),
                             "Non-compatible field modifiers found when looking for " +
                             field.toSignatureString());
@@ -733,7 +735,7 @@
                     }
                     if (genericTypeName == null || !genericTypeName.equals(field.mFieldType)) {
                         mResultObserver.notifyFailure(
-                                SignatureTestActivity.FAILURE_TYPE.MISMATCH_FIELD,
+                                FAILURE_TYPE.MISMATCH_FIELD,
                                 field.toReadableString(mAbsoluteClassName),
                                 "Non-compatible field type found when looking for " +
                                 field.toSignatureString());
@@ -742,7 +744,7 @@
 
             } catch (Exception e) {
                 SignatureTestLog.e("Got exception when checking field compliance", e);
-                mResultObserver.notifyFailure(SignatureTestActivity.FAILURE_TYPE.CAUGHT_EXCEPTION,
+                mResultObserver.notifyFailure(FAILURE_TYPE.CAUGHT_EXCEPTION,
                         field.toReadableString(mAbsoluteClassName),
                 "Exception!");
             }
@@ -883,11 +885,11 @@
             if (mClass == null) {
                 // No class found, notify the observer according to the class type
                 if (JDiffType.INTERFACE.equals(mClassType)) {
-                    mResultObserver.notifyFailure(SignatureTestActivity.FAILURE_TYPE.MISSING_INTERFACE,
+                    mResultObserver.notifyFailure(FAILURE_TYPE.MISSING_INTERFACE,
                             mAbsoluteClassName,
                             "Classloader is unable to find " + mAbsoluteClassName);
                 } else {
-                    mResultObserver.notifyFailure(SignatureTestActivity.FAILURE_TYPE.MISSING_CLASS,
+                    mResultObserver.notifyFailure(FAILURE_TYPE.MISSING_CLASS,
                             mAbsoluteClassName,
                             "Classloader is unable to find " + mAbsoluteClassName);
                 }
@@ -924,7 +926,7 @@
             }
         } catch (Exception e) {
             SignatureTestLog.e("Got exception when checking field compliance", e);
-            mResultObserver.notifyFailure(SignatureTestActivity.FAILURE_TYPE.CAUGHT_EXCEPTION,
+            mResultObserver.notifyFailure(FAILURE_TYPE.CAUGHT_EXCEPTION,
                     mAbsoluteClassName,
             "Exception!");
         }
@@ -977,11 +979,11 @@
 
     private void logMismatchInterfaceSignature(String classFullName, String errorMessage) {
         if (JDiffType.INTERFACE.equals(mClassType)) {
-            mResultObserver.notifyFailure(SignatureTestActivity.FAILURE_TYPE.MISMATCH_INTERFACE,
+            mResultObserver.notifyFailure(FAILURE_TYPE.MISMATCH_INTERFACE,
                     classFullName,
                     errorMessage);
         } else {
-            mResultObserver.notifyFailure(SignatureTestActivity.FAILURE_TYPE.MISMATCH_CLASS,
+            mResultObserver.notifyFailure(FAILURE_TYPE.MISMATCH_CLASS,
                     classFullName,
                     errorMessage);
         }
diff --git a/tests/SignatureTest/src/android/tests/sigtest/ResultObserver.java b/tests/SignatureTest/src/android/tests/sigtest/ResultObserver.java
index 72f1a97..e9d2260 100644
--- a/tests/SignatureTest/src/android/tests/sigtest/ResultObserver.java
+++ b/tests/SignatureTest/src/android/tests/sigtest/ResultObserver.java
@@ -16,6 +16,7 @@
 
 package android.tests.sigtest;
 
+import android.tests.sigtest.SignatureTest.FAILURE_TYPE;
 /**
  * Interface for saving signature test result.
  */
@@ -26,7 +27,7 @@
      * @param name Name of the failed element (interface/class/method/field)
      * @param errorMessage a descriptive message indicating why it failed.
      */
-    void notifyFailure(SignatureTestActivity.FAILURE_TYPE type,
+    void notifyFailure(FAILURE_TYPE type,
                        String name,
                        String errorMessage);
 
diff --git a/tests/SignatureTest/src/android/tests/sigtest/SignatureTest.java b/tests/SignatureTest/src/android/tests/sigtest/SignatureTest.java
index 8001130..8ae02ac 100644
--- a/tests/SignatureTest/src/android/tests/sigtest/SignatureTest.java
+++ b/tests/SignatureTest/src/android/tests/sigtest/SignatureTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2008 The Android Open Source Project
+ * Copyright (C) 2011 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.
@@ -16,6 +16,8 @@
 
 package android.tests.sigtest;
 
+import android.content.res.Resources;
+import android.test.AndroidTestCase;
 import android.tests.sigtest.JDiffClassDescription.JDiffConstructor;
 import android.tests.sigtest.JDiffClassDescription.JDiffField;
 import android.tests.sigtest.JDiffClassDescription.JDiffMethod;
@@ -24,15 +26,17 @@
 import org.xmlpull.v1.XmlPullParserException;
 
 import java.io.IOException;
+import java.lang.reflect.Field;
 import java.lang.reflect.Modifier;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashSet;
 
 /**
- * Entry class for signature test.
+ * Performs the signature check via a JUnit test.
  */
-public class SignatureTest {
+public class SignatureTest extends AndroidTestCase {
+
     private static final String TAG_ROOT = "api";
     private static final String TAG_PACKAGE = "package";
     private static final String TAG_CLASS = "class";
@@ -64,22 +68,70 @@
     private static ArrayList<String> mDebugArray = new ArrayList<String>();
 
     private HashSet<String> mKeyTagSet;
+    private TestResultObserver mResultObserver;
 
-    private ArrayList<ResultObserver> mReportObserverList;
+    /**
+     * Define the type of the signature check failures.
+     */
+    public static enum FAILURE_TYPE {
+        MISSING_CLASS,
+        MISSING_INTERFACE,
+        MISSING_METHOD,
+        MISSING_FIELD,
+        MISMATCH_CLASS,
+        MISMATCH_INTERFACE,
+        MISMATCH_METHOD,
+        MISMATCH_FIELD,
+        CAUGHT_EXCEPTION,
+    }
 
-    private ResultObserver resultObserver;
+    private class TestResultObserver implements ResultObserver {
+        boolean mDidFail = false;
+        StringBuilder mErrorString = new StringBuilder();
 
-    public SignatureTest(ResultObserver resultObserver) {
-        this.resultObserver = resultObserver;
-        mReportObserverList = new ArrayList<ResultObserver>();
+        public void notifyFailure(FAILURE_TYPE type, String name, String errorMessage) {
+            mDidFail = true;
+            mErrorString.append("\n");
+            mErrorString.append(type.toString().toLowerCase());
+            mErrorString.append(":\t");
+            mErrorString.append(name);
+        }
+    }
+
+    @Override
+    protected void setUp() throws Exception {
+        super.setUp();
         mKeyTagSet = new HashSet<String>();
         mKeyTagSet.addAll(Arrays.asList(new String[] {
                 TAG_PACKAGE, TAG_CLASS, TAG_INTERFACE, TAG_IMPLEMENTS, TAG_CONSTRUCTOR,
                 TAG_METHOD, TAG_PARAM, TAG_EXCEPTION, TAG_FIELD }));
+        mResultObserver = new TestResultObserver();
     }
 
-    public static final void beginDocument(XmlPullParser parser, String firstElementName) throws XmlPullParserException, IOException
-    {
+    /**
+     * Tests that the device's API matches the expected set defined in xml.
+     * <p/>
+     * Will check the entire API, and then report the complete list of failures
+     */
+    public void testSignature() {
+        Resources r = getContext().getResources();
+        Class rClass = R.xml.class;
+        Field[] fs = rClass.getFields();
+        for (Field f : fs) {
+            try {
+                start(r.getXml(f.getInt(rClass)));
+            } catch (Exception e) {
+                mResultObserver.notifyFailure(FAILURE_TYPE.CAUGHT_EXCEPTION, e.getMessage(),
+                        e.getMessage());
+            }
+        }
+        if (mResultObserver.mDidFail) {
+            fail(mResultObserver.mErrorString.toString());
+        }
+    }
+
+    private  void beginDocument(XmlPullParser parser, String firstElementName)
+            throws XmlPullParserException, IOException {
         int type;
         while ((type=parser.next()) != XmlPullParser.START_TAG
                    && type != XmlPullParser.END_DOCUMENT) { }
@@ -97,12 +149,12 @@
     /**
      * Signature test entry point.
      */
-    public void start(XmlPullParser parser) throws XmlPullParserException, IOException {
+    private void start(XmlPullParser parser) throws XmlPullParserException, IOException {
         JDiffClassDescription currentClass = null;
         String currentPackage = "";
         JDiffMethod currentMethod = null;
 
-        SignatureTest.beginDocument(parser, TAG_ROOT);
+        beginDocument(parser, TAG_ROOT);
         int type;
         while (true) {
             type = XmlPullParser.START_DOCUMENT;
@@ -160,22 +212,6 @@
         }
     }
 
-    public static void log(final String msg) {
-        mDebugArray.add(msg);
-    }
-
-    public void addReportObserver(ResultObserver observer) {
-        mReportObserverList.add(observer);
-    }
-
-    public void removeReportObserver(ResultObserver observer) {
-        mReportObserverList.remove(observer);
-    }
-
-    public void clearReportObserverList() {
-        mReportObserverList.clear();
-    }
-
     /**
      * Load field information from xml to memory.
      *
@@ -232,7 +268,7 @@
         String className = parser.getAttributeValue(null, ATTRIBUTE_NAME);
         JDiffClassDescription currentClass = new JDiffClassDescription(pkg,
                                                                        className,
-                                                                       resultObserver);
+                                                                       mResultObserver);
         currentClass.setModifier(jdiffModifierToReflectionFormat(className, parser));
         currentClass.setType(isInterface ? JDiffClassDescription.JDiffType.INTERFACE :
                              JDiffClassDescription.JDiffType.CLASS);
diff --git a/tests/SignatureTest/src/android/tests/sigtest/SignatureTestActivity.java b/tests/SignatureTest/src/android/tests/sigtest/SignatureTestActivity.java
deleted file mode 100644
index 9c81cef..0000000
--- a/tests/SignatureTest/src/android/tests/sigtest/SignatureTestActivity.java
+++ /dev/null
@@ -1,219 +0,0 @@
-/*
- * 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.tests.sigtest;
-
-import android.app.Activity;
-import android.content.Intent;
-import android.content.res.Resources;
-import android.content.res.Resources.NotFoundException;
-import android.os.Bundle;
-
-import org.xmlpull.v1.XmlPullParserException;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.lang.reflect.Field;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-
-/**
- * This class is used for Signature Test. It will started by the Instrumentation class,
- * and send back the test result via IBinder.
- */
-public class SignatureTestActivity extends Activity {
-    static final String BUNDLE_EXTRA_SIG_TEST = "sigtest";
-
-    static final String BUNDLE_KEY_RESULT = "result";
-    static final String BUNDLE_KEY_MISSING_CLASS = "missing_class";
-    static final String BUNDLE_KEY_MISSING_INTERFACE = "missing_interface";
-    static final String BUNDLE_KEY_MISSING_METHOD = "missing_method";
-    static final String BUNDLE_KEY_MISSING_FIELD = "missing_field";
-    static final String BUNDLE_KEY_MISMATCH_CLASS = "mismatch_class_signature";
-    static final String BUNDLE_KEY_MISMATCH_INTERFACE = "mismatch_interface_signature";
-    static final String BUNDLE_KEY_MISMATCH_METHOD = "mismatch_method_signature";
-    static final String BUNDLE_KEY_MISMATCH_FIELD = "mismatch_field_signature";
-    static final String BUNDLE_KEY_CAUGHT_EXCEPTION = "caught_exception";
-
-
-    static final int GET_SIG_TEST_RESULT_TRANSACTION = 101;
-
-    private DeviceResultObserver mResultObserver;
-
-    /**
-     * Define the type of the signature check failures.
-     */
-    public static enum FAILURE_TYPE {
-        MISSING_CLASS,
-        MISSING_INTERFACE,
-        MISSING_METHOD,
-        MISSING_FIELD,
-        MISMATCH_CLASS,
-        MISMATCH_INTERFACE,
-        MISMATCH_METHOD,
-        MISMATCH_FIELD,
-        CAUGHT_EXCEPTION,
-    }
-
-    static final HashMap<FAILURE_TYPE, String> FAILURE_TYPE_TO_KEY =
-            new HashMap<FAILURE_TYPE, String>();
-    static {
-        FAILURE_TYPE_TO_KEY.put(FAILURE_TYPE.MISSING_CLASS, BUNDLE_KEY_MISSING_CLASS);
-        FAILURE_TYPE_TO_KEY.put(FAILURE_TYPE.MISSING_INTERFACE, BUNDLE_KEY_MISSING_INTERFACE);
-        FAILURE_TYPE_TO_KEY.put(FAILURE_TYPE.MISSING_METHOD, BUNDLE_KEY_MISSING_METHOD);
-        FAILURE_TYPE_TO_KEY.put(FAILURE_TYPE.MISSING_FIELD, BUNDLE_KEY_MISSING_FIELD);
-        FAILURE_TYPE_TO_KEY.put(FAILURE_TYPE.MISMATCH_CLASS, BUNDLE_KEY_MISMATCH_CLASS);
-        FAILURE_TYPE_TO_KEY.put(FAILURE_TYPE.MISMATCH_INTERFACE, BUNDLE_KEY_MISMATCH_INTERFACE);
-        FAILURE_TYPE_TO_KEY.put(FAILURE_TYPE.MISMATCH_METHOD, BUNDLE_KEY_MISMATCH_METHOD);
-        FAILURE_TYPE_TO_KEY.put(FAILURE_TYPE.MISMATCH_FIELD, BUNDLE_KEY_MISMATCH_FIELD);
-        FAILURE_TYPE_TO_KEY.put(FAILURE_TYPE.CAUGHT_EXCEPTION, BUNDLE_KEY_CAUGHT_EXCEPTION);
-    }
-
-    @Override
-    protected void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-
-        mResultObserver = new DeviceResultObserver();
-        start();
-        mResultObserver.sendResult(getIntent());
-    }
-
-    /**
-     * Start the signature test.
-     */
-    @SuppressWarnings("unchecked")
-    private void start() {
-        SignatureTest sigTest = new SignatureTest(mResultObserver);
-
-        HashSet<String> excludeSet = getExcludedSet();
-
-        Resources r = getResources();
-
-        Class rClass = R.xml.class;
-        Field[]fs = rClass.getFields();
-        for (Field f : fs) {
-            if (!excludeSet.contains(f.getName())) {
-                try {
-                    sigTest.start(r.getXml(f.getInt(rClass)));
-                } catch (Exception e) {
-                    mResultObserver.notifyFailure(FAILURE_TYPE.CAUGHT_EXCEPTION, e.getMessage(),
-                            e.getMessage());
-                }
-            }
-        }
-    }
-
-    /**
-     * Get the excluded package set, which is defined by res/raw/excludepackages.txt.
-     *
-     * @return The excluded package set.
-     */
-    private HashSet<String> getExcludedSet() {
-        HashSet<String> excludeSet = new HashSet<String>();
-
-        Resources r = getResources();
-        InputStream excludepackage = r.openRawResource(R.raw.excludepackages);
-        BufferedReader reader = new BufferedReader(new InputStreamReader(excludepackage));
-        try {
-            String p = null;
-            while (true) {
-                p = reader.readLine();
-                if (p == null || p.equals("")) {
-                    break;
-                }
-                excludeSet.add(p);
-            }
-            reader.close();
-        } catch (IOException e) {
-            throw new RuntimeException(e);
-        }
-
-        return excludeSet;
-    }
-
-    Bundle mBundle;
-
-    /**
-     * This class is an implementation of the ResultObserver. And it aims to
-     * record the result in the Bundle, and send back to the Instrumentation class
-     * after all results has been recorded.
-     */
-    final class DeviceResultObserver implements ResultObserver {
-        DeviceResultObserver() {
-            mBundle = new Bundle();
-            mBundle.putStringArrayList(BUNDLE_KEY_MISSING_FIELD, new ArrayList<String>());
-            mBundle.putStringArrayList(BUNDLE_KEY_MISSING_METHOD, new ArrayList<String>());
-            mBundle.putStringArrayList(BUNDLE_KEY_MISMATCH_CLASS,
-                    new ArrayList<String>());
-            mBundle.putStringArrayList(BUNDLE_KEY_MISMATCH_FIELD,
-                    new ArrayList<String>());
-            mBundle.putStringArrayList(BUNDLE_KEY_MISMATCH_METHOD,
-                    new ArrayList<String>());
-            mBundle.putStringArrayList(BUNDLE_KEY_MISSING_CLASS, new ArrayList<String>());
-            mBundle.putStringArrayList(BUNDLE_KEY_MISSING_INTERFACE,
-                    new ArrayList<String>());
-            mBundle.putStringArrayList(BUNDLE_KEY_MISMATCH_INTERFACE,
-                    new ArrayList<String>());
-            mBundle.putStringArrayList(BUNDLE_KEY_CAUGHT_EXCEPTION,
-                    new ArrayList<String>());
-        }
-
-        /**
-         * This method is called when all the results has been recorded. And this method
-         * will save the results in IBinder and send back to the Instrumentation class.
-         *
-         * @param i The intent to carry the result.
-         */
-        @SuppressWarnings("deprecation")
-        public void sendResult(Intent i) {
-            SignatureTestLog.d("Send result");
-            if ((mBundle.getStringArrayList(BUNDLE_KEY_MISSING_FIELD).size() == 0)
-                    && (mBundle.getStringArrayList(BUNDLE_KEY_MISSING_CLASS).size() == 0)
-                    && (mBundle.getStringArrayList(BUNDLE_KEY_MISSING_METHOD).size() == 0)
-                    && (mBundle.getStringArrayList(BUNDLE_KEY_MISSING_INTERFACE).size() == 0)
-                    && (mBundle.getStringArrayList(
-                            BUNDLE_KEY_MISMATCH_CLASS).size() == 0)
-                    && (mBundle.getStringArrayList(
-                            BUNDLE_KEY_MISMATCH_FIELD).size() == 0)
-                    && (mBundle.getStringArrayList(
-                            BUNDLE_KEY_MISMATCH_INTERFACE).size() == 0)
-                    && (mBundle.getStringArrayList(
-                            BUNDLE_KEY_MISMATCH_METHOD).size() == 0)
-                    && (mBundle.getStringArrayList(
-                            BUNDLE_KEY_CAUGHT_EXCEPTION).size() == 0)) {
-                SignatureTestLog.d("PASS");
-                mBundle.putBoolean(BUNDLE_KEY_RESULT, true);
-            } else {
-                SignatureTestLog.d("FAIL: " + mBundle.size());
-                mBundle.putBoolean(BUNDLE_KEY_RESULT, false);
-            }
-        }
-
-        public void notifyFailure(FAILURE_TYPE type,
-                                  String name,
-                                  String errorMessage) {
-            SignatureTestLog.d("Failure: ");
-            SignatureTestLog.d("   Type: " + type);
-            SignatureTestLog.d("   Name: " + name);
-            SignatureTestLog.d("   Why : " + errorMessage);
-            mBundle.getStringArrayList(SignatureTestActivity.FAILURE_TYPE_TO_KEY.get(type))
-                    .add(name);
-        }
-    }
-}
diff --git a/tests/SignatureTest/src/android/tests/sigtest/SimpleSignatureTest.java b/tests/SignatureTest/src/android/tests/sigtest/SimpleSignatureTest.java
deleted file mode 100644
index c206c9a..0000000
--- a/tests/SignatureTest/src/android/tests/sigtest/SimpleSignatureTest.java
+++ /dev/null
@@ -1,324 +0,0 @@
-/*
- * Copyright (C) 2011 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.tests.sigtest;
-
-import android.content.res.Resources;
-import android.test.AndroidTestCase;
-import android.tests.sigtest.JDiffClassDescription.JDiffConstructor;
-import android.tests.sigtest.JDiffClassDescription.JDiffField;
-import android.tests.sigtest.JDiffClassDescription.JDiffMethod;
-import android.tests.sigtest.SignatureTestActivity.FAILURE_TYPE;
-
-import org.xmlpull.v1.XmlPullParser;
-import org.xmlpull.v1.XmlPullParserException;
-
-import java.io.IOException;
-import java.lang.reflect.Field;
-import java.lang.reflect.Modifier;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashSet;
-
-/**
- * A simpler version of {@link SignatureTest} that performs the signature check via a JUnit test.
- * <p/>
- * Eventually the existing  {@link SignatureTest} and {@link SignatureActivity} will be deleted
- * once the move to a tradefederation based CTS harness is complete.
- */
-public class SimpleSignatureTest extends AndroidTestCase {
-
-    private static final String TAG_ROOT = "api";
-    private static final String TAG_PACKAGE = "package";
-    private static final String TAG_CLASS = "class";
-    private static final String TAG_INTERFACE = "interface";
-    private static final String TAG_IMPLEMENTS = "implements";
-    private static final String TAG_CONSTRUCTOR = "constructor";
-    private static final String TAG_METHOD = "method";
-    private static final String TAG_PARAM = "parameter";
-    private static final String TAG_EXCEPTION = "exception";
-    private static final String TAG_FIELD = "field";
-
-    private static final String MODIFIER_ABSTRACT = "abstract";
-    private static final String MODIFIER_FINAL = "final";
-    private static final String MODIFIER_NATIVE = "native";
-    private static final String MODIFIER_PRIVATE = "private";
-    private static final String MODIFIER_PROTECTED = "protected";
-    private static final String MODIFIER_PUBLIC = "public";
-    private static final String MODIFIER_STATIC = "static";
-    private static final String MODIFIER_SYNCHRONIZED = "synchronized";
-    private static final String MODIFIER_TRANSIENT = "transient";
-    private static final String MODIFIER_VOLATILE = "volatile";
-    private static final String MODIFIER_VISIBILITY = "visibility";
-
-    private static final String ATTRIBUTE_NAME = "name";
-    private static final String ATTRIBUTE_EXTENDS = "extends";
-    private static final String ATTRIBUTE_TYPE = "type";
-    private static final String ATTRIBUTE_RETURN = "return";
-
-    private static ArrayList<String> mDebugArray = new ArrayList<String>();
-
-    private HashSet<String> mKeyTagSet;
-    private TestResultObserver mResultObserver;
-
-    private class TestResultObserver implements ResultObserver {
-        boolean mDidFail = false;
-        StringBuilder mErrorString = new StringBuilder();
-
-        public void notifyFailure(FAILURE_TYPE type, String name, String errorMessage) {
-            mDidFail = true;
-            mErrorString.append("\n");
-            mErrorString.append(type.toString().toLowerCase());
-            mErrorString.append(":\t");
-            mErrorString.append(name);
-        }
-    }
-
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-        mKeyTagSet = new HashSet<String>();
-        mKeyTagSet.addAll(Arrays.asList(new String[] {
-                TAG_PACKAGE, TAG_CLASS, TAG_INTERFACE, TAG_IMPLEMENTS, TAG_CONSTRUCTOR,
-                TAG_METHOD, TAG_PARAM, TAG_EXCEPTION, TAG_FIELD }));
-        mResultObserver = new TestResultObserver();
-    }
-
-    /**
-     * Tests that the device's API matches the expected set defined in xml.
-     * <p/>
-     * Will check the entire API, and then report the complete list of failures
-     */
-    public void testSignature() {
-        Resources r = getContext().getResources();
-        Class rClass = R.xml.class;
-        Field[] fs = rClass.getFields();
-        for (Field f : fs) {
-            try {
-                start(r.getXml(f.getInt(rClass)));
-            } catch (Exception e) {
-                mResultObserver.notifyFailure(FAILURE_TYPE.CAUGHT_EXCEPTION, e.getMessage(),
-                        e.getMessage());
-            }
-        }
-        if (mResultObserver.mDidFail) {
-            fail(mResultObserver.mErrorString.toString());
-        }
-    }
-
-    private  void beginDocument(XmlPullParser parser, String firstElementName)
-            throws XmlPullParserException, IOException {
-        int type;
-        while ((type=parser.next()) != XmlPullParser.START_TAG
-                   && type != XmlPullParser.END_DOCUMENT) { }
-
-        if (type != XmlPullParser.START_TAG) {
-            throw new XmlPullParserException("No start tag found");
-        }
-
-        if (!parser.getName().equals(firstElementName)) {
-            throw new XmlPullParserException("Unexpected start tag: found " + parser.getName() +
-                    ", expected " + firstElementName);
-        }
-    }
-
-    /**
-     * Signature test entry point.
-     */
-    private void start(XmlPullParser parser) throws XmlPullParserException, IOException {
-        JDiffClassDescription currentClass = null;
-        String currentPackage = "";
-        JDiffMethod currentMethod = null;
-
-        beginDocument(parser, TAG_ROOT);
-        int type;
-        while (true) {
-            type = XmlPullParser.START_DOCUMENT;
-            while ((type=parser.next()) != XmlPullParser.START_TAG
-                       && type != XmlPullParser.END_DOCUMENT
-                       && type != XmlPullParser.END_TAG) {
-
-            }
-
-            if (type == XmlPullParser.END_TAG) {
-                if (TAG_CLASS.equals(parser.getName())
-                        || TAG_INTERFACE.equals(parser.getName())) {
-                    currentClass.checkSignatureCompliance();
-                } else if (TAG_PACKAGE.equals(parser.getName())) {
-                    currentPackage = "";
-                }
-                continue;
-            }
-
-            if (type == XmlPullParser.END_DOCUMENT) {
-                break;
-            }
-
-            String tagname = parser.getName();
-            if (!mKeyTagSet.contains(tagname)) {
-                continue;
-            }
-
-            if (type == XmlPullParser.START_TAG && tagname.equals(TAG_PACKAGE)) {
-                currentPackage = parser.getAttributeValue(null, ATTRIBUTE_NAME);
-            } else if (tagname.equals(TAG_CLASS)) {
-                currentClass = loadClassInfo(parser, false, currentPackage);
-            } else if (tagname.equals(TAG_INTERFACE)) {
-                currentClass = loadClassInfo(parser, true, currentPackage);
-            } else if (tagname.equals(TAG_IMPLEMENTS)) {
-                currentClass.addImplInterface(parser.getAttributeValue(null, ATTRIBUTE_NAME));
-            } else if (tagname.equals(TAG_CONSTRUCTOR)) {
-                JDiffConstructor constructor = loadConstructorInfo(parser, currentClass);
-                currentClass.addConstructor(constructor);
-                currentMethod = constructor;
-            } else if (tagname.equals(TAG_METHOD)) {
-                currentMethod = loadMethodInfo(currentClass.getClassName(), parser);
-                currentClass.addMethod(currentMethod);
-            } else if (tagname.equals(TAG_PARAM)) {
-                currentMethod.addParam(parser.getAttributeValue(null, ATTRIBUTE_TYPE));
-            } else if (tagname.equals(TAG_EXCEPTION)) {
-                currentMethod.addException(parser.getAttributeValue(null, ATTRIBUTE_TYPE));
-            } else if (tagname.equals(TAG_FIELD)) {
-                JDiffField field = loadFieldInfo(currentClass.getClassName(), parser);
-                currentClass.addField(field);
-            } else {
-                throw new RuntimeException(
-                        "unknow tag exception:" + tagname);
-            }
-        }
-    }
-
-    /**
-     * Load field information from xml to memory.
-     *
-     * @param className of the class being examined which will be shown in error messages
-     * @param parser The XmlPullParser which carries the xml information.
-     * @return the new field
-     */
-    private JDiffField loadFieldInfo(String className, XmlPullParser parser) {
-        String fieldName = parser.getAttributeValue(null, ATTRIBUTE_NAME);
-        String fieldType = parser.getAttributeValue(null, ATTRIBUTE_TYPE);
-        int modifier = jdiffModifierToReflectionFormat(className, parser);
-        return new JDiffField(fieldName, fieldType, modifier);
-    }
-
-    /**
-     * Load method information from xml to memory.
-     *
-     * @param className of the class being examined which will be shown in error messages
-     * @param parser The XmlPullParser which carries the xml information.
-     * @return the newly loaded method.
-     */
-    private JDiffMethod loadMethodInfo(String className, XmlPullParser parser) {
-        String methodName = parser.getAttributeValue(null, ATTRIBUTE_NAME);
-        String returnType = parser.getAttributeValue(null, ATTRIBUTE_RETURN);
-        int modifier = jdiffModifierToReflectionFormat(className, parser);
-        return new JDiffMethod(methodName, modifier, returnType);
-    }
-
-    /**
-     * Load constructor information from xml to memory.
-     *
-     * @param parser The XmlPullParser which carries the xml information.
-     * @param currentClass the current class being loaded.
-     * @return the new constructor
-     */
-    private JDiffConstructor loadConstructorInfo(XmlPullParser parser,
-                                                 JDiffClassDescription currentClass) {
-        String name = currentClass.getClassName();
-        int modifier = jdiffModifierToReflectionFormat(name, parser);
-        return new JDiffConstructor(name, modifier);
-    }
-
-    /**
-     * Load class or interface information to memory.
-     *
-     * @param parser The XmlPullParser which carries the xml information.
-     * @param isInterface true if the current class is an interface, otherwise is false.
-     * @param pkg the name of the java package this class can be found in.
-     * @return the new class description.
-     */
-    private JDiffClassDescription loadClassInfo(XmlPullParser parser,
-                                                boolean isInterface,
-                                                String pkg) {
-        String className = parser.getAttributeValue(null, ATTRIBUTE_NAME);
-        JDiffClassDescription currentClass = new JDiffClassDescription(pkg,
-                                                                       className,
-                                                                       mResultObserver);
-        currentClass.setModifier(jdiffModifierToReflectionFormat(className, parser));
-        currentClass.setType(isInterface ? JDiffClassDescription.JDiffType.INTERFACE :
-                             JDiffClassDescription.JDiffType.CLASS);
-        currentClass.setExtendsClass(parser.getAttributeValue(null, ATTRIBUTE_EXTENDS));
-        return currentClass;
-    }
-
-    /**
-     * Convert string modifier to int modifier.
-     *
-     * @param name of the class/method/field being examined which will be shown in error messages
-     * @param key modifier name
-     * @param value modifier value
-     * @return converted modifier value
-     */
-    private static int modifierDescriptionToReflectedType(String name, String key, String value) {
-        if (key.equals(MODIFIER_ABSTRACT)) {
-            return value.equals("true") ? Modifier.ABSTRACT : 0;
-        } else if (key.equals(MODIFIER_FINAL)) {
-            return value.equals("true") ? Modifier.FINAL : 0;
-        } else if (key.equals(MODIFIER_NATIVE)) {
-            return value.equals("true") ? Modifier.NATIVE : 0;
-        } else if (key.equals(MODIFIER_STATIC)) {
-            return value.equals("true") ? Modifier.STATIC : 0;
-        } else if (key.equals(MODIFIER_SYNCHRONIZED)) {
-            return value.equals("true") ? Modifier.SYNCHRONIZED : 0;
-        } else if (key.equals(MODIFIER_TRANSIENT)) {
-            return value.equals("true") ? Modifier.TRANSIENT : 0;
-        } else if (key.equals(MODIFIER_VOLATILE)) {
-            return value.equals("true") ? Modifier.VOLATILE : 0;
-        } else if (key.equals(MODIFIER_VISIBILITY)) {
-            if (value.equals(MODIFIER_PRIVATE)) {
-                throw new RuntimeException("Private visibility found in API spec: " + name);
-            } else if (value.equals(MODIFIER_PROTECTED)) {
-                return Modifier.PROTECTED;
-            } else if (value.equals(MODIFIER_PUBLIC)) {
-                return Modifier.PUBLIC;
-            } else if ("".equals(value)) {
-                // If the visibility is "", it means it has no modifier.
-                // which is package private. We should return 0 for this modifier.
-                return 0;
-            } else {
-                throw new RuntimeException("Unknown modifier found in API spec: " + value);
-            }
-        }
-        return 0;
-    }
-
-    /**
-     * Transfer string modifier to int one.
-     *
-     * @param name of the class/method/field being examined which will be shown in error messages
-     * @param parser XML resource parser
-     * @return converted modifier
-     */
-    private static int jdiffModifierToReflectionFormat(String name, XmlPullParser parser){
-        int modifier = 0;
-        for (int i = 0;i < parser.getAttributeCount();i++) {
-            modifier |= modifierDescriptionToReflectedType(name, parser.getAttributeName(i),
-                    parser.getAttributeValue(i));
-        }
-        return modifier;
-    }
-}
diff --git a/tests/SignatureTest/tests/AndroidManifest.xml b/tests/SignatureTest/tests/AndroidManifest.xml
index b1161f9..ab8a6d6 100644
--- a/tests/SignatureTest/tests/AndroidManifest.xml
+++ b/tests/SignatureTest/tests/AndroidManifest.xml
@@ -14,15 +14,14 @@
      limitations under the License.
 -->
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="android.tests.sigtest.tests">
+          package="android.tests.sigtest.tests">
 
     <application>
-        <uses-library android:name="android.test.runner" />
+        <uses-library android:name="android.test.runner"/>
     </application>
 
     <instrumentation android:name="android.test.InstrumentationTestRunner"
-        android:targetPackage="android.tests.sigtest"
-        android:label="SignatureTest Functional Testset">
-    </instrumentation>
+                     android:targetPackage="android.tests.sigtest"
+                     android:label="SignatureTest Functional Testset"/>
 
 </manifest>
diff --git a/tests/SignatureTest/tests/src/android/tests/sigtest/tests/JDiffClassDescriptionTest.java b/tests/SignatureTest/tests/src/android/tests/sigtest/tests/JDiffClassDescriptionTest.java
index f8798d0..b5bf49e 100644
--- a/tests/SignatureTest/tests/src/android/tests/sigtest/tests/JDiffClassDescriptionTest.java
+++ b/tests/SignatureTest/tests/src/android/tests/sigtest/tests/JDiffClassDescriptionTest.java
@@ -19,7 +19,7 @@
 import android.test.InstrumentationTestCase;
 import android.tests.sigtest.JDiffClassDescription;
 import android.tests.sigtest.ResultObserver;
-import android.tests.sigtest.SignatureTestActivity;
+import android.tests.sigtest.SignatureTest.FAILURE_TYPE;
 
 import java.lang.reflect.Modifier;
 
@@ -28,20 +28,20 @@
  */
 public class JDiffClassDescriptionTest extends InstrumentationTestCase {
     private class NoFailures implements ResultObserver {
-        public void notifyFailure(SignatureTestActivity.FAILURE_TYPE type, String name, String errmsg) {
+        public void notifyFailure(FAILURE_TYPE type, String name, String errmsg) {
             JDiffClassDescriptionTest.this.fail("Saw unexpected test failure: " + name + " failure type: " + type);
         }
     }
 
     private class ExpectFailure implements ResultObserver {
-        private SignatureTestActivity.FAILURE_TYPE expectedType;
+        private FAILURE_TYPE expectedType;
         private boolean failureSeen;
 
-        public ExpectFailure(SignatureTestActivity.FAILURE_TYPE expectedType) {
+        public ExpectFailure(FAILURE_TYPE expectedType) {
             this.expectedType = expectedType;
         }
 
-        public void notifyFailure(SignatureTestActivity.FAILURE_TYPE type, String name, String errMsg) {
+        public void notifyFailure(FAILURE_TYPE type, String name, String errMsg) {
             if (type == expectedType) {
                 if (failureSeen) {
                     JDiffClassDescriptionTest.this.fail("Saw second test failure: " + name + " failure type: " + type);
@@ -88,7 +88,7 @@
     }
 
     public void testMissingClass() {
-        ExpectFailure observer = new ExpectFailure(SignatureTestActivity.FAILURE_TYPE.MISSING_CLASS);
+        ExpectFailure observer = new ExpectFailure(FAILURE_TYPE.MISSING_CLASS);
         JDiffClassDescription clz = new JDiffClassDescription("android.tests.sigtest.tests.data",
                 "NoSuchClass",
                 observer);
@@ -280,7 +280,7 @@
     /** Test the case where the API declares the method not
      *  synchronized, but it actually is. */
     public void testAddingSync() {
-        ExpectFailure observer = new ExpectFailure(SignatureTestActivity.FAILURE_TYPE.MISMATCH_METHOD);      
+        ExpectFailure observer = new ExpectFailure(FAILURE_TYPE.MISMATCH_METHOD);
         JDiffClassDescription clz = createNormalClass(observer);
         JDiffClassDescription.JDiffMethod method = new JDiffClassDescription.JDiffMethod("syncMethod", Modifier.PUBLIC, "void");
         clz.addMethod(method);
@@ -333,7 +333,7 @@
      * http://b/1839622
      */
     public void testAddingAbstractToAClass() {
-        ExpectFailure observer = new ExpectFailure(SignatureTestActivity.FAILURE_TYPE.MISMATCH_CLASS);
+        ExpectFailure observer = new ExpectFailure(FAILURE_TYPE.MISMATCH_CLASS);
         JDiffClassDescription clz = new JDiffClassDescription("android.tests.sigtest.tests.data",
                 "AbstractClass", 
                 observer);
@@ -380,7 +380,7 @@
      * http://b/1839589
      */  
     public void testAddingFinalToAMethodInANonFinalClass() {
-        ExpectFailure observer = new ExpectFailure(SignatureTestActivity.FAILURE_TYPE.MISMATCH_METHOD);
+        ExpectFailure observer = new ExpectFailure(FAILURE_TYPE.MISMATCH_METHOD);
         JDiffClassDescription clz = new JDiffClassDescription("android.tests.sigtest.tests.data", 
                 "NormalClass", 
                 observer);
diff --git a/tests/expectations/knownfailures.txt b/tests/expectations/knownfailures.txt
index f691e29..9d28c34 100644
--- a/tests/expectations/knownfailures.txt
+++ b/tests/expectations/knownfailures.txt
@@ -8,10 +8,6 @@
   bug: 8148617
 },
 {
-  name: "android.tests.sigtest.SimpleSignatureTest#testSignature",
-  bug: 11436500
-},
-{
   name: "android.nativeopengl.EGLCleanupTest#TestCorrect",
   name: "android.nativeopengl.EGLCreateContextTest#BadAttributeFails",
   bug: 11652564
diff --git a/tools/tradefed-host/src/com/android/cts/tradefed/testtype/TestPackageDef.java b/tools/tradefed-host/src/com/android/cts/tradefed/testtype/TestPackageDef.java
index 03e043b..8ab5d18 100644
--- a/tools/tradefed-host/src/com/android/cts/tradefed/testtype/TestPackageDef.java
+++ b/tools/tradefed-host/src/com/android/cts/tradefed/testtype/TestPackageDef.java
@@ -55,7 +55,7 @@
     public static final String UIAUTOMATOR_TEST = "uiAutomator";
 
     private static final String SIGNATURE_TEST_METHOD = "testSignature";
-    private static final String SIGNATURE_TEST_CLASS = "android.tests.sigtest.SimpleSignatureTest";
+    private static final String SIGNATURE_TEST_CLASS = "android.tests.sigtest.SignatureTest";
 
     private String mUri = null;
     private String mAppNameSpace = null;
diff --git a/tools/utils/buildCts.py b/tools/utils/buildCts.py
index 63c8abe..b269be8 100755
--- a/tools/utils/buildCts.py
+++ b/tools/utils/buildCts.py
@@ -173,7 +173,7 @@
   package.AddAttribute('appNameSpace', 'android.tests.sigtest')
   package.AddAttribute('signatureCheck', 'true')
   package.AddAttribute('runner', '.InstrumentationRunner')
-  package.AddTest('android.tests.sigtest.SignatureTest.signatureTest')
+  package.AddTest('android.tests.sigtest.SignatureTest.testSignature')
   description = open(os.path.join(test_repository, 'SignatureTest.xml'), 'w')
   package.WriteDescription(description)
   description.close()