diff options
author | Raphael Moll <ralf@android.com> | 2010-06-11 16:23:02 -0700 |
---|---|---|
committer | Android Code Review <code-review@android.com> | 2010-06-11 16:23:02 -0700 |
commit | 50ec6d9b0ff6dcbb8aec2b081d927a89527696fe (patch) | |
tree | c780fdde9d35c267cf5c42d33af0efd924ebb14a | |
parent | 8468e27abead39a9c2027095965874f2386c67db (diff) | |
parent | 560780185ad763a59425b89bbb2fe3bc4519142f (diff) | |
download | sdk-50ec6d9b0ff6dcbb8aec2b081d927a89527696fe.zip sdk-50ec6d9b0ff6dcbb8aec2b081d927a89527696fe.tar.gz sdk-50ec6d9b0ff6dcbb8aec2b081d927a89527696fe.tar.bz2 |
Merge "Fix adt-tests (broken by last ADT GLE2 AttributeDescriptor change)"
2 files changed, 22 insertions, 12 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/UiElementPullParserTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/UiElementPullParserTest.java index 72dbf81..b9a798a 100644 --- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/UiElementPullParserTest.java +++ b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/UiElementPullParserTest.java @@ -16,11 +16,13 @@ package com.android.ide.eclipse.adt.internal.editors.layout; +import com.android.ide.eclipse.adt.editors.layout.gscripts.IAttributeInfo.Format; import com.android.ide.eclipse.adt.internal.editors.descriptors.AttributeDescriptor; import com.android.ide.eclipse.adt.internal.editors.descriptors.ElementDescriptor; import com.android.ide.eclipse.adt.internal.editors.descriptors.TextAttributeDescriptor; import com.android.ide.eclipse.adt.internal.editors.mock.MockXmlNode; import com.android.ide.eclipse.adt.internal.editors.uimodel.UiElementNode; +import com.android.ide.eclipse.adt.internal.resources.AttributeInfo; import com.android.sdklib.SdkConstants; import com.android.sdklib.resources.Density; @@ -39,6 +41,16 @@ public class UiElementPullParserTest extends TestCase { private HashMap<String, String> button2Map; private HashMap<String, String> textMap; + private TextAttributeDescriptor createTextAttrDesc(String xmlName) { + return new TextAttributeDescriptor( + xmlName, // xmlLocalName + xmlName, // uiName + SdkConstants.NS_RESOURCES, // ns uri + "", // tooltip + new AttributeInfo(xmlName, new Format[] { Format.STRING }) + ); + } + @Override protected void setUp() throws Exception { // set up some basic descriptors. @@ -47,31 +59,30 @@ public class UiElementPullParserTest extends TestCase { // Also add some dummy attributes. ElementDescriptor buttonDescriptor = new ElementDescriptor("Button", "Button", "", "", new AttributeDescriptor[] { - new TextAttributeDescriptor("name", "name", SdkConstants.NS_RESOURCES, ""), - new TextAttributeDescriptor("text", "text", SdkConstants.NS_RESOURCES, ""), + createTextAttrDesc("name"), + createTextAttrDesc("text"), }, new ElementDescriptor[] {}, false); ElementDescriptor textDescriptor = new ElementDescriptor("TextView", "TextView", "", "", new AttributeDescriptor[] { - new TextAttributeDescriptor("name", "name", SdkConstants.NS_RESOURCES, ""), - new TextAttributeDescriptor("text", "text", SdkConstants.NS_RESOURCES, ""), }, + createTextAttrDesc("name"), + createTextAttrDesc("text"), + }, new ElementDescriptor[] {}, false); ElementDescriptor linearDescriptor = new ElementDescriptor("LinearLayout", "Linear Layout", "", "", new AttributeDescriptor[] { - new TextAttributeDescriptor("orientation", "orientation", - SdkConstants.NS_RESOURCES, ""), - }, + createTextAttrDesc("orientation"), + }, new ElementDescriptor[] { }, false); ElementDescriptor relativeDescriptor = new ElementDescriptor("RelativeLayout", "Relative Layout", "", "", new AttributeDescriptor[] { - new TextAttributeDescriptor("orientation", "orientation", - SdkConstants.NS_RESOURCES, ""), - }, + createTextAttrDesc("orientation"), + }, new ElementDescriptor[] { }, false); ElementDescriptor[] a = new ElementDescriptor[] { 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 f5c16e7..8894982 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,8 +17,7 @@ package com.android.ide.eclipse.adt.internal.resources; -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.adt.editors.layout.gscripts.IAttributeInfo.Format; import com.android.ide.eclipse.tests.AdtTestData; import org.w3c.dom.Document; |