diff options
author | Brett Chabot <brettchabot@android.com> | 2009-11-03 12:29:42 -0800 |
---|---|---|
committer | Brett Chabot <brettchabot@android.com> | 2009-11-03 12:34:46 -0800 |
commit | 0cb9dbea5addbc04fcc8908d456c96a1994b45bf (patch) | |
tree | 40a487f3fe30ace8e39e85ecc94f05bf1ccab16a /eclipse | |
parent | 5694c5984d855f2c454ae50022b311d66f5c849c (diff) | |
download | sdk-0cb9dbea5addbc04fcc8908d456c96a1994b45bf.zip sdk-0cb9dbea5addbc04fcc8908d456c96a1994b45bf.tar.gz sdk-0cb9dbea5addbc04fcc8908d456c96a1994b45bf.tar.bz2 |
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.
Diffstat (limited to 'eclipse')
13 files changed, 61 insertions, 409 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/AdtTestData.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/AdtTestData.java index 2eef828..281170e 100644 --- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/AdtTestData.java +++ b/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 - * + * <p/> + * 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/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/project/AndroidManifestParserTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/project/AndroidManifestParserTest.java index b76e802..e05391c 100644 --- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/project/AndroidManifestParserTest.java +++ b/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/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/resources/AttrsXmlParserTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/resources/AttrsXmlParserTest.java index ac6ebf5..f5c16e7 100644 --- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/resources/AttrsXmlParserTest.java +++ b/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: <!-- Standard orientation constant. --> @@ -90,32 +90,32 @@ public class AttrsXmlParserTest extends TestCase { mParser.preload(); Map<String, Map<String, Integer>> attrMap = mParser.getEnumFlagValues(); assertTrue(attrMap.containsKey("orientation")); - + Map<String, Integer> 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/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/sdk/AndroidJarLoaderTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/sdk/AndroidJarLoaderTest.java index 71c79be..f9178f1 100644 --- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/sdk/AndroidJarLoaderTest.java +++ b/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/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/sdk/LayoutParamsParserTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/sdk/LayoutParamsParserTest.java index cf5f194..166b63d 100644 --- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/sdk/LayoutParamsParserTest.java +++ b/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<String, ArrayList<IClassDescriptor>> findClassesDerivingFrom( String rootPackage, String[] superClasses) throws ClassFormatError { return new HashMap<String, ArrayList<IClassDescriptor>>(); } } - - 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/eclipse/plugins/com.android.ide.eclipse.tests/unittests/data/AndroidManifest-instrumentation.xml b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/AndroidManifest-instrumentation.xml index b380f96..b380f96 100644 --- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/data/AndroidManifest-instrumentation.xml +++ b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/AndroidManifest-instrumentation.xml diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/data/AndroidManifest-testapp.xml b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/AndroidManifest-testapp.xml index 8ae7012..8ae7012 100644 --- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/data/AndroidManifest-testapp.xml +++ b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/AndroidManifest-testapp.xml diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/data/jar_example.jar b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/jar_example.jar Binary files differindex f95b595..f95b595 100644 --- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/data/jar_example.jar +++ b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/jar_example.jar diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/data/jar_example.jardesc b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/jar_example.jardesc index 14cd44f..14cd44f 100644 --- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/data/jar_example.jardesc +++ b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/jar_example.jardesc diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/data/mock_attrs.xml b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/mock_attrs.xml index aa9a1f7..aa9a1f7 100644 --- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/data/mock_attrs.xml +++ b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/mock_attrs.xml diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/data/button.9.png b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/data/button.9.png Binary files differdeleted file mode 100644 index 9d52f40..0000000 --- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/data/button.9.png +++ /dev/null diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/data/layout1.xml b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/data/layout1.xml deleted file mode 100644 index 554f541..0000000 --- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/data/layout1.xml +++ /dev/null @@ -1,49 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> - -<!-- - 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. ---> - -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="fill_parent" - android:layout_height="fill_parent" - android:orientation="vertical" -> - <Button - android:id="@+id/bouton" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_weight="1" - android:text="My Button Text" - > - </Button> - <View - android:id="@+id/surface" - android:layout_width="fill_parent" - android:layout_height="fill_parent" - android:layout_weight="2" - /> - <TextView - android:id="@+id/status" - android:paddingLeft="2dip" - android:layout_weight="0" - android:background="@drawable/black" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:lines="1" - android:gravity="center_vertical|center_horizontal" - android:text="My TextView Text" - /> -</LinearLayout> diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/data/repository_sample.xml b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/data/repository_sample.xml deleted file mode 100755 index c90e18d..0000000 --- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/data/repository_sample.xml +++ /dev/null @@ -1,275 +0,0 @@ -<?xml version="1.0"?>
-<!--
- * Copyright (C) 2009 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.
--->
-<sdk:sdk-repository
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:sdk="http://schemas.android.com/sdk/android/repository/1">
-
- <!-- Define a couple of licenses. These will be referenced by uses-license later. -->
-
- <sdk:license type="text" id="license1">
- This is the license
- for this platform.
- </sdk:license>
-
- <sdk:license id="license2">
- Licenses are only of type 'text' right now, so this is implied.
- </sdk:license>
-
- <!-- Inner elements must be either platform, add-on, doc or tool.
- There can be 0 or more of each, in any order. -->
-
- <sdk:platform>
- <sdk:version>1.0</sdk:version>
- <sdk:api-level>1</sdk:api-level>
- <sdk:revision>3</sdk:revision>
- <sdk:uses-license ref="license1" />
- <sdk:description>Some optional description</sdk:description>
- <sdk:desc-url>http://www.example.com/platform1.html</sdk:desc-url>
- <sdk:release-note>This is an optional release note
- for this package. It's a free multi-line text.
- </sdk:release-note>
- <sdk:release-url>http://some/url/for/the/release/note.html</sdk:release-url>
- <sdk:min-tools-rev>2</sdk:min-tools-rev>
- <!-- The archives node is mandatory and it cannot be empty. -->
- <sdk:archives>
- <sdk:archive os="any">
- <sdk:size>65536</sdk:size>
- <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
- <sdk:url>http://www.example.com/files/plat1.zip</sdk:url>
- </sdk:archive>
- </sdk:archives>
- </sdk:platform>
-
- <sdk:doc>
- <sdk:api-level>1</sdk:api-level>
- <sdk:revision>1</sdk:revision>
- <!-- the license element is not mandatory. -->
- <sdk:description>Some optional description</sdk:description>
- <sdk:desc-url>http://www.example.com/docs.html</sdk:desc-url>
- <sdk:archives>
- <sdk:archive os="any">
- <sdk:size>65536</sdk:size>
- <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
- <sdk:url>http://www.example.com/docs/docs1.zip</sdk:url>
- </sdk:archive>
- </sdk:archives>
- </sdk:doc>
-
- <sdk:add-on>
- <sdk:name>My First add-on</sdk:name>
- <sdk:api-level>1</sdk:api-level>
- <sdk:vendor>John Doe</sdk:vendor>
- <sdk:revision>1</sdk:revision>
- <sdk:uses-license ref="license2" />
- <sdk:description>Some optional description</sdk:description>
- <sdk:desc-url>http://www.example.com/myfirstaddon</sdk:desc-url>
- <sdk:archives>
- <sdk:archive os="any">
- <sdk:size>65536</sdk:size>
- <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
- <sdk:url>http://www.example.com/add-ons/first.zip</sdk:url>
- </sdk:archive>
- </sdk:archives>
- <!-- The libs node is mandatory, however it can be empty. -->
- <sdk:libs>
- <sdk:lib>
- <sdk:name>android.blah.somelib</sdk:name>
- <sdk:description>The description for this library.</sdk:description>
- </sdk:lib>
- <sdk:lib>
- <!-- sdk:description is optional, name is not -->
- <sdk:name>com.android.mymaps</sdk:name>
- </sdk:lib>
- </sdk:libs>
- </sdk:add-on>
-
- <sdk:platform>
- <sdk:version>1.1</sdk:version>
- <sdk:api-level>2</sdk:api-level>
- <sdk:revision>12</sdk:revision>
- <sdk:uses-license ref="license1" />
- <!-- sdk:description and sdk:desc-url are optional -->
- <sdk:archives>
- <sdk:archive os="windows">
- <!-- arch attribute is optional -->
- <sdk:size>65536</sdk:size>
- <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
- <sdk:url>distrib/platform-2-12-win.zip</sdk:url>
- </sdk:archive>
- <sdk:archive os="macosx" arch="any">
- <sdk:size>65536</sdk:size>
- <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
- <sdk:url>distrib/platform-2-12-mac.zip</sdk:url>
- </sdk:archive>
- <sdk:archive os="macosx" arch="ppc">
- <sdk:size>65536</sdk:size>
- <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
- <sdk:url>distrib/platform-2-12-mac.zip</sdk:url>
- </sdk:archive>
- <sdk:archive os="linux" arch="x86">
- <sdk:size>65536</sdk:size>
- <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
- <sdk:url>distrib/platform-2-12-linux.tar.bz2</sdk:url>
- </sdk:archive>
- <sdk:archive os="linux" arch="x86_64">
- <sdk:size>65536</sdk:size>
- <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
- <sdk:url>distrib/platform-2-12-linux.tar.bz2</sdk:url>
- </sdk:archive>
- </sdk:archives>
- </sdk:platform>
-
- <sdk:add-on>
- <sdk:name>My Second add-on</sdk:name>
- <sdk:api-level>2</sdk:api-level>
- <sdk:vendor>John Deer</sdk:vendor>
- <sdk:revision>42</sdk:revision>
- <sdk:archives>
- <sdk:archive os="windows">
- <sdk:size>65536</sdk:size>
- <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
- <sdk:url>distrib/second-42-win.zip</sdk:url>
- </sdk:archive>
- <sdk:archive os="linux">
- <sdk:size>65536</sdk:size>
- <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
- <sdk:url>distrib/second-42-linux.tar.bz2</sdk:url>
- </sdk:archive>
- </sdk:archives>
- <sdk:libs>
- <sdk:lib>
- <sdk:name>android.blah.somelib</sdk:name>
- <sdk:description>The description for this library.</sdk:description>
- </sdk:lib>
- <sdk:lib>
- <sdk:name>com.android.mymaps</sdk:name>
- </sdk:lib>
- </sdk:libs>
- <sdk:uses-license ref="license2" />
- </sdk:add-on>
- - <sdk:platform> - <sdk:version>Pastry</sdk:version> - <sdk:api-level>5</sdk:api-level> - <sdk:codename>Pastry</sdk:codename> - <sdk:revision>3</sdk:revision> - <sdk:uses-license ref="license1" /> - <sdk:description>Preview version for Pastry</sdk:description> - <sdk:desc-url>http://www.example.com/platform1.html</sdk:desc-url> - <!-- The archives node is mandatory and it cannot be empty. --> - <sdk:archives> - <sdk:archive os="any"> - <sdk:size>65536</sdk:size> - <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum> - <sdk:url>http://www.example.com/files/plat1.zip</sdk:url> - </sdk:archive> - </sdk:archives> - </sdk:platform> -
- <sdk:tool>
- <sdk:revision>1</sdk:revision>
- <sdk:description>Some optional description</sdk:description>
- <sdk:desc-url>http://www.example.com/tools.html</sdk:desc-url>
- <sdk:uses-license ref="license1" />
- <sdk:archives>
- <sdk:archive os="any">
- <sdk:size>65536</sdk:size>
- <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
- <sdk:url>http://www.example.com/files/tools1.zip</sdk:url>
- </sdk:archive>
- </sdk:archives>
- </sdk:tool>
-
- <sdk:doc>
- <sdk:api-level>2</sdk:api-level>
- <sdk:revision>42</sdk:revision>
- <sdk:uses-license ref="license2" />
- <sdk:archives>
- <sdk:archive os="windows">
- <sdk:size>65536</sdk:size>
- <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
- <sdk:url>distrib/docs/2.zip</sdk:url>
- </sdk:archive>
- <sdk:archive os="linux">
- <sdk:size>65536</sdk:size>
- <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
- <sdk:url>distrib/docs2-linux.tar.bz2</sdk:url>
- </sdk:archive>
- <sdk:archive os="macosx">
- <sdk:size>65536</sdk:size>
- <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
- <sdk:url>distrib/docs2-mac.tar.bz2</sdk:url>
- </sdk:archive>
- </sdk:archives>
- </sdk:doc>
-
- <sdk:tool>
- <sdk:revision>42</sdk:revision>
- <sdk:uses-license ref="license1" />
- <sdk:archives>
- <sdk:archive os="windows">
- <sdk:size>65536</sdk:size>
- <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
- <sdk:url>distrib/tools/2.zip</sdk:url>
- </sdk:archive>
- <sdk:archive os="linux">
- <sdk:size>65536</sdk:size>
- <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
- <sdk:url>distrib/tools2-linux.tar.bz2</sdk:url>
- </sdk:archive>
- <sdk:archive os="macosx">
- <sdk:size>65536</sdk:size>
- <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
- <sdk:url>distrib/tools2-mac.tar.bz2</sdk:url>
- </sdk:archive>
- </sdk:archives>
- </sdk:tool>
-
- <sdk:add-on>
- <sdk:uses-license ref="license2" />
- <sdk:name>This add-on has no libraries</sdk:name>
- <sdk:api-level>4</sdk:api-level>
- <sdk:vendor>Joe Bar</sdk:vendor>
- <sdk:revision>3</sdk:revision>
- <sdk:archives>
- <sdk:archive os="any" arch="any">
- <sdk:size>65536</sdk:size>
- <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
- <sdk:url>distrib/imnotanarchiveimadoctorjim.zip</sdk:url>
- </sdk:archive>
- </sdk:archives>
- <!-- The libs node is mandatory, however it can be empty. -->
- <sdk:libs />
- </sdk:add-on>
-
- <sdk:extra>
- <sdk:path>usb_driver</sdk:path>
- <sdk:uses-license ref="license2" />
- <sdk:revision>43</sdk:revision>
- <sdk:archives>
- <sdk:archive os="any" arch="any">
- <sdk:size>65536</sdk:size>
- <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
- <sdk:url>distrib/extraduff.zip</sdk:url>
- </sdk:archive>
- </sdk:archives>
- <sdk:description>An Extra package for the USB driver, it will install in $SDK/usb_driver</sdk:description>
- <sdk:desc-url>http://www.example.com/extra.html</sdk:desc-url>
- <sdk:min-tools-rev>3</sdk:min-tools-rev>
- </sdk:extra>
-
-</sdk:sdk-repository>
|