aboutsummaryrefslogtreecommitdiffstats
path: root/eclipse/plugins
diff options
context:
space:
mode:
authorTor Norbye <tnorbye@google.com>2012-11-16 20:11:42 +0100
committerTor Norbye <tnorbye@google.com>2012-11-26 17:30:22 -0800
commitb293ca775054871164e9e3c83833a2fd4601387c (patch)
treef7601ace94fd544fcd28404503df055dc1a2ffb2 /eclipse/plugins
parenta96737ef1ee717e322c87a8ef391440b2aaf03b6 (diff)
downloadsdk-b293ca775054871164e9e3c83833a2fd4601387c.zip
sdk-b293ca775054871164e9e3c83833a2fd4601387c.tar.gz
sdk-b293ca775054871164e9e3c83833a2fd4601387c.tar.bz2
Add sdktestutils package and consolidate some test utility code
This CL creates a new project, sdk/testutils, which is added to the test projects for ADT and lint. It contains various test utility code, some from ADT tests, some from lint tests, and some duplicated in both, and some new utility code such as a better diff-er. The CL also updates a bunch of tests; many golden files are updated to the new test file diff output format, and some golden files were out of date, and in a couple of cases I fixed some bugs I noticed in the output. Change-Id: I98c49c929916ae9bad24db45602e10ded6c526da
Diffstat (limited to 'eclipse/plugins')
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/GridLayoutConverter.java21
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/UseCompoundDrawableRefactoring.java4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/VisualRefactoring.java4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/changes/AndroidDocumentChange.java9
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/changes/AndroidLayoutChange.java4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/.classpath1
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/META-INF/MANIFEST.MF1
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/build.properties1
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/AdtProjectTest.java297
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ChangeLayoutRefactoringTest.java5
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/RefactoringTest.java10
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/UseCompoundDrawableRefactoringTest.java12
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken1-expected-applyCompletion15.diff6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken2-expected-applyCompletion16.diff6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken3-expected-applyCompletion14.diff6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion1.diff6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion10.diff6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion11a.diff6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion11b.diff6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion12.diff6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion2.diff6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion3.diff6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion39.diff6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion4.diff6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion5.diff6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion6.diff6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion7a.diff6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion7b.diff6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion9.diff6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion10-expected-applyCompletion42.diff6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion10-expected-applyCompletion43.diff6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion11-expected-applyCompletion46.diff6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2-expected-applyCompletion13a.diff6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2-expected-applyCompletion13b.diff6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2-expected-applyCompletion13c.diff6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion3-expected-applyCompletion17.diff6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion3-expected-applyCompletion18.diff6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-applyCompletion19.diff6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-applyCompletion20.diff6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-applyCompletion21.diff6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-applyCompletion40.diff6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion6-expected-applyCompletion22.diff6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion7-expected-applyCompletion23.diff6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion8-expected-applyCompletion41.diff6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion24a.diff6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion24b.diff6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion25.diff6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion26.diff6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion27.diff6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion28.diff6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion29.diff6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion30.diff6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion31.diff6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion32.diff6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion33.diff6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion34.diff6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion35.diff6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion36.diff6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion37.diff6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion38.diff6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion44.diff6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract1b.diff68
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract1c.diff62
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract1d.diff64
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract2.diff64
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract3.diff64
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract4.diff66
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract5.diff66
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract8.diff62
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle2-expected-extract7.diff66
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigationstyles-expected-extract2.diff11
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newlayout6-expected-extract6.diff23
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newlayout6-expected-extract7.diff59
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles-expected-extract1.diff19
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles2-expected-extract1b.diff19
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles3-expected-extract1c.diff19
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles3-expected-extract8.diff19
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles4-expected-extract1d.diff19
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles4-expected-extract3.diff19
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles5-expected-extract4.diff17
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles6-expected-extract5.diff17
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles8-expected-extract7.diff19
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/quickfix1-expected-quickFix1.xml5
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/quickfix1-expected-quickFix3.xml12
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/quickfix2-expected-quickFix4.xml7
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample10-expected-convertFromGrid.xml3
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample10-expected-initialAttributes.xml3
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-extract6.diff18
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-extract7.diff170
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample2-expected-changeView2.xml4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample7-expected-extract6.diff20
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample7-expected-extract7.diff139
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample8-expected-extract6.diff30
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample8-expected-extract7.diff180
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/lint/ProjectLintConfigurationTest.java27
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/refactorings/core/RefactoringTestBase.java476
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/refactorings/core/RenameResourceParticipantTest.java624
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/wizards/templates/TemplateHandlerTest.java4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/SdkLoadingTestCase.java (renamed from eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/SdkTestCase.java)9
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/functests/layoutRendering/ApiDemosRenderingTest.java4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/functests/sampleProjects/SampleProjectTest.java4
101 files changed, 1549 insertions, 1695 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/GridLayoutConverter.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/GridLayoutConverter.java
index 868d790..fe673a5 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/GridLayoutConverter.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/GridLayoutConverter.java
@@ -15,8 +15,7 @@
*/
package com.android.ide.eclipse.adt.internal.editors.layout.refactoring;
-import static com.android.ide.common.layout.GravityHelper.GRAVITY_HORIZ_MASK;
-import static com.android.ide.common.layout.GravityHelper.GRAVITY_VERT_MASK;
+import static com.android.SdkConstants.ANDROID_URI;
import static com.android.SdkConstants.ATTR_BACKGROUND;
import static com.android.SdkConstants.ATTR_COLUMN_COUNT;
import static com.android.SdkConstants.ATTR_LAYOUT_ALIGN_BASELINE;
@@ -34,10 +33,10 @@ import static com.android.SdkConstants.ATTR_LAYOUT_ROW_SPAN;
import static com.android.SdkConstants.ATTR_LAYOUT_WIDTH;
import static com.android.SdkConstants.ATTR_ORIENTATION;
import static com.android.SdkConstants.FQCN_GRID_LAYOUT;
+import static com.android.SdkConstants.FQCN_SPACE;
import static com.android.SdkConstants.GRAVITY_VALUE_FILL;
import static com.android.SdkConstants.GRAVITY_VALUE_FILL_HORIZONTAL;
import static com.android.SdkConstants.GRAVITY_VALUE_FILL_VERTICAL;
-import static com.android.SdkConstants.GRID_LAYOUT;
import static com.android.SdkConstants.ID_PREFIX;
import static com.android.SdkConstants.LINEAR_LAYOUT;
import static com.android.SdkConstants.NEW_ID_PREFIX;
@@ -51,10 +50,9 @@ import static com.android.SdkConstants.VALUE_HORIZONTAL;
import static com.android.SdkConstants.VALUE_MATCH_PARENT;
import static com.android.SdkConstants.VALUE_VERTICAL;
import static com.android.SdkConstants.VALUE_WRAP_CONTENT;
+import static com.android.ide.common.layout.GravityHelper.GRAVITY_HORIZ_MASK;
+import static com.android.ide.common.layout.GravityHelper.GRAVITY_VERT_MASK;
-
-import com.android.SdkConstants;
-import static com.android.SdkConstants.ANDROID_URI;
import com.android.ide.common.api.IViewMetadata.FillPreference;
import com.android.ide.common.layout.BaseLayoutRule;
import com.android.ide.common.layout.GravityHelper;
@@ -66,7 +64,9 @@ import com.android.ide.eclipse.adt.internal.editors.layout.descriptors.ViewEleme
import com.android.ide.eclipse.adt.internal.editors.layout.gle2.CanvasViewInfo;
import com.android.ide.eclipse.adt.internal.editors.layout.gle2.DomUtilities;
import com.android.ide.eclipse.adt.internal.editors.layout.gre.ViewMetadataRepository;
+import com.android.ide.eclipse.adt.internal.project.SupportLibraryHelper;
+import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.text.edits.InsertEdit;
@@ -227,9 +227,12 @@ class GridLayoutConverter {
int column = columnFixed.size();
StringBuilder sb = new StringBuilder(64);
String spaceTag = SPACE;
- if (!gridLayout.equals(GRID_LAYOUT) && gridLayout.length() > GRID_LAYOUT.length()) {
- String pkg = gridLayout.substring(0, gridLayout.length() - GRID_LAYOUT.length());
- spaceTag = pkg + spaceTag;
+ IFile file = mRefactoring.getFile();
+ if (file != null) {
+ spaceTag = SupportLibraryHelper.getTagFor(file.getProject(), FQCN_SPACE);
+ if (spaceTag.equals(FQCN_SPACE)) {
+ spaceTag = SPACE;
+ }
}
sb.append('<').append(spaceTag).append(' ');
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/UseCompoundDrawableRefactoring.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/UseCompoundDrawableRefactoring.java
index 99a6c81..b96d31a 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/UseCompoundDrawableRefactoring.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/UseCompoundDrawableRefactoring.java
@@ -353,8 +353,10 @@ public class UseCompoundDrawableRefactoring extends VisualRefactoring {
}
}
- String xml = XmlPrettyPrinter.prettyPrint(tempDocument, XmlFormatPreferences.create(),
+ String xml = XmlPrettyPrinter.prettyPrint(tempDocument.getDocumentElement(),
+ XmlFormatPreferences.create(),
XmlFormatStyle.LAYOUT, null);
+
TextEdit replace = new ReplaceEdit(mSelectionStart, mSelectionEnd - mSelectionStart, xml);
rootEdit.addChild(replace);
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/VisualRefactoring.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/VisualRefactoring.java
index 15744e8..5939a8a 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/VisualRefactoring.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/VisualRefactoring.java
@@ -294,6 +294,10 @@ public abstract class VisualRefactoring extends Refactoring {
return args;
}
+ IFile getFile() {
+ return mFile;
+ }
+
// ---- Shared functionality ----
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/changes/AndroidDocumentChange.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/changes/AndroidDocumentChange.java
index c0a9283..eb8ccc7 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/changes/AndroidDocumentChange.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/changes/AndroidDocumentChange.java
@@ -78,6 +78,15 @@ public class AndroidDocumentChange extends DocumentChange {
super(SdkConstants.FN_ANDROID_MANIFEST_XML, document);
}
+ /**
+ * Returns the manifest file
+ *
+ * @return the manifest
+ */
+ public IFile getManifest() {
+ return mAndroidManifest;
+ }
+
@Override
public RefactoringStatus isValid(IProgressMonitor pm) throws CoreException,
OperationCanceledException {
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/changes/AndroidLayoutChange.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/changes/AndroidLayoutChange.java
index 85c038d..7bac6d7 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/changes/AndroidLayoutChange.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/changes/AndroidLayoutChange.java
@@ -91,6 +91,10 @@ public class AndroidLayoutChange extends DocumentChange {
}
}
+ public IFile getFile() {
+ return mFile;
+ }
+
@Override
public String getName() {
return mFile.getName();
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/.classpath b/eclipse/plugins/com.android.ide.eclipse.tests/.classpath
index 1f464fb..ae0cb35 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/.classpath
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/.classpath
@@ -6,6 +6,7 @@
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="lib" path="kxml2-2.3.0.jar"/>
<classpathentry kind="lib" path="easymock.jar"/>
+ <classpathentry kind="lib" path="sdktestutils.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/ddmlib"/>
<classpathentry combineaccessrules="false" kind="src" path="/ddmuilib"/>
<classpathentry kind="lib" path="/plugin-adt/libs/ninepatch.jar" sourcepath="/ninepatch"/>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/META-INF/MANIFEST.MF b/eclipse/plugins/com.android.ide.eclipse.tests/META-INF/MANIFEST.MF
index c853ecb..a432c10 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/META-INF/MANIFEST.MF
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/META-INF/MANIFEST.MF
@@ -9,6 +9,7 @@ Require-Bundle: org.junit
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ClassPath: kxml2-2.3.0.jar,
.,
+ sdktestutils.jar,
layoutlib.jar,
lint_api.jar,
lint_checks.jar,
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/build.properties b/eclipse/plugins/com.android.ide.eclipse.tests/build.properties
index a79421c..436573e 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/build.properties
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/build.properties
@@ -7,6 +7,7 @@ bin.includes = META-INF/,\
prefs.template,\
unittest.xml,\
kxml2-2.3.0.jar,\
+ sdktestutils.jar,\
layoutlib.jar,\
lint_api.jar,
lint_checks.jar,
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/AdtProjectTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/AdtProjectTest.java
index 68995ae..7fb9cdb 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/AdtProjectTest.java
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/AdtProjectTest.java
@@ -19,8 +19,8 @@ import static com.android.SdkConstants.FD_RES;
import static com.android.SdkConstants.FD_RES_LAYOUT;
import static com.android.SdkConstants.FD_RES_VALUES;
-import com.android.SdkConstants;
import com.android.ide.eclipse.adt.AdtPlugin;
+import com.android.ide.eclipse.adt.AdtUtils;
import com.android.ide.eclipse.adt.internal.editors.common.CommonXmlEditor;
import com.android.ide.eclipse.adt.internal.editors.descriptors.AttributeDescriptor;
import com.android.ide.eclipse.adt.internal.editors.descriptors.ElementDescriptor;
@@ -32,7 +32,7 @@ import com.android.ide.eclipse.adt.internal.preferences.AdtPrefs;
import com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectCreator;
import com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectWizardState;
import com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectWizardState.Mode;
-import com.android.ide.eclipse.tests.SdkTestCase;
+import com.android.ide.eclipse.tests.SdkLoadingTestCase;
import com.android.sdklib.IAndroidTarget;
import org.eclipse.core.resources.IContainer;
@@ -51,31 +51,19 @@ import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.InputStream;
-import java.io.InputStreamReader;
import java.lang.reflect.InvocationTargetException;
-import java.util.Calendar;
import java.util.HashMap;
import java.util.Map;
@SuppressWarnings({"restriction", "javadoc"})
-public class AdtProjectTest extends SdkTestCase {
+public abstract class AdtProjectTest extends SdkLoadingTestCase {
private static final int TARGET_API_LEVEL = 12;
public static final String TEST_PROJECT_PACKAGE = "com.android.eclipse.tests"; //$NON-NLS-1$
-
- /** Update golden files if different from the actual results */
- private static final boolean UPDATE_DIFFERENT_FILES = false;
- /** Create golden files if missing */
- private static final boolean UPDATE_MISSING_FILES = true;
- private static final String TEST_DATA_REL_PATH =
- "eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/"
- + "internal/editors/layout/refactoring/testdata";
- private static final String PROJECTNAME_PREFIX = "testproject-";
private static final long TESTS_START_TIME = System.currentTimeMillis();
- private static File sTempDir = null;
+ private static final String PROJECTNAME_PREFIX = "testproject-";
/**
* We don't stash the project used by each test case as a field such that test cases
@@ -85,6 +73,23 @@ public class AdtProjectTest extends SdkTestCase {
private static Map<String, IProject> sProjectMap = new HashMap<String, IProject>();
@Override
+ protected String getTestDataRelPath() {
+ return "eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/"
+ + "internal/editors/layout/refactoring/testdata";
+ }
+
+ @Override
+ protected InputStream getTestResource(String relativePath, boolean expectExists) {
+ String path = "testdata" + File.separator + relativePath; //$NON-NLS-1$
+ InputStream stream =
+ AdtProjectTest.class.getResourceAsStream(path);
+ if (!expectExists && stream == null) {
+ return null;
+ }
+ return stream;
+ }
+
+ @Override
protected void setUp() throws Exception {
super.setUp();
@@ -147,7 +152,10 @@ public class AdtProjectTest extends SdkTestCase {
assertNotNull(project);
sProjectMap.put(projectName, project);
}
-
+ if (!testCaseNeedsUniqueProject() && !testNeedsUniqueProject()) {
+ addCleanupDir(AdtUtils.getAbsolutePath(project).toFile());
+ }
+ addCleanupDir(project.getFullPath().toFile());
return project;
}
@@ -243,12 +251,19 @@ public class AdtProjectTest extends SdkTestCase {
state.applicationName = name;
state.createActivity = false;
state.useDefaultLocation = true;
+ if (getMinSdk() != -1) {
+ state.minSdk = Integer.toString(getMinSdk());
+ }
NewProjectCreator creator = new NewProjectCreator(state, context);
creator.createAndroidProjects();
return validateProjectExists(name);
}
+ protected int getMinSdk() {
+ return -1;
+ }
+
public void createTestProject() {
IAndroidTarget target = null;
@@ -270,8 +285,7 @@ public class AdtProjectTest extends SdkTestCase {
}
private static IProject getProject(String name) {
- IProject iproject = ResourcesPlugin.getWorkspace().getRoot()
- .getProject(name);
+ IProject iproject = ResourcesPlugin.getWorkspace().getRoot().getProject(name);
return iproject;
}
@@ -282,33 +296,6 @@ public class AdtProjectTest extends SdkTestCase {
return getCaretOffset(fileContent, caretLocation);
}
- protected int getCaretOffset(String fileContent, String caretLocation) {
- assertTrue(caretLocation, caretLocation.contains("^")); //$NON-NLS-1$
-
- int caretDelta = caretLocation.indexOf("^"); //$NON-NLS-1$
- assertTrue(caretLocation, caretDelta != -1);
-
- // String around caret/range without the range and caret marker characters
- String caretContext;
- if (caretLocation.contains("[^")) { //$NON-NLS-1$
- caretDelta--;
- assertTrue(caretLocation, caretLocation.startsWith("[^", caretDelta)); //$NON-NLS-1$
- int caretRangeEnd = caretLocation.indexOf(']', caretDelta + 2);
- assertTrue(caretLocation, caretRangeEnd != -1);
- caretContext = caretLocation.substring(0, caretDelta)
- + caretLocation.substring(caretDelta + 2, caretRangeEnd)
- + caretLocation.substring(caretRangeEnd + 1);
- } else {
- caretContext = caretLocation.substring(0, caretDelta)
- + caretLocation.substring(caretDelta + 1); // +1: skip "^"
- }
-
- int caretContextIndex = fileContent.indexOf(caretContext);
- assertTrue("Caret content " + caretContext + " not found in file",
- caretContextIndex != -1);
- return caretContextIndex + caretDelta;
- }
-
/**
* If the given caret location string contains a selection range, select that range in
* the given viewer
@@ -361,107 +348,9 @@ public class AdtProjectTest extends SdkTestCase {
return addSelection(newFileContents, selectionBegin, selectionEnd);
}
- protected String addSelection(String newFileContents, int selectionBegin, int selectionEnd) {
- // Insert selection markers -- [ ] for the selection range, ^ for the caret
- String newFileWithCaret;
- if (selectionBegin < selectionEnd) {
- newFileWithCaret = newFileContents.substring(0, selectionBegin) + "[^"
- + newFileContents.substring(selectionBegin, selectionEnd) + "]"
- + newFileContents.substring(selectionEnd);
- } else {
- // Selected range
- newFileWithCaret = newFileContents.substring(0, selectionBegin) + "^"
- + newFileContents.substring(selectionBegin);
- }
-
- return newFileWithCaret;
- }
-
- protected String getCaretContext(String file, int offset) {
- int windowSize = 20;
- int begin = Math.max(0, offset - windowSize / 2);
- int end = Math.min(file.length(), offset + windowSize / 2);
-
- return "..." + file.substring(begin, offset) + "^" + file.substring(offset, end) + "...";
- }
-
- /**
- * Very primitive line differ, intended for files where there are very minor changes
- * (such as code completion apply-tests)
- */
- protected String getDiff(String before, String after) {
- // Do line by line analysis
- String[] beforeLines = before.split("\n");
- String[] afterLines = after.split("\n");
-
- int firstDelta = 0;
- for (; firstDelta < Math.min(beforeLines.length, afterLines.length); firstDelta++) {
- if (!beforeLines[firstDelta].equals(afterLines[firstDelta])) {
- break;
- }
- }
-
- if (firstDelta == beforeLines.length && firstDelta == afterLines.length) {
- return "";
- }
-
- // Counts from the end of both arrays
- int lastDelta = 0;
- for (; lastDelta < Math.min(beforeLines.length, afterLines.length); lastDelta++) {
- if (!beforeLines[beforeLines.length - 1 - lastDelta].equals(
- afterLines[afterLines.length - 1 - lastDelta])) {
- break;
- }
- }
-
- boolean showBeforeWindow = firstDelta >= beforeLines.length - lastDelta;
- boolean showAfterWindow = firstDelta >= afterLines.length - lastDelta;
-
- StringBuilder sb = new StringBuilder();
- if (showAfterWindow && firstDelta > 0) {
- sb.append(" ");
- sb.append(afterLines[firstDelta - 1]);
- sb.append('\n');
- }
- for (int i = firstDelta; i < beforeLines.length - lastDelta; i++) {
- sb.append("<");
- if (beforeLines[i].length() > 0) {
- sb.append(" ");
- }
- sb.append(beforeLines[i]);
- sb.append('\n');
- }
- if (showAfterWindow && lastDelta < afterLines.length - 1) {
- sb.append(" ");
- sb.append(afterLines[afterLines.length - (lastDelta -1)]);
- sb.append('\n');
- }
-
- sb.append("---\n");
-
- if (showBeforeWindow && firstDelta > 0) {
- sb.append(" ");
- sb.append(beforeLines[firstDelta - 1]);
- sb.append('\n');
- }
- for (int i = firstDelta; i < afterLines.length - lastDelta; i++) {
- sb.append(">");
- if (afterLines[i].length() > 0) {
- sb.append(" ");
- }
- sb.append(afterLines[i]);
- sb.append('\n');
- }
- if (showBeforeWindow && lastDelta < beforeLines.length - 1) {
- sb.append(" ");
- sb.append(beforeLines[beforeLines.length - (lastDelta -1)]);
- sb.append('\n');
- }
-
- return sb.toString();
- }
-
+ @Override
protected String removeSessionData(String data) {
+ data = super.removeSessionData(data);
if (getProject() != null) {
data = data.replace(getProject().getName(), "PROJECTNAME");
}
@@ -493,122 +382,6 @@ public class AdtProjectTest extends SdkTestCase {
return createNode(null, fqn, hasChildren);
}
- protected String readTestFile(String relativePath, boolean expectExists) {
- String path = "testdata" + File.separator + relativePath; //$NON-NLS-1$
- InputStream stream =
- AdtProjectTest.class.getResourceAsStream(path);
- if (!expectExists && stream == null) {
- return null;
- }
-
- assertNotNull(relativePath + " does not exist", stream);
-
- BufferedReader reader = new BufferedReader(new InputStreamReader(stream));
- String xml = AdtPlugin.readFile(reader);
- assertNotNull(xml);
- assertTrue(xml.length() > 0);
-
- // Remove any references to the project name such that we are isolated from
- // that in golden file.
- // Appears in strings.xml etc.
- xml = removeSessionData(xml);
-
- return xml;
- }
-
- protected void assertEqualsGolden(String basename, String actual) {
- assertEqualsGolden(basename, actual, basename.substring(basename.lastIndexOf('.') + 1));
- }
-
- protected void assertEqualsGolden(String basename, String actual, String newExtension) {
- String testName = getName();
- if (testName.startsWith("test")) {
- testName = testName.substring(4);
- if (Character.isUpperCase(testName.charAt(0))) {
- testName = Character.toLowerCase(testName.charAt(0)) + testName.substring(1);
- }
- }
- String expectedName;
- String extension = basename.substring(basename.lastIndexOf('.') + 1);
- if (newExtension == null) {
- newExtension = extension;
- }
- expectedName = basename.substring(0, basename.indexOf('.'))
- + "-expected-" + testName + '.' + newExtension;
- String expected = readTestFile(expectedName, false);
- if (expected == null) {
- File expectedPath = new File(
- UPDATE_MISSING_FILES ? getTargetDir() : getTempDir(), expectedName);
- AdtPlugin.writeFile(expectedPath, actual);
- System.out.println("Expected - written to " + expectedPath + ":\n");
- System.out.println(actual);
- fail("Did not find golden file (" + expectedName + "): Wrote contents as "
- + expectedPath);
- } else {
- if (!expected.replaceAll("\r\n", "\n").equals(actual.replaceAll("\r\n", "\n"))) {
- File expectedPath = new File(getTempDir(), expectedName);
- File actualPath = new File(getTempDir(),
- expectedName.replace("expected", "actual"));
- AdtPlugin.writeFile(expectedPath, expected);
- AdtPlugin.writeFile(actualPath, actual);
- // Also update data dir with the current value
- if (UPDATE_DIFFERENT_FILES) {
- AdtPlugin.writeFile( new File(getTargetDir(), expectedName), actual);
- }
- System.out.println("The files differ: diff " + expectedPath + " "
- + actualPath);
- assertEquals("The files differ - see " + expectedPath + " versus " + actualPath,
- expected, actual);
- }
- }
- }
-
- /** Get the location to write missing golden files to */
- protected File getTargetDir() {
- // Set $ADT_SDK_SOURCE_PATH to point to your git "sdk" directory; if done, then
- // if you run a unit test which refers to a golden file which does not exist, it
- // will be created directly into the test data directory and you can rerun the
- // test
- // and it should pass (after you verify that the golden file contains the correct
- // result of course).
- String sdk = System.getenv("ADT_SDK_SOURCE_PATH");
- if (sdk != null) {
- File sdkPath = new File(sdk);
- if (sdkPath.exists()) {
- File testData = new File(sdkPath, TEST_DATA_REL_PATH.replace('/',
- File.separatorChar));
- if (testData.exists()) {
- return testData;
- }
- }
- }
- return getTempDir();
- }
-
- protected File getTempDir() {
- if (SdkConstants.CURRENT_PLATFORM == SdkConstants.PLATFORM_DARWIN) {
- return new File("/tmp"); //$NON-NLS-1$
- }
-
- if (sTempDir == null) {
- // On Windows, we don't want to pollute the temp folder (which is generally
- // already incredibly busy). So let's create a temp folder for the results.
-
- File base = new File(System.getProperty("java.io.tmpdir")); //$NON-NLS-1$
-
- Calendar c = Calendar.getInstance();
- String name = String.format("adtTests_%1$tF_%1$tT", c).replace(':', '-'); //$NON-NLS-1$
- File tmpDir = new File(base, name);
- if (!tmpDir.exists() && tmpDir.mkdir()) {
- sTempDir = tmpDir;
- } else {
- sTempDir = base;
- }
- }
-
- return sTempDir;
- }
-
/** Special editor context set on the model to be rendered */
protected static class TestLayoutEditorDelegate extends LayoutEditorDelegate {
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ChangeLayoutRefactoringTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ChangeLayoutRefactoringTest.java
index 4c55323..a716a75 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ChangeLayoutRefactoringTest.java
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ChangeLayoutRefactoringTest.java
@@ -107,6 +107,11 @@ public class ChangeLayoutRefactoringTest extends RefactoringTest {
checkRefactoring(newLayoutType, basename, flatten, null);
}
+ @Override
+ protected int getMinSdk() {
+ return 14;
+ }
+
private void checkRefactoring(String newLayoutType, String basename,
boolean flatten, String initialAttributes) throws Exception {
IFile file = getLayoutFile(getProject(), basename);
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/RefactoringTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/RefactoringTest.java
index 86fc8a7..9565183 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/RefactoringTest.java
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/RefactoringTest.java
@@ -116,6 +116,9 @@ public class RefactoringTest extends AdtProjectTest {
if (change instanceof TextFileChange) {
TextFileChange tf = (TextFileChange) change;
TextEdit edit = tf.getEdit();
+ IFile file = tf.getFile();
+ String contents = AdtPlugin.readFile(file);
+ assertEquals(contents, xml);
if (edit instanceof MultiTextEdit) {
MultiTextEdit edits = (MultiTextEdit) edit;
edits.apply(document);
@@ -138,12 +141,13 @@ public class RefactoringTest extends AdtProjectTest {
}
protected void checkEdits(List<Change> changes,
- Map<IPath, String> fileToGoldenName) throws BadLocationException {
+ Map<IPath, String> fileToGoldenName) throws BadLocationException, IOException {
checkEdits(changes, fileToGoldenName, false);
}
protected void checkEdits(List<Change> changes,
- Map<IPath, String> fileToGoldenName, boolean createDiffs) throws BadLocationException {
+ Map<IPath, String> fileToGoldenName, boolean createDiffs)
+ throws BadLocationException, IOException {
for (Change change : changes) {
if (change instanceof TextFileChange) {
TextFileChange tf = (TextFileChange) change;
@@ -214,7 +218,7 @@ public class RefactoringTest extends AdtProjectTest {
* <p>
* Each file can be generated by the dump method in the ViewHierarchy.
*/
- protected ViewInfo createInfos(UiElementNode model, String relativePath) {
+ protected ViewInfo createInfos(UiElementNode model, String relativePath) throws IOException {
String basename = relativePath.substring(0, relativePath.lastIndexOf('.') + 1);
String relative = basename + "info"; //$NON-NLS-1$
String info = readTestFile(relative, true);
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/UseCompoundDrawableRefactoringTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/UseCompoundDrawableRefactoringTest.java
index e946327..01a0e1e 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/UseCompoundDrawableRefactoringTest.java
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/UseCompoundDrawableRefactoringTest.java
@@ -17,9 +17,12 @@ package com.android.ide.eclipse.adt.internal.editors.layout.refactoring;
import static com.android.ide.eclipse.adt.internal.editors.layout.refactoring.UseCompoundDrawableRefactoring.combine;
+import com.android.ide.eclipse.adt.AdtUtils;
+
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.ltk.core.refactoring.Change;
+import org.eclipse.ltk.core.refactoring.CompositeChange;
import org.w3c.dom.Element;
import java.util.List;
@@ -90,7 +93,8 @@ public class UseCompoundDrawableRefactoringTest extends RefactoringTest {
checkRefactoring("refactoring/usecompound/compound7.xml", "@+id/layout1");
}
- private void checkRefactoring(String basename, String id) throws Exception {
+ private void checkRefactoring(String basename, String id)
+ throws Exception {
IFile file = getLayoutFile(getProject(), basename);
TestContext info = setupTestContext(file, basename);
TestLayoutEditorDelegate layoutEditor = info.mLayoutEditorDelegate;
@@ -99,6 +103,12 @@ public class UseCompoundDrawableRefactoringTest extends RefactoringTest {
UseCompoundDrawableRefactoring refactoring = new UseCompoundDrawableRefactoring(
selectedElements, layoutEditor);
List<Change> changes = refactoring.computeChanges(new NullProgressMonitor());
+
+ CompositeChange cc = new CompositeChange("Combined from unit test",
+ changes.toArray(new Change[changes.size()]));
+ cc.markAsSynthetic();
+ addCleanupDir(AdtUtils.getAbsolutePath(getProject()).toFile());
+
checkEdits(basename, changes);
}
}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken1-expected-applyCompletion15.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken1-expected-applyCompletion15.diff
index 51a2cc9..4ce3540 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken1-expected-applyCompletion15.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken1-expected-applyCompletion15.diff
@@ -1,4 +1,4 @@
Code completion in broken1.xml for android:textColorHigh^ selecting android:textColorHighlight:
-< android:textColorHigh^
----
-> android:textColorHighlight="^"
+@@ -8 +8
+- android:textColorHigh^
++ android:textColorHighlight="^"
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken2-expected-applyCompletion16.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken2-expected-applyCompletion16.diff
index 21437b9..3337ad2 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken2-expected-applyCompletion16.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken2-expected-applyCompletion16.diff
@@ -1,4 +1,4 @@
Code completion in broken2.xml for style=^ selecting "@android:":
-< style=^
----
-> style="@android:^"
+@@ -9 +9
+- style=^
++ style="@android:^"
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken3-expected-applyCompletion14.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken3-expected-applyCompletion14.diff
index 3e60eb9..2787380 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken3-expected-applyCompletion14.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken3-expected-applyCompletion14.diff
@@ -1,4 +1,4 @@
Code completion in broken3.xml for <EditT^ selecting EditText />:
-< <EditT^
----
-> <EditText ^/>
+@@ -6 +6
+- <EditT^
++ <EditText ^/>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion1.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion1.diff
index d656509..6b05566 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion1.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion1.diff
@@ -1,4 +1,4 @@
Code completion in completion1.xml for layout_w^idth="fill_parent" selecting android:layout_weight:
-< android:layout_w^idth="fill_parent"
----
-> android:layout_weight^="fill_parent"
+@@ -8 +8
+- android:layout_w^idth="fill_parent"
++ android:layout_weight^="fill_parent"
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion10.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion10.diff
index 824fa25..7b448c2 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion10.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion10.diff
@@ -1,4 +1,4 @@
Code completion in completion1.xml for <T^extView selecting TableLayout:
-< <T^extView
----
-> <TableLayout^
+@@ -7 +7
+- <T^extView
++ <TableLayout^
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion11a.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion11a.diff
index 7f4ec86..1a5f24d 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion11a.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion11a.diff
@@ -1,4 +1,4 @@
Code completion in completion1.xml for ^<TextView selecting <RadioGroup ></RadioGroup>:
-< ^<TextView
----
-> <RadioGroup ^></RadioGroup><TextView
+@@ -7 +7
+- ^<TextView
++ <RadioGroup ^></RadioGroup><TextView
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion11b.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion11b.diff
index 384c4a9..9010bf6 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion11b.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion11b.diff
@@ -1,4 +1,4 @@
Code completion in completion1.xml for ^<TextView selecting <CheckBox />:
-< ^<TextView
----
-> <CheckBox ^/><TextView
+@@ -7 +7
+- ^<TextView
++ <CheckBox ^/><TextView
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion12.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion12.diff
index a4b7231..a7a4638 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion12.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion12.diff
@@ -1,4 +1,4 @@
Code completion in completion1.xml for btn_default">^</FrameLayout> selecting <FrameLayout ></FrameLayout>:
-< <FrameLayout android:foreground="@android:drawable/btn_default">^</FrameLayout>
----
-> <FrameLayout android:foreground="@android:drawable/btn_default"><FrameLayout ^></FrameLayout></FrameLayout>
+@@ -18 +18
+- <FrameLayout android:foreground="@android:drawable/btn_default">^</FrameLayout>
++ <FrameLayout android:foreground="@android:drawable/btn_default"><FrameLayout ^></FrameLayout></FrameLayout>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion2.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion2.diff
index a410606..7776131 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion2.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion2.diff
@@ -1,4 +1,4 @@
Code completion in completion1.xml for layout_width="^fill_parent" selecting match_parent:
-< android:layout_width="^fill_parent"
----
-> android:layout_width="match_parent"^
+@@ -8 +8
+- android:layout_width="^fill_parent"
++ android:layout_width="match_parent"^
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion3.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion3.diff
index 578f8ea..e67a336 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion3.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion3.diff
@@ -1,4 +1,4 @@
Code completion in completion1.xml for layout_width="fi^ll_parent" selecting fill_parent:
-< android:layout_width="fi^ll_parent"
----
-> android:layout_width="fill_parent"^
+@@ -8 +8
+- android:layout_width="fi^ll_parent"
++ android:layout_width="fill_parent"^
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion39.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion39.diff
index 577089b..fe63acd 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion39.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion39.diff
@@ -1,4 +1,4 @@
Code completion in completion1.xml for marginBottom="50"^ selecting android:maxEms:
-< android:layout_marginBottom="50"^
----
-> android:layout_marginBottom="50" android:maxEms="^"
+@@ -12 +12
+- android:layout_marginBottom="50"^
++ android:layout_marginBottom="50" android:maxEms="^"
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion4.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion4.diff
index ebbba89..2d229f3 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion4.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion4.diff
@@ -1,4 +1,4 @@
Code completion in completion1.xml for marginBottom="50^" selecting 50mm:
-< android:layout_marginBottom="50^"
----
-> android:layout_marginBottom="50mm"^
+@@ -12 +12
+- android:layout_marginBottom="50^"
++ android:layout_marginBottom="50mm"^
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion5.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion5.diff
index ba7cb0b..5a2b413 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion5.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion5.diff
@@ -1,4 +1,4 @@
Code completion in completion1.xml for layout_marginLeft="50d^p" selecting 50dp:
-< android:layout_marginLeft="50d^p"
----
-> android:layout_marginLeft="50dp"^
+@@ -11 +11
+- android:layout_marginLeft="50d^p"
++ android:layout_marginLeft="50dp"^
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion6.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion6.diff
index f1e6465..d3a8c11 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion6.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion6.diff
@@ -1,4 +1,4 @@
Code completion in completion1.xml for style="@android:^style/Widget.Button" selecting @android:drawable/:
-< style="@android:^style/Widget.Button"
----
-> style="@android:drawable/^"
+@@ -14 +14
+- style="@android:^style/Widget.Button"
++ style="@android:drawable/^"
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion7a.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion7a.diff
index 1a577db..afd7e21 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion7a.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion7a.diff
@@ -1,4 +1,4 @@
Code completion in completion1.xml for android:gravity="l^eft|bottom" selecting left:
-< android:gravity="l^eft|bottom"
----
-> android:gravity="left^"
+@@ -15 +15
+- android:gravity="l^eft|bottom"
++ android:gravity="left^"
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion7b.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion7b.diff
index 2560011..73f2bd4 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion7b.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion7b.diff
@@ -1,4 +1,4 @@
Code completion in completion1.xml for android:gravity="left|b^ottom" selecting bottom:
-< android:gravity="left|b^ottom"
----
-> android:gravity="left|bottom^"
+@@ -15 +15
+- android:gravity="left|b^ottom"
++ android:gravity="left|bottom^"
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion9.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion9.diff
index 05656fb..1b4198e 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion9.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion9.diff
@@ -1,4 +1,4 @@
Code completion in completion1.xml for layout_width=^"fill_parent" selecting "wrap_content":
-< android:layout_width=^"fill_parent"
----
-> android:layout_width="wrap_content"^
+@@ -8 +8
+- android:layout_width=^"fill_parent"
++ android:layout_width="wrap_content"^
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion10-expected-applyCompletion42.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion10-expected-applyCompletion42.diff
index dcd7f71..af28a13 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion10-expected-applyCompletion42.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion10-expected-applyCompletion42.diff
@@ -1,4 +1,4 @@
Code completion in completion10.xml for "[^wrap_content]" selecting fill_parent:
-< android:layout_height="^wrap_content"/>
----
-> android:layout_height="fill_parent"^/>
+@@ -9 +9
+- android:layout_height="^wrap_content"/>
++ android:layout_height="fill_parent"^/>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion10-expected-applyCompletion43.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion10-expected-applyCompletion43.diff
index a8d2d43..0a4d338 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion10-expected-applyCompletion43.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion10-expected-applyCompletion43.diff
@@ -1,4 +1,4 @@
Code completion in completion10.xml for "[^wrap_c]ontent" selecting fill_parent:
-< android:layout_height="^wrap_content"/>
----
-> android:layout_height="fill_parent"^/>
+@@ -9 +9
+- android:layout_height="^wrap_content"/>
++ android:layout_height="fill_parent"^/>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion11-expected-applyCompletion46.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion11-expected-applyCompletion46.diff
index 981a931..321deaa 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion11-expected-applyCompletion46.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion11-expected-applyCompletion46.diff
@@ -1,4 +1,4 @@
Code completion in completion11.xml for ?android:attr/Textapp^ selecting ?android:attr/textAppearanceLargeInverse:
-< style="?android:attr/Textapp^"
----
-> style="?android:attr/textAppearanceLargeInverse^"
+@@ -7 +7
+- style="?android:attr/Textapp^"
++ style="?android:attr/textAppearanceLargeInverse^"
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2-expected-applyCompletion13a.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2-expected-applyCompletion13a.diff
index 13e224e..b365736 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2-expected-applyCompletion13a.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2-expected-applyCompletion13a.diff
@@ -1,4 +1,4 @@
Code completion in completion2.xml for gravity="left|bottom|^cen selecting fill_vertical:
-< <TextView android:gravity="left|bottom|^cen"></TextView>
----
-> <TextView android:gravity="left|bottom|fill_vertical^"></TextView>
+@@ -4 +4
+- <TextView android:gravity="left|bottom|^cen"></TextView>
++ <TextView android:gravity="left|bottom|fill_vertical^"></TextView>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2-expected-applyCompletion13b.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2-expected-applyCompletion13b.diff
index 5d1b39e..46268af 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2-expected-applyCompletion13b.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2-expected-applyCompletion13b.diff
@@ -1,4 +1,4 @@
Code completion in completion2.xml for gravity="left|bottom|cen^ selecting center_horizontal:
-< <TextView android:gravity="left|bottom|cen^"></TextView>
----
-> <TextView android:gravity="left|bottom|center_horizontal^"></TextView>
+@@ -4 +4
+- <TextView android:gravity="left|bottom|cen^"></TextView>
++ <TextView android:gravity="left|bottom|center_horizontal^"></TextView>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2-expected-applyCompletion13c.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2-expected-applyCompletion13c.diff
index 0c7e564..bcac56d 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2-expected-applyCompletion13c.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2-expected-applyCompletion13c.diff
@@ -1,4 +1,4 @@
Code completion in completion2.xml for gravity="left|bottom^|cen selecting bottom|fill_horizontal:
-< <TextView android:gravity="left|bottom^|cen"></TextView>
----
-> <TextView android:gravity="left|bottom|fill_horizontal^"></TextView>
+@@ -4 +4
+- <TextView android:gravity="left|bottom^|cen"></TextView>
++ <TextView android:gravity="left|bottom|fill_horizontal^"></TextView>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion3-expected-applyCompletion17.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion3-expected-applyCompletion17.diff
index 14bb9ac..ef070b2 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion3-expected-applyCompletion17.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion3-expected-applyCompletion17.diff
@@ -1,4 +1,4 @@
Code completion in completion3.xml for <EditText ^/> selecting android:textColorHighlight:
-< <EditText ^/>
----
-> <EditText android:textColorHighlight="^"/>
+@@ -3 +3
+- <EditText ^/>
++ <EditText android:textColorHighlight="^"/>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion3-expected-applyCompletion18.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion3-expected-applyCompletion18.diff
index a751a3e..283636b 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion3-expected-applyCompletion18.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion3-expected-applyCompletion18.diff
@@ -1,4 +1,4 @@
Code completion in completion3.xml for <Button ^></Button> selecting android:paddingRight:
-< <Button ^></Button>
----
-> <Button android:paddingRight="^"></Button>
+@@ -4 +4
+- <Button ^></Button>
++ <Button android:paddingRight="^"></Button>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-applyCompletion19.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-applyCompletion19.diff
index 16f42b2..3f78663 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-applyCompletion19.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-applyCompletion19.diff
@@ -1,4 +1,4 @@
Code completion in completion5.xml for android:orientation='^' selecting horizontal:
-< android:orientation='^'
----
-> android:orientation='horizontal'^
+@@ -5 +5
+- android:orientation='^'
++ android:orientation='horizontal'^
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-applyCompletion20.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-applyCompletion20.diff
index dd48af1..4933d13 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-applyCompletion20.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-applyCompletion20.diff
@@ -1,4 +1,4 @@
Code completion in completion5.xml for android:layout_marginTop='50^dp' selecting 50pt:
-< android:layout_marginTop='50^dp'
----
-> android:layout_marginTop='50pt'^
+@@ -10 +10
+- android:layout_marginTop='50^dp'
++ android:layout_marginTop='50pt'^
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-applyCompletion21.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-applyCompletion21.diff
index 40e5bb1..a4c88d7 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-applyCompletion21.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-applyCompletion21.diff
@@ -1,4 +1,4 @@
Code completion in completion5.xml for android:layout_width='^wrap_content' selecting match_parent:
-< android:layout_width='^wrap_content'
----
-> android:layout_width='match_parent'^
+@@ -11 +11
+- android:layout_width='^wrap_content'
++ android:layout_width='match_parent'^
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-applyCompletion40.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-applyCompletion40.diff
index 00ffd0a..705f865 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-applyCompletion40.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-applyCompletion40.diff
@@ -1,4 +1,4 @@
Code completion in completion5.xml for android:id='@+id/button2'^ selecting android:maxWidth:
-< android:id='@+id/button2'^
----
-> android:id='@+id/button2' android:maxWidth="^"
+@@ -15 +15
+- android:id='@+id/button2'^
++ android:id='@+id/button2' android:maxWidth="^"
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion6-expected-applyCompletion22.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion6-expected-applyCompletion22.diff
index 8ea8837..92cd2f2 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion6-expected-applyCompletion22.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion6-expected-applyCompletion22.diff
@@ -1,4 +1,4 @@
Code completion in completion6.xml for android:orientation="^" selecting horizontal:
-< android:orientation="^"
----
-> android:orientation="horizontal"^
+@@ -5 +5
+- android:orientation="^"
++ android:orientation="horizontal"^
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion7-expected-applyCompletion23.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion7-expected-applyCompletion23.diff
index d874fc1..1aaadc2 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion7-expected-applyCompletion23.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion7-expected-applyCompletion23.diff
@@ -1,4 +1,4 @@
Code completion in completion7.xml for android:orientation="^ selecting horizontal:
-< android:orientation="^
----
-> android:orientation="horizontal^
+@@ -5 +5
+- android:orientation="^
++ android:orientation="horizontal^
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion8-expected-applyCompletion41.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion8-expected-applyCompletion41.diff
index 9a1b962..7678740 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion8-expected-applyCompletion41.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion8-expected-applyCompletion41.diff
@@ -1,4 +1,4 @@
Code completion in completion8.xml for android:mar^="50dp" selecting android:layout_marginRight:
-< android:mar^="50dp"
----
-> android:layout_marginRight^="50dp"
+@@ -6 +6
+- android:mar^="50dp"
++ android:layout_marginRight^="50dp"
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion24a.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion24a.diff
index 4b88448..d323219 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion24a.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion24a.diff
@@ -1,4 +1,4 @@
Code completion in completionvalues1.xml for android:textS^ize selecting android:textSelectHandleLeft:
-< <item name="android:textS^ize">17sp</item>
----
-> <item name="android:textSelectHandleLeft"^>17sp</item>
+@@ -4 +4
+- <item name="android:textS^ize">17sp</item>
++ <item name="android:textSelectHandleLeft"^>17sp</item>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion24b.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion24b.diff
index acfd3ab..ac71df7 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion24b.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion24b.diff
@@ -1,4 +1,4 @@
Code completion in completionvalues1.xml for 17^sp selecting 17mm:
-< <item name="android:textSize">17^sp</item>
----
-> <item name="android:textSize">17mm^</item>
+@@ -4 +4
+- <item name="android:textSize">17^sp</item>
++ <item name="android:textSize">17mm^</item>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion25.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion25.diff
index ba7a1f2..df6fceb 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion25.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion25.diff
@@ -1,4 +1,4 @@
Code completion in completionvalues1.xml for textColor">^@color/title_color</item> selecting @android::
-< <item name="android:textColor">^@color/title_color</item>
----
-> <item name="android:textColor">@android:^</item>
+@@ -5 +5
+- <item name="android:textColor">^@color/title_color</item>
++ <item name="android:textColor">@android:^</item>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion26.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion26.diff
index 491363b..36fce8b 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion26.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion26.diff
@@ -1,4 +1,4 @@
Code completion in completionvalues1.xml for <item name="android:shadowColor">@an^</item> selecting @android::
-< <item name="android:shadowColor">@an^</item>
----
-> <item name="android:shadowColor">@android:^</item>
+@@ -6 +6
+- <item name="android:shadowColor">@an^</item>
++ <item name="android:shadowColor">@android:^</item>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion27.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion27.diff
index 1c999c7..6315fc4 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion27.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion27.diff
@@ -1,4 +1,4 @@
Code completion in completionvalues1.xml for <item name="android:gravity">^ </item> selecting center_vertical:
-< <item name="android:gravity">^ </item>
----
-> <item name="android:gravity">center_vertical^</item>
+@@ -7 +7
+- <item name="android:gravity">^ </item>
++ <item name="android:gravity">center_vertical^</item>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion28.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion28.diff
index fbfa7a8..1db9773 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion28.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion28.diff
@@ -1,4 +1,4 @@
Code completion in completionvalues1.xml for <item name="android:gravity"> ^</item> selecting left:
-< <item name="android:gravity"> ^</item>
----
-> <item name="android:gravity"> left^</item>
+@@ -7 +7
+- <item name="android:gravity"> ^</item>
++ <item name="android:gravity"> left^</item>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion29.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion29.diff
index 3e2cf0d..6307646 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion29.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion29.diff
@@ -1,4 +1,4 @@
Code completion in completionvalues1.xml for <item name="gr^"> selecting android:gravity:
-< <item name="gr^">@color/title_color</item>
----
-> <item name="android:gravity"^>@color/title_color</item>
+@@ -8 +8
+- <item name="gr^">@color/title_color</item>
++ <item name="android:gravity"^>@color/title_color</item>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion30.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion30.diff
index 5f79eaf..c8a119f 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion30.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion30.diff
@@ -1,4 +1,4 @@
Code completion in completionvalues1.xml for <item name="an^"> selecting android:animateOnClick:
-< <item name="an^">@color/title_color</item>
----
-> <item name="android:animateOnClick"^>@color/title_color</item>
+@@ -9 +9
+- <item name="an^">@color/title_color</item>
++ <item name="android:animateOnClick"^>@color/title_color</item>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion31.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion31.diff
index 8f83183..9b37438 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion31.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion31.diff
@@ -1,4 +1,4 @@
Code completion in completionvalues1.xml for <item ^></item> selecting name:
-< <item ^></item>
----
-> <item name="^"></item>
+@@ -10 +10
+- <item ^></item>
++ <item name="^"></item>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion32.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion32.diff
index 1a68f13..b34a8ec 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion32.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion32.diff
@@ -1,4 +1,4 @@
Code completion in completionvalues1.xml for <item name="^"></item> selecting android:background:
-< <item name="^"></item>
----
-> <item name="android:background"^></item>
+@@ -11 +11
+- <item name="^"></item>
++ <item name="android:background"^></item>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion33.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion33.diff
index 1a61da3..b78adee 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion33.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion33.diff
@@ -1,4 +1,4 @@
Code completion in completionvalues1.xml for <item name="android:allowSingleTap">^</item> selecting true:
-< <item name="android:allowSingleTap">^</item>
----
-> <item name="android:allowSingleTap">true^</item>
+@@ -12 +12
+- <item name="android:allowSingleTap">^</item>
++ <item name="android:allowSingleTap">true^</item>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion34.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion34.diff
index da4d30f..5af6c92 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion34.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion34.diff
@@ -1,4 +1,4 @@
Code completion in completionvalues1.xml for <item name="android:alwaysDrawnWithCache">^ false </item> selecting true:
-< <item name="android:alwaysDrawnWithCache">^ false </item>
----
-> <item name="android:alwaysDrawnWithCache">true^</item>
+@@ -13 +13
+- <item name="android:alwaysDrawnWithCache">^ false </item>
++ <item name="android:alwaysDrawnWithCache">true^</item>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion35.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion35.diff
index 4334c9f..f48f101 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion35.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion35.diff
@@ -1,4 +1,4 @@
Code completion in completionvalues1.xml for <item name="android:alwaysDrawnWithCache"> ^false </item> selecting true:
-< <item name="android:alwaysDrawnWithCache"> ^false </item>
----
-> <item name="android:alwaysDrawnWithCache"> true^</item>
+@@ -13 +13
+- <item name="android:alwaysDrawnWithCache"> ^false </item>
++ <item name="android:alwaysDrawnWithCache"> true^</item>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion36.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion36.diff
index 2c9f547..8c246a8 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion36.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion36.diff
@@ -1,4 +1,4 @@
Code completion in completionvalues1.xml for <item name="android:alwaysDrawnWithCache"> f^alse </item> selecting false:
-< <item name="android:alwaysDrawnWithCache"> f^alse </item>
----
-> <item name="android:alwaysDrawnWithCache"> false^</item>
+@@ -13 +13
+- <item name="android:alwaysDrawnWithCache"> f^alse </item>
++ <item name="android:alwaysDrawnWithCache"> false^</item>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion37.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion37.diff
index 195e159..082f2b2 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion37.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion37.diff
@@ -1,4 +1,4 @@
Code completion in completionvalues1.xml for <item name="android:orientation">h^</item> selecting horizontal:
-< <item name="android:orientation">h^</item>
----
-> <item name="android:orientation">horizontal^</item>
+@@ -14 +14
+- <item name="android:orientation">h^</item>
++ <item name="android:orientation">horizontal^</item>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion38.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion38.diff
index 0e81810..47580e1 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion38.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion38.diff
@@ -1,4 +1,4 @@
Code completion in completionvalues1.xml for c^ selecting center:
-< c^
----
-> center^
+@@ -16 +16
+- c^
++ center^
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion44.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion44.diff
index 7a845b3..57fe472 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion44.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion44.diff
@@ -1,4 +1,4 @@
Code completion in completionvalues1.xml for [^false] selecting true:
-< <item name="android:alwaysDrawnWithCache"> ^false </item>
----
-> <item name="android:alwaysDrawnWithCache"> true^</item>
+@@ -13 +13
+- <item name="android:alwaysDrawnWithCache"> ^false </item>
++ <item name="android:alwaysDrawnWithCache"> true^</item>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract1b.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract1b.diff
index 95d078c..e21c594 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract1b.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract1b.diff
@@ -1,34 +1,34 @@
-< android:layout_width="wrap_content" android:layout_height="match_parent">
-< <Button android:text="Button"
-< android:layout_width="wrap_content" android:layout_height="wrap_content"
-< android:textColor="#FF0000" android:textSize="20pt"
-< android:id="@+id/button1" android:layout_alignParentBottom="true"></Button>
-< <Button android:text="Button"
-< android:layout_width="wrap_content" android:layout_height="fill_parent"
-< android:textColor="#FF00FF" android:textSize="20pt"
-< android:id="@+id/button2" android:layout_alignParentBottom="true"></Button>
----
-> android:layout_width="wrap_content"
-> android:layout_height="match_parent" >
->
-> <Button
-> android:id="@+id/button1"
-> android:layout_width="wrap_content"
-> android:layout_height="wrap_content"
-> android:layout_alignParentBottom="true"
-> android:text="Button"
-> android:textColor="#FF0000"
-> android:textSize="20pt" >
-> </Button>
->
-> <Button
-> android:id="@+id/button2"
-> style="@style/newstyle"
-> android:layout_width="wrap_content"
-> android:layout_height="fill_parent"
-> android:layout_alignParentBottom="true"
-> android:text="Button"
-> android:textColor="#FF00FF"
-> android:textSize="20pt" >
-> </Button>
->
+@@ -2 +2
+- android:layout_width="wrap_content" android:layout_height="match_parent">
+- <Button android:text="Button"
+- android:layout_width="wrap_content" android:layout_height="wrap_content"
+- android:textColor="#FF0000" android:textSize="20pt"
+- android:id="@+id/button1" android:layout_alignParentBottom="true"></Button>
+- <Button android:text="Button"
+- android:layout_width="wrap_content" android:layout_height="fill_parent"
+- android:textColor="#FF00FF" android:textSize="20pt"
+- android:id="@+id/button2" android:layout_alignParentBottom="true"></Button>
++ android:layout_width="wrap_content"
++ android:layout_height="match_parent" >
++
++ <Button
++ android:id="@+id/button1"
++ android:layout_width="wrap_content"
++ android:layout_height="wrap_content"
++ android:layout_alignParentBottom="true"
++ android:text="Button"
++ android:textColor="#FF0000"
++ android:textSize="20pt" >
++ </Button>
++
++ <Button
++ android:id="@+id/button2"
++ style="@style/newstyle"
++ android:layout_width="wrap_content"
++ android:layout_height="fill_parent"
++ android:layout_alignParentBottom="true"
++ android:text="Button"
++ android:textColor="#FF00FF"
++ android:textSize="20pt" >
++ </Button>
++
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract1c.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract1c.diff
index 3c3d47f..8c12b7c 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract1c.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract1c.diff
@@ -1,31 +1,31 @@
-< android:layout_width="wrap_content" android:layout_height="match_parent">
-< <Button android:text="Button"
-< android:layout_width="wrap_content" android:layout_height="wrap_content"
-< android:textColor="#FF0000" android:textSize="20pt"
-< android:id="@+id/button1" android:layout_alignParentBottom="true"></Button>
-< <Button android:text="Button"
-< android:layout_width="wrap_content" android:layout_height="fill_parent"
-< android:textColor="#FF00FF" android:textSize="20pt"
-< android:id="@+id/button2" android:layout_alignParentBottom="true"></Button>
----
-> android:layout_width="wrap_content"
-> android:layout_height="match_parent" >
->
-> <Button
-> android:id="@+id/button1"
-> android:layout_width="wrap_content"
-> android:layout_height="wrap_content"
-> android:layout_alignParentBottom="true"
-> android:text="Button"
-> android:textColor="#FF0000"
-> android:textSize="20pt" >
-> </Button>
->
-> <Button
-> android:id="@+id/button2"
-> android:layout_width="wrap_content"
-> android:layout_height="fill_parent"
-> android:layout_alignParentBottom="true"
-> android:text="Button" >
-> </Button>
->
+@@ -2 +2
+- android:layout_width="wrap_content" android:layout_height="match_parent">
+- <Button android:text="Button"
+- android:layout_width="wrap_content" android:layout_height="wrap_content"
+- android:textColor="#FF0000" android:textSize="20pt"
+- android:id="@+id/button1" android:layout_alignParentBottom="true"></Button>
+- <Button android:text="Button"
+- android:layout_width="wrap_content" android:layout_height="fill_parent"
+- android:textColor="#FF00FF" android:textSize="20pt"
+- android:id="@+id/button2" android:layout_alignParentBottom="true"></Button>
++ android:layout_width="wrap_content"
++ android:layout_height="match_parent" >
++
++ <Button
++ android:id="@+id/button1"
++ android:layout_width="wrap_content"
++ android:layout_height="wrap_content"
++ android:layout_alignParentBottom="true"
++ android:text="Button"
++ android:textColor="#FF0000"
++ android:textSize="20pt" >
++ </Button>
++
++ <Button
++ android:id="@+id/button2"
++ android:layout_width="wrap_content"
++ android:layout_height="fill_parent"
++ android:layout_alignParentBottom="true"
++ android:text="Button" >
++ </Button>
++
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract1d.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract1d.diff
index 33ff9db..c819b09 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract1d.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract1d.diff
@@ -1,32 +1,32 @@
-< android:layout_width="wrap_content" android:layout_height="match_parent">
-< <Button android:text="Button"
-< android:layout_width="wrap_content" android:layout_height="wrap_content"
-< android:textColor="#FF0000" android:textSize="20pt"
-< android:id="@+id/button1" android:layout_alignParentBottom="true"></Button>
-< <Button android:text="Button"
-< android:layout_width="wrap_content" android:layout_height="fill_parent"
-< android:textColor="#FF00FF" android:textSize="20pt"
-< android:id="@+id/button2" android:layout_alignParentBottom="true"></Button>
----
-> android:layout_width="wrap_content"
-> android:layout_height="match_parent" >
->
-> <Button
-> android:id="@+id/button1"
-> android:layout_width="wrap_content"
-> android:layout_height="wrap_content"
-> android:layout_alignParentBottom="true"
-> android:text="Button"
-> android:textColor="#FF0000"
-> android:textSize="20pt" >
-> </Button>
->
-> <Button
-> android:id="@+id/button2"
-> style="@style/newstyle"
-> android:layout_width="wrap_content"
-> android:layout_height="fill_parent"
-> android:layout_alignParentBottom="true"
-> android:text="Button" >
-> </Button>
->
+@@ -2 +2
+- android:layout_width="wrap_content" android:layout_height="match_parent">
+- <Button android:text="Button"
+- android:layout_width="wrap_content" android:layout_height="wrap_content"
+- android:textColor="#FF0000" android:textSize="20pt"
+- android:id="@+id/button1" android:layout_alignParentBottom="true"></Button>
+- <Button android:text="Button"
+- android:layout_width="wrap_content" android:layout_height="fill_parent"
+- android:textColor="#FF00FF" android:textSize="20pt"
+- android:id="@+id/button2" android:layout_alignParentBottom="true"></Button>
++ android:layout_width="wrap_content"
++ android:layout_height="match_parent" >
++
++ <Button
++ android:id="@+id/button1"
++ android:layout_width="wrap_content"
++ android:layout_height="wrap_content"
++ android:layout_alignParentBottom="true"
++ android:text="Button"
++ android:textColor="#FF0000"
++ android:textSize="20pt" >
++ </Button>
++
++ <Button
++ android:id="@+id/button2"
++ style="@style/newstyle"
++ android:layout_width="wrap_content"
++ android:layout_height="fill_parent"
++ android:layout_alignParentBottom="true"
++ android:text="Button" >
++ </Button>
++
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract2.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract2.diff
index 33ff9db..c819b09 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract2.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract2.diff
@@ -1,32 +1,32 @@
-< android:layout_width="wrap_content" android:layout_height="match_parent">
-< <Button android:text="Button"
-< android:layout_width="wrap_content" android:layout_height="wrap_content"
-< android:textColor="#FF0000" android:textSize="20pt"
-< android:id="@+id/button1" android:layout_alignParentBottom="true"></Button>
-< <Button android:text="Button"
-< android:layout_width="wrap_content" android:layout_height="fill_parent"
-< android:textColor="#FF00FF" android:textSize="20pt"
-< android:id="@+id/button2" android:layout_alignParentBottom="true"></Button>
----
-> android:layout_width="wrap_content"
-> android:layout_height="match_parent" >
->
-> <Button
-> android:id="@+id/button1"
-> android:layout_width="wrap_content"
-> android:layout_height="wrap_content"
-> android:layout_alignParentBottom="true"
-> android:text="Button"
-> android:textColor="#FF0000"
-> android:textSize="20pt" >
-> </Button>
->
-> <Button
-> android:id="@+id/button2"
-> style="@style/newstyle"
-> android:layout_width="wrap_content"
-> android:layout_height="fill_parent"
-> android:layout_alignParentBottom="true"
-> android:text="Button" >
-> </Button>
->
+@@ -2 +2
+- android:layout_width="wrap_content" android:layout_height="match_parent">
+- <Button android:text="Button"
+- android:layout_width="wrap_content" android:layout_height="wrap_content"
+- android:textColor="#FF0000" android:textSize="20pt"
+- android:id="@+id/button1" android:layout_alignParentBottom="true"></Button>
+- <Button android:text="Button"
+- android:layout_width="wrap_content" android:layout_height="fill_parent"
+- android:textColor="#FF00FF" android:textSize="20pt"
+- android:id="@+id/button2" android:layout_alignParentBottom="true"></Button>
++ android:layout_width="wrap_content"
++ android:layout_height="match_parent" >
++
++ <Button
++ android:id="@+id/button1"
++ android:layout_width="wrap_content"
++ android:layout_height="wrap_content"
++ android:layout_alignParentBottom="true"
++ android:text="Button"
++ android:textColor="#FF0000"
++ android:textSize="20pt" >
++ </Button>
++
++ <Button
++ android:id="@+id/button2"
++ style="@style/newstyle"
++ android:layout_width="wrap_content"
++ android:layout_height="fill_parent"
++ android:layout_alignParentBottom="true"
++ android:text="Button" >
++ </Button>
++
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract3.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract3.diff
index e4d3412..36186b8 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract3.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract3.diff
@@ -1,32 +1,32 @@
-< android:layout_width="wrap_content" android:layout_height="match_parent">
-< <Button android:text="Button"
-< android:layout_width="wrap_content" android:layout_height="wrap_content"
-< android:textColor="#FF0000" android:textSize="20pt"
-< android:id="@+id/button1" android:layout_alignParentBottom="true"></Button>
-< <Button android:text="Button"
-< android:layout_width="wrap_content" android:layout_height="fill_parent"
-< android:textColor="#FF00FF" android:textSize="20pt"
-< android:id="@+id/button2" android:layout_alignParentBottom="true"></Button>
----
-> android:layout_width="wrap_content"
-> android:layout_height="match_parent" >
->
-> <Button
-> android:id="@+id/button1"
-> style="@style/newstyle"
-> android:layout_width="wrap_content"
-> android:layout_height="wrap_content"
-> android:layout_alignParentBottom="true"
-> android:text="Button" >
-> </Button>
->
-> <Button
-> android:id="@+id/button2"
-> style="@style/newstyle"
-> android:layout_width="wrap_content"
-> android:layout_height="fill_parent"
-> android:layout_alignParentBottom="true"
-> android:text="Button"
-> android:textColor="#FF00FF" >
-> </Button>
->
+@@ -2 +2
+- android:layout_width="wrap_content" android:layout_height="match_parent">
+- <Button android:text="Button"
+- android:layout_width="wrap_content" android:layout_height="wrap_content"
+- android:textColor="#FF0000" android:textSize="20pt"
+- android:id="@+id/button1" android:layout_alignParentBottom="true"></Button>
+- <Button android:text="Button"
+- android:layout_width="wrap_content" android:layout_height="fill_parent"
+- android:textColor="#FF00FF" android:textSize="20pt"
+- android:id="@+id/button2" android:layout_alignParentBottom="true"></Button>
++ android:layout_width="wrap_content"
++ android:layout_height="match_parent" >
++
++ <Button
++ android:id="@+id/button1"
++ style="@style/newstyle"
++ android:layout_width="wrap_content"
++ android:layout_height="wrap_content"
++ android:layout_alignParentBottom="true"
++ android:text="Button" >
++ </Button>
++
++ <Button
++ android:id="@+id/button2"
++ style="@style/newstyle"
++ android:layout_width="wrap_content"
++ android:layout_height="fill_parent"
++ android:layout_alignParentBottom="true"
++ android:text="Button"
++ android:textColor="#FF00FF" >
++ </Button>
++
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract4.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract4.diff
index 9094011..83837f5 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract4.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract4.diff
@@ -1,33 +1,33 @@
-< android:layout_width="wrap_content" android:layout_height="match_parent">
-< <Button android:text="Button"
-< android:layout_width="wrap_content" android:layout_height="wrap_content"
-< android:textColor="#FF0000" android:textSize="20pt"
-< android:id="@+id/button1" android:layout_alignParentBottom="true"></Button>
-< <Button android:text="Button"
-< android:layout_width="wrap_content" android:layout_height="fill_parent"
-< android:textColor="#FF00FF" android:textSize="20pt"
-< android:id="@+id/button2" android:layout_alignParentBottom="true"></Button>
----
-> android:layout_width="wrap_content"
-> android:layout_height="match_parent" >
->
-> <Button
-> android:id="@+id/button1"
-> android:layout_width="wrap_content"
-> android:layout_height="wrap_content"
-> android:layout_alignParentBottom="true"
-> android:text="Button"
-> android:textColor="#FF0000"
-> android:textSize="20pt" >
-> </Button>
->
-> <Button
-> android:id="@+id/button2"
-> style="@style/newstyle"
-> android:layout_width="wrap_content"
-> android:layout_height="fill_parent"
-> android:layout_alignParentBottom="true"
-> android:text="Button"
-> android:textSize="20pt" >
-> </Button>
->
+@@ -2 +2
+- android:layout_width="wrap_content" android:layout_height="match_parent">
+- <Button android:text="Button"
+- android:layout_width="wrap_content" android:layout_height="wrap_content"
+- android:textColor="#FF0000" android:textSize="20pt"
+- android:id="@+id/button1" android:layout_alignParentBottom="true"></Button>
+- <Button android:text="Button"
+- android:layout_width="wrap_content" android:layout_height="fill_parent"
+- android:textColor="#FF00FF" android:textSize="20pt"
+- android:id="@+id/button2" android:layout_alignParentBottom="true"></Button>
++ android:layout_width="wrap_content"
++ android:layout_height="match_parent" >
++
++ <Button
++ android:id="@+id/button1"
++ android:layout_width="wrap_content"
++ android:layout_height="wrap_content"
++ android:layout_alignParentBottom="true"
++ android:text="Button"
++ android:textColor="#FF0000"
++ android:textSize="20pt" >
++ </Button>
++
++ <Button
++ android:id="@+id/button2"
++ style="@style/newstyle"
++ android:layout_width="wrap_content"
++ android:layout_height="fill_parent"
++ android:layout_alignParentBottom="true"
++ android:text="Button"
++ android:textSize="20pt" >
++ </Button>
++
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract5.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract5.diff
index c7cdba6..55d658d 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract5.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract5.diff
@@ -1,33 +1,33 @@
-< android:layout_width="wrap_content" android:layout_height="match_parent">
-< <Button android:text="Button"
-< android:layout_width="wrap_content" android:layout_height="wrap_content"
-< android:textColor="#FF0000" android:textSize="20pt"
-< android:id="@+id/button1" android:layout_alignParentBottom="true"></Button>
-< <Button android:text="Button"
-< android:layout_width="wrap_content" android:layout_height="fill_parent"
-< android:textColor="#FF00FF" android:textSize="20pt"
-< android:id="@+id/button2" android:layout_alignParentBottom="true"></Button>
----
-> android:layout_width="wrap_content"
-> android:layout_height="match_parent" >
->
-> <Button
-> android:id="@+id/button1"
-> style="@style/newstyle"
-> android:layout_width="wrap_content"
-> android:layout_height="wrap_content"
-> android:layout_alignParentBottom="true"
-> android:text="Button"
-> android:textColor="#FF0000" >
-> </Button>
->
-> <Button
-> android:id="@+id/button2"
-> android:layout_width="wrap_content"
-> android:layout_height="fill_parent"
-> android:layout_alignParentBottom="true"
-> android:text="Button"
-> android:textColor="#FF00FF"
-> android:textSize="20pt" >
-> </Button>
->
+@@ -2 +2
+- android:layout_width="wrap_content" android:layout_height="match_parent">
+- <Button android:text="Button"
+- android:layout_width="wrap_content" android:layout_height="wrap_content"
+- android:textColor="#FF0000" android:textSize="20pt"
+- android:id="@+id/button1" android:layout_alignParentBottom="true"></Button>
+- <Button android:text="Button"
+- android:layout_width="wrap_content" android:layout_height="fill_parent"
+- android:textColor="#FF00FF" android:textSize="20pt"
+- android:id="@+id/button2" android:layout_alignParentBottom="true"></Button>
++ android:layout_width="wrap_content"
++ android:layout_height="match_parent" >
++
++ <Button
++ android:id="@+id/button1"
++ style="@style/newstyle"
++ android:layout_width="wrap_content"
++ android:layout_height="wrap_content"
++ android:layout_alignParentBottom="true"
++ android:text="Button"
++ android:textColor="#FF0000" >
++ </Button>
++
++ <Button
++ android:id="@+id/button2"
++ android:layout_width="wrap_content"
++ android:layout_height="fill_parent"
++ android:layout_alignParentBottom="true"
++ android:text="Button"
++ android:textColor="#FF00FF"
++ android:textSize="20pt" >
++ </Button>
++
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract8.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract8.diff
index 3c3d47f..8c12b7c 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract8.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract8.diff
@@ -1,31 +1,31 @@
-< android:layout_width="wrap_content" android:layout_height="match_parent">
-< <Button android:text="Button"
-< android:layout_width="wrap_content" android:layout_height="wrap_content"
-< android:textColor="#FF0000" android:textSize="20pt"
-< android:id="@+id/button1" android:layout_alignParentBottom="true"></Button>
-< <Button android:text="Button"
-< android:layout_width="wrap_content" android:layout_height="fill_parent"
-< android:textColor="#FF00FF" android:textSize="20pt"
-< android:id="@+id/button2" android:layout_alignParentBottom="true"></Button>
----
-> android:layout_width="wrap_content"
-> android:layout_height="match_parent" >
->
-> <Button
-> android:id="@+id/button1"
-> android:layout_width="wrap_content"
-> android:layout_height="wrap_content"
-> android:layout_alignParentBottom="true"
-> android:text="Button"
-> android:textColor="#FF0000"
-> android:textSize="20pt" >
-> </Button>
->
-> <Button
-> android:id="@+id/button2"
-> android:layout_width="wrap_content"
-> android:layout_height="fill_parent"
-> android:layout_alignParentBottom="true"
-> android:text="Button" >
-> </Button>
->
+@@ -2 +2
+- android:layout_width="wrap_content" android:layout_height="match_parent">
+- <Button android:text="Button"
+- android:layout_width="wrap_content" android:layout_height="wrap_content"
+- android:textColor="#FF0000" android:textSize="20pt"
+- android:id="@+id/button1" android:layout_alignParentBottom="true"></Button>
+- <Button android:text="Button"
+- android:layout_width="wrap_content" android:layout_height="fill_parent"
+- android:textColor="#FF00FF" android:textSize="20pt"
+- android:id="@+id/button2" android:layout_alignParentBottom="true"></Button>
++ android:layout_width="wrap_content"
++ android:layout_height="match_parent" >
++
++ <Button
++ android:id="@+id/button1"
++ android:layout_width="wrap_content"
++ android:layout_height="wrap_content"
++ android:layout_alignParentBottom="true"
++ android:text="Button"
++ android:textColor="#FF0000"
++ android:textSize="20pt" >
++ </Button>
++
++ <Button
++ android:id="@+id/button2"
++ android:layout_width="wrap_content"
++ android:layout_height="fill_parent"
++ android:layout_alignParentBottom="true"
++ android:text="Button" >
++ </Button>
++
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle2-expected-extract7.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle2-expected-extract7.diff
index a4dd387..bb2960e 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle2-expected-extract7.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle2-expected-extract7.diff
@@ -1,33 +1,33 @@
-< foo:layout_width="wrap_content" foo:layout_height="match_parent" foo:orientation="vertical">
-< <Button foo:text="Button"
-< foo:layout_width="wrap_content" foo:layout_height="wrap_content"
-< foo:textColor="#FF0000" foo:textSize="20pt"
-< foo:id="@+id/button1" foo:layout_alignParentBottom="true"></Button>
-< <Button foo:text="Button"
-< foo:layout_width="wrap_content" foo:layout_height="fill_parent"
-< foo:textColor="#00FF00" foo:textSize="20pt"
-< foo:id="@+id/button2" foo:layout_alignParentBottom="true"></Button>
----
-> foo:layout_width="wrap_content"
-> foo:layout_height="match_parent"
-> foo:orientation="vertical" >
->
-> <Button
-> foo:id="@+id/button1"
-> style="@style/newstyle"
-> foo:layout_width="wrap_content"
-> foo:layout_height="wrap_content"
-> foo:layout_alignParentBottom="true"
-> foo:text="Button"
-> foo:textColor="#FF0000" >
-> </Button>
->
-> <Button
-> foo:id="@+id/button2"
-> style="@style/newstyle"
-> foo:layout_width="wrap_content"
-> foo:layout_height="fill_parent"
-> foo:layout_alignParentBottom="true"
-> foo:text="Button" >
-> </Button>
->
+@@ -2 +2
+- foo:layout_width="wrap_content" foo:layout_height="match_parent" foo:orientation="vertical">
+- <Button foo:text="Button"
+- foo:layout_width="wrap_content" foo:layout_height="wrap_content"
+- foo:textColor="#FF0000" foo:textSize="20pt"
+- foo:id="@+id/button1" foo:layout_alignParentBottom="true"></Button>
+- <Button foo:text="Button"
+- foo:layout_width="wrap_content" foo:layout_height="fill_parent"
+- foo:textColor="#00FF00" foo:textSize="20pt"
+- foo:id="@+id/button2" foo:layout_alignParentBottom="true"></Button>
++ foo:layout_width="wrap_content"
++ foo:layout_height="match_parent"
++ foo:orientation="vertical" >
++
++ <Button
++ foo:id="@+id/button1"
++ style="@style/newstyle"
++ foo:layout_width="wrap_content"
++ foo:layout_height="wrap_content"
++ foo:layout_alignParentBottom="true"
++ foo:text="Button"
++ foo:textColor="#FF0000" >
++ </Button>
++
++ <Button
++ foo:id="@+id/button2"
++ style="@style/newstyle"
++ foo:layout_width="wrap_content"
++ foo:layout_height="fill_parent"
++ foo:layout_alignParentBottom="true"
++ foo:text="Button" >
++ </Button>
++
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigationstyles-expected-extract2.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigationstyles-expected-extract2.diff
index 141180b..8890f79 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigationstyles-expected-extract2.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigationstyles-expected-extract2.diff
@@ -1,6 +1,5 @@
----
- </style>
-> <style name="newstyle">
-> <item name="android:textColor">#FF00FF</item>
-> <item name="android:textSize">20pt</item>
- </resources>
+@@ -28 +28
++ <style name="newstyle">
++ <item name="android:textColor">#FF00FF</item>
++ <item name="android:textSize">20pt</item>
++ </style>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newlayout6-expected-extract6.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newlayout6-expected-extract6.diff
index 1958ae5..6772a8f 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newlayout6-expected-extract6.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newlayout6-expected-extract6.diff
@@ -1,11 +1,12 @@
-<
----
-> <?xml version="1.0" encoding="utf-8"?>
-> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="wrap_content" android:id="@+id/linearLayout4" android:layout_width="match_parent">
-> <LinearLayout android:layout_height="match_parent" android:id="@+id/linearLayout5" android:layout_width="wrap_content">
-> <LinearLayout android:layout_height="match_parent" android:id="@+id/linearLayout6" android:layout_width="wrap_content">
-> <!-- Comment -->
-> <Button android:text="Button" android:id="@+id/button6" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
-> </LinearLayout>
-> </LinearLayout>
-> </LinearLayout>
+@@ -1 +1
+-
+@@ -2 +1
++ <?xml version="1.0" encoding="utf-8"?>
++ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="wrap_content" android:id="@+id/linearLayout4" android:layout_width="match_parent">
++ <LinearLayout android:layout_height="match_parent" android:id="@+id/linearLayout5" android:layout_width="wrap_content">
++ <LinearLayout android:layout_height="match_parent" android:id="@+id/linearLayout6" android:layout_width="wrap_content">
++ <!-- Comment -->
++ <Button android:text="Button" android:id="@+id/button6" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
++ </LinearLayout>
++ </LinearLayout>
++ </LinearLayout>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newlayout6-expected-extract7.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newlayout6-expected-extract7.diff
index 871a14d..d0fdc92 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newlayout6-expected-extract7.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newlayout6-expected-extract7.diff
@@ -1,30 +1,29 @@
-<
----
-> <?xml version="1.0" encoding="utf-8"?>
-> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-> android:id="@+id/linearLayout4"
-> android:layout_width="match_parent"
-> android:layout_height="wrap_content" >
->
-> <LinearLayout
-> android:id="@+id/linearLayout5"
-> android:layout_width="wrap_content"
-> android:layout_height="match_parent" >
->
-> <LinearLayout
-> android:id="@+id/linearLayout6"
-> android:layout_width="wrap_content"
-> android:layout_height="match_parent" >
->
-> <!-- Comment -->
->
-> <Button
-> android:id="@+id/button6"
-> android:layout_width="wrap_content"
-> android:layout_height="wrap_content"
-> android:text="Button" >
-> </Button>
-> </LinearLayout>
-> </LinearLayout>
->
-> </LinearLayout>
+@@ -1 +1
++ <?xml version="1.0" encoding="utf-8"?>
++ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
++ android:id="@+id/linearLayout4"
++ android:layout_width="match_parent"
++ android:layout_height="wrap_content" >
+@@ -2 +7
++ <LinearLayout
++ android:id="@+id/linearLayout5"
++ android:layout_width="wrap_content"
++ android:layout_height="match_parent" >
++
++ <LinearLayout
++ android:id="@+id/linearLayout6"
++ android:layout_width="wrap_content"
++ android:layout_height="match_parent" >
++
++ <!-- Comment -->
++
++ <Button
++ android:id="@+id/button6"
++ android:layout_width="wrap_content"
++ android:layout_height="wrap_content"
++ android:text="Button" >
++ </Button>
++ </LinearLayout>
++ </LinearLayout>
++
++ </LinearLayout>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles-expected-extract1.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles-expected-extract1.diff
index 7f076e7..0949fbd 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles-expected-extract1.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles-expected-extract1.diff
@@ -1,9 +1,10 @@
-<
----
-> <?xml version="1.0" encoding="utf-8"?>
-> <resources xmlns:android="http://schemas.android.com/apk/res/android">
-> <style name="newstyle">
-> <item name="android:textColor">#FF00FF</item>
-> <item name="android:textSize">20pt</item>
-> </style>
-> </resources>
+@@ -1 +1
+-
+@@ -2 +1
++ <?xml version="1.0" encoding="utf-8"?>
++ <resources xmlns:android="http://schemas.android.com/apk/res/android">
++ <style name="newstyle">
++ <item name="android:textColor">#FF00FF</item>
++ <item name="android:textSize">20pt</item>
++ </style>
++ </resources>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles2-expected-extract1b.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles2-expected-extract1b.diff
index 7f076e7..0949fbd 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles2-expected-extract1b.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles2-expected-extract1b.diff
@@ -1,9 +1,10 @@
-<
----
-> <?xml version="1.0" encoding="utf-8"?>
-> <resources xmlns:android="http://schemas.android.com/apk/res/android">
-> <style name="newstyle">
-> <item name="android:textColor">#FF00FF</item>
-> <item name="android:textSize">20pt</item>
-> </style>
-> </resources>
+@@ -1 +1
+-
+@@ -2 +1
++ <?xml version="1.0" encoding="utf-8"?>
++ <resources xmlns:android="http://schemas.android.com/apk/res/android">
++ <style name="newstyle">
++ <item name="android:textColor">#FF00FF</item>
++ <item name="android:textSize">20pt</item>
++ </style>
++ </resources>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles3-expected-extract1c.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles3-expected-extract1c.diff
index 7f076e7..0949fbd 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles3-expected-extract1c.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles3-expected-extract1c.diff
@@ -1,9 +1,10 @@
-<
----
-> <?xml version="1.0" encoding="utf-8"?>
-> <resources xmlns:android="http://schemas.android.com/apk/res/android">
-> <style name="newstyle">
-> <item name="android:textColor">#FF00FF</item>
-> <item name="android:textSize">20pt</item>
-> </style>
-> </resources>
+@@ -1 +1
+-
+@@ -2 +1
++ <?xml version="1.0" encoding="utf-8"?>
++ <resources xmlns:android="http://schemas.android.com/apk/res/android">
++ <style name="newstyle">
++ <item name="android:textColor">#FF00FF</item>
++ <item name="android:textSize">20pt</item>
++ </style>
++ </resources>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles3-expected-extract8.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles3-expected-extract8.diff
index 01d0697..e8b553e 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles3-expected-extract8.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles3-expected-extract8.diff
@@ -1,9 +1,10 @@
-<
----
-> <?xml version="1.0" encoding="utf-8"?>
-> <resources xmlns:android="http://schemas.android.com/apk/res/android">
-> <style name="newstyle" parent="android:Widget.Button">
-> <item name="android:textColor">#FF00FF</item>
-> <item name="android:textSize">20pt</item>
-> </style>
-> </resources>
+@@ -1 +1
+-
+@@ -2 +1
++ <?xml version="1.0" encoding="utf-8"?>
++ <resources xmlns:android="http://schemas.android.com/apk/res/android">
++ <style name="newstyle" parent="android:Widget.Button">
++ <item name="android:textColor">#FF00FF</item>
++ <item name="android:textSize">20pt</item>
++ </style>
++ </resources>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles4-expected-extract1d.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles4-expected-extract1d.diff
index 7f076e7..0949fbd 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles4-expected-extract1d.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles4-expected-extract1d.diff
@@ -1,9 +1,10 @@
-<
----
-> <?xml version="1.0" encoding="utf-8"?>
-> <resources xmlns:android="http://schemas.android.com/apk/res/android">
-> <style name="newstyle">
-> <item name="android:textColor">#FF00FF</item>
-> <item name="android:textSize">20pt</item>
-> </style>
-> </resources>
+@@ -1 +1
+-
+@@ -2 +1
++ <?xml version="1.0" encoding="utf-8"?>
++ <resources xmlns:android="http://schemas.android.com/apk/res/android">
++ <style name="newstyle">
++ <item name="android:textColor">#FF00FF</item>
++ <item name="android:textSize">20pt</item>
++ </style>
++ </resources>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles4-expected-extract3.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles4-expected-extract3.diff
index 8f2e543..88a94e7 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles4-expected-extract3.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles4-expected-extract3.diff
@@ -1,9 +1,10 @@
-<
----
-> <?xml version="1.0" encoding="utf-8"?>
-> <resources xmlns:android="http://schemas.android.com/apk/res/android">
-> <style name="newstyle">
-> <item name="android:textColor">#FF0000</item>
-> <item name="android:textSize">20pt</item>
-> </style>
-> </resources>
+@@ -1 +1
+-
+@@ -2 +1
++ <?xml version="1.0" encoding="utf-8"?>
++ <resources xmlns:android="http://schemas.android.com/apk/res/android">
++ <style name="newstyle">
++ <item name="android:textColor">#FF0000</item>
++ <item name="android:textSize">20pt</item>
++ </style>
++ </resources>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles5-expected-extract4.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles5-expected-extract4.diff
index 3013eb5..49043b9 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles5-expected-extract4.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles5-expected-extract4.diff
@@ -1,8 +1,9 @@
-<
----
-> <?xml version="1.0" encoding="utf-8"?>
-> <resources xmlns:android="http://schemas.android.com/apk/res/android">
-> <style name="newstyle">
-> <item name="android:textColor">#FF00FF</item>
-> </style>
-> </resources>
+@@ -1 +1
+-
+@@ -2 +1
++ <?xml version="1.0" encoding="utf-8"?>
++ <resources xmlns:android="http://schemas.android.com/apk/res/android">
++ <style name="newstyle">
++ <item name="android:textColor">#FF00FF</item>
++ </style>
++ </resources>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles6-expected-extract5.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles6-expected-extract5.diff
index 7980fae..49ab2c3 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles6-expected-extract5.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles6-expected-extract5.diff
@@ -1,8 +1,9 @@
-<
----
-> <?xml version="1.0" encoding="utf-8"?>
-> <resources xmlns:android="http://schemas.android.com/apk/res/android">
-> <style name="newstyle">
-> <item name="android:textSize">20pt</item>
-> </style>
-> </resources>
+@@ -1 +1
+-
+@@ -2 +1
++ <?xml version="1.0" encoding="utf-8"?>
++ <resources xmlns:android="http://schemas.android.com/apk/res/android">
++ <style name="newstyle">
++ <item name="android:textSize">20pt</item>
++ </style>
++ </resources>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles8-expected-extract7.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles8-expected-extract7.diff
index 9e4ee25..6bcd6ff 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles8-expected-extract7.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles8-expected-extract7.diff
@@ -1,9 +1,10 @@
-<
----
-> <?xml version="1.0" encoding="utf-8"?>
-> <resources xmlns:android="http://schemas.android.com/apk/res/android">
-> <style name="newstyle">
-> <item name="android:textColor">#00FF00</item>
-> <item name="android:textSize">20pt</item>
-> </style>
-> </resources>
+@@ -1 +1
+-
+@@ -2 +1
++ <?xml version="1.0" encoding="utf-8"?>
++ <resources xmlns:android="http://schemas.android.com/apk/res/android">
++ <style name="newstyle">
++ <item name="android:textColor">#00FF00</item>
++ <item name="android:textSize">20pt</item>
++ </style>
++ </resources>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/quickfix1-expected-quickFix1.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/quickfix1-expected-quickFix1.xml
index 2ef716b..a51abf4 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/quickfix1-expected-quickFix1.xml
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/quickfix1-expected-quickFix1.xml
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
- <string name="hello">Hello World!</string>
+
<string name="app_name">PROJECTNAME</string>
<string name="firststring">[^TODO]</string>
-</resources>
+
+</resources> \ No newline at end of file
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/quickfix1-expected-quickFix3.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/quickfix1-expected-quickFix3.xml
index 8773027..900c420 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/quickfix1-expected-quickFix3.xml
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/quickfix1-expected-quickFix3.xml
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="vertical"
- android:layout_width="match_parent"
- android:layout_height="match_parent">
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical" >
^
-</LinearLayout>
+
+</LinearLayout> \ No newline at end of file
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/quickfix2-expected-quickFix4.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/quickfix2-expected-quickFix4.xml
index 025fa0a..7b638c6 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/quickfix2-expected-quickFix4.xml
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/quickfix2-expected-quickFix4.xml
@@ -1,3 +1,4 @@
-< <color android:color="#0000000"/>
----
-> <color android:color="#0000000" xmlns:android="http://schemas.android.com/apk/res/android"/>
+@@ -5 +5
+- <color android:color="#0000000"/>
+@@ -6 +5
++ <color android:color="#0000000" xmlns:android="http://schemas.android.com/apk/res/android"/>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample10-expected-convertFromGrid.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample10-expected-convertFromGrid.xml
index faa95d7..98e1f36 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample10-expected-convertFromGrid.xml
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample10-expected-convertFromGrid.xml
@@ -3,6 +3,7 @@
android:id="@+id/LinearLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
+ android:columnCount="2"
android:orientation="horizontal" >
<Button
@@ -15,6 +16,8 @@
android:id="@+id/radioButton1"
android:layout_width="150dp"
android:layout_height="wrap_content"
+ android:layout_column="0"
+ android:layout_row="1"
android:text="RadioButton" />
<RadioButton
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample10-expected-initialAttributes.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample10-expected-initialAttributes.xml
index 8f19186..aa8ecda 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample10-expected-initialAttributes.xml
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample10-expected-initialAttributes.xml
@@ -3,6 +3,7 @@
android:id="@+id/LinearLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
+ android:columnCount="2"
android:orientation="vertical" >
<Button
@@ -15,6 +16,8 @@
android:id="@+id/radioButton1"
android:layout_width="150dp"
android:layout_height="wrap_content"
+ android:layout_column="0"
+ android:layout_row="1"
android:text="RadioButton" />
<RadioButton
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-extract6.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-extract6.diff
index c0ebd59..1ae5748 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-extract6.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-extract6.diff
@@ -1,9 +1,9 @@
-< <LinearLayout android:layout_height="wrap_content" android:id="@+id/linearLayout4" android:layout_width="match_parent">
-< <LinearLayout android:layout_height="match_parent" android:id="@+id/linearLayout5" android:layout_width="wrap_content">
-< <LinearLayout android:layout_height="match_parent" android:id="@+id/linearLayout6" android:layout_width="wrap_content">
-< <Button android:text="Button" android:id="@+id/button6" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
-< </LinearLayout>
-< </LinearLayout>
-< </LinearLayout>
----
-> <include layout="@layout/newlayout6" android:id="@+id/linearLayout4_ref" android:layout_width="match_parent" android:layout_height="wrap_content"/>
+@@ -13 +13
+- <LinearLayout android:layout_height="wrap_content" android:id="@+id/linearLayout4" android:layout_width="match_parent">
+- <LinearLayout android:layout_height="match_parent" android:id="@+id/linearLayout5" android:layout_width="wrap_content">
+- <LinearLayout android:layout_height="match_parent" android:id="@+id/linearLayout6" android:layout_width="wrap_content">
+- <Button android:text="Button" android:id="@+id/button6" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
+- </LinearLayout>
+- </LinearLayout>
+- </LinearLayout>
++ <include layout="@layout/newlayout6" android:id="@+id/linearLayout4_ref" android:layout_width="match_parent" android:layout_height="wrap_content"/>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-extract7.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-extract7.diff
index 0a0b809..6d18aab 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-extract7.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-extract7.diff
@@ -1,86 +1,84 @@
-< <LinearLayout android:id="@+id/LinearLayout2" xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical">
-< <Button android:text="FirstButton" android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
-< <LinearLayout android:layout_width="match_parent" android:id="@+id/linearLayout1" android:layout_height="wrap_content">
-< <Button android:text="SecondButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/button2"></Button>
-< <Button android:text="ThirdButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/button3"></Button>
-< <CheckBox android:id="@+id/checkBox1" android:text="CheckBox" android:layout_width="wrap_content" android:layout_height="wrap_content"></CheckBox>
-< </LinearLayout>
-< <Button android:layout_height="wrap_content" android:text="FourthButton" android:id="@+id/button4" android:layout_width="match_parent"></Button>
-< <LinearLayout android:layout_height="wrap_content" android:id="@+id/linearLayout3" android:layout_width="match_parent">
-< <Button android:layout_gravity="right" android:id="@+id/button5" android:text="FifthButton" android:layout_height="wrap_content" android:layout_width="wrap_content"></Button>
-< </LinearLayout>
-< <LinearLayout android:layout_height="wrap_content" android:id="@+id/linearLayout4" android:layout_width="match_parent">
-< <LinearLayout android:layout_height="match_parent" android:id="@+id/linearLayout5" android:layout_width="wrap_content">
-< <LinearLayout android:layout_height="match_parent" android:id="@+id/linearLayout6" android:layout_width="wrap_content">
-< <Button android:text="Button" android:id="@+id/button6" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
-< </LinearLayout>
-< </LinearLayout>
-< </LinearLayout>
----
-> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-> android:id="@+id/LinearLayout2"
-> android:layout_width="match_parent"
-> android:layout_height="match_parent"
-> android:orientation="vertical" >
->
-> <Button
-> android:id="@+id/button1"
-> android:layout_width="wrap_content"
-> android:layout_height="wrap_content"
-> android:text="FirstButton" >
-> </Button>
->
-> <LinearLayout
-> android:id="@+id/linearLayout1"
-> android:layout_width="match_parent"
-> android:layout_height="wrap_content" >
->
-> <Button
-> android:id="@+id/button2"
-> android:layout_width="wrap_content"
-> android:layout_height="wrap_content"
-> android:text="SecondButton" >
-> </Button>
->
-> <Button
-> android:id="@+id/button3"
-> android:layout_width="wrap_content"
-> android:layout_height="wrap_content"
-> android:text="ThirdButton" >
-> </Button>
->
-> <CheckBox
-> android:id="@+id/checkBox1"
-> android:layout_width="wrap_content"
-> android:layout_height="wrap_content"
-> android:text="CheckBox" >
-> </CheckBox>
-> </LinearLayout>
->
-> <Button
-> android:id="@+id/button4"
-> android:layout_width="match_parent"
-> android:layout_height="wrap_content"
-> android:text="FourthButton" >
-> </Button>
->
-> <LinearLayout
-> android:id="@+id/linearLayout3"
-> android:layout_width="match_parent"
-> android:layout_height="wrap_content" >
->
-> <Button
-> android:id="@+id/button5"
-> android:layout_width="wrap_content"
-> android:layout_height="wrap_content"
-> android:layout_gravity="right"
-> android:text="FifthButton" >
-> </Button>
-> </LinearLayout>
->
-> <include
-> android:id="@+id/linearLayout4_ref"
-> android:layout_width="match_parent"
-> android:layout_height="wrap_content"
-> layout="@layout/newlayout6" />
->
+@@ -2 +2
+- <LinearLayout android:id="@+id/LinearLayout2" xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical">
+- <Button android:text="FirstButton" android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
+- <LinearLayout android:layout_width="match_parent" android:id="@+id/linearLayout1" android:layout_height="wrap_content">
+- <Button android:text="SecondButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/button2"></Button>
+- <Button android:text="ThirdButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/button3"></Button>
+- <CheckBox android:id="@+id/checkBox1" android:text="CheckBox" android:layout_width="wrap_content" android:layout_height="wrap_content"></CheckBox>
+- </LinearLayout>
+- <Button android:layout_height="wrap_content" android:text="FourthButton" android:id="@+id/button4" android:layout_width="match_parent"></Button>
+- <LinearLayout android:layout_height="wrap_content" android:id="@+id/linearLayout3" android:layout_width="match_parent">
+- <Button android:layout_gravity="right" android:id="@+id/button5" android:text="FifthButton" android:layout_height="wrap_content" android:layout_width="wrap_content"></Button>
++ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
++ android:id="@+id/LinearLayout2"
++ android:layout_width="match_parent"
++ android:layout_height="match_parent"
++ android:orientation="vertical" >
++
++ <Button
++ android:id="@+id/button1"
++ android:layout_width="wrap_content"
++ android:layout_height="wrap_content"
++ android:text="FirstButton" >
++ </Button>
++
++ <LinearLayout
++ android:id="@+id/linearLayout1"
++ android:layout_width="match_parent"
++ android:layout_height="wrap_content" >
++
++ <Button
++ android:id="@+id/button2"
++ android:layout_width="wrap_content"
++ android:layout_height="wrap_content"
++ android:text="SecondButton" >
++ </Button>
++
++ <Button
++ android:id="@+id/button3"
++ android:layout_width="wrap_content"
++ android:layout_height="wrap_content"
++ android:text="ThirdButton" >
++ </Button>
++
++ <CheckBox
++ android:id="@+id/checkBox1"
++ android:layout_width="wrap_content"
++ android:layout_height="wrap_content"
++ android:text="CheckBox" >
++ </CheckBox>
+@@ -13 +41
+- <LinearLayout android:layout_height="wrap_content" android:id="@+id/linearLayout4" android:layout_width="match_parent">
+- <LinearLayout android:layout_height="match_parent" android:id="@+id/linearLayout5" android:layout_width="wrap_content">
+- <LinearLayout android:layout_height="match_parent" android:id="@+id/linearLayout6" android:layout_width="wrap_content">
+- <Button android:text="Button" android:id="@+id/button6" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
+- </LinearLayout>
+- </LinearLayout>
++
++ <Button
++ android:id="@+id/button4"
++ android:layout_width="match_parent"
++ android:layout_height="wrap_content"
++ android:text="FourthButton" >
++ </Button>
++
++ <LinearLayout
++ android:id="@+id/linearLayout3"
++ android:layout_width="match_parent"
++ android:layout_height="wrap_content" >
++
++ <Button
++ android:id="@+id/button5"
++ android:layout_width="wrap_content"
++ android:layout_height="wrap_content"
++ android:layout_gravity="right"
++ android:text="FifthButton" >
++ </Button>
+@@ -20 +62
++
++ <include
++ android:id="@+id/linearLayout4_ref"
++ android:layout_width="match_parent"
++ android:layout_height="wrap_content"
++ layout="@layout/newlayout6" />
++
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample2-expected-changeView2.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample2-expected-changeView2.xml
index 5a55498..366c8df 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample2-expected-changeView2.xml
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample2-expected-changeView2.xml
@@ -3,10 +3,10 @@
<Button android:text="Button" android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
<RelativeLayout android:layout_height="match_parent" android:id="@+id/relativeLayout1" android:layout_width="match_parent">
<Button android:layout_width="wrap_content" android:layout_alignParentLeft="true" android:id="@+id/button2" android:layout_height="wrap_content" android:text="Button"></Button>
- <ImageButton android:layout_width="wrap_content" android:id="@+id/ImageButton1" android:layout_below="@+id/button2" android:layout_height="wrap_content" android:layout_toRightOf="@+id/button2"></ImageButton>
+ <ImageButton android:layout_width="wrap_content" android:id="@+id/ImageButton1" android:layout_below="@+id/button2" android:layout_height="wrap_content" android:text="Button" android:layout_toRightOf="@+id/button2"></ImageButton>
<Button android:layout_width="wrap_content" android:id="@+id/button4" android:layout_below="@+id/ImageButton1" android:layout_height="wrap_content" android:text="Button" android:layout_toRightOf="@+id/ImageButton1"></Button>
<CheckBox android:layout_width="wrap_content" android:layout_below="@+id/button4" android:id="@+id/checkBox1" android:layout_height="wrap_content" android:text="CheckBox" android:layout_toLeftOf="@+id/button4"></CheckBox>
- <ImageButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/ImageButton2" android:layout_alignParentRight="true"></ImageButton>
+ <ImageButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Button" android:id="@+id/ImageButton2" android:layout_alignParentRight="true"></ImageButton>
</RelativeLayout>
</LinearLayout>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample7-expected-extract6.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample7-expected-extract6.diff
index 636e301..8a01599 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample7-expected-extract6.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample7-expected-extract6.diff
@@ -1,10 +1,10 @@
-< <LinearLayout android:layout_height="wrap_content" android:id="@+id/linearLayout4" android:layout_width="match_parent">
-< <LinearLayout android:layout_height="match_parent" android:id="@+id/linearLayout5" android:layout_width="wrap_content">
-< <LinearLayout android:layout_height="match_parent" android:id="@+id/linearLayout6" android:layout_width="wrap_content">
-< <!-- Comment -->
-< <Button android:text="Button" android:id="@+id/button6" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
-< </LinearLayout>
-< </LinearLayout>
-< </LinearLayout>
----
-> <include layout="@layout/newlayout6" android:id="@+id/linearLayout4_ref" android:layout_width="match_parent" android:layout_height="wrap_content"/>
+@@ -4 +4
+- <LinearLayout android:layout_height="wrap_content" android:id="@+id/linearLayout4" android:layout_width="match_parent">
+- <LinearLayout android:layout_height="match_parent" android:id="@+id/linearLayout5" android:layout_width="wrap_content">
+- <LinearLayout android:layout_height="match_parent" android:id="@+id/linearLayout6" android:layout_width="wrap_content">
+- <!-- Comment -->
+- <Button android:text="Button" android:id="@+id/button6" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
+- </LinearLayout>
+- </LinearLayout>
+- </LinearLayout>
++ <include layout="@layout/newlayout6" android:id="@+id/linearLayout4_ref" android:layout_width="match_parent" android:layout_height="wrap_content"/>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample7-expected-extract7.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample7-expected-extract7.diff
index 96e6dfb..3de135d 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample7-expected-extract7.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample7-expected-extract7.diff
@@ -1,70 +1,69 @@
-< <LinearLayout android:id="@+id/LinearLayout2" xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical">
-< <Button android:text="FirstButton" android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
-< <LinearLayout android:layout_height="wrap_content" android:id="@+id/linearLayout4" android:layout_width="match_parent">
-< <LinearLayout android:layout_height="match_parent" android:id="@+id/linearLayout5" android:layout_width="wrap_content">
-< <LinearLayout android:layout_height="match_parent" android:id="@+id/linearLayout6" android:layout_width="wrap_content">
-< <!-- Comment -->
-< <Button android:text="Button" android:id="@+id/button6" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
-< </LinearLayout>
-< </LinearLayout>
-< </LinearLayout>
-< <LinearLayout android:layout_width="match_parent" android:id="@+id/linearLayout9" android:layout_height="wrap_content">
-< <Button android:text="SecondButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/button2"></Button>
-< <Button android:text="ThirdButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/button3"></Button>
-< <CheckBox android:id="@+id/checkBox1" android:text="CheckBox" android:layout_width="wrap_content" android:layout_height="wrap_content"></CheckBox>
-< </LinearLayout>
-< <Button android:layout_height="wrap_content" android:text="FourthButton" android:id="@+id/button4" android:layout_width="match_parent"></Button>
----
-> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-> android:id="@+id/LinearLayout2"
-> android:layout_width="match_parent"
-> android:layout_height="match_parent"
-> android:orientation="vertical" >
->
-> <Button
-> android:id="@+id/button1"
-> android:layout_width="wrap_content"
-> android:layout_height="wrap_content"
-> android:text="FirstButton" >
-> </Button>
->
-> <include
-> android:id="@+id/linearLayout4_ref"
-> android:layout_width="match_parent"
-> android:layout_height="wrap_content"
-> layout="@layout/newlayout6" />
->
-> <LinearLayout
-> android:id="@+id/linearLayout9"
-> android:layout_width="match_parent"
-> android:layout_height="wrap_content" >
->
-> <Button
-> android:id="@+id/button2"
-> android:layout_width="wrap_content"
-> android:layout_height="wrap_content"
-> android:text="SecondButton" >
-> </Button>
->
-> <Button
-> android:id="@+id/button3"
-> android:layout_width="wrap_content"
-> android:layout_height="wrap_content"
-> android:text="ThirdButton" >
-> </Button>
->
-> <CheckBox
-> android:id="@+id/checkBox1"
-> android:layout_width="wrap_content"
-> android:layout_height="wrap_content"
-> android:text="CheckBox" >
-> </CheckBox>
-> </LinearLayout>
->
-> <Button
-> android:id="@+id/button4"
-> android:layout_width="match_parent"
-> android:layout_height="wrap_content"
-> android:text="FourthButton" >
-> </Button>
->
+@@ -2 +2
+- <LinearLayout android:id="@+id/LinearLayout2" xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical">
+- <Button android:text="FirstButton" android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
+- <LinearLayout android:layout_height="wrap_content" android:id="@+id/linearLayout4" android:layout_width="match_parent">
+- <LinearLayout android:layout_height="match_parent" android:id="@+id/linearLayout5" android:layout_width="wrap_content">
+- <LinearLayout android:layout_height="match_parent" android:id="@+id/linearLayout6" android:layout_width="wrap_content">
+- <!-- Comment -->
+- <Button android:text="Button" android:id="@+id/button6" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
+- </LinearLayout>
+- </LinearLayout>
+- </LinearLayout>
+- <LinearLayout android:layout_width="match_parent" android:id="@+id/linearLayout9" android:layout_height="wrap_content">
+- <Button android:text="SecondButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/button2"></Button>
+- <Button android:text="ThirdButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/button3"></Button>
+- <CheckBox android:id="@+id/checkBox1" android:text="CheckBox" android:layout_width="wrap_content" android:layout_height="wrap_content"></CheckBox>
++ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
++ android:id="@+id/LinearLayout2"
++ android:layout_width="match_parent"
++ android:layout_height="match_parent"
++ android:orientation="vertical" >
++
++ <Button
++ android:id="@+id/button1"
++ android:layout_width="wrap_content"
++ android:layout_height="wrap_content"
++ android:text="FirstButton" >
++ </Button>
++
++ <include
++ android:id="@+id/linearLayout4_ref"
++ android:layout_width="match_parent"
++ android:layout_height="wrap_content"
++ layout="@layout/newlayout6" />
++
++ <LinearLayout
++ android:id="@+id/linearLayout9"
++ android:layout_width="match_parent"
++ android:layout_height="wrap_content" >
++
++ <Button
++ android:id="@+id/button2"
++ android:layout_width="wrap_content"
++ android:layout_height="wrap_content"
++ android:text="SecondButton" >
++ </Button>
++
++ <Button
++ android:id="@+id/button3"
++ android:layout_width="wrap_content"
++ android:layout_height="wrap_content"
++ android:text="ThirdButton" >
++ </Button>
++
++ <CheckBox
++ android:id="@+id/checkBox1"
++ android:layout_width="wrap_content"
++ android:layout_height="wrap_content"
++ android:text="CheckBox" >
++ </CheckBox>
+@@ -17 +47
+- <Button android:layout_height="wrap_content" android:text="FourthButton" android:id="@+id/button4" android:layout_width="match_parent"></Button>
++
++ <Button
++ android:id="@+id/button4"
++ android:layout_width="match_parent"
++ android:layout_height="wrap_content"
++ android:text="FourthButton" >
++ </Button>
++
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample8-expected-extract6.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample8-expected-extract6.diff
index 024141a..ea3afc2 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample8-expected-extract6.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample8-expected-extract6.diff
@@ -1,15 +1,15 @@
-< <LinearLayout android:layout_height="wrap_content"
-< android:id="@+id/linearLayout4" android:layout_width="match_parent">
-< <LinearLayout android:layout_height="match_parent"
-< android:layout_width="wrap_content" android:id="@+id/linearLayout5">
-< <LinearLayout android:layout_height="match_parent"
-< android:id="@+id/linearLayout6"
-< android:layout_width="wrap_content">
-< <Button android:text="Button" android:id="@+id/button6"
-< android:layout_width="wrap_content"
-< android:layout_height="wrap_content"></Button>
-< </LinearLayout>
-< </LinearLayout>
-< </LinearLayout>
----
-> <include layout="@layout/newlayout6" android:id="@+id/linearLayout4_ref" android:layout_width="match_parent" android:layout_height="wrap_content"/>
+@@ -10 +10
+- <LinearLayout android:layout_height="wrap_content"
+- android:id="@+id/linearLayout4" android:layout_width="match_parent">
+- <LinearLayout android:layout_height="match_parent"
+- android:layout_width="wrap_content" android:id="@+id/linearLayout5">
+- <LinearLayout android:layout_height="match_parent"
+- android:id="@+id/linearLayout6"
+- android:layout_width="wrap_content">
+- <Button android:text="Button" android:id="@+id/button6"
+- android:layout_width="wrap_content"
+- android:layout_height="wrap_content"></Button>
+- </LinearLayout>
+- </LinearLayout>
+- </LinearLayout>
++ <include layout="@layout/newlayout6" android:id="@+id/linearLayout4_ref" android:layout_width="match_parent" android:layout_height="wrap_content"/>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample8-expected-extract7.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample8-expected-extract7.diff
index 1774968..8228b59 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample8-expected-extract7.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample8-expected-extract7.diff
@@ -1,95 +1,85 @@
-< <LinearLayout android:id="@+id/LinearLayout2"
-< xmlns:android="http://schemas.android.com/apk/res/android"
-< android:layout_width="match_parent" android:layout_height="match_parent"
-< android:orientation="vertical">
-< <Button android:text="FirstButton" android:id="@+id/button1"
-< android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
-< <FrameLayout android:id="@+id/outer"
-< android:layout_width="match_parent" android:layout_height="wrap_content">
-< <LinearLayout android:layout_height="wrap_content"
-< android:id="@+id/linearLayout4" android:layout_width="match_parent">
-< <LinearLayout android:layout_height="match_parent"
-< android:layout_width="wrap_content" android:id="@+id/linearLayout5">
-< <LinearLayout android:layout_height="match_parent"
-< android:id="@+id/linearLayout6"
-< android:layout_width="wrap_content">
-< <Button android:text="Button" android:id="@+id/button6"
-< android:layout_width="wrap_content"
-< android:layout_height="wrap_content"></Button>
-< </LinearLayout>
-< </LinearLayout>
-< </LinearLayout>
-< </FrameLayout>
-< <FrameLayout android:id="@+id/outer"
-< android:layout_width="match_parent" android:layout_height="wrap_content">
-< <LinearLayout android:layout_height="wrap_content"
-< android:id="@+id/linearLayout4" android:layout_width="match_parent">
-< <LinearLayout android:layout_height="match_parent"
-< android:layout_width="wrap_content" android:id="@+id/linearLayout5">
-< <LinearLayout android:layout_height="match_parent"
-< android:id="@+id/linearLayout6"
-< android:layout_width="wrap_content">
-< <Button android:text="Button" android:id="@+id/button6"
-< android:layout_width="wrap_content"
-< android:layout_height="wrap_content"></Button>
-< </LinearLayout>
-< </LinearLayout>
-< </LinearLayout>
-< </FrameLayout>
----
-> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-> android:id="@+id/LinearLayout2"
-> android:layout_width="match_parent"
-> android:layout_height="match_parent"
-> android:orientation="vertical" >
->
-> <Button
-> android:id="@+id/button1"
-> android:layout_width="wrap_content"
-> android:layout_height="wrap_content"
-> android:text="FirstButton" >
-> </Button>
->
-> <FrameLayout
-> android:id="@+id/outer"
-> android:layout_width="match_parent"
-> android:layout_height="wrap_content" >
->
-> <include
-> android:id="@+id/linearLayout4_ref"
-> android:layout_width="match_parent"
-> android:layout_height="wrap_content"
-> layout="@layout/newlayout6" />
-> </FrameLayout>
->
-> <FrameLayout
-> android:id="@+id/outer"
-> android:layout_width="match_parent"
-> android:layout_height="wrap_content" >
->
-> <LinearLayout
-> android:id="@+id/linearLayout4"
-> android:layout_width="match_parent"
-> android:layout_height="wrap_content" >
->
-> <LinearLayout
-> android:id="@+id/linearLayout5"
-> android:layout_width="wrap_content"
-> android:layout_height="match_parent" >
->
-> <LinearLayout
-> android:id="@+id/linearLayout6"
-> android:layout_width="wrap_content"
-> android:layout_height="match_parent" >
->
-> <Button
-> android:id="@+id/button6"
-> android:layout_width="wrap_content"
-> android:layout_height="wrap_content"
-> android:text="Button" >
-> </Button>
-> </LinearLayout>
-> </LinearLayout>
-> </LinearLayout>
-> </FrameLayout>
->
+@@ -2 +2
+- <LinearLayout android:id="@+id/LinearLayout2"
+- xmlns:android="http://schemas.android.com/apk/res/android"
+- android:layout_width="match_parent" android:layout_height="match_parent"
+- android:orientation="vertical">
+- <Button android:text="FirstButton" android:id="@+id/button1"
+- android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
+- <FrameLayout android:id="@+id/outer"
+- android:layout_width="match_parent" android:layout_height="wrap_content">
+- <LinearLayout android:layout_height="wrap_content"
+- android:id="@+id/linearLayout4" android:layout_width="match_parent">
+- <LinearLayout android:layout_height="match_parent"
+- android:layout_width="wrap_content" android:id="@+id/linearLayout5">
+- <LinearLayout android:layout_height="match_parent"
+- android:id="@+id/linearLayout6"
+- android:layout_width="wrap_content">
+- <Button android:text="Button" android:id="@+id/button6"
+- android:layout_width="wrap_content"
+- android:layout_height="wrap_content"></Button>
+- </LinearLayout>
+- </LinearLayout>
+- </LinearLayout>
++ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
++ android:id="@+id/LinearLayout2"
++ android:layout_width="match_parent"
++ android:layout_height="match_parent"
++ android:orientation="vertical" >
++
++ <Button
++ android:id="@+id/button1"
++ android:layout_width="wrap_content"
++ android:layout_height="wrap_content"
++ android:text="FirstButton" >
++ </Button>
++
++ <FrameLayout
++ android:id="@+id/outer"
++ android:layout_width="match_parent"
++ android:layout_height="wrap_content" >
++
++ <include
++ android:id="@+id/linearLayout4_ref"
++ android:layout_width="match_parent"
++ android:layout_height="wrap_content"
++ layout="@layout/newlayout6" />
+@@ -24 +26
+- <FrameLayout android:id="@+id/outer"
+- android:layout_width="match_parent" android:layout_height="wrap_content">
+- <LinearLayout android:layout_height="wrap_content"
+- android:id="@+id/linearLayout4" android:layout_width="match_parent">
+- <LinearLayout android:layout_height="match_parent"
+- android:layout_width="wrap_content" android:id="@+id/linearLayout5">
+- <LinearLayout android:layout_height="match_parent"
++
++ <FrameLayout
++ android:id="@+id/outer"
++ android:layout_width="match_parent"
++ android:layout_height="wrap_content" >
++
++ <LinearLayout
++ android:id="@+id/linearLayout4"
++ android:layout_width="match_parent"
++ android:layout_height="wrap_content" >
++
++ <LinearLayout
++ android:id="@+id/linearLayout5"
++ android:layout_width="wrap_content"
++ android:layout_height="match_parent" >
++
++ <LinearLayout
+@@ -32 +44
+- android:layout_width="wrap_content">
+- <Button android:text="Button" android:id="@+id/button6"
++ android:layout_width="wrap_content"
++ android:layout_height="match_parent" >
++
++ <Button
++ android:id="@+id/button6"
+@@ -35 +50
+- android:layout_height="wrap_content"></Button>
++ android:layout_height="wrap_content"
++ android:text="Button" >
++ </Button>
+@@ -40 +57
++
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/lint/ProjectLintConfigurationTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/lint/ProjectLintConfigurationTest.java
index 9f0783f..088ece7 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/lint/ProjectLintConfigurationTest.java
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/lint/ProjectLintConfigurationTest.java
@@ -33,7 +33,6 @@ import com.android.tools.lint.detector.api.Severity;
import org.eclipse.core.resources.IProject;
import java.io.File;
-import java.util.Calendar;
@SuppressWarnings("javadoc")
public class ProjectLintConfigurationTest extends AdtProjectTest {
@@ -181,31 +180,11 @@ public class ProjectLintConfigurationTest extends AdtProjectTest {
assertSame(config1, config2);
}
- private static File sTempDir = null;
- @Override
- protected File getTempDir() {
- if (sTempDir == null) {
- File base = new File(System.getProperty("java.io.tmpdir")); //$NON-NLS-1$
- String os = System.getProperty("os.name"); //$NON-NLS-1$
- if (os.startsWith("Mac OS")) { //$NON-NLS-1$
- base = new File("/tmp");
- }
- Calendar c = Calendar.getInstance();
- String name = String.format("lintTests/%1$tF_%1$tT", c).replace(':', '-'); //$NON-NLS-1$
- File tmpDir = new File(base, name);
- if (!tmpDir.exists() && tmpDir.mkdirs()) {
- sTempDir = tmpDir;
- } else {
- sTempDir = base;
- }
- }
-
- return sTempDir;
- }
-
@Override
protected File getTargetDir() {
- return new File(getTempDir(), getClass().getSimpleName() + "_" + getName());
+ File targetDir = new File(getTempDir(), getClass().getSimpleName() + "_" + getName());
+ addCleanupDir(targetDir);
+ return targetDir;
}
private static class TestClient extends LintClient {
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/refactorings/core/RefactoringTestBase.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/refactorings/core/RefactoringTestBase.java
new file mode 100644
index 0000000..3ae8535
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/refactorings/core/RefactoringTestBase.java
@@ -0,0 +1,476 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
+ *
+ * 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 com.android.ide.eclipse.adt.internal.refactorings.core;
+
+import com.android.ide.eclipse.adt.AdtUtils;
+import com.android.ide.eclipse.adt.internal.editors.layout.refactoring.AdtProjectTest;
+import com.android.ide.eclipse.adt.internal.refactorings.changes.AndroidLayoutChange;
+import com.android.ide.eclipse.adt.internal.refactorings.changes.AndroidPackageRenameChange;
+import com.android.ide.eclipse.adt.internal.refactorings.changes.AndroidTypeRenameChange;
+import com.google.common.base.Charsets;
+import com.google.common.base.Splitter;
+import com.google.common.io.ByteStreams;
+import com.google.common.io.Files;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jdt.internal.corext.refactoring.changes.RenamePackageChange;
+import org.eclipse.jface.text.Document;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.eclipse.ltk.core.refactoring.CompositeChange;
+import org.eclipse.ltk.core.refactoring.Refactoring;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.eclipse.ltk.core.refactoring.TextChange;
+import org.eclipse.ltk.core.refactoring.TextFileChange;
+import org.eclipse.ltk.core.refactoring.resource.RenameResourceChange;
+import org.eclipse.text.edits.TextEdit;
+
+import java.io.File;
+import java.io.IOException;
+
+@SuppressWarnings({"javadoc","restriction"})
+public abstract class RefactoringTestBase extends AdtProjectTest {
+ protected void checkRefactoring(Refactoring refactoring, String expected)
+ throws Exception {
+ RefactoringStatus status = refactoring.checkAllConditions(new NullProgressMonitor());
+ assertNotNull(status);
+ if (!status.isOK()) {
+ assertEquals(status.toString(), expected);
+ return;
+ }
+ assertTrue(status.toString(), status.isOK());
+ Change change = refactoring.createChange(new NullProgressMonitor());
+ assertNotNull(change);
+ String explanation = "CHANGES:\n-------\n" + describe(change);
+ if (!expected.trim().equals(explanation.trim())) { // allow trimming endlines in expected
+ assertEquals(expected, explanation);
+ }
+ }
+
+ protected IProject createProject(Object[] testData) throws Exception {
+ String name = getName();
+ IProject project = createProject(name);
+ File projectDir = AdtUtils.getAbsolutePath(project).toFile();
+ assertNotNull(projectDir);
+ assertTrue(projectDir.getPath(), projectDir.exists());
+ createTestDataDir(projectDir, testData);
+ project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
+
+ for (int i = 0; i < testData.length; i+= 2) {
+ assertTrue(testData[i].toString(), testData[i] instanceof String);
+ String relative = (String) testData[i];
+ IResource member = project.findMember(relative);
+ assertNotNull(relative, member);
+ assertTrue(member.getClass().getSimpleName(), member instanceof IFile);
+ }
+
+ return project;
+ }
+
+ public static String describe(Change change) throws Exception {
+ StringBuilder sb = new StringBuilder(1000);
+ describe(sb, change, 0);
+
+ // Trim trailing space
+ for (int i = sb.length() - 1; i >= 0; i--) {
+ if (!Character.isWhitespace(sb.charAt(i))) {
+ sb.setLength(i + 1);
+ break;
+ }
+ }
+
+ return sb.toString();
+ }
+
+ protected static void describe(StringBuilder sb, Change change, int indent) throws Exception {
+ if (change instanceof CompositeChange
+ && ((CompositeChange) change).isSynthetic()) {
+ // Don't display information about synthetic changes
+ } else {
+ String changeName = change.getName();
+
+ if (changeName.contains("MoreUnit")) {
+ // If MoreUnit plugin is installed, don't include in unit test results
+ return;
+ }
+
+ // Describe this change
+ indent(sb, indent);
+ sb.append("* ");
+ sb.append(changeName);
+ if (change instanceof TextFileChange) {
+ TextFileChange tfc = (TextFileChange) change;
+ sb.append(" - ");
+ sb.append(tfc.getFile().getFullPath());
+ sb.append('\n');
+ } else {
+ sb.append('\n');
+ }
+ if (change instanceof TextFileChange
+ || change instanceof AndroidLayoutChange
+ || change instanceof AndroidTypeRenameChange
+ || change instanceof AndroidPackageRenameChange) {
+ TextChange tc = (TextChange) change;
+ TextEdit edit = tc.getEdit();
+ IFile file = null;
+ if (change instanceof TextFileChange) {
+ TextFileChange tfc = (TextFileChange) change;
+ file = tfc.getFile();
+ } else if (change instanceof AndroidPackageRenameChange) {
+ AndroidPackageRenameChange aprc = (AndroidPackageRenameChange) change;
+ file = aprc.getManifest();
+ } else if (change instanceof AndroidTypeRenameChange) {
+ AndroidTypeRenameChange aprc = (AndroidTypeRenameChange) change;
+ file = aprc.getManifest();
+ } else {
+ assert change instanceof AndroidLayoutChange;
+ AndroidLayoutChange alc = (AndroidLayoutChange) change;
+ file = alc.getFile();
+ }
+ byte[] bytes = ByteStreams.toByteArray(file.getContents());
+ String before = new String(bytes, Charsets.UTF_8);
+ IDocument document = new Document();
+ document.replace(0, 0, before);
+ edit.apply(document);
+ String after = document.get();
+
+ String diff = getDiff(before, after);
+ for (String line : Splitter.on('\n').split(diff)) {
+ if (!line.trim().isEmpty()) {
+ indent(sb, indent + 1);
+ sb.append(line);
+ }
+ sb.append('\n');
+ }
+ } else if (change instanceof RenameResourceChange) {
+ // Change name, appended above, is adequate
+ } else if (change instanceof RenamePackageChange) {
+ // Change name, appended above, is adequate
+ } else if (change instanceof AndroidPackageRenameChange) {
+ AndroidPackageRenameChange aprc = (AndroidPackageRenameChange) change;
+ aprc.getEdit();
+ } else if (change instanceof AndroidLayoutChange) {
+ AndroidLayoutChange tfc = (AndroidLayoutChange) change;
+ TextEdit edit = tfc.getEdit();
+ tfc.getModifiedElement();
+ IFile file = tfc.getFile();
+ byte[] bytes = ByteStreams.toByteArray(file.getContents());
+ String before = new String(bytes, Charsets.UTF_8);
+ IDocument document = new Document();
+ document.replace(0, 0, before);
+ edit.apply(document);
+ String after = document.get();
+ String diff = getDiff(before, after);
+ for (String line : Splitter.on('\n').split(diff)) {
+ if (!line.trim().isEmpty()) {
+ indent(sb, indent + 1);
+ sb.append(line);
+ }
+ sb.append('\n');
+ }
+ } else if (change instanceof CompositeChange) {
+ // Don't print details about children here; they'll be nested below
+ } else {
+ indent(sb, indent);
+ sb.append("<unknown change type " + change.getClass().getName() + ">");
+ }
+ sb.append('\n');
+ }
+
+ if (change instanceof CompositeChange) {
+ CompositeChange composite = (CompositeChange) change;
+ Change[] children = composite.getChildren();
+ for (Change child : children) {
+ describe(sb, child, indent + (composite.isSynthetic() ? 0 : 1));
+ }
+ }
+ }
+
+ protected static void indent(StringBuilder sb, int indent) {
+ for (int i = 0; i < indent; i++) {
+ sb.append(" ");
+ }
+ }
+
+ protected void createTestDataDir(File dir, Object[] data) throws IOException {
+ for (int i = 0, n = data.length; i < n; i += 2) {
+ assertTrue("Must be a path: " + data[i], data[i] instanceof String);
+ String relativePath = ((String) data[i]).replace('/', File.separatorChar);
+ File to = new File(dir, relativePath);
+ File parent = to.getParentFile();
+ if (!parent.exists()) {
+ boolean mkdirs = parent.mkdirs();
+ assertTrue(to.getPath(), mkdirs);
+ }
+
+ Object o = data[i + 1];
+ if (o instanceof String) {
+ String contents = (String) o;
+ Files.write(contents, to, Charsets.UTF_8);
+ } else if (o instanceof byte[]) {
+ Files.write((byte[]) o, to);
+ } else {
+ fail("Data must be a String or a byte[] for " + to);
+ }
+ }
+ }
+
+ // Test sources
+
+ protected static final String SAMPLE_MANIFEST =
+ "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
+ "<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n" +
+ " package=\"com.example.refactoringtest\"\n" +
+ " android:versionCode=\"1\"\n" +
+ " android:versionName=\"1.0\" >\n" +
+ "\n" +
+ " <uses-sdk\n" +
+ " android:minSdkVersion=\"8\"\n" +
+ " android:targetSdkVersion=\"17\" />\n" +
+ "\n" +
+ " <application\n" +
+ " android:icon=\"@drawable/ic_launcher\"\n" +
+ " android:label=\"@string/app_name\"\n" +
+ " android:theme=\"@style/AppTheme\" >\n" +
+ " <activity\n" +
+ " android:name=\"com.example.refactoringtest.MainActivity\"\n" +
+ " android:label=\"@string/app_name\" >\n" +
+ " <intent-filter>\n" +
+ " <action android:name=\"android.intent.action.MAIN\" />\n" +
+ "\n" +
+ " <category android:name=\"android.intent.category.LAUNCHER\" />\n" +
+ " </intent-filter>\n" +
+ " </activity>\n" +
+ " </application>\n" +
+ "\n" +
+ "</manifest>";
+
+ protected static final String SAMPLE_MAIN_ACTIVITY =
+ "package com.example.refactoringtest;\n" +
+ "\n" +
+ "import android.os.Bundle;\n" +
+ "import android.app.Activity;\n" +
+ "import android.view.Menu;\n" +
+ "import android.view.View;\n" +
+ "\n" +
+ "public class MainActivity extends Activity {\n" +
+ "\n" +
+ " @Override\n" +
+ " protected void onCreate(Bundle savedInstanceState) {\n" +
+ " super.onCreate(savedInstanceState);\n" +
+ " setContentView(R.layout.activity_main);\n" +
+ " View view1 = findViewById(R.id.textView1);\n" +
+ " }\n" +
+ "\n" +
+ " @Override\n" +
+ " public boolean onCreateOptionsMenu(Menu menu) {\n" +
+ " // Inflate the menu; this adds items to the action bar if it is present.\n" +
+ " getMenuInflater().inflate(R.menu.activity_main, menu);\n" +
+ " return true;\n" +
+ " }\n" +
+ "\n" +
+ "}\n";
+
+ protected static final String SAMPLE_LAYOUT =
+ "<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n" +
+ " xmlns:tools=\"http://schemas.android.com/tools\"\n" +
+ " android:layout_width=\"match_parent\"\n" +
+ " android:layout_height=\"match_parent\"\n" +
+ " tools:context=\".MainActivity\" >\n" +
+ "\n" +
+ " <TextView\n" +
+ " android:id=\"@+id/textView1\"\n" +
+ " android:layout_width=\"wrap_content\"\n" +
+ " android:layout_height=\"wrap_content\"\n" +
+ " android:layout_centerVertical=\"true\"\n" +
+ " android:layout_toRightOf=\"@+id/button2\"\n" +
+ " android:text=\"@string/hello_world\" />\n" +
+ "\n" +
+ " <Button\n" +
+ " android:id=\"@+id/button1\"\n" +
+ " android:layout_width=\"wrap_content\"\n" +
+ " android:layout_height=\"wrap_content\"\n" +
+ " android:layout_alignLeft=\"@+id/textView1\"\n" +
+ " android:layout_below=\"@+id/textView1\"\n" +
+ " android:layout_marginLeft=\"22dp\"\n" +
+ " android:layout_marginTop=\"24dp\"\n" +
+ " android:text=\"Button\" />\n" +
+ "\n" +
+ " <Button\n" +
+ " android:id=\"@+id/button2\"\n" +
+ " android:layout_width=\"wrap_content\"\n" +
+ " android:layout_height=\"wrap_content\"\n" +
+ " android:layout_alignParentLeft=\"true\"\n" +
+ " android:layout_alignParentTop=\"true\"\n" +
+ " android:text=\"Button\" />\n" +
+ "\n" +
+ "</RelativeLayout>";
+
+ protected static final String SAMPLE_LAYOUT_2 =
+ "<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n" +
+ " xmlns:tools=\"http://schemas.android.com/tools\"\n" +
+ " android:layout_width=\"match_parent\"\n" +
+ " android:layout_height=\"match_parent\"\n" +
+ " tools:context=\".MainActivity\" >\n" +
+ "\n" +
+ "\n" +
+ "</RelativeLayout>";
+
+
+ protected static final String SAMPLE_MENU =
+ "<menu xmlns:android=\"http://schemas.android.com/apk/res/android\" >\n" +
+ "\n" +
+ " <item\n" +
+ " android:id=\"@+id/menu_settings\"\n" +
+ " android:orderInCategory=\"100\"\n" +
+ " android:showAsAction=\"never\"\n" +
+ " android:title=\"@string/menu_settings\"/>\n" +
+ "\n" +
+ "</menu>";
+
+ protected static final String SAMPLE_STRINGS =
+ "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
+ "<resources>\n" +
+ "\n" +
+ " <string name=\"app_name\">RefactoringTest</string>\n" +
+ " <string name=\"hello_world\">Hello world!</string>\n" +
+ " <string name=\"menu_settings\">Settings</string>\n" +
+ "\n" +
+ "</resources>";
+
+ protected static final String SAMPLE_STYLES =
+ "<resources>\n" +
+ "\n" +
+ " <!--\n" +
+ " Base application theme, dependent on API level. This theme is replaced\n" +
+ " by AppBaseTheme from res/values-vXX/styles.xml on newer devices.\n" +
+ " -->\n" +
+ " <style name=\"AppBaseTheme\" parent=\"android:Theme.Light\">\n" +
+ " <!--\n" +
+ " Theme customizations available in newer API levels can go in\n" +
+ " res/values-vXX/styles.xml, while customizations related to\n" +
+ " backward-compatibility can go here.\n" +
+ " -->\n" +
+ " </style>\n" +
+ "\n" +
+ " <!-- Application theme. -->\n" +
+ " <style name=\"AppTheme\" parent=\"AppBaseTheme\">\n" +
+ " <!-- All customizations that are NOT specific to a particular API-level can go here. -->\n" +
+ " </style>\n" +
+ "\n" +
+ "</resources>";
+
+ protected static final String SAMPLE_R =
+ "/* AUTO-GENERATED FILE. DO NOT MODIFY.\n" +
+ " *\n" +
+ " * This class was automatically generated by the\n" +
+ " * aapt tool from the resource data it found. It\n" +
+ " * should not be modified by hand.\n" +
+ " */\n" +
+ "\n" +
+ "package com.example.refactoringtest;\n" +
+ "\n" +
+ "public final class R {\n" +
+ " public static final class attr {\n" +
+ " }\n" +
+ " public static final class drawable {\n" +
+ " public static final int ic_launcher=0x7f020000;\n" +
+ " }\n" +
+ " public static final class id {\n" +
+ " public static final int button1=0x7f070002;\n" +
+ " public static final int button2=0x7f070001;\n" +
+ " public static final int menu_settings=0x7f070003;\n" +
+ " public static final int textView1=0x7f070000;\n" +
+ " }\n" +
+ " public static final class layout {\n" +
+ " public static final int activity_main=0x7f030000;\n" +
+ " }\n" +
+ " public static final class menu {\n" +
+ " public static final int activity_main=0x7f060000;\n" +
+ " }\n" +
+ " public static final class string {\n" +
+ " public static final int app_name=0x7f040000;\n" +
+ " public static final int hello_world=0x7f040001;\n" +
+ " public static final int menu_settings=0x7f040002;\n" +
+ " }\n" +
+ " public static final class style {\n" +
+ " /** \n" +
+ " Base application theme, dependent on API level. This theme is replaced\n" +
+ " by AppBaseTheme from res/values-vXX/styles.xml on newer devices.\n" +
+ " \n" +
+ "\n" +
+ " Theme customizations available in newer API levels can go in\n" +
+ " res/values-vXX/styles.xml, while customizations related to\n" +
+ " backward-compatibility can go here.\n" +
+ " \n" +
+ "\n" +
+ " Base application theme for API 11+. This theme completely replaces\n" +
+ " AppBaseTheme from res/values/styles.xml on API 11+ devices.\n" +
+ " \n" +
+ " API 11 theme customizations can go here. \n" +
+ "\n" +
+ " Base application theme for API 14+. This theme completely replaces\n" +
+ " AppBaseTheme from BOTH res/values/styles.xml and\n" +
+ " res/values-v11/styles.xml on API 14+ devices.\n" +
+ " \n" +
+ " API 14 theme customizations can go here. \n" +
+ " */\n" +
+ " public static final int AppBaseTheme=0x7f050000;\n" +
+ " /** Application theme. \n" +
+ " All customizations that are NOT specific to a particular API-level can go here. \n" +
+ " */\n" +
+ " public static final int AppTheme=0x7f050001;\n" +
+ " }\n" +
+ "}\n";
+
+ protected static final Object[] TEST_PROJECT = new Object[] {
+ "AndroidManifest.xml",
+ SAMPLE_MANIFEST,
+
+ "src/com/example/refactoringtest/MainActivity.java",
+ SAMPLE_MAIN_ACTIVITY,
+
+ "gen/com/example/refactoringtest/R.java",
+ SAMPLE_R,
+
+ "res/drawable-xhdpi/ic_launcher.png",
+ new byte[] { 0 },
+ "res/drawable-hdpi/ic_launcher.png",
+ new byte[] { 0 },
+ "res/drawable-ldpi/ic_launcher.png",
+ new byte[] { 0 },
+ "res/drawable-mdpi/ic_launcher.png",
+ new byte[] { 0 },
+
+ "res/layout/activity_main.xml",
+ SAMPLE_LAYOUT,
+
+ "res/layout-land/activity_main.xml",
+ SAMPLE_LAYOUT_2,
+
+ "res/menu/activity_main.xml",
+ SAMPLE_MENU,
+
+ "res/values/strings.xml", // file 3
+ SAMPLE_STRINGS,
+
+ "res/values/styles.xml", // file 3
+ SAMPLE_STYLES,
+ };
+}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/refactorings/core/RenameResourceParticipantTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/refactorings/core/RenameResourceParticipantTest.java
index a5d2a9a..90b49fb 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/refactorings/core/RenameResourceParticipantTest.java
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/refactorings/core/RenameResourceParticipantTest.java
@@ -16,43 +16,25 @@
package com.android.ide.eclipse.adt.internal.refactorings.core;
import com.android.annotations.NonNull;
-import com.android.ide.eclipse.adt.AdtUtils;
import com.android.ide.eclipse.adt.internal.editors.Hyperlinks;
-import com.android.ide.eclipse.adt.internal.editors.layout.refactoring.AdtProjectTest;
import com.android.ide.eclipse.adt.internal.project.BaseProjectHelper;
import com.android.resources.ResourceType;
import com.android.utils.Pair;
-import com.google.common.base.Charsets;
-import com.google.common.base.Splitter;
-import com.google.common.io.ByteStreams;
-import com.google.common.io.Files;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jdt.core.IField;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.internal.corext.refactoring.rename.RenameFieldProcessor;
-import org.eclipse.jface.text.Document;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.ltk.core.refactoring.Change;
-import org.eclipse.ltk.core.refactoring.CompositeChange;
-import org.eclipse.ltk.core.refactoring.RefactoringStatus;
-import org.eclipse.ltk.core.refactoring.TextFileChange;
import org.eclipse.ltk.core.refactoring.participants.RenameProcessor;
import org.eclipse.ltk.core.refactoring.participants.RenameRefactoring;
-import org.eclipse.ltk.core.refactoring.resource.RenameResourceChange;
-import org.eclipse.text.edits.TextEdit;
-
-import java.io.File;
-import java.io.IOException;
@SuppressWarnings({"javadoc", "restriction"})
-public class RenameResourceParticipantTest extends AdtProjectTest {
+public class RenameResourceParticipantTest extends RefactoringTestBase {
public void testRefactor1() throws Exception {
- checkRefactoring(
+ renameResource(
TEST_PROJECT,
"@string/app_name",
true /*updateReferences*/,
@@ -61,33 +43,28 @@ public class RenameResourceParticipantTest extends AdtProjectTest {
"CHANGES:\n" +
"-------\n" +
"* AndroidManifest.xml - /testRefactor1/AndroidManifest.xml\n" +
- " < android:label=\"@string/app_name\"\n" +
- " < android:theme=\"@style/AppTheme\" >\n" +
- " < <activity\n" +
- " < android:name=\"com.example.refactoringtest.MainActivity\"\n" +
- " < android:label=\"@string/app_name\" >\n" +
- " ---\n" +
- " > android:label=\"@string/myname\"\n" +
- " > android:theme=\"@style/AppTheme\" >\n" +
- " > <activity\n" +
- " > android:name=\"com.example.refactoringtest.MainActivity\"\n" +
- " > android:label=\"@string/myname\" >\n" +
+ " @@ -13 +13\n" +
+ " - android:label=\"@string/app_name\"\n" +
+ " + android:label=\"@string/myname\"\n" +
+ " @@ -17 +17\n" +
+ " - android:label=\"@string/app_name\" >\n" +
+ " + android:label=\"@string/myname\" >\n" +
"\n" +
"\n" +
"* strings.xml - /testRefactor1/res/values/strings.xml\n" +
- " < <string name=\"app_name\">RefactoringTest</string>\n" +
- " ---\n" +
- " > <string name=\"myname\">RefactoringTest</string>\n" +
+ " @@ -4 +4\n" +
+ " - <string name=\"app_name\">RefactoringTest</string>\n" +
+ " + <string name=\"myname\">RefactoringTest</string>\n" +
"\n" +
"\n" +
"* R.java - /testRefactor1/gen/com/example/refactoringtest/R.java\n" +
- " < public static final int app_name=0x7f040000;\n" +
- " ---\n" +
- " > public static final int myname=0x7f040000;");
+ " @@ -29 +29\n" +
+ " - public static final int app_name=0x7f040000;\n" +
+ " + public static final int myname=0x7f040000;");
}
public void testRefactor2() throws Exception {
- checkRefactoring(
+ renameResource(
TEST_PROJECT,
"@+id/menu_settings",
true /*updateReferences*/,
@@ -96,19 +73,19 @@ public class RenameResourceParticipantTest extends AdtProjectTest {
"CHANGES:\n" +
"-------\n" +
"* activity_main.xml - /testRefactor2/res/menu/activity_main.xml\n" +
- " < android:id=\"@+id/menu_settings\"\n" +
- " ---\n" +
- " > android:id=\"@+id/new_id_for_the_action_bar\"\n" +
+ " @@ -4 +4\n" +
+ " - android:id=\"@+id/menu_settings\"\n" +
+ " + android:id=\"@+id/new_id_for_the_action_bar\"\n" +
"\n" +
"\n" +
"* R.java - /testRefactor2/gen/com/example/refactoringtest/R.java\n" +
- " < public static final int menu_settings=0x7f070003;\n" +
- " ---\n" +
- " > public static final int new_id_for_the_action_bar=0x7f070003;");
+ " @@ -19 +19\n" +
+ " - public static final int menu_settings=0x7f070003;\n" +
+ " + public static final int new_id_for_the_action_bar=0x7f070003;");
}
public void testRefactor3() throws Exception {
- checkRefactoring(
+ renameResource(
TEST_PROJECT,
"@+id/textView1",
true /*updateReferences*/,
@@ -117,49 +94,30 @@ public class RenameResourceParticipantTest extends AdtProjectTest {
"CHANGES:\n" +
"-------\n" +
"* activity_main.xml - /testRefactor3/res/layout/activity_main.xml\n" +
- " < android:id=\"@+id/textView1\"\n" +
- " < android:layout_width=\"wrap_content\"\n" +
- " < android:layout_height=\"wrap_content\"\n" +
- " < android:layout_centerVertical=\"true\"\n" +
- " < android:layout_toRightOf=\"@+id/button2\"\n" +
- " < android:text=\"@string/hello_world\" />\n" +
- " <\n" +
- " < <Button\n" +
- " < android:id=\"@+id/button1\"\n" +
- " < android:layout_width=\"wrap_content\"\n" +
- " < android:layout_height=\"wrap_content\"\n" +
- " < android:layout_alignLeft=\"@+id/textView1\"\n" +
- " < android:layout_below=\"@+id/textView1\"\n" +
- " ---\n" +
- " > android:id=\"@+id/output\"\n" +
- " > android:layout_width=\"wrap_content\"\n" +
- " > android:layout_height=\"wrap_content\"\n" +
- " > android:layout_centerVertical=\"true\"\n" +
- " > android:layout_toRightOf=\"@+id/button2\"\n" +
- " > android:text=\"@string/hello_world\" />\n" +
- " >\n" +
- " > <Button\n" +
- " > android:id=\"@+id/button1\"\n" +
- " > android:layout_width=\"wrap_content\"\n" +
- " > android:layout_height=\"wrap_content\"\n" +
- " > android:layout_alignLeft=\"@+id/output\"\n" +
- " > android:layout_below=\"@+id/output\"\n" +
+ " @@ -8 +8\n" +
+ " - android:id=\"@+id/textView1\"\n" +
+ " + android:id=\"@+id/output\"\n" +
+ " @@ -19 +19\n" +
+ " - android:layout_alignLeft=\"@+id/textView1\"\n" +
+ " - android:layout_below=\"@+id/textView1\"\n" +
+ " + android:layout_alignLeft=\"@+id/output\"\n" +
+ " + android:layout_below=\"@+id/output\"\n" +
"\n" +
"\n" +
"* MainActivity.java - /testRefactor3/src/com/example/refactoringtest/MainActivity.java\n" +
- " < View view1 = findViewById(R.id.textView1);\n" +
- " ---\n" +
- " > View view1 = findViewById(R.id.output);\n" +
+ " @@ -14 +14\n" +
+ " - View view1 = findViewById(R.id.textView1);\n" +
+ " + View view1 = findViewById(R.id.output);\n" +
"\n" +
"\n" +
"* R.java - /testRefactor3/gen/com/example/refactoringtest/R.java\n" +
- " < public static final int textView1=0x7f070000;\n" +
- " ---\n" +
- " > public static final int output=0x7f070000;");
+ " @@ -20 +20\n" +
+ " - public static final int textView1=0x7f070000;\n" +
+ " + public static final int output=0x7f070000;");
}
public void testRefactor4() throws Exception {
- checkRefactoring(
+ renameResource(
TEST_PROJECT,
// same as testRefactor3, but use @id rather than @+id even though @+id is in file
"@id/textView1",
@@ -169,49 +127,30 @@ public class RenameResourceParticipantTest extends AdtProjectTest {
"CHANGES:\n" +
"-------\n" +
"* activity_main.xml - /testRefactor4/res/layout/activity_main.xml\n" +
- " < android:id=\"@+id/textView1\"\n" +
- " < android:layout_width=\"wrap_content\"\n" +
- " < android:layout_height=\"wrap_content\"\n" +
- " < android:layout_centerVertical=\"true\"\n" +
- " < android:layout_toRightOf=\"@+id/button2\"\n" +
- " < android:text=\"@string/hello_world\" />\n" +
- " <\n" +
- " < <Button\n" +
- " < android:id=\"@+id/button1\"\n" +
- " < android:layout_width=\"wrap_content\"\n" +
- " < android:layout_height=\"wrap_content\"\n" +
- " < android:layout_alignLeft=\"@+id/textView1\"\n" +
- " < android:layout_below=\"@+id/textView1\"\n" +
- " ---\n" +
- " > android:id=\"@+id/output\"\n" +
- " > android:layout_width=\"wrap_content\"\n" +
- " > android:layout_height=\"wrap_content\"\n" +
- " > android:layout_centerVertical=\"true\"\n" +
- " > android:layout_toRightOf=\"@+id/button2\"\n" +
- " > android:text=\"@string/hello_world\" />\n" +
- " >\n" +
- " > <Button\n" +
- " > android:id=\"@+id/button1\"\n" +
- " > android:layout_width=\"wrap_content\"\n" +
- " > android:layout_height=\"wrap_content\"\n" +
- " > android:layout_alignLeft=\"@+id/output\"\n" +
- " > android:layout_below=\"@+id/output\"\n" +
+ " @@ -8 +8\n" +
+ " - android:id=\"@+id/textView1\"\n" +
+ " + android:id=\"@+id/output\"\n" +
+ " @@ -19 +19\n" +
+ " - android:layout_alignLeft=\"@+id/textView1\"\n" +
+ " - android:layout_below=\"@+id/textView1\"\n" +
+ " + android:layout_alignLeft=\"@+id/output\"\n" +
+ " + android:layout_below=\"@+id/output\"\n" +
"\n" +
"\n" +
"* MainActivity.java - /testRefactor4/src/com/example/refactoringtest/MainActivity.java\n" +
- " < View view1 = findViewById(R.id.textView1);\n" +
- " ---\n" +
- " > View view1 = findViewById(R.id.output);\n" +
+ " @@ -14 +14\n" +
+ " - View view1 = findViewById(R.id.textView1);\n" +
+ " + View view1 = findViewById(R.id.output);\n" +
"\n" +
"\n" +
"* R.java - /testRefactor4/gen/com/example/refactoringtest/R.java\n" +
- " < public static final int textView1=0x7f070000;\n" +
- " ---\n" +
- " > public static final int output=0x7f070000;");
+ " @@ -20 +20\n" +
+ " - public static final int textView1=0x7f070000;\n" +
+ " + public static final int output=0x7f070000;");
}
public void testRefactor5() throws Exception {
- checkRefactoring(
+ renameResource(
TEST_PROJECT,
"@layout/activity_main",
true /*updateReferences*/,
@@ -220,21 +159,23 @@ public class RenameResourceParticipantTest extends AdtProjectTest {
"CHANGES:\n" +
"-------\n" +
"* Rename 'testRefactor5/res/layout/activity_main.xml' to 'newlayout.xml'\n" +
+ "\n" +
"* Rename 'testRefactor5/res/layout-land/activity_main.xml' to 'newlayout.xml'\n" +
+ "\n" +
"* MainActivity.java - /testRefactor5/src/com/example/refactoringtest/MainActivity.java\n" +
- " < setContentView(R.layout.activity_main);\n" +
- " ---\n" +
- " > setContentView(R.layout.newlayout);\n" +
+ " @@ -13 +13\n" +
+ " - setContentView(R.layout.activity_main);\n" +
+ " + setContentView(R.layout.newlayout);\n" +
"\n" +
"\n" +
"* R.java - /testRefactor5/gen/com/example/refactoringtest/R.java\n" +
- " < public static final int activity_main=0x7f030000;\n" +
- " ---\n" +
- " > public static final int newlayout=0x7f030000;");
+ " @@ -23 +23\n" +
+ " - public static final int activity_main=0x7f030000;\n" +
+ " + public static final int newlayout=0x7f030000;");
}
public void testRefactor6() throws Exception {
- checkRefactoring(
+ renameResource(
TEST_PROJECT,
"@drawable/ic_launcher",
true /*updateReferences*/,
@@ -243,26 +184,30 @@ public class RenameResourceParticipantTest extends AdtProjectTest {
"CHANGES:\n" +
"-------\n" +
"* AndroidManifest.xml - /testRefactor6/AndroidManifest.xml\n" +
- " < android:icon=\"@drawable/ic_launcher\"\n" +
- " ---\n" +
- " > android:icon=\"@drawable/newlauncher\"\n" +
+ " @@ -12 +12\n" +
+ " - android:icon=\"@drawable/ic_launcher\"\n" +
+ " + android:icon=\"@drawable/newlauncher\"\n" +
"\n" +
"\n" +
"* Rename 'testRefactor6/res/drawable-hdpi/ic_launcher.png' to 'newlauncher.png'\n" +
+ "\n" +
"* Rename 'testRefactor6/res/drawable-ldpi/ic_launcher.png' to 'newlauncher.png'\n" +
+ "\n" +
"* Rename 'testRefactor6/res/drawable-mdpi/ic_launcher.png' to 'newlauncher.png'\n" +
+ "\n" +
"* Rename 'testRefactor6/res/drawable-xhdpi/ic_launcher.png' to 'newlauncher.png'\n" +
+ "\n" +
"* R.java - /testRefactor6/gen/com/example/refactoringtest/R.java\n" +
- " < public static final int ic_launcher=0x7f020000;\n" +
- " ---\n" +
- " > public static final int newlauncher=0x7f020000;");
+ " @@ -14 +14\n" +
+ " - public static final int ic_launcher=0x7f020000;\n" +
+ " + public static final int newlauncher=0x7f020000;");
}
public void testRefactor7() throws Exception {
// Test refactoring initiated on a file rename
IProject project = createProject(TEST_PROJECT);
IFile file = project.getFile("res/layout/activity_main.xml");
- checkRefactoring(
+ renameResource(
project,
file,
true /*updateReferences*/,
@@ -271,17 +216,19 @@ public class RenameResourceParticipantTest extends AdtProjectTest {
"CHANGES:\n" +
"-------\n" +
"* Rename 'testRefactor7/res/layout/activity_main.xml' to 'newlayout.xml'\n" +
+ "\n" +
"* Rename 'testRefactor7/res/layout-land/activity_main.xml' to 'newlayout.xml'\n" +
+ "\n" +
"* MainActivity.java - /testRefactor7/src/com/example/refactoringtest/MainActivity.java\n" +
- " < setContentView(R.layout.activity_main);\n" +
- " ---\n" +
- " > setContentView(R.layout.newlayout);\n" +
+ " @@ -13 +13\n" +
+ " - setContentView(R.layout.activity_main);\n" +
+ " + setContentView(R.layout.newlayout);\n" +
"\n" +
"\n" +
"* R.java - /testRefactor7/gen/com/example/refactoringtest/R.java\n" +
- " < public static final int activity_main=0x7f030000;\n" +
- " ---\n" +
- " > public static final int newlayout=0x7f030000;");
+ " @@ -23 +23\n" +
+ " - public static final int activity_main=0x7f030000;\n" +
+ " + public static final int newlayout=0x7f030000;");
}
public void testRefactor8() throws Exception {
@@ -300,7 +247,7 @@ public class RenameResourceParticipantTest extends AdtProjectTest {
assertNotNull(field);
assertTrue(field.exists());
- checkRefactoring(
+ renameResource(
project,
field,
true /*updateReferences*/,
@@ -309,23 +256,24 @@ public class RenameResourceParticipantTest extends AdtProjectTest {
"CHANGES:\n" +
"-------\n" +
"* MainActivity.java - /testRefactor8/src/com/example/refactoringtest/MainActivity.java\n" +
- " < setContentView(R.layout.activity_main);\n" +
- " ---\n" +
- " > setContentView(R.layout.newlauncher);\n" +
+ " @@ -13 +13\n" +
+ " - setContentView(R.layout.activity_main);\n" +
+ " + setContentView(R.layout.newlauncher);\n" +
"\n" +
"\n" +
"* R.java - /testRefactor8/gen/com/example/refactoringtest/R.java\n" +
- " < public static final int activity_main=0x7f030000;\n" +
- " ---\n" +
- " > public static final int newlauncher=0x7f030000;\n" +
+ " @@ -23 +23\n" +
+ " - public static final int activity_main=0x7f030000;\n" +
+ " + public static final int newlauncher=0x7f030000;\n" +
"\n" +
"\n" +
"* Rename 'testRefactor8/res/layout/activity_main.xml' to 'newlauncher.xml'\n" +
+ "\n" +
"* Rename 'testRefactor8/res/layout-land/activity_main.xml' to 'newlauncher.xml'");
}
public void testInvalidName() throws Exception {
- checkRefactoring(
+ renameResource(
TEST_PROJECT,
"@drawable/ic_launcher",
true /*updateReferences*/,
@@ -342,7 +290,7 @@ public class RenameResourceParticipantTest extends AdtProjectTest {
public void testRefactor9() throws Exception {
// same as testRefactor4, but not updating references
- checkRefactoring(
+ renameResource(
TEST_PROJECT,
"@id/textView1",
false /*updateReferences*/,
@@ -351,30 +299,30 @@ public class RenameResourceParticipantTest extends AdtProjectTest {
"CHANGES:\n" +
"-------\n" +
"* activity_main.xml - /testRefactor9/res/layout/activity_main.xml\n" +
- " < android:id=\"@+id/textView1\"\n" +
- " ---\n" +
- " > android:id=\"@+id/output\"\n" +
+ " @@ -8 +8\n" +
+ " - android:id=\"@+id/textView1\"\n" +
+ " + android:id=\"@+id/output\"\n" +
"\n" +
"\n" +
"* R.java - /testRefactor9/gen/com/example/refactoringtest/R.java\n" +
- " < public static final int textView1=0x7f070000;\n" +
- " ---\n" +
- " > public static final int output=0x7f070000;");
+ " @@ -20 +20\n" +
+ " - public static final int textView1=0x7f070000;\n" +
+ " + public static final int output=0x7f070000;");
}
- // ---- Only test infrastructure below ----
+ // ---- Test infrastructure ----
- private void checkRefactoring(
+ protected void renameResource(
@NonNull Object[] testData,
@NonNull Object resource,
boolean updateReferences,
@NonNull String newName,
@NonNull String expected) throws Exception {
IProject project = createProject(testData);
- checkRefactoring(project, resource, updateReferences, newName, expected);
+ renameResource(project, resource, updateReferences, newName, expected);
}
- private void checkRefactoring(
+ protected void renameResource(
@NonNull IProject project,
@NonNull Object resource,
boolean updateReferences,
@@ -414,376 +362,6 @@ public class RenameResourceParticipantTest extends AdtProjectTest {
assertNotNull(processor);
RenameRefactoring refactoring = new RenameRefactoring(processor);
- RefactoringStatus status = refactoring.checkAllConditions(new NullProgressMonitor());
- assertNotNull(status);
- if (!status.isOK()) {
- assertEquals(status.toString(), expected);
- return;
- }
- assertTrue(status.toString(), status.isOK());
- Change change = refactoring.createChange(new NullProgressMonitor());
- assertNotNull(change);
- String explanation = "CHANGES:\n-------\n" + describe(change);
- if (!expected.trim().equals(explanation.trim())) { // allow trimming endlines in expected
- assertEquals(expected, explanation);
- }
- }
-
- private IProject createProject(Object[] testData) throws Exception {
- String name = getName();
- IProject project = createProject(name);
- File projectDir = AdtUtils.getAbsolutePath(project).toFile();
- assertNotNull(projectDir);
- assertTrue(projectDir.getPath(), projectDir.exists());
- createTestDataDir(projectDir, testData);
- project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
-
- for (int i = 0; i < testData.length; i+= 2) {
- assertTrue(testData[i].toString(), testData[i] instanceof String);
- String relative = (String) testData[i];
- IResource member = project.findMember(relative);
- assertNotNull(relative, member);
- assertTrue(member.getClass().getSimpleName(), member instanceof IFile);
- }
-
- return project;
- }
-
- private String describe(Change change) throws Exception {
- StringBuilder sb = new StringBuilder(1000);
- describe(sb, change, 0);
-
- // Trim trailing space
- for (int i = sb.length() - 1; i >= 0; i--) {
- if (!Character.isWhitespace(sb.charAt(i))) {
- sb.setLength(i + 1);
- break;
- }
- }
-
- return sb.toString();
- }
-
- private void describe(StringBuilder sb, Change change, int indent) throws Exception {
- if (change instanceof CompositeChange
- && ((CompositeChange) change).isSynthetic()) {
- // Don't display information about synthetic changes
- } else {
- // Describe this change
- indent(sb, indent);
- sb.append("* ");
- sb.append(change.getName());
- if (change instanceof TextFileChange) {
- TextFileChange tfc = (TextFileChange) change;
- sb.append(" - ");
- sb.append(tfc.getFile().getFullPath());
- sb.append('\n');
- }
- if (change instanceof TextFileChange) {
- TextFileChange tfc = (TextFileChange) change;
- TextEdit edit = tfc.getEdit();
- IFile file = tfc.getFile();
- byte[] bytes = ByteStreams.toByteArray(file.getContents());
- String before = new String(bytes, Charsets.UTF_8);
- IDocument document = new Document();
- document.replace(0, 0, before);
- edit.apply(document);
- String after = document.get();
- String diff = getDiff(before, after);
- for (String line : Splitter.on('\n').split(diff)) {
- if (!line.trim().isEmpty()) {
- indent(sb, indent + 1);
- sb.append(line);
- }
- sb.append('\n');
- }
- } else if (change instanceof RenameResourceChange) {
- // Change name, appended above, is adequate
- } else {
- indent(sb, indent);
- sb.append("<unknown change type " + change.getClass().getName() + ">");
- }
- sb.append('\n');
- }
-
- if (change instanceof CompositeChange) {
- CompositeChange composite = (CompositeChange) change;
- Change[] children = composite.getChildren();
- for (Change child : children) {
- describe(sb, child, indent + (composite.isSynthetic() ? 0 : 1));
- }
- }
+ checkRefactoring(refactoring, expected);
}
-
- private static void indent(StringBuilder sb, int indent) {
- for (int i = 0; i < indent; i++) {
- sb.append(" ");
- }
- }
-
- private void createTestDataDir(File dir, Object[] data) throws IOException {
- for (int i = 0, n = data.length; i < n; i += 2) {
- assertTrue("Must be a path: " + data[i], data[i] instanceof String);
- String relativePath = ((String) data[i]).replace('/', File.separatorChar);
- File to = new File(dir, relativePath);
- File parent = to.getParentFile();
- if (!parent.exists()) {
- boolean mkdirs = parent.mkdirs();
- assertTrue(to.getPath(), mkdirs);
- }
-
- Object o = data[i + 1];
- if (o instanceof String) {
- String contents = (String) o;
- Files.write(contents, to, Charsets.UTF_8);
- } else if (o instanceof byte[]) {
- Files.write((byte[]) o, to);
- } else {
- fail("Data must be a String or a byte[] for " + to);
- }
- }
- }
-
- // Test sources
-
- private static final String SAMPLE_MANIFEST =
- "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
- "<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n" +
- " package=\"com.example.refactoringtest\"\n" +
- " android:versionCode=\"1\"\n" +
- " android:versionName=\"1.0\" >\n" +
- "\n" +
- " <uses-sdk\n" +
- " android:minSdkVersion=\"8\"\n" +
- " android:targetSdkVersion=\"17\" />\n" +
- "\n" +
- " <application\n" +
- " android:icon=\"@drawable/ic_launcher\"\n" +
- " android:label=\"@string/app_name\"\n" +
- " android:theme=\"@style/AppTheme\" >\n" +
- " <activity\n" +
- " android:name=\"com.example.refactoringtest.MainActivity\"\n" +
- " android:label=\"@string/app_name\" >\n" +
- " <intent-filter>\n" +
- " <action android:name=\"android.intent.action.MAIN\" />\n" +
- "\n" +
- " <category android:name=\"android.intent.category.LAUNCHER\" />\n" +
- " </intent-filter>\n" +
- " </activity>\n" +
- " </application>\n" +
- "\n" +
- "</manifest>";
-
- private static final String SAMPLE_MAIN_ACTIVITY =
- "package com.example.refactoringtest;\n" +
- "\n" +
- "import android.os.Bundle;\n" +
- "import android.app.Activity;\n" +
- "import android.view.Menu;\n" +
- "import android.view.View;\n" +
- "\n" +
- "public class MainActivity extends Activity {\n" +
- "\n" +
- " @Override\n" +
- " protected void onCreate(Bundle savedInstanceState) {\n" +
- " super.onCreate(savedInstanceState);\n" +
- " setContentView(R.layout.activity_main);\n" +
- " View view1 = findViewById(R.id.textView1);\n" +
- " }\n" +
- "\n" +
- " @Override\n" +
- " public boolean onCreateOptionsMenu(Menu menu) {\n" +
- " // Inflate the menu; this adds items to the action bar if it is present.\n" +
- " getMenuInflater().inflate(R.menu.activity_main, menu);\n" +
- " return true;\n" +
- " }\n" +
- "\n" +
- "}\n";
-
- private static final String SAMPLE_LAYOUT =
- "<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n" +
- " xmlns:tools=\"http://schemas.android.com/tools\"\n" +
- " android:layout_width=\"match_parent\"\n" +
- " android:layout_height=\"match_parent\"\n" +
- " tools:context=\".MainActivity\" >\n" +
- "\n" +
- " <TextView\n" +
- " android:id=\"@+id/textView1\"\n" +
- " android:layout_width=\"wrap_content\"\n" +
- " android:layout_height=\"wrap_content\"\n" +
- " android:layout_centerVertical=\"true\"\n" +
- " android:layout_toRightOf=\"@+id/button2\"\n" +
- " android:text=\"@string/hello_world\" />\n" +
- "\n" +
- " <Button\n" +
- " android:id=\"@+id/button1\"\n" +
- " android:layout_width=\"wrap_content\"\n" +
- " android:layout_height=\"wrap_content\"\n" +
- " android:layout_alignLeft=\"@+id/textView1\"\n" +
- " android:layout_below=\"@+id/textView1\"\n" +
- " android:layout_marginLeft=\"22dp\"\n" +
- " android:layout_marginTop=\"24dp\"\n" +
- " android:text=\"Button\" />\n" +
- "\n" +
- " <Button\n" +
- " android:id=\"@+id/button2\"\n" +
- " android:layout_width=\"wrap_content\"\n" +
- " android:layout_height=\"wrap_content\"\n" +
- " android:layout_alignParentLeft=\"true\"\n" +
- " android:layout_alignParentTop=\"true\"\n" +
- " android:text=\"Button\" />\n" +
- "\n" +
- "</RelativeLayout>";
-
- private static final String SAMPLE_LAYOUT_2 =
- "<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n" +
- " xmlns:tools=\"http://schemas.android.com/tools\"\n" +
- " android:layout_width=\"match_parent\"\n" +
- " android:layout_height=\"match_parent\"\n" +
- " tools:context=\".MainActivity\" >\n" +
- "\n" +
- "\n" +
- "</RelativeLayout>";
-
-
- private static final String SAMPLE_MENU =
- "<menu xmlns:android=\"http://schemas.android.com/apk/res/android\" >\n" +
- "\n" +
- " <item\n" +
- " android:id=\"@+id/menu_settings\"\n" +
- " android:orderInCategory=\"100\"\n" +
- " android:showAsAction=\"never\"\n" +
- " android:title=\"@string/menu_settings\"/>\n" +
- "\n" +
- "</menu>";
-
- private static final String SAMPLE_STRINGS =
- "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
- "<resources>\n" +
- "\n" +
- " <string name=\"app_name\">RefactoringTest</string>\n" +
- " <string name=\"hello_world\">Hello world!</string>\n" +
- " <string name=\"menu_settings\">Settings</string>\n" +
- "\n" +
- "</resources>";
-
- private static final String SAMPLE_STYLES =
- "<resources>\n" +
- "\n" +
- " <!--\n" +
- " Base application theme, dependent on API level. This theme is replaced\n" +
- " by AppBaseTheme from res/values-vXX/styles.xml on newer devices.\n" +
- " -->\n" +
- " <style name=\"AppBaseTheme\" parent=\"android:Theme.Light\">\n" +
- " <!--\n" +
- " Theme customizations available in newer API levels can go in\n" +
- " res/values-vXX/styles.xml, while customizations related to\n" +
- " backward-compatibility can go here.\n" +
- " -->\n" +
- " </style>\n" +
- "\n" +
- " <!-- Application theme. -->\n" +
- " <style name=\"AppTheme\" parent=\"AppBaseTheme\">\n" +
- " <!-- All customizations that are NOT specific to a particular API-level can go here. -->\n" +
- " </style>\n" +
- "\n" +
- "</resources>";
-
- private static final String SAMPLE_R =
- "/* AUTO-GENERATED FILE. DO NOT MODIFY.\n" +
- " *\n" +
- " * This class was automatically generated by the\n" +
- " * aapt tool from the resource data it found. It\n" +
- " * should not be modified by hand.\n" +
- " */\n" +
- "\n" +
- "package com.example.refactoringtest;\n" +
- "\n" +
- "public final class R {\n" +
- " public static final class attr {\n" +
- " }\n" +
- " public static final class drawable {\n" +
- " public static final int ic_launcher=0x7f020000;\n" +
- " }\n" +
- " public static final class id {\n" +
- " public static final int button1=0x7f070002;\n" +
- " public static final int button2=0x7f070001;\n" +
- " public static final int menu_settings=0x7f070003;\n" +
- " public static final int textView1=0x7f070000;\n" +
- " }\n" +
- " public static final class layout {\n" +
- " public static final int activity_main=0x7f030000;\n" +
- " }\n" +
- " public static final class menu {\n" +
- " public static final int activity_main=0x7f060000;\n" +
- " }\n" +
- " public static final class string {\n" +
- " public static final int app_name=0x7f040000;\n" +
- " public static final int hello_world=0x7f040001;\n" +
- " public static final int menu_settings=0x7f040002;\n" +
- " }\n" +
- " public static final class style {\n" +
- " /** \n" +
- " Base application theme, dependent on API level. This theme is replaced\n" +
- " by AppBaseTheme from res/values-vXX/styles.xml on newer devices.\n" +
- " \n" +
- "\n" +
- " Theme customizations available in newer API levels can go in\n" +
- " res/values-vXX/styles.xml, while customizations related to\n" +
- " backward-compatibility can go here.\n" +
- " \n" +
- "\n" +
- " Base application theme for API 11+. This theme completely replaces\n" +
- " AppBaseTheme from res/values/styles.xml on API 11+ devices.\n" +
- " \n" +
- " API 11 theme customizations can go here. \n" +
- "\n" +
- " Base application theme for API 14+. This theme completely replaces\n" +
- " AppBaseTheme from BOTH res/values/styles.xml and\n" +
- " res/values-v11/styles.xml on API 14+ devices.\n" +
- " \n" +
- " API 14 theme customizations can go here. \n" +
- " */\n" +
- " public static final int AppBaseTheme=0x7f050000;\n" +
- " /** Application theme. \n" +
- " All customizations that are NOT specific to a particular API-level can go here. \n" +
- " */\n" +
- " public static final int AppTheme=0x7f050001;\n" +
- " }\n" +
- "}\n";
-
- private static final Object[] TEST_PROJECT = new Object[] {
- "AndroidManifest.xml",
- SAMPLE_MANIFEST,
-
- "src/com/example/refactoringtest/MainActivity.java",
- SAMPLE_MAIN_ACTIVITY,
-
- "gen/com/example/refactoringtest/R.java",
- SAMPLE_R,
-
- "res/drawable-xhdpi/ic_launcher.png",
- new byte[] { 0 },
- "res/drawable-hdpi/ic_launcher.png",
- new byte[] { 0 },
- "res/drawable-ldpi/ic_launcher.png",
- new byte[] { 0 },
- "res/drawable-mdpi/ic_launcher.png",
- new byte[] { 0 },
-
- "res/layout/activity_main.xml",
- SAMPLE_LAYOUT,
-
- "res/layout-land/activity_main.xml",
- SAMPLE_LAYOUT_2,
-
- "res/menu/activity_main.xml",
- SAMPLE_MENU,
-
- "res/values/strings.xml", // file 3
- SAMPLE_STRINGS,
-
- "res/values/styles.xml", // file 3
- SAMPLE_STYLES,
- };
} \ No newline at end of file
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/wizards/templates/TemplateHandlerTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/wizards/templates/TemplateHandlerTest.java
index 7fac5b0..80df145 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/wizards/templates/TemplateHandlerTest.java
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/wizards/templates/TemplateHandlerTest.java
@@ -30,7 +30,7 @@ import com.android.ide.eclipse.adt.AdtUtils;
import com.android.ide.eclipse.adt.internal.lint.EclipseLintClient;
import com.android.ide.eclipse.adt.internal.preferences.AdtPrefs;
import com.android.ide.eclipse.adt.internal.sdk.Sdk;
-import com.android.ide.eclipse.tests.SdkTestCase;
+import com.android.ide.eclipse.tests.SdkLoadingTestCase;
import com.android.sdklib.IAndroidTarget;
import com.android.sdklib.util.GrabProcessOutput;
import com.android.sdklib.util.GrabProcessOutput.IProcessOutput;
@@ -91,7 +91,7 @@ import java.util.Set;
* TODO: Test adding multiple instances of the templates (to look for resource conflicts)
*/
@SuppressWarnings("javadoc")
-public class TemplateHandlerTest extends SdkTestCase {
+public class TemplateHandlerTest extends SdkLoadingTestCase {
/**
* Flag used to quickly check each template once (for one version), to get
* quicker feedback on whether something is broken instead of waiting for
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/SdkTestCase.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/SdkLoadingTestCase.java
index 84c238e..65ce8e1 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/SdkTestCase.java
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/SdkLoadingTestCase.java
@@ -21,20 +21,19 @@ import com.android.ide.eclipse.adt.internal.preferences.AdtPrefs;
import com.android.ide.eclipse.adt.internal.sdk.AndroidTargetParser;
import com.android.ide.eclipse.adt.internal.sdk.Sdk;
import com.android.sdklib.IAndroidTarget;
+import com.android.testutils.SdkTestCase;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
-import junit.framework.TestCase;
-
/**
* A test case which uses the SDK loaded by the ADT plugin.
*/
-public abstract class SdkTestCase extends TestCase {
+public abstract class SdkLoadingTestCase extends SdkTestCase {
private Sdk mSdk;
- protected SdkTestCase() {
+ protected SdkLoadingTestCase() {
}
/**
@@ -107,10 +106,12 @@ public abstract class SdkTestCase extends TestCase {
if (!validateSdk(target)) {
continue;
}
+ if (false) { // This takes forEVER
IStatus status = new AndroidTargetParser(target).run(new NullProgressMonitor());
if (status.getCode() != IStatus.OK) {
fail("Failed to parse targets data");
}
+ }
}
}
}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/functests/layoutRendering/ApiDemosRenderingTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/functests/layoutRendering/ApiDemosRenderingTest.java
index 2b364a5..8b46f87 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/functests/layoutRendering/ApiDemosRenderingTest.java
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/functests/layoutRendering/ApiDemosRenderingTest.java
@@ -47,7 +47,7 @@ import com.android.ide.common.resources.configuration.TouchScreenQualifier;
import com.android.ide.common.sdk.LoadStatus;
import com.android.ide.eclipse.adt.internal.resources.manager.ResourceManager;
import com.android.ide.eclipse.adt.internal.sdk.AndroidTargetData;
-import com.android.ide.eclipse.tests.SdkTestCase;
+import com.android.ide.eclipse.tests.SdkLoadingTestCase;
import com.android.io.FolderWrapper;
import com.android.resources.Density;
import com.android.resources.Keyboard;
@@ -74,7 +74,7 @@ import java.util.Map;
import javax.imageio.ImageIO;
-public class ApiDemosRenderingTest extends SdkTestCase {
+public class ApiDemosRenderingTest extends SdkLoadingTestCase {
/**
* Custom parser that implements {@link ILayoutPullParser} (which itself extends
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/functests/sampleProjects/SampleProjectTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/functests/sampleProjects/SampleProjectTest.java
index 656e8e8..3fb705d 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/functests/sampleProjects/SampleProjectTest.java
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/functests/sampleProjects/SampleProjectTest.java
@@ -20,7 +20,7 @@ import com.android.ide.eclipse.adt.AdtUtils;
import com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectCreator;
import com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectWizardState;
import com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectWizardState.Mode;
-import com.android.ide.eclipse.tests.SdkTestCase;
+import com.android.ide.eclipse.tests.SdkLoadingTestCase;
import com.android.sdklib.IAndroidTarget;
import org.eclipse.core.resources.IMarker;
@@ -50,7 +50,7 @@ import java.util.logging.Logger;
* execution there
*
*/
-public class SampleProjectTest extends SdkTestCase {
+public class SampleProjectTest extends SdkLoadingTestCase {
private static final Logger sLogger = Logger.getLogger(SampleProjectTest.class.getName());