From fd893b5fb02b3cfece034dc224502f742daa1fac Mon Sep 17 00:00:00 2001 From: Brett Chabot Date: Tue, 3 Nov 2009 12:29:42 -0800 Subject: [PATCH] Fix ADT test data references. - Remove reference to ADT from sdklib tests. - Move ADT test data to be closer to their test classes, and to make it obvious this data is only for ADT unit tests. --- .../ide/eclipse/tests/AdtTestData.java | 34 +++--------- .../project/AndroidManifestParserTest.java | 30 ++++++----- .../resources/AttrsXmlParserTest.java | 36 ++++++------- .../internal/sdk/AndroidJarLoaderTest.java | 3 +- .../internal/sdk/LayoutParamsParserTest.java | 43 +++++++-------- .../AndroidManifest-instrumentation.xml | 0 .../testdata}/AndroidManifest-testapp.xml | 0 .../ide/eclipse/testdata}/jar_example.jar | Bin .../ide/eclipse/testdata}/jar_example.jardesc | 0 .../ide/eclipse/testdata}/mock_attrs.xml | 0 .../unittests/data/button.9.png | Bin 3750 -> 0 bytes .../unittests/data/layout1.xml | 49 ------------------ .../sdklib/repository/TestSdkRepository.java | 7 ++- .../sdklib/testdata}/repository_sample.xml | 0 14 files changed, 64 insertions(+), 138 deletions(-) rename tools/eclipse/plugins/com.android.ide.eclipse.tests/unittests/{data => com/android/ide/eclipse/testdata}/AndroidManifest-instrumentation.xml (100%) rename tools/eclipse/plugins/com.android.ide.eclipse.tests/unittests/{data => com/android/ide/eclipse/testdata}/AndroidManifest-testapp.xml (100%) rename tools/eclipse/plugins/com.android.ide.eclipse.tests/unittests/{data => com/android/ide/eclipse/testdata}/jar_example.jar (100%) rename tools/eclipse/plugins/com.android.ide.eclipse.tests/unittests/{data => com/android/ide/eclipse/testdata}/jar_example.jardesc (100%) rename tools/eclipse/plugins/com.android.ide.eclipse.tests/unittests/{data => com/android/ide/eclipse/testdata}/mock_attrs.xml (100%) delete mode 100644 tools/eclipse/plugins/com.android.ide.eclipse.tests/unittests/data/button.9.png delete mode 100644 tools/eclipse/plugins/com.android.ide.eclipse.tests/unittests/data/layout1.xml rename tools/{eclipse/plugins/com.android.ide.eclipse.tests/unittests/data => sdkmanager/libs/sdklib/tests/com/android/sdklib/testdata}/repository_sample.xml (100%) diff --git a/tools/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/AdtTestData.java b/tools/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/AdtTestData.java index 2eef828f9..281170e81 100644 --- a/tools/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/AdtTestData.java +++ b/tools/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/AdtTestData.java @@ -21,18 +21,14 @@ import org.eclipse.core.runtime.FileLocator; import org.eclipse.core.runtime.Platform; import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; import java.io.IOException; -import java.io.InputStream; import java.net.URL; import java.util.logging.Logger; /** * Helper class for retrieving test data - * - * All tests which need to retrieve test data files should go through this class - * + *

+ * All tests which need to retrieve paths to test data files should go through this class. */ public class AdtTestData { @@ -40,12 +36,9 @@ public class AdtTestData { private static AdtTestData sInstance = null; private static final Logger sLogger = Logger.getLogger(AdtTestData.class.getName()); - /** the absolute file path to the /data directory in this test - * environment. - */ + /** The absolute file path to the plugin's contents. */ private String mOsRootDataPath; - private AdtTestData() { // can set test_data env variable to override default behavior of // finding data using class loader @@ -55,7 +48,7 @@ public class AdtTestData { mOsRootDataPath = System.getProperty("test_data"); if (mOsRootDataPath == null) { sLogger.info("Cannot find test_data environment variable, init to class loader"); - URL url = this.getClass().getClassLoader().getResource("data"); //$NON-NLS-1$ + URL url = this.getClass().getClassLoader().getResource("."); //$NON-NLS-1$ if (Platform.isRunning()) { sLogger.info("Running as an Eclipse Plug-in JUnit test, using FileLocator"); @@ -71,7 +64,7 @@ public class AdtTestData { } } - if (mOsRootDataPath.equals(AndroidConstants.WS_SEP + "data")) { + if (mOsRootDataPath.equals(AndroidConstants.WS_SEP)) { sLogger.warning("Resource data not found using class loader!, Defaulting to no path"); } @@ -90,9 +83,9 @@ public class AdtTestData { } /** - * Returns the absolute file path to a file located in this plugins "data" directory + * Returns the absolute file path to a file located in this plugin. * - * @param osRelativePath {@link String} path to file contained in /data. Must + * @param osRelativePath {@link String} path to file contained in plugin. Must * use path separators appropriate to host OS * * @return absolute OS path to test file @@ -100,17 +93,4 @@ public class AdtTestData { public String getTestFilePath(String osRelativePath) { return mOsRootDataPath + osRelativePath; } - - /** - * Helper method to get a {@link InputStream} to test data file. - * - * @param osRelativePath {@link String} path to file contained in /data. Must - * use path separators appropriate to host OS - * - * @return {@link InputStream} for test file - * @throws FileNotFoundException if test file could not be found - */ - public InputStream getTestFileStream(String osRelativePath) throws FileNotFoundException { - return new FileInputStream(getTestFilePath(osRelativePath)); - } } diff --git a/tools/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/project/AndroidManifestParserTest.java b/tools/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/project/AndroidManifestParserTest.java index b76e802d0..e05391c4b 100644 --- a/tools/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/project/AndroidManifestParserTest.java +++ b/tools/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/project/AndroidManifestParserTest.java @@ -28,9 +28,13 @@ import junit.framework.TestCase; public class AndroidManifestParserTest extends TestCase { private AndroidManifestParser mManifestTestApp; private AndroidManifestParser mManifestInstrumentation; - - private static final String INSTRUMENTATION_XML = "AndroidManifest-instrumentation.xml"; //$NON-NLS-1$ - private static final String TESTAPP_XML = "AndroidManifest-testapp.xml"; //$NON-NLS-1$ + + private static final String TESTDATA_PATH = + "com/android/ide/eclipse/testdata/"; //$NON-NLS-1$ + private static final String INSTRUMENTATION_XML = TESTDATA_PATH + + "AndroidManifest-instrumentation.xml"; //$NON-NLS-1$ + private static final String TESTAPP_XML = TESTDATA_PATH + + "AndroidManifest-testapp.xml"; //$NON-NLS-1$ private static final String PACKAGE_NAME = "com.android.testapp"; //$NON-NLS-1$ private static final String ACTIVITY_NAME = "com.android.testapp.MainActivity"; //$NON-NLS-1$ private static final String LIBRARY_NAME = "android.test.runner"; //$NON-NLS-1$ @@ -40,26 +44,24 @@ public class AndroidManifestParserTest extends TestCase { @Override protected void setUp() throws Exception { super.setUp(); - - String testFilePath = AdtTestData.getInstance().getTestFilePath( - TESTAPP_XML); + + String testFilePath = AdtTestData.getInstance().getTestFilePath(TESTAPP_XML); mManifestTestApp = AndroidManifestParser.parseForData(testFilePath); assertNotNull(mManifestTestApp); - - testFilePath = AdtTestData.getInstance().getTestFilePath( - INSTRUMENTATION_XML); + + testFilePath = AdtTestData.getInstance().getTestFilePath(INSTRUMENTATION_XML); mManifestInstrumentation = AndroidManifestParser.parseForData(testFilePath); assertNotNull(mManifestInstrumentation); } public void testGetInstrumentationInformation() { assertEquals(1, mManifestInstrumentation.getInstrumentations().length); - assertEquals(INSTRUMENTATION_NAME, + assertEquals(INSTRUMENTATION_NAME, mManifestInstrumentation.getInstrumentations()[0].getName()); - assertEquals(INSTRUMENTATION_TARGET, + assertEquals(INSTRUMENTATION_TARGET, mManifestInstrumentation.getInstrumentations()[0].getTargetPackage()); } - + public void testGetPackage() { assertEquals(PACKAGE_NAME, mManifestTestApp.getPackage()); } @@ -80,7 +82,7 @@ public class AndroidManifestParserTest extends TestCase { assertTrue(activity.hasAction()); assertTrue(activity.isHomeActivity()); } - + private void assertEquals(Activity lhs, Activity rhs) { assertTrue(lhs == rhs || (lhs != null && rhs != null)); if (lhs != null && rhs != null) { @@ -93,7 +95,7 @@ public class AndroidManifestParserTest extends TestCase { public void testGetUsesLibraries() { assertEquals(1, mManifestTestApp.getUsesLibraries().length); - assertEquals(LIBRARY_NAME, mManifestTestApp.getUsesLibraries()[0]); + assertEquals(LIBRARY_NAME, mManifestTestApp.getUsesLibraries()[0]); } public void testGetPackageName() { diff --git a/tools/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/resources/AttrsXmlParserTest.java b/tools/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/resources/AttrsXmlParserTest.java index ac6ebf544..f5c16e74b 100644 --- a/tools/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/resources/AttrsXmlParserTest.java +++ b/tools/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/resources/AttrsXmlParserTest.java @@ -17,9 +17,6 @@ package com.android.ide.eclipse.adt.internal.resources; -import com.android.ide.eclipse.adt.internal.resources.AttrsXmlParser; -import com.android.ide.eclipse.adt.internal.resources.DeclareStyleableInfo; -import com.android.ide.eclipse.adt.internal.resources.ViewClassInfo; import com.android.ide.eclipse.adt.internal.resources.DeclareStyleableInfo.AttributeInfo; import com.android.ide.eclipse.adt.internal.resources.DeclareStyleableInfo.AttributeInfo.Format; import com.android.ide.eclipse.tests.AdtTestData; @@ -32,20 +29,23 @@ import java.util.Map; import junit.framework.TestCase; public class AttrsXmlParserTest extends TestCase { - + private AttrsXmlParser mParser; private String mFilePath; + private static final String MOCK_DATA_PATH = + "com/android/ide/eclipse/testdata/mock_attrs.xml"; //$NON-NLS-1$ + @Override public void setUp() throws Exception { - mFilePath = AdtTestData.getInstance().getTestFilePath("mock_attrs.xml"); //$NON-NLS-1$ + mFilePath = AdtTestData.getInstance().getTestFilePath(MOCK_DATA_PATH); //$NON-NLS-1$ mParser = new AttrsXmlParser(mFilePath); } @Override public void tearDown() throws Exception { } - + public final void testGetDocument() throws Exception { assertNotNull(_getDocument()); } @@ -53,12 +53,12 @@ public class AttrsXmlParserTest extends TestCase { public void testGetOsAttrsXmlPath() throws Exception { assertEquals(mFilePath, mParser.getOsAttrsXmlPath()); } - + public final void testPreload() throws Exception { assertSame(mParser, mParser.preload()); } - - + + public final void testLoadViewAttributes() throws Exception { mParser.preload(); ViewClassInfo info = new ViewClassInfo( @@ -66,7 +66,7 @@ public class AttrsXmlParserTest extends TestCase { "mock_android.something.Theme", //$NON-NLS-1$ "Theme"); //$NON-NLS-1$ mParser.loadViewAttributes(info); - + assertEquals("These are the standard attributes that make up a complete theme.", //$NON-NLS-1$ info.getJavaDoc()); AttributeInfo[] attrs = info.getAttributes(); @@ -75,7 +75,7 @@ public class AttrsXmlParserTest extends TestCase { assertEquals(1, info.getAttributes()[0].getFormats().length); assertEquals(Format.DIMENSION, info.getAttributes()[0].getFormats()[0]); } - + public final void testEnumFlagValues() throws Exception { /* The XML being read contains: @@ -90,32 +90,32 @@ public class AttrsXmlParserTest extends TestCase { mParser.preload(); Map> attrMap = mParser.getEnumFlagValues(); assertTrue(attrMap.containsKey("orientation")); - + Map valueMap = attrMap.get("orientation"); assertTrue(valueMap.containsKey("horizontal")); assertTrue(valueMap.containsKey("vertical")); assertEquals(Integer.valueOf(0), valueMap.get("horizontal")); assertEquals(Integer.valueOf(1), valueMap.get("vertical")); } - + public final void testDeprecated() throws Exception { mParser.preload(); - + DeclareStyleableInfo dep = mParser.getDeclareStyleableList().get("DeprecatedTest"); assertNotNull(dep); - + AttributeInfo[] attrs = dep.getAttributes(); assertEquals(4, attrs.length); assertEquals("deprecated-inline", attrs[0].getName()); assertEquals("In-line deprecated.", attrs[0].getDeprecatedDoc()); assertEquals("Deprecated comments using delimiters.", attrs[0].getJavaDoc()); - + assertEquals("deprecated-multiline", attrs[1].getName()); assertEquals("Multi-line version of deprecated that works till the next tag.", attrs[1].getDeprecatedDoc()); assertEquals("Deprecated comments on their own line.", attrs[1].getJavaDoc()); - + assertEquals("deprecated-not", attrs[2].getName()); assertEquals(null, attrs[2].getDeprecatedDoc()); assertEquals("This attribute is not deprecated.", attrs[2].getJavaDoc()); @@ -126,7 +126,7 @@ public class AttrsXmlParserTest extends TestCase { } //---- access to private methods - + private Document _getDocument() throws Exception { Method method = AttrsXmlParser.class.getDeclaredMethod("getDocument"); //$NON-NLS-1$ method.setAccessible(true); diff --git a/tools/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/sdk/AndroidJarLoaderTest.java b/tools/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/sdk/AndroidJarLoaderTest.java index 71c79be1f..f9178f10f 100644 --- a/tools/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/sdk/AndroidJarLoaderTest.java +++ b/tools/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/sdk/AndroidJarLoaderTest.java @@ -40,7 +40,8 @@ public class AndroidJarLoaderTest extends TestCase { /** Creates an instance of {@link AndroidJarLoader} on our test data JAR */ @Override public void setUp() throws Exception { - String jarfilePath = AdtTestData.getInstance().getTestFilePath("jar_example.jar"); //$NON-NLS-1$ + String jarfilePath = AdtTestData.getInstance().getTestFilePath( + "com/android/ide/eclipse/testdata/jar_example.jar"); //$NON-NLS-1$ mFrameworkClassLoader = new AndroidJarLoader(jarfilePath); } diff --git a/tools/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/sdk/LayoutParamsParserTest.java b/tools/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/sdk/LayoutParamsParserTest.java index cf5f194d9..166b63db4 100644 --- a/tools/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/sdk/LayoutParamsParserTest.java +++ b/tools/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/sdk/LayoutParamsParserTest.java @@ -19,15 +19,12 @@ package com.android.ide.eclipse.adt.internal.sdk; import com.android.ide.eclipse.adt.internal.resources.AttrsXmlParser; import com.android.ide.eclipse.adt.internal.resources.ViewClassInfo; import com.android.ide.eclipse.adt.internal.resources.ViewClassInfo.LayoutParamsInfo; -import com.android.ide.eclipse.adt.internal.sdk.AndroidJarLoader; -import com.android.ide.eclipse.adt.internal.sdk.AndroidTargetParser; -import com.android.ide.eclipse.adt.internal.sdk.LayoutParamsParser; import com.android.ide.eclipse.adt.internal.sdk.AndroidJarLoader.ClassWrapper; import com.android.ide.eclipse.adt.internal.sdk.IAndroidClassLoader.IClassDescriptor; +import com.android.ide.eclipse.tests.AdtTestData; import java.lang.reflect.Constructor; import java.lang.reflect.Method; -import java.net.URL; import java.util.ArrayList; import java.util.HashMap; import java.util.TreeMap; @@ -36,7 +33,7 @@ import junit.framework.TestCase; /** * Test the inner private methods of PlatformDataParser. - * + * * Convention: method names that start with an underscore are actually local wrappers * that call private methods from {@link AndroidTargetParser} using reflection. * This is inspired by the Python coding rule which mandates underscores prefixes for @@ -44,30 +41,26 @@ import junit.framework.TestCase; */ public class LayoutParamsParserTest extends TestCase { + private static final String MOCK_DATA_PATH = + "com/android/ide/eclipse/testdata/mock_attrs.xml"; //$NON-NLS-1$ + private static class MockFrameworkClassLoader extends AndroidJarLoader { MockFrameworkClassLoader() { super(null /* osFrameworkLocation */); } - + @Override public HashMap> findClassesDerivingFrom( String rootPackage, String[] superClasses) throws ClassFormatError { return new HashMap>(); } } - - private static class MockAttrsXmlPath { - public String getPath() { - ClassLoader cl = this.getClass().getClassLoader(); - URL res = cl.getResource("data/mock_attrs.xml"); //$NON-NLS-1$ - return res.getFile(); - } - } - + private static class MockLayoutParamsParser extends LayoutParamsParser { public MockLayoutParamsParser() { super(new MockFrameworkClassLoader(), - new AttrsXmlParser(new MockAttrsXmlPath().getPath()).preload()); + new AttrsXmlParser( + AdtTestData.getInstance().getTestFilePath(MOCK_DATA_PATH)).preload()); mTopViewClass = new ClassWrapper(mock_android.view.View.class); mTopGroupClass = new ClassWrapper(mock_android.view.ViewGroup.class); @@ -82,7 +75,7 @@ public class LayoutParamsParserTest extends TestCase { } private MockLayoutParamsParser mParser; - + @Override public void setUp() throws Exception { mParser = new MockLayoutParamsParser(); @@ -91,7 +84,7 @@ public class LayoutParamsParserTest extends TestCase { @Override public void tearDown() throws Exception { } - + public final void testFindLayoutParams() throws Exception { assertEquals(mock_android.view.ViewGroup.LayoutParams.class, ((ClassWrapper)_findLayoutParams(mock_android.view.ViewGroup.class)).wrappedClass()); @@ -102,7 +95,7 @@ public class LayoutParamsParserTest extends TestCase { assertEquals(mock_android.widget.TableLayout.LayoutParams.class, ((ClassWrapper)_findLayoutParams(mock_android.widget.TableLayout.class)).wrappedClass()); } - + public final void testGetLayoutParamsInfo() throws Exception { LayoutParamsInfo info1 = _getLayoutParamsInfo( mock_android.view.ViewGroup.LayoutParams.class); @@ -115,7 +108,7 @@ public class LayoutParamsParserTest extends TestCase { assertNotNull(info2); // LinearLayout.LayoutData links to ViewGroup.LayoutParams assertSame(info1, info2.getSuperClass()); - + LayoutParamsInfo info3 = _getLayoutParamsInfo( mock_android.widget.TableLayout.LayoutParams.class); assertNotNull(info3); @@ -124,7 +117,7 @@ public class LayoutParamsParserTest extends TestCase { assertNotSame(info1, info3.getSuperClass()); assertNotSame(info2, info3.getSuperClass()); // TableLayout.LayoutParams => ViewGroup.MarginLayoutParams => ViewGroup.LayoutParams - assertSame(info1, info3.getSuperClass().getSuperClass()); + assertSame(info1, info3.getSuperClass().getSuperClass()); } public final void testGetLayoutClasses() throws Exception { @@ -132,7 +125,7 @@ public class LayoutParamsParserTest extends TestCase { } //---- access to private methods - + /** Calls the private constructor of the parser */ @SuppressWarnings("unused") private AndroidTargetParser _Constructor(String osJarPath) throws Exception { @@ -141,7 +134,7 @@ public class LayoutParamsParserTest extends TestCase { constructor.setAccessible(true); return constructor.newInstance(osJarPath); } - + /** calls the private getLayoutClasses() of the parser */ @SuppressWarnings("unused") private void _getLayoutClasses() throws Exception { @@ -149,7 +142,7 @@ public class LayoutParamsParserTest extends TestCase { method.setAccessible(true); method.invoke(mParser); } - + /** calls the private addGroup() of the parser */ @SuppressWarnings("unused") private ViewClassInfo _addGroup(Class groupClass) throws Exception { @@ -175,7 +168,7 @@ public class LayoutParamsParserTest extends TestCase { method.setAccessible(true); return (LayoutParamsInfo) method.invoke(mParser, new ClassWrapper(layoutParamsClass)); } - + /** calls the private findLayoutParams() of the parser */ private IClassDescriptor _findLayoutParams(Class groupClass) throws Exception { Method method = LayoutParamsParser.class.getDeclaredMethod("findLayoutParams", //$NON-NLS-1$ diff --git a/tools/eclipse/plugins/com.android.ide.eclipse.tests/unittests/data/AndroidManifest-instrumentation.xml b/tools/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/AndroidManifest-instrumentation.xml similarity index 100% rename from tools/eclipse/plugins/com.android.ide.eclipse.tests/unittests/data/AndroidManifest-instrumentation.xml rename to tools/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/AndroidManifest-instrumentation.xml diff --git a/tools/eclipse/plugins/com.android.ide.eclipse.tests/unittests/data/AndroidManifest-testapp.xml b/tools/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/AndroidManifest-testapp.xml similarity index 100% rename from tools/eclipse/plugins/com.android.ide.eclipse.tests/unittests/data/AndroidManifest-testapp.xml rename to tools/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/AndroidManifest-testapp.xml diff --git a/tools/eclipse/plugins/com.android.ide.eclipse.tests/unittests/data/jar_example.jar b/tools/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/jar_example.jar similarity index 100% rename from tools/eclipse/plugins/com.android.ide.eclipse.tests/unittests/data/jar_example.jar rename to tools/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/jar_example.jar diff --git a/tools/eclipse/plugins/com.android.ide.eclipse.tests/unittests/data/jar_example.jardesc b/tools/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/jar_example.jardesc similarity index 100% rename from tools/eclipse/plugins/com.android.ide.eclipse.tests/unittests/data/jar_example.jardesc rename to tools/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/jar_example.jardesc diff --git a/tools/eclipse/plugins/com.android.ide.eclipse.tests/unittests/data/mock_attrs.xml b/tools/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/mock_attrs.xml similarity index 100% rename from tools/eclipse/plugins/com.android.ide.eclipse.tests/unittests/data/mock_attrs.xml rename to tools/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/mock_attrs.xml diff --git a/tools/eclipse/plugins/com.android.ide.eclipse.tests/unittests/data/button.9.png b/tools/eclipse/plugins/com.android.ide.eclipse.tests/unittests/data/button.9.png deleted file mode 100644 index 9d52f40d00fd9c6cfd29800e0f0347439c568369..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3750 zcmV;X4q5SuP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX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ository.java b/tools/sdkmanager/libs/sdklib/tests/com/android/sdklib/repository/TestSdkRepository.java index 7f1d96746..de50b6ece 100755 --- a/tools/sdkmanager/libs/sdklib/tests/com/android/sdklib/repository/TestSdkRepository.java +++ b/tools/sdkmanager/libs/sdklib/tests/com/android/sdklib/repository/TestSdkRepository.java @@ -16,8 +16,6 @@ package com.android.sdklib.repository; -import com.android.ide.eclipse.tests.AdtTestData; - import org.xml.sax.ErrorHandler; import org.xml.sax.SAXException; import org.xml.sax.SAXParseException; @@ -125,8 +123,9 @@ public class TestSdkRepository extends TestCase { /** Validate a valid sample using an InputStream */ public void testValidateLocalRepositoryFile() throws Exception { - InputStream xmlStream = AdtTestData.getInstance().getTestFileStream( - "repository_sample.xml"); + InputStream xmlStream = + this.getClass().getClassLoader().getResourceAsStream( + "com/android/sdklib/testdata/repository_sample.xml"); Source source = new StreamSource(xmlStream); CaptureErrorHandler handler = new CaptureErrorHandler(); diff --git a/tools/eclipse/plugins/com.android.ide.eclipse.tests/unittests/data/repository_sample.xml b/tools/sdkmanager/libs/sdklib/tests/com/android/sdklib/testdata/repository_sample.xml similarity index 100% rename from tools/eclipse/plugins/com.android.ide.eclipse.tests/unittests/data/repository_sample.xml rename to tools/sdkmanager/libs/sdklib/tests/com/android/sdklib/testdata/repository_sample.xml